Diff
Modified: trunk/LayoutTests/ChangeLog (195091 => 195092)
--- trunk/LayoutTests/ChangeLog 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/LayoutTests/ChangeLog 2016-01-15 07:18:47 UTC (rev 195092)
@@ -1,3 +1,17 @@
+2016-01-14 Commit Queue <commit-qu...@webkit.org>
+
+ Unreviewed, rolling out r195064.
+ https://bugs.webkit.org/show_bug.cgi?id=153118
+
+ test fails most of the time (Requested by alexchristensen on
+ #webkit).
+
+ Reverted changeset:
+
+ "Avoid downloading the wrong image for <picture> elements."
+ https://bugs.webkit.org/show_bug.cgi?id=153027
+ http://trac.webkit.org/changeset/195064
+
2016-01-14 Myles C. Maxfield <mmaxfi...@apple.com>
Test gardening after r195088
Deleted: trunk/LayoutTests/fast/picture/hidpi-image-picture-loads-expected.txt (195091 => 195092)
--- trunk/LayoutTests/fast/picture/hidpi-image-picture-loads-expected.txt 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/LayoutTests/fast/picture/hidpi-image-picture-loads-expected.txt 2016-01-15 07:18:47 UTC (rev 195092)
@@ -1,13 +0,0 @@
-resources/image-set-4x.png - willSendRequest <NSURLRequest URL resources/image-set-4x.png, main document URL hidpi-image-picture-loads.html, http method GET> redirectResponse (null)
-resources/image-set-4x.png - willSendRequest <NSURLRequest URL resources/image-set-4x.png, main document URL hidpi-image-picture-loads.html, http method GET> redirectResponse (null)
-data:,b - willSendRequest <NSURLRequest URL data:,b, main document URL hidpi-image-picture-loads.html, http method GET> redirectResponse (null)
-hidpi-image-picture-loads.html - didFinishLoading
-resources/image-set-4x.png - didReceiveResponse <NSURLResponse resources/image-set-4x.png, http status code 0>
-resources/image-set-4x.png - didFinishLoading
-resources/image-set-4x.png - didReceiveResponse <NSURLResponse resources/image-set-4x.png, http status code 0>
-resources/image-set-4x.png - didFinishLoading
-data:,b - didReceiveResponse <NSURLResponse data:,b, http status code 0>
-data:,b - didFinishLoading
-
-some text
-
Deleted: trunk/LayoutTests/fast/picture/hidpi-image-picture-loads.html (195091 => 195092)
--- trunk/LayoutTests/fast/picture/hidpi-image-picture-loads.html 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/LayoutTests/fast/picture/hidpi-image-picture-loads.html 2016-01-15 07:18:47 UTC (rev 195092)
@@ -1,108 +0,0 @@
-<!DOCTYPE html>
- <script>
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpResourceLoadCallbacks();
- }
- </script>
- <!-- simple picture construct -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" sizes="800px" srcset="../hidpi/resources/image-set-1x.png?10002 400w, ../hidpi/resources/image-set-2x.png?10002 800w,
- resources/image-set-4x.png?10002 1600w">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="simple" src=""
- </picture>
- <!-- Multiple img elements -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" sizes="800px" srcset="../hidpi/resources/image-set-1x.png?10002 400w, ../hidpi/resources/image-set-2x.png?10002 800w,
- resources/image-set-4x.png?10002 1600w">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img src=""
- <img id="multiple" src=""
- </picture>
- <!-- non-source children - should be ignored-->
- <picture>
- <div>some text</div>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" sizes="800px" srcset="../hidpi/resources/image-set-1x.png?10002 400w, ../hidpi/resources/image-set-2x.png?10002 800w,
- resources/image-set-4x.png?10002 1600w">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="other_children" src=""
- </picture>
- <!-- source with unknown type - should be ignored -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" type="image/nonsense" sizes="800px" srcset="../hidpi/resources/image-set-1x.png?10002 400w, ../hidpi/resources/image-set-2x.png?10002 800w,
- resources/image-set-4x.png?10002 1600w">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="unknown_type" src=""
- </picture>
- <!-- SVG source - should not be ignored -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" type="image/svg+xml" sizes="800px" srcset="../hidpi/resources/image-set-1x.png?10002 400w, ../hidpi/resources/image-set-2x.png?10002 800w,
- resources/image-set-4x.png?10002 1600w">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="svg_type" src=""
- </picture>
- <!-- Empty type - should not be ignored -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" type="" sizes="800px" srcset="../hidpi/resources/image-set-1x.png?10002 400w, ../hidpi/resources/image-set-2x.png?10002 800w,
- resources/image-set-4x.png?10002 1600w">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="empty_type" src=""
- </picture>
- <!-- whitespace type - should not be ignored -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" type=" " sizes="800px" srcset="../hidpi/resources/image-set-1x.png?10002 400w, ../hidpi/resources/image-set-2x.png?10002 800w,
- resources/image-set-4x.png?10002 1600w">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="whitespace_type" src=""
- </picture>
- <!-- parameter type - should not be ignored -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" type="image/png;bla=bla" sizes="800px" srcset="../hidpi/resources/image-set-1x.png?10002 400w, ../hidpi/resources/image-set-2x.png?10002 800w,
- resources/image-set-4x.png?10002 1600w">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="parameter_type" src=""
- </picture>
- <!-- source with empty srcset - should be ignored -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" sizes="800px" srcset=", , ">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="empty_srcset" src=""
- </picture>
- <!-- source with no srcset - should be ignored -->
- <picture>
- <source media="(max-width: 400px)" sizes="400px" srcset="../hidpi/resources/image-set-1x.png?10001 400w, ../hidpi/resources/image-set-2x.png?10001 800w,
- resources/image-set-4x.png?10001 1600w">
- <source media="(max-width: 800px)" sizes="800px">
- <source media="(max-width: 1600px)" sizes="1600px" srcset="../hidpi/resources/image-set-1x.png?10003 400w, ../hidpi/resources/image-set-2x.png?10003 800w,
- resources/image-set-4x.png?10003 1600w">
- <img id="no_srcset" src=""
- </picture>
- <picture><source srcset="data:,b"><img src=""
Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (195091 => 195092)
--- trunk/LayoutTests/platform/ios-simulator/TestExpectations 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations 2016-01-15 07:18:47 UTC (rev 195092)
@@ -2839,6 +2839,7 @@
webkit.org/b/152141 fast/picture/image-picture-1x.html [ Skip ]
webkit.org/b/152141 fast/picture/image-picture-invalid.html [ Skip ]
webkit.org/b/152141 fast/picture/image-picture-nested.html [ Skip ]
+webkit.org/b/153043 fast/picture/image-picture-loads-1x.html [ Skip ]
webkit.org/b/152992 http/tests/loading/preload-picture-invalid.html [ Skip ]
webkit.org/b/152992 http/tests/loading/preload-picture-nested.html [ Skip ]
webkit.org/b/152992 http/tests/loading/preload-picture-sizes.html [ Skip ]
Deleted: trunk/LayoutTests/platform/mac-yosemite/TestExpectations (195091 => 195092)
--- trunk/LayoutTests/platform/mac-yosemite/TestExpectations 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/LayoutTests/platform/mac-yosemite/TestExpectations 2016-01-15 07:18:47 UTC (rev 195092)
@@ -1 +0,0 @@
-webkit.org/b/153027 fast/picture/hidpi-image-picture-loads.html [ Skip ]
Modified: trunk/Source/WebCore/ChangeLog (195091 => 195092)
--- trunk/Source/WebCore/ChangeLog 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/Source/WebCore/ChangeLog 2016-01-15 07:18:47 UTC (rev 195092)
@@ -1,3 +1,17 @@
+2016-01-14 Commit Queue <commit-qu...@webkit.org>
+
+ Unreviewed, rolling out r195064.
+ https://bugs.webkit.org/show_bug.cgi?id=153118
+
+ test fails most of the time (Requested by alexchristensen on
+ #webkit).
+
+ Reverted changeset:
+
+ "Avoid downloading the wrong image for <picture> elements."
+ https://bugs.webkit.org/show_bug.cgi?id=153027
+ http://trac.webkit.org/changeset/195064
+
2016-01-14 Ryosuke Niwa <rn...@webkit.org>
createElement should not lowercase non-ASCII characters
Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (195091 => 195092)
--- trunk/Source/WebCore/html/HTMLImageElement.cpp 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp 2016-01-15 07:18:47 UTC (rev 195092)
@@ -53,9 +53,6 @@
using namespace HTMLNames;
-typedef HashMap<const HTMLImageElement*, WeakPtr<HTMLPictureElement>> PictureOwnerMap;
-static PictureOwnerMap* gPictureOwnerMap = nullptr;
-
HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
: HTMLElement(tagName, document)
, m_imageLoader(*this)
@@ -85,7 +82,6 @@
{
if (m_form)
m_form->removeImgElement(this);
- setPictureElement(nullptr);
}
Ref<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, const int* optionalWidth, const int* optionalHeight)
@@ -144,12 +140,13 @@
ImageCandidate HTMLImageElement::bestFitSourceFromPictureElement()
{
- auto* picture = pictureElement();
- if (!picture)
+ auto* parent = parentNode();
+ if (!is<HTMLPictureElement>(parent))
return { };
+ auto* picture = downcast<HTMLPictureElement>(parent);
picture->clearViewportDependentResults();
document().removeViewportDependentPicture(*picture);
- for (Node* child = picture->firstChild(); child && child != this; child = child->nextSibling()) {
+ for (Node* child = parent->firstChild(); child && child != this; child = child->nextSibling()) {
if (!is<HTMLSourceElement>(*child))
continue;
auto& source = downcast<HTMLSourceElement>(*child);
@@ -166,7 +163,7 @@
if (!type.isEmpty() && !MIMETypeRegistry::isSupportedImageMIMEType(type) && type != "image/svg+xml")
continue;
}
- MediaQueryEvaluator evaluator(document().printing() ? "print" : "screen", document().frame(), document().documentElement() ? document().documentElement()->computedStyle() : nullptr);
+ MediaQueryEvaluator evaluator(document().printing() ? "print" : "screen", document().frame(), computedStyle());
bool evaluation = evaluator.evalCheckingViewportDependentResults(source.mediaQuerySet(), picture->viewportDependentResults());
if (picture->hasViewportDependentResults())
document().addViewportDependentPicture(*picture);
@@ -316,10 +313,8 @@
if (insertionPoint.inDocument() && !m_lowercasedUsemap.isNull())
document().addImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
- if (is<HTMLPictureElement>(parentNode())) {
- setPictureElement(&downcast<HTMLPictureElement>(*parentNode()));
+ if (is<HTMLPictureElement>(parentNode()))
selectImageSource();
- }
// If we have been inserted from a renderer-less document,
// our loader may have not fetched the image, so do it now.
@@ -336,37 +331,11 @@
if (insertionPoint.inDocument() && !m_lowercasedUsemap.isNull())
document().removeImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
-
- if (is<HTMLPictureElement>(parentNode()))
- setPictureElement(nullptr);
-
+
m_form = nullptr;
HTMLElement::removedFrom(insertionPoint);
}
-HTMLPictureElement* HTMLImageElement::pictureElement() const
-{
- if (!gPictureOwnerMap || !gPictureOwnerMap->contains(this))
- return nullptr;
- HTMLPictureElement* result = gPictureOwnerMap->get(this).get();
- if (!result)
- gPictureOwnerMap->remove(this);
- return result;
-}
-
-void HTMLImageElement::setPictureElement(HTMLPictureElement* pictureElement)
-{
- if (!pictureElement) {
- if (gPictureOwnerMap)
- gPictureOwnerMap->remove(this);
- return;
- }
-
- if (!gPictureOwnerMap)
- gPictureOwnerMap = new PictureOwnerMap();
- gPictureOwnerMap->add(this, pictureElement->createWeakPtr());
-}
-
int HTMLImageElement::width(bool ignorePendingStylesheets)
{
if (!renderer()) {
Modified: trunk/Source/WebCore/html/HTMLImageElement.h (195091 => 195092)
--- trunk/Source/WebCore/html/HTMLImageElement.h 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/Source/WebCore/html/HTMLImageElement.h 2016-01-15 07:18:47 UTC (rev 195092)
@@ -87,9 +87,6 @@
virtual const AtomicString& imageSourceURL() const override;
bool hasShadowControls() const { return m_experimentalImageMenuEnabled; }
-
- HTMLPictureElement* pictureElement() const;
- void setPictureElement(HTMLPictureElement*);
protected:
HTMLImageElement(const QualifiedName&, Document&, HTMLFormElement* = 0);
@@ -130,7 +127,6 @@
HTMLImageLoader m_imageLoader;
HTMLFormElement* m_form;
HTMLFormElement* m_formSetByParser;
-
CompositeOperator m_compositeOperator;
AtomicString m_bestFitImageURL;
AtomicString m_currentSrc;
Modified: trunk/Source/WebCore/html/HTMLPictureElement.h (195091 => 195092)
--- trunk/Source/WebCore/html/HTMLPictureElement.h 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/Source/WebCore/html/HTMLPictureElement.h 2016-01-15 07:18:47 UTC (rev 195092)
@@ -46,12 +46,9 @@
bool viewportChangeAffectedPicture();
- WeakPtr<HTMLPictureElement> createWeakPtr() { return m_weakFactory.createWeakPtr(); }
-
private:
HTMLPictureElement(const QualifiedName&, Document&);
- WeakPtrFactory<HTMLPictureElement> m_weakFactory { this };
Vector<std::unique_ptr<MediaQueryResult>> m_viewportDependentMediaQueryResults;
};
Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (195091 => 195092)
--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp 2016-01-15 07:18:47 UTC (rev 195092)
@@ -36,11 +36,9 @@
#include "HTMLElementFactory.h"
#include "HTMLFormElement.h"
#include "HTMLHtmlElement.h"
-#include "HTMLImageElement.h"
#include "HTMLOptGroupElement.h"
#include "HTMLOptionElement.h"
#include "HTMLParserIdioms.h"
-#include "HTMLPictureElement.h"
#include "HTMLScriptElement.h"
#include "HTMLTemplateElement.h"
#include "NotImplemented.h"
@@ -642,13 +640,6 @@
Document& ownerDocument = ownerDocumentForCurrentNode();
bool insideTemplateElement = !ownerDocument.frame();
RefPtr<Element> element = HTMLElementFactory::createElement(tagName, ownerDocument, insideTemplateElement ? nullptr : form(), true);
-
- // FIXME: This is a hack to connect images to pictures before the image has
- // been inserted into the document. It can be removed once asynchronous image
- // loading is working.
- if (is<HTMLPictureElement>(currentNode()) && is<HTMLImageElement>(*element.get()))
- downcast<HTMLImageElement>(*element.get()).setPictureElement(&downcast<HTMLPictureElement>(currentNode()));
-
setAttributes(element.get(), token, m_parserContentPolicy);
ASSERT(element->isHTMLElement());
return element.release();
Modified: trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp (195091 => 195092)
--- trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp 2016-01-15 06:12:56 UTC (rev 195091)
+++ trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp 2016-01-15 07:18:47 UTC (rev 195092)
@@ -208,7 +208,7 @@
m_mediaAttribute = attributeValue;
Ref<MediaQuerySet> mediaSet = MediaQuerySet::createAllowingDescriptionSyntax(attributeValue);
Vector<std::unique_ptr<MediaQueryResult>> viewportDependentMediaQueryResults;
- MediaQueryEvaluator evaluator(document.printing() ? "print" : "screen", document.frame(), document.documentElement() ? document.documentElement()->computedStyle() : nullptr);
+ MediaQueryEvaluator evaluator(document.printing() ? "print" : "screen", document.frame(), document.documentElement()->computedStyle());
m_mediaMatched = evaluator.evalCheckingViewportDependentResults(mediaSet.ptr(), viewportDependentMediaQueryResults);
}
break;