Changeset 195092 in webkit


Ignore:
Timestamp:
Jan 14, 2016, 11:18:47 PM (10 years ago)
Author:
achristensen@apple.com
Message:

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

Patch by Commit Queue <commit-queue@webkit.org> on 2016-01-14

Location:
trunk
Files:
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/LayoutTests/ChangeLog

    r195089 r195092  
     12016-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
    1152016-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
    216
  • TabularUnified trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r195064 r195092  
    28402840webkit.org/b/152141 fast/picture/image-picture-invalid.html [ Skip ]
    28412841webkit.org/b/152141 fast/picture/image-picture-nested.html [ Skip ]
     2842webkit.org/b/153043 fast/picture/image-picture-loads-1x.html [ Skip ]
    28422843webkit.org/b/152992 http/tests/loading/preload-picture-invalid.html [ Skip ]
    28432844webkit.org/b/152992 http/tests/loading/preload-picture-nested.html [ Skip ]
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r195091 r195092  
     12016-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
    1152016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • TabularUnified trunk/Source/WebCore/html/HTMLImageElement.cpp

    r195064 r195092  
    5454using namespace HTMLNames;
    5555
    56 typedef HashMap<const HTMLImageElement*, WeakPtr<HTMLPictureElement>> PictureOwnerMap;
    57 static PictureOwnerMap* gPictureOwnerMap = nullptr;
    58 
    5956HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
    6057    : HTMLElement(tagName, document)
     
    8683    if (m_form)
    8784        m_form->removeImgElement(this);
    88     setPictureElement(nullptr);
    8985}
    9086
     
    145141ImageCandidate HTMLImageElement::bestFitSourceFromPictureElement()
    146142{
    147     auto* picture = pictureElement();
    148     if (!picture)
     143    auto* parent = parentNode();
     144    if (!is<HTMLPictureElement>(parent))
    149145        return { };
     146    auto* picture = downcast<HTMLPictureElement>(parent);
    150147    picture->clearViewportDependentResults();
    151148    document().removeViewportDependentPicture(*picture);
    152     for (Node* child = picture->firstChild(); child && child != this; child = child->nextSibling()) {
     149    for (Node* child = parent->firstChild(); child && child != this; child = child->nextSibling()) {
    153150        if (!is<HTMLSourceElement>(*child))
    154151            continue;
     
    167164                continue;
    168165        }
    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());
    170167        bool evaluation = evaluator.evalCheckingViewportDependentResults(source.mediaQuerySet(), picture->viewportDependentResults());
    171168        if (picture->hasViewportDependentResults())
     
    317314        document().addImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
    318315
    319     if (is<HTMLPictureElement>(parentNode())) {
    320         setPictureElement(&downcast<HTMLPictureElement>(*parentNode()));
     316    if (is<HTMLPictureElement>(parentNode()))
    321317        selectImageSource();
    322     }
    323318
    324319    // If we have been inserted from a renderer-less document,
     
    337332    if (insertionPoint.inDocument() && !m_lowercasedUsemap.isNull())
    338333        document().removeImageElementByLowercasedUsemap(*m_lowercasedUsemap.impl(), *this);
    339    
    340     if (is<HTMLPictureElement>(parentNode()))
    341         setPictureElement(nullptr);
    342    
     334
    343335    m_form = nullptr;
    344336    HTMLElement::removedFrom(insertionPoint);
    345337}
    346338
    347 HTMLPictureElement* HTMLImageElement::pictureElement() const
    348 {
    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    
    370339int HTMLImageElement::width(bool ignorePendingStylesheets)
    371340{
  • TabularUnified trunk/Source/WebCore/html/HTMLImageElement.h

    r195064 r195092  
    8888
    8989    bool hasShadowControls() const { return m_experimentalImageMenuEnabled; }
    90    
    91     HTMLPictureElement* pictureElement() const;
    92     void setPictureElement(HTMLPictureElement*);
    9390
    9491protected:
     
    131128    HTMLFormElement* m_form;
    132129    HTMLFormElement* m_formSetByParser;
    133 
    134130    CompositeOperator m_compositeOperator;
    135131    AtomicString m_bestFitImageURL;
  • TabularUnified trunk/Source/WebCore/html/HTMLPictureElement.h

    r195064 r195092  
    4747    bool viewportChangeAffectedPicture();
    4848
    49     WeakPtr<HTMLPictureElement> createWeakPtr() { return m_weakFactory.createWeakPtr(); }
    50 
    5149private:
    5250    HTMLPictureElement(const QualifiedName&, Document&);
    5351   
    54     WeakPtrFactory<HTMLPictureElement> m_weakFactory { this };
    5552    Vector<std::unique_ptr<MediaQueryResult>> m_viewportDependentMediaQueryResults;
    5653
  • TabularUnified trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp

    r195064 r195092  
    3737#include "HTMLFormElement.h"
    3838#include "HTMLHtmlElement.h"
    39 #include "HTMLImageElement.h"
    4039#include "HTMLOptGroupElement.h"
    4140#include "HTMLOptionElement.h"
    4241#include "HTMLParserIdioms.h"
    43 #include "HTMLPictureElement.h"
    4442#include "HTMLScriptElement.h"
    4543#include "HTMLTemplateElement.h"
     
    643641    bool insideTemplateElement = !ownerDocument.frame();
    644642    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 has
    647     // been inserted into the document. It can be removed once asynchronous image
    648     // loading is working.
    649     if (is<HTMLPictureElement>(currentNode()) && is<HTMLImageElement>(*element.get()))
    650         downcast<HTMLImageElement>(*element.get()).setPictureElement(&downcast<HTMLPictureElement>(currentNode()));
    651 
    652643    setAttributes(element.get(), token, m_parserContentPolicy);
    653644    ASSERT(element->isHTMLElement());
  • TabularUnified trunk/Source/WebCore/html/parser/HTMLPreloadScanner.cpp

    r195064 r195092  
    209209                Ref<MediaQuerySet> mediaSet = MediaQuerySet::createAllowingDescriptionSyntax(attributeValue);
    210210                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());
    212212                m_mediaMatched = evaluator.evalCheckingViewportDependentResults(mediaSet.ptr(), viewportDependentMediaQueryResults);
    213213            }
Note: See TracChangeset for help on using the changeset viewer.