Changeset 195092 in webkit
- Timestamp:
- Jan 14, 2016, 11:18:47 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r195089 r195092 1 2016-01-14 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r195064. 4 https://bugs.webkit.org/show_bug.cgi?id=153118 5 6 test fails most of the time (Requested by alexchristensen on 7 #webkit). 8 9 Reverted changeset: 10 11 "Avoid downloading the wrong image for <picture> elements." 12 https://bugs.webkit.org/show_bug.cgi?id=153027 13 http://trac.webkit.org/changeset/195064 14 1 15 2016-01-14 Myles C. Maxfield <mmaxfield@apple.com> 2 16 -
TabularUnified trunk/LayoutTests/platform/ios-simulator/TestExpectations ¶
r195064 r195092 2840 2840 webkit.org/b/152141 fast/picture/image-picture-invalid.html [ Skip ] 2841 2841 webkit.org/b/152141 fast/picture/image-picture-nested.html [ Skip ] 2842 webkit.org/b/153043 fast/picture/image-picture-loads-1x.html [ Skip ] 2842 2843 webkit.org/b/152992 http/tests/loading/preload-picture-invalid.html [ Skip ] 2843 2844 webkit.org/b/152992 http/tests/loading/preload-picture-nested.html [ Skip ] -
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r195091 r195092 1 2016-01-14 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r195064. 4 https://bugs.webkit.org/show_bug.cgi?id=153118 5 6 test fails most of the time (Requested by alexchristensen on 7 #webkit). 8 9 Reverted changeset: 10 11 "Avoid downloading the wrong image for <picture> elements." 12 https://bugs.webkit.org/show_bug.cgi?id=153027 13 http://trac.webkit.org/changeset/195064 14 1 15 2016-01-14 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
TabularUnified trunk/Source/WebCore/html/HTMLImageElement.cpp ¶
r195064 r195092 54 54 using namespace HTMLNames; 55 55 56 typedef HashMap<const HTMLImageElement*, WeakPtr<HTMLPictureElement>> PictureOwnerMap;57 static PictureOwnerMap* gPictureOwnerMap = nullptr;58 59 56 HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form) 60 57 : HTMLElement(tagName, document) … … 86 83 if (m_form) 87 84 m_form->removeImgElement(this); 88 setPictureElement(nullptr);89 85 } 90 86 … … 145 141 ImageCandidate HTMLImageElement::bestFitSourceFromPictureElement() 146 142 { 147 auto* p icture = pictureElement();148 if (! picture)143 auto* parent = parentNode(); 144 if (!is<HTMLPictureElement>(parent)) 149 145 return { }; 146 auto* picture = downcast<HTMLPictureElement>(parent); 150 147 picture->clearViewportDependentResults(); 151 148 document().removeViewportDependentPicture(*picture); 152 for (Node* child = p icture->firstChild(); child && child != this; child = child->nextSibling()) {149 for (Node* child = parent->firstChild(); child && child != this; child = child->nextSibling()) { 153 150 if (!is<HTMLSourceElement>(*child)) 154 151 continue; … … 167 164 continue; 168 165 } 169 MediaQueryEvaluator evaluator(document().printing() ? "print" : "screen", document().frame(), document().documentElement() ? document().documentElement()->computedStyle() : nullptr);166 MediaQueryEvaluator evaluator(document().printing() ? "print" : "screen", document().frame(), computedStyle()); 170 167 bool evaluation = evaluator.evalCheckingViewportDependentResults(source.mediaQuerySet(), picture->viewportDependentResults()); 171 168 if (picture->hasViewportDependentResults()) … … 317 314 document().addImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this); 318 315 319 if (is<HTMLPictureElement>(parentNode())) { 320 setPictureElement(&downcast<HTMLPictureElement>(*parentNode())); 316 if (is<HTMLPictureElement>(parentNode())) 321 317 selectImageSource(); 322 }323 318 324 319 // If we have been inserted from a renderer-less document, … … 337 332 if (insertionPoint.inDocument() && !m_lowercasedUsemap.isNull()) 338 333 document().removeImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this); 339 340 if (is<HTMLPictureElement>(parentNode())) 341 setPictureElement(nullptr); 342 334 343 335 m_form = nullptr; 344 336 HTMLElement::removedFrom(insertionPoint); 345 337 } 346 338 347 HTMLPictureElement* HTMLImageElement::pictureElement() const348 {349 if (!gPictureOwnerMap || !gPictureOwnerMap->contains(this))350 return nullptr;351 HTMLPictureElement* result = gPictureOwnerMap->get(this).get();352 if (!result)353 gPictureOwnerMap->remove(this);354 return result;355 }356 357 void HTMLImageElement::setPictureElement(HTMLPictureElement* pictureElement)358 {359 if (!pictureElement) {360 if (gPictureOwnerMap)361 gPictureOwnerMap->remove(this);362 return;363 }364 365 if (!gPictureOwnerMap)366 gPictureOwnerMap = new PictureOwnerMap();367 gPictureOwnerMap->add(this, pictureElement->createWeakPtr());368 }369 370 339 int HTMLImageElement::width(bool ignorePendingStylesheets) 371 340 { -
TabularUnified trunk/Source/WebCore/html/HTMLImageElement.h ¶
r195064 r195092 88 88 89 89 bool hasShadowControls() const { return m_experimentalImageMenuEnabled; } 90 91 HTMLPictureElement* pictureElement() const;92 void setPictureElement(HTMLPictureElement*);93 90 94 91 protected: … … 131 128 HTMLFormElement* m_form; 132 129 HTMLFormElement* m_formSetByParser; 133 134 130 CompositeOperator m_compositeOperator; 135 131 AtomicString m_bestFitImageURL; -
TabularUnified trunk/Source/WebCore/html/HTMLPictureElement.h ¶
r195064 r195092 47 47 bool viewportChangeAffectedPicture(); 48 48 49 WeakPtr<HTMLPictureElement> createWeakPtr() { return m_weakFactory.createWeakPtr(); }50 51 49 private: 52 50 HTMLPictureElement(const QualifiedName&, Document&); 53 51 54 WeakPtrFactory<HTMLPictureElement> m_weakFactory { this };55 52 Vector<std::unique_ptr<MediaQueryResult>> m_viewportDependentMediaQueryResults; 56 53 -
TabularUnified trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp ¶
r195064 r195092 37 37 #include "HTMLFormElement.h" 38 38 #include "HTMLHtmlElement.h" 39 #include "HTMLImageElement.h"40 39 #include "HTMLOptGroupElement.h" 41 40 #include "HTMLOptionElement.h" 42 41 #include "HTMLParserIdioms.h" 43 #include "HTMLPictureElement.h"44 42 #include "HTMLScriptElement.h" 45 43 #include "HTMLTemplateElement.h" … … 643 641 bool insideTemplateElement = !ownerDocument.frame(); 644 642 RefPtr<Element> element = HTMLElementFactory::createElement(tagName, ownerDocument, insideTemplateElement ? nullptr : form(), true); 645 646 // FIXME: This is a hack to connect images to pictures before the image has647 // been inserted into the document. It can be removed once asynchronous image648 // loading is working.649 if (is<HTMLPictureElement>(currentNode()) && is<HTMLImageElement>(*element.get()))650 downcast<HTMLImageElement>(*element.get()).setPictureElement(&downcast<HTMLPictureElement>(currentNode()));651 652 643 setAttributes(element.get(), token, m_parserContentPolicy); 653 644 ASSERT(element->isHTMLElement()); -
TabularUnified trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp ¶
r195064 r195092 209 209 Ref<MediaQuerySet> mediaSet = MediaQuerySet::createAllowingDescriptionSyntax(attributeValue); 210 210 Vector<std::unique_ptr<MediaQueryResult>> viewportDependentMediaQueryResults; 211 MediaQueryEvaluator evaluator(document.printing() ? "print" : "screen", document.frame(), document.documentElement() ? document.documentElement()->computedStyle() : nullptr);211 MediaQueryEvaluator evaluator(document.printing() ? "print" : "screen", document.frame(), document.documentElement()->computedStyle()); 212 212 m_mediaMatched = evaluator.evalCheckingViewportDependentResults(mediaSet.ptr(), viewportDependentMediaQueryResults); 213 213 }
Note:
See TracChangeset
for help on using the changeset viewer.