Changeset 166853 in webkit


Ignore:
Timestamp:
Apr 6, 2014 1:27:07 PM (10 years ago)
Author:
Darin Adler
Message:

Refactor post-attach and HTMLObjectElement-related code
https://bugs.webkit.org/show_bug.cgi?id=131282

Reviewed by Antti Koivisto.

Source/WebCore:

  • dom/ContainerNode.cpp: Moved the post-attach callback code from here to

StyleResolveTree.h/cpp.

  • dom/ContainerNode.h: Ditto.
  • dom/Document.cpp:

(WebCore::Document::recalcStyle): Use Style::PostResolutionCallbackDisabler instead of
PostAttachCallbackDisabler.

  • dom/Element.h: Moved the post-attach callback code from here to StyleResolveTree.h/cpp.
  • html/HTMLEmbedElement.cpp:

(WebCore::HTMLEmbedElement::parseAttribute): Simplified the code for typeAttr, turning
it into a 1-liner. Added a FIXME in codeAttr about the fact that it does not have the
code to trigger image loads.

  • html/HTMLFormControlElement.cpp:

(WebCore::HTMLFormControlElement::didAttachRenderers): Updated to use
Style::queuePostResolutionCallback and use a lambda instead of a function.
(WebCore::HTMLFormControlElement::didRecalcStyle): Ditto. Also added RefPtr instead
of just using wishful thinking to keep the object alive.

  • html/HTMLFrameOwnerElement.cpp:

(WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Ditto.

  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::parseAttribute):: Simplified the code for typeAttr, turning
it into a 1-liner. Made dataAttr call setNeedsWidgetUpdate(true) unconditionally after
checking carefully to see that's harmless if there is no renderer. Changed classidAttr
to call setNeedsWidgetUpdate(true) unconditionally and not set m_classId.
(WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use fastGetAttribute
instead of classId and descendantsOfType instead of getElementsByTagName.
(WebCore::HTMLObjectElement::hasValidClassId): Use fastGetAttribute instead of classId.
(WebCore::HTMLObjectElement::renderFallbackContent): Use imageLoader instead of m_imageLoader.

  • html/HTMLObjectElement.h: Removed classId, since there is no reason to cache that

attribute in a data member. Rearranged header, making more private, and fixing some typos,
and doing a "using" instead of a function to disambiguate the inherited form functions.

  • html/HTMLPlugInImageElement.cpp:

(WebCore::HTMLPlugInImageElement::createElementRenderer): Fixed some code that assumed the
first child of the shadow root is guaranteed to be an element.
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Removed null check on oldDocument,
since m_needsDocumentActivationCallbacks can't be true if the old document was null.
(WebCore::is100Percent): Added helper to make function below more readable.
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Restructured the code a
bit. The part that attracted my attention was the local variable of type RenderBox, which
was named renderEmbeddedObject. Turns out the caller guarantees to only call this if there
is a renderer of type RenderEmbeddedObject, so depend on that.

  • html/HTMLPlugInImageElement.h: Trimmed includes a bit. Made more members private.

Marked more function members final. Made a protected imageLoader function so that
m_imageLoader can be private eventually. Made m_imageLoader be std::unique_ptr.

  • style/StyleResolveTree.cpp:

(WebCore::Style::needsPseudoElement): Fixed spelling error in the name of this function.
(WebCore::Style::attachBeforeOrAfterPseudoElementIfNeeded): Updated for name change.
(WebCore::Style::attachRenderTree): Update for new name of PostResolutionCallbackDisabler.
(WebCore::Style::updateBeforeOrAfterPseudoElement): Updated for name change.
(WebCore::Style::postResolutionCallbackQueue): Added.
(WebCore::Style::queuePostResolutionCallback): Added.
(WebCore::Style::suspendMemoryCacheClientCalls): Added. This is a side effect of the original
PostAttachCallbackDisabler that is now done in a cleaner way, using the callback queue, instead
of as a special case. It should not work for multiple documents across multiple pages instead of
only the outermost one.
(WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler): Added.
Calls suspendMemoryCacheClientCalls, but a FIXME tries to point out why that isn't so great.
(WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler): Added.
(WebCore::Style::postResolutionCallbacksAreSuspended): Added.

  • style/StyleResolveTree.h: Added queuePostResolutionCallback and

postResolutionCallbacksAreSuspended. Also added PostResolutionCallbackDisabler, which should
eventually become a private implementation detail.

Source/WebKit/mac:

  • WebCoreSupport/WebFrameLoaderClient.mm: Call toHTMLPlugInImageElement instead of

doing a static_cast.

LayoutTests:

  • svg/custom/object-no-size-attributes-expected.txt: Removed expectation of an empty text

renderer from the render tree.

  • svg/custom/object-no-size-attributes.xhtml: Restructured the source so there is no text

to render. Without this, we were seeing two text renderers due to the loading timing change.

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r166840 r166853  
     12014-03-23  Darin Adler  <darin@apple.com>
     2
     3        Refactor post-attach and HTMLObjectElement-related code
     4        https://bugs.webkit.org/show_bug.cgi?id=131282
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * svg/custom/object-no-size-attributes-expected.txt: Removed expectation of an empty text
     9        renderer from the render tree.
     10        * svg/custom/object-no-size-attributes.xhtml: Restructured the source so there is no text
     11        to render. Without this, we were seeing two text renderers due to the loading timing change.
     12
    1132014-04-05  Dirk Schulze  <krit@webkit.org>
    214
  • trunk/LayoutTests/svg/custom/object-no-size-attributes-expected.txt

    r166680 r166853  
    1010          RenderSVGRoot {svg} at (0,0) size 100x100
    1111            RenderSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
    12       RenderText {#text} at (0,0) size 0x0
  • trunk/LayoutTests/svg/custom/object-no-size-attributes.xhtml

    r166680 r166853  
    22<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    33<body>
    4 <object type="image/svg+xml" data="data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100px%22%20height%3D%22100px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20fill%3D%22green%22%20width%3D%22100px%22%20height%3D%22100px%22%20%2F%3E%3C%2Fsvg%3E" style='background: red'></object>
    5 
    6 <!--
     4<object type="image/svg+xml" data="data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%22100px%22%20height%3D%22100px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect%20fill%3D%22green%22%20width%3D%22100px%22%20height%3D%22100px%22%20%2F%3E%3C%2Fsvg%3E" style='background: red'></object><!--
    75100px x 100px SVG
    86
     
    1412
    1513You should see a 100 x 100 green square above.  No red should be visible.  &lt;object&gt; tags should treat the width/height attributes on an embeded SVG as the intrinsic size and not default to the CSS default of 300 x 150.
    16 -->
    17 
    18 </body>
     14--></body>
    1915</html>
  • trunk/Source/WebCore/ChangeLog

    r166851 r166853  
     12014-03-23  Darin Adler  <darin@apple.com>
     2
     3        Refactor post-attach and HTMLObjectElement-related code
     4        https://bugs.webkit.org/show_bug.cgi?id=131282
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * dom/ContainerNode.cpp: Moved the post-attach callback code from here to
     9        StyleResolveTree.h/cpp.
     10        * dom/ContainerNode.h: Ditto.
     11
     12        * dom/Document.cpp:
     13        (WebCore::Document::recalcStyle): Use Style::PostResolutionCallbackDisabler instead of
     14        PostAttachCallbackDisabler.
     15
     16        * dom/Element.h: Moved the post-attach callback code from here to StyleResolveTree.h/cpp.
     17
     18        * html/HTMLEmbedElement.cpp:
     19        (WebCore::HTMLEmbedElement::parseAttribute): Simplified the code for typeAttr, turning
     20        it into a 1-liner. Added a FIXME in codeAttr about the fact that it does not have the
     21        code to trigger image loads.
     22
     23        * html/HTMLFormControlElement.cpp:
     24        (WebCore::HTMLFormControlElement::didAttachRenderers): Updated to use
     25        Style::queuePostResolutionCallback and use a lambda instead of a function.
     26        (WebCore::HTMLFormControlElement::didRecalcStyle): Ditto. Also added RefPtr instead
     27        of just using wishful thinking to keep the object alive.
     28        * html/HTMLFrameOwnerElement.cpp:
     29        (WebCore::HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc): Ditto.
     30
     31        * html/HTMLObjectElement.cpp:
     32        (WebCore::HTMLObjectElement::parseAttribute):: Simplified the code for typeAttr, turning
     33        it into a 1-liner. Made dataAttr call setNeedsWidgetUpdate(true) unconditionally after
     34        checking carefully to see that's harmless if there is no renderer. Changed classidAttr
     35        to call setNeedsWidgetUpdate(true) unconditionally and not set m_classId.
     36        (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use fastGetAttribute
     37        instead of classId and descendantsOfType instead of getElementsByTagName.
     38        (WebCore::HTMLObjectElement::hasValidClassId): Use fastGetAttribute instead of classId.
     39        (WebCore::HTMLObjectElement::renderFallbackContent): Use imageLoader instead of m_imageLoader.
     40
     41        * html/HTMLObjectElement.h: Removed classId, since there is no reason to cache that
     42        attribute in a data member. Rearranged header, making more private, and fixing some typos,
     43        and doing a "using" instead of a function to disambiguate the inherited form functions.
     44
     45        * html/HTMLPlugInImageElement.cpp:
     46        (WebCore::HTMLPlugInImageElement::createElementRenderer): Fixed some code that assumed the
     47        first child of the shadow root is guaranteed to be an element.
     48        (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Removed null check on oldDocument,
     49        since m_needsDocumentActivationCallbacks can't be true if the old document was null.
     50        (WebCore::is100Percent): Added helper to make function below more readable.
     51        (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Restructured the code a
     52        bit. The part that attracted my attention was the local variable of type RenderBox, which
     53        was named renderEmbeddedObject. Turns out the caller guarantees to only call this if there
     54        is a renderer of type RenderEmbeddedObject, so depend on that.
     55
     56        * html/HTMLPlugInImageElement.h: Trimmed includes a bit. Made more members private.
     57        Marked more function members final. Made a protected imageLoader function so that
     58        m_imageLoader can be private eventually. Made m_imageLoader be std::unique_ptr.
     59
     60        * style/StyleResolveTree.cpp:
     61        (WebCore::Style::needsPseudoElement): Fixed spelling error in the name of this function.
     62        (WebCore::Style::attachBeforeOrAfterPseudoElementIfNeeded): Updated for name change.
     63        (WebCore::Style::attachRenderTree): Update for new name of PostResolutionCallbackDisabler.
     64        (WebCore::Style::updateBeforeOrAfterPseudoElement): Updated for name change.
     65        (WebCore::Style::postResolutionCallbackQueue): Added.
     66        (WebCore::Style::queuePostResolutionCallback): Added.
     67        (WebCore::Style::suspendMemoryCacheClientCalls): Added. This is a side effect of the original
     68        PostAttachCallbackDisabler that is now done in a cleaner way, using the callback queue, instead
     69        of as a special case. It should not work for multiple documents across multiple pages instead of
     70        only the outermost one.
     71        (WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler): Added.
     72        Calls suspendMemoryCacheClientCalls, but a FIXME tries to point out why that isn't so great.
     73        (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler): Added.
     74        (WebCore::Style::postResolutionCallbacksAreSuspended): Added.
     75
     76        * style/StyleResolveTree.h: Added queuePostResolutionCallback and
     77        postResolutionCallbacksAreSuspended. Also added PostResolutionCallbackDisabler, which should
     78        eventually become a private implementation detail.
     79
    1802014-04-04  Brian J. Burg  <burg@cs.washington.edu>
    281
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r166680 r166853  
    3838#include "JSNode.h"
    3939#include "LabelsNodeList.h"
    40 #include "LoaderStrategy.h"
    41 #include "MemoryCache.h"
    4240#include "MutationEvent.h"
    4341#include "NameNodeList.h"
    4442#include "NodeRareData.h"
    4543#include "NodeRenderStyle.h"
    46 #include "PlatformStrategies.h"
    4744#include "RadioNodeList.h"
    4845#include "RenderBox.h"
     
    6360static void dispatchChildInsertionEvents(Node&);
    6461static void dispatchChildRemovalEvents(Node&);
    65 
    66 typedef std::pair<RefPtr<Node>, unsigned> CallbackParameters;
    67 typedef std::pair<NodeCallback, CallbackParameters> CallbackInfo;
    68 typedef Vector<CallbackInfo> NodeCallbackQueue;
    69 
    70 static NodeCallbackQueue* s_postAttachCallbackQueue;
    71 
    72 static size_t s_attachDepth;
    73 static bool s_shouldReEnableMemoryCacheCallsAfterAttach;
    7462
    7563ChildNodesLazySnapshot* ChildNodesLazySnapshot::latestSnapshot = 0;
     
    757745
    758746    newChild->setNeedsStyleRecalc(ReconstructRenderTree);
    759 }
    760 
    761 void ContainerNode::suspendPostAttachCallbacks(Document& document)
    762 {
    763     if (!s_attachDepth) {
    764         ASSERT(!s_shouldReEnableMemoryCacheCallsAfterAttach);
    765         if (Page* page = document.page()) {
    766             // FIXME: How can this call be specific to one Page, while the
    767             // s_attachDepth is a global? Doesn't make sense.
    768             if (page->areMemoryCacheClientCallsEnabled()) {
    769                 page->setMemoryCacheClientCallsEnabled(false);
    770                 s_shouldReEnableMemoryCacheCallsAfterAttach = true;
    771             }
    772         }
    773         platformStrategies()->loaderStrategy()->resourceLoadScheduler()->suspendPendingRequests();
    774     }
    775     ++s_attachDepth;
    776 }
    777 
    778 void ContainerNode::resumePostAttachCallbacks(Document& document)
    779 {
    780     if (s_attachDepth == 1) {
    781         Ref<Document> protect(document);
    782 
    783         if (s_postAttachCallbackQueue)
    784             dispatchPostAttachCallbacks();
    785         if (s_shouldReEnableMemoryCacheCallsAfterAttach) {
    786             s_shouldReEnableMemoryCacheCallsAfterAttach = false;
    787             if (Page* page = document.page())
    788                 page->setMemoryCacheClientCallsEnabled(true);
    789         }
    790         platformStrategies()->loaderStrategy()->resourceLoadScheduler()->resumePendingRequests();
    791     }
    792     --s_attachDepth;
    793 }
    794 
    795 void ContainerNode::queuePostAttachCallback(NodeCallback callback, Node& node, unsigned callbackData)
    796 {
    797     if (!s_postAttachCallbackQueue)
    798         s_postAttachCallbackQueue = new NodeCallbackQueue;
    799    
    800     s_postAttachCallbackQueue->append(CallbackInfo(callback, CallbackParameters(&node, callbackData)));
    801 }
    802 
    803 bool ContainerNode::postAttachCallbacksAreSuspended()
    804 {
    805     return s_attachDepth;
    806 }
    807 
    808 void ContainerNode::dispatchPostAttachCallbacks()
    809 {
    810     // We recalculate size() each time through the loop because a callback
    811     // can add more callbacks to the end of the queue.
    812     for (size_t i = 0; i < s_postAttachCallbackQueue->size(); ++i) {
    813         const CallbackInfo& info = (*s_postAttachCallbackQueue)[i];
    814         NodeCallback callback = info.first;
    815         CallbackParameters params = info.second;
    816 
    817         callback(*params.first, params.second);
    818     }
    819     s_postAttachCallbackQueue->clear();
    820747}
    821748
  • trunk/Source/WebCore/dom/ContainerNode.h

    r166680 r166853  
    8080
    8181class ContainerNode : public Node {
    82     friend class PostAttachCallbackDisabler;
    8382public:
    8483    virtual ~ContainerNode();
     
    141140    explicit ContainerNode(Document&, ConstructionType = CreateContainer);
    142141
    143     static void queuePostAttachCallback(NodeCallback, Node&, unsigned = 0);
    144     static bool postAttachCallbacksAreSuspended();
    145 
    146142    template<class GenericNode, class GenericNodeContainer>
    147143    friend void appendChildToContainer(GenericNode* child, GenericNodeContainer&);
     
    157153    void removeBetween(Node* previousChild, Node* nextChild, Node& oldChild);
    158154    void insertBeforeCommon(Node& nextChild, Node& oldChild);
    159 
    160     static void dispatchPostAttachCallbacks();
    161     static void suspendPostAttachCallbacks(Document&);
    162     static void resumePostAttachCallbacks(Document&);
    163155
    164156    bool getUpperLeftCorner(FloatPoint&) const;
  • trunk/Source/WebCore/dom/Document.cpp

    r166740 r166853  
    17551755    m_inStyleRecalc = true;
    17561756    {
    1757         PostAttachCallbackDisabler disabler(*this);
     1757        Style::PostResolutionCallbackDisabler disabler(*this);
    17581758        WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
    17591759
  • trunk/Source/WebCore/dom/Element.h

    r166680 r166853  
    797797}
    798798
    799 class PostAttachCallbackDisabler {
    800 public:
    801     explicit PostAttachCallbackDisabler(Document& document)
    802         : m_document(document)
    803     {
    804         Element::suspendPostAttachCallbacks(m_document);
    805     }
    806 
    807     ~PostAttachCallbackDisabler()
    808     {
    809         Element::resumePostAttachCallbacks(m_document);
    810     }
    811 
    812 private:
    813     Document& m_document;
    814 };
    815 
    816799} // namespace WebCore
    817800
  • trunk/Source/WebCore/html/HTMLEmbedElement.cpp

    r166680 r166853  
    9898{
    9999    if (name == typeAttr) {
    100         m_serviceType = value.string().lower();
    101         size_t pos = m_serviceType.find(";");
    102         if (pos != notFound)
    103             m_serviceType = m_serviceType.left(pos);
    104     } else if (name == codeAttr)
     100        m_serviceType = value.string().left(value.find(";")).lower();
     101        // FIXME: The only difference between this and HTMLObjectElement's corresponding
     102        // code is that HTMLObjectElement does setNeedsWidgetUpdate(true). Consider moving
     103        // this up to the HTMLPlugInImageElement to be shared.
     104    } else if (name == codeAttr) {
    105105        m_url = stripLeadingAndTrailingHTMLSpaces(value);
    106     else if (name == srcAttr) {
     106        // FIXME: Why no call to the image loader?
     107        // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right!
     108    } else if (name == srcAttr) {
    107109        m_url = stripLeadingAndTrailingHTMLSpaces(value);
    108110        document().updateStyleIfNeeded();
    109111        if (renderer() && isImageType()) {
    110112            if (!m_imageLoader)
    111                 m_imageLoader = adoptPtr(new HTMLImageLoader(*this));
     113                m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
    112114            m_imageLoader->updateFromElementIgnoringPreviousError();
    113115        }
     116        // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right!
    114117    } else
    115118        HTMLPlugInImageElement::parseAttribute(name, value);
  • trunk/Source/WebCore/html/HTMLFormControlElement.cpp

    r166680 r166853  
    209209}
    210210
    211 static void focusPostAttach(Node& element, unsigned)
    212 {
    213     toElement(element).focus();
    214     element.deref();
    215 }
    216 
    217211void HTMLFormControlElement::didAttachRenderers()
    218212{
     
    225219    if (shouldAutofocus(this)) {
    226220        setAutofocused();
    227         ref();
    228         queuePostAttachCallback(focusPostAttach, *this);
     221
     222        RefPtr<HTMLFormControlElement> element = this;
     223        Style::queuePostResolutionCallback([element] {
     224            element->focus();
     225        });
    229226    }
    230227}
     
    289286}
    290287
    291 static void updateFromElementCallback(Node& node, unsigned)
    292 {
    293     if (auto renderer = toHTMLFormControlElement(node).renderer())
    294         renderer->updateFromElement();
    295 }
    296 
    297288void HTMLFormControlElement::didRecalcStyle(Style::Change)
    298289{
    299290    // updateFromElement() can cause the selection to change, and in turn
    300291    // trigger synchronous layout, so it must not be called during style recalc.
    301     if (renderer())
    302         queuePostAttachCallback(updateFromElementCallback, *this);
     292    if (renderer()) {
     293        RefPtr<HTMLFormControlElement> element = this;
     294        Style::queuePostResolutionCallback([element]{
     295            if (auto* renderer = element->renderer())
     296                renderer->updateFromElement();
     297        });
     298    }
    303299}
    304300
  • trunk/Source/WebCore/html/HTMLFrameOwnerElement.cpp

    r166680 r166853  
    122122}
    123123
    124 static void needsStyleRecalcCallback(Node& node, unsigned data)
    125 {
    126     node.setNeedsStyleRecalc(static_cast<StyleChangeType>(data));
    127 }
    128 
    129124void HTMLFrameOwnerElement::scheduleSetNeedsStyleRecalc(StyleChangeType changeType)
    130125{
    131     if (postAttachCallbacksAreSuspended())
    132         queuePostAttachCallback(needsStyleRecalcCallback, *this, static_cast<unsigned>(changeType));
    133     else
     126    if (Style::postResolutionCallbacksAreSuspended()) {
     127        RefPtr<HTMLFrameOwnerElement> element = this;
     128        Style::queuePostResolutionCallback([element, changeType]{
     129            element->setNeedsStyleRecalc(changeType);
     130        });
     131    } else
    134132        setNeedsStyleRecalc(changeType);
    135133}
  • trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r166680 r166853  
    108108        formAttributeChanged();
    109109    else if (name == typeAttr) {
    110         m_serviceType = value.lower();
    111         size_t pos = m_serviceType.find(";");
    112         if (pos != notFound)
    113             m_serviceType = m_serviceType.left(pos);
    114         if (renderer())
    115             setNeedsWidgetUpdate(true);
     110        m_serviceType = value.string().left(value.find(';')).lower();
     111        setNeedsWidgetUpdate(true);
    116112    } else if (name == dataAttr) {
    117113        m_url = stripLeadingAndTrailingHTMLSpaces(value);
     114        setNeedsWidgetUpdate(true);
    118115        document().updateStyleIfNeeded();
    119116        if (renderer()) {
    120             setNeedsWidgetUpdate(true);
    121117            if (isImageType()) {
    122118                if (!m_imageLoader)
    123                     m_imageLoader = adoptPtr(new HTMLImageLoader(*this));
     119                    m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
    124120                m_imageLoader->updateFromElementIgnoringPreviousError();
    125121            }
    126122        }
    127     } else if (name == classidAttr) {
    128         m_classId = value;
    129         if (renderer())
    130             setNeedsWidgetUpdate(true);
    131     } else if (name == onbeforeloadAttr)
     123    } else if (name == classidAttr)
     124        setNeedsWidgetUpdate(true);
     125    else if (name == onbeforeloadAttr)
    132126        setAttributeEventListener(eventNames().beforeloadEvent, name, value);
    133127    else
     
    252246    // fallback content, which ensures the quirk will disable itself if Wiki
    253247    // Server is updated to generate an alternate embed tag as fallback content.
     248
    254249    if (!document().page()
    255250        || !document().page()->settings().needsSiteSpecificQuirks()
    256251        || hasFallbackContent()
    257         || !equalIgnoringCase(classId(), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"))
     252        || !equalIgnoringCase(fastGetAttribute(classidAttr), "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"))
    258253        return false;
    259254
    260     RefPtr<NodeList> metaElements = document().getElementsByTagName(HTMLNames::metaTag.localName());
    261     unsigned length = metaElements->length();
    262     for (unsigned i = 0; i < length; ++i) {
    263         HTMLMetaElement& metaElement = toHTMLMetaElement(*metaElements->item(i));
     255    for (auto& metaElement : descendantsOfType<HTMLMetaElement>(document())) {
    264256        if (equalIgnoringCase(metaElement.name(), "generator") && metaElement.content().startsWith("Mac OS X Server Web Services Server", false))
    265257            return true;
    266258    }
    267    
     259
    268260    return false;
    269261}
     
    271263bool HTMLObjectElement::hasValidClassId()
    272264{
    273     if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && classId().startsWith("java:", false))
     265    if (MIMETypeRegistry::isJavaAppletMIMEType(serviceType()) && fastGetAttribute(classidAttr).startsWith("java:", false))
    274266        return true;
    275267   
     
    279271    // HTML5 says that fallback content should be rendered if a non-empty
    280272    // classid is specified for which the UA can't find a suitable plug-in.
    281     return classId().isEmpty();
     273    return fastGetAttribute(classidAttr).isEmpty();
    282274}
    283275
     
    376368
    377369    // Before we give up and use fallback content, check to see if this is a MIME type issue.
    378     if (m_imageLoader && m_imageLoader->image() && m_imageLoader->image()->status() != CachedResource::LoadError) {
    379         m_serviceType = m_imageLoader->image()->response().mimeType();
     370    auto* loader = imageLoader();
     371    if (loader && loader->image() && loader->image()->status() != CachedResource::LoadError) {
     372        m_serviceType = loader->image()->response().mimeType();
    380373        if (!isImageType()) {
    381374            // If we don't think we have an image type anymore, then clear the image from the loader.
    382             m_imageLoader->setImage(0);
     375            loader->setImage(nullptr);
    383376            return;
    384377        }
     
    387380    m_useFallbackContent = true;
    388381
    389     // This is here mainly to keep acid2 non-flaky. A style recalc is required to make fallback resources to load. Without forcing
    390     // this may happen after all the other resources have been loaded and the document is already considered complete.
    391     // FIXME: Disentangle fallback content handling from style recalcs.
     382    // This was added to keep Acid 2 non-flaky. A style recalc is required to make fallback resources load.
     383    // Without forcing, this may happen after all the other resources have been loaded and the document is already
     384    // considered complete. FIXME: Would be better to address this with incrementLoadEventDelayCount instead
     385    // or disentangle loading from style entirely.
    392386    document().updateStyleIfNeeded();
    393387}
  • trunk/Source/WebCore/html/HTMLObjectElement.h

    r166680 r166853  
    3737
    3838    bool isDocNamedItem() const { return m_docNamedItem; }
    39 
    40     const String& classId() const { return m_classId; }
    41 
    4239    bool containsJavaApplet() const;
    4340
     41    bool hasFallbackContent() const;
    4442    virtual bool useFallbackContent() const override { return m_useFallbackContent; }
    4543    void renderFallbackContent();
    4644
    47     // Implementations of FormAssociatedElement
    48     HTMLFormElement* form() const { return FormAssociatedElement::form(); }
     45    // Implementation of constraint validation API.
     46    // Note that the object elements are always barred from constraint validation.
     47    static bool checkValidity() { return true; }
     48    virtual void setCustomValidity(const String&) override { }
     49    virtual String validationMessage() const override { return String(); }
    4950
    50     virtual bool isFormControlElement() const override { return false; }
     51    using HTMLPlugInImageElement::ref;
     52    using HTMLPlugInImageElement::deref;
    5153
    52     virtual bool isEnumeratable() const override { return true; }
    53     virtual bool appendFormData(FormDataList&, bool) override;
    54 
    55     // Implementations of constraint validation API.
    56     // Note that the object elements are always barred from constraint validation.
    57     virtual String validationMessage() const override { return String(); }
    58     bool checkValidity() { return true; }
    59     virtual void setCustomValidity(const String&) override { }
    60 
    61     using Node::ref;
    62     using Node::deref;
    63 
    64     virtual bool canContainRangeEndPoint() const override { return useFallbackContent(); }
    65 
    66     bool hasFallbackContent() const;
     54    using FormAssociatedElement::form;
    6755
    6856private:
     
    10593    virtual const HTMLObjectElement& asHTMLElement() const override final { return *this; }
    10694
    107     String m_classId;
     95    virtual bool isFormControlElement() const override { return false; }
     96
     97    virtual bool isEnumeratable() const override { return true; }
     98    virtual bool appendFormData(FormDataList&, bool) override;
     99
     100    virtual bool canContainRangeEndPoint() const override { return useFallbackContent(); }
     101
    108102    bool m_docNamedItem : 1;
    109103    bool m_useFallbackContent : 1;
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp

    r166680 r166853  
    11/*
    2  * Copyright (C) 2008, 2011, 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2011, 2012, 2014 Apple Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    228228#if PLATFORM(IOS)
    229229    if (ShadowRoot* shadowRoot = this->shadowRoot()) {
    230         Element* shadowElement = toElement(shadowRoot->firstChild());
    231         if (shadowElement && shadowElement->shadowPseudoId() == "-apple-youtube-shadow-iframe")
     230        Node* shadowNode = shadowRoot->firstChild();
     231        if (shadowNode && shadowNode->isElementNode() && toElement(*shadowNode).shadowPseudoId() == "-apple-youtube-shadow-iframe")
    232232            return createRenderer<RenderBlockFlow>(*this, std::move(style));
    233233    }
    234234#endif
     235
    235236    return HTMLPlugInElement::createElementRenderer(std::move(style));
    236237}
     
    248249{
    249250    if (!isImageType()) {
    250         queuePostAttachCallback(&HTMLPlugInImageElement::updateWidgetCallback, *this);
     251        RefPtr<HTMLPlugInImageElement> element = this;
     252        Style::queuePostResolutionCallback([element]{
     253            element->updateWidgetIfNecessary();
     254        });
    251255        return;
    252256    }
     
    254258        return;
    255259
    256     // Image load might complete synchronously and cause us to re-enter attach.
    257     queuePostAttachCallback(&HTMLPlugInImageElement::startLoadingImageCallback, *this);
     260    // Image load might complete synchronously and cause us to re-enter.
     261    RefPtr<HTMLPlugInImageElement> element = this;
     262    Style::queuePostResolutionCallback([element]{
     263        element->startLoadingImage();
     264    });
    258265}
    259266
     
    262269    // FIXME: Because of the insanity that is HTMLPlugInImageElement::willRecalcStyle,
    263270    // we can end up detaching during an attach() call, before we even have a
    264     // renderer.  In that case, don't mark the widget for update.
     271    // renderer. In that case, don't mark the widget for update.
    265272    if (renderer() && !useFallbackContent()) {
    266273        // Update the widget the next time we attach (detaching destroys the plugin).
    267274        setNeedsWidgetUpdate(true);
    268275    }
     276
    269277    HTMLPlugInElement::willDetachRenderers();
    270278}
     
    297305{
    298306    if (m_needsDocumentActivationCallbacks) {
    299         if (oldDocument)
    300             oldDocument->unregisterForPageCacheSuspensionCallbacks(this);
     307        oldDocument->unregisterForPageCacheSuspensionCallbacks(this);
    301308        document().registerForPageCacheSuspensionCallbacks(this);
    302309    }
     
    304311    if (m_imageLoader)
    305312        m_imageLoader->elementDidMoveToNewDocument();
     313
    306314    HTMLPlugInElement::didMoveToNewDocument(oldDocument);
    307315}
     
    322330}
    323331
    324 void HTMLPlugInImageElement::updateWidgetCallback(Node& node, unsigned)
    325 {
    326     toHTMLPlugInImageElement(node).updateWidgetIfNecessary();
    327 }
    328 
    329332void HTMLPlugInImageElement::startLoadingImage()
    330333{
    331334    if (!m_imageLoader)
    332         m_imageLoader = adoptPtr(new HTMLImageLoader(*this));
     335        m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
    333336    m_imageLoader->updateFromElement();
    334 }
    335 
    336 void HTMLPlugInImageElement::startLoadingImageCallback(Node& node, unsigned)
    337 {
    338     toHTMLPlugInImageElement(node).startLoadingImage();
    339337}
    340338
     
    438436    root.appendChild(shadowElement, ASSERT_NO_EXCEPTION);
    439437
    440     RefPtr<HTMLIFrameElement> iframeElement = HTMLIFrameElement::create(HTMLNames::iframeTag, document());
    441     if (hasAttribute(HTMLNames::widthAttr))
    442         iframeElement->setAttribute(HTMLNames::widthAttr, AtomicString("100%", AtomicString::ConstructFromLiteral));
    443     if (hasAttribute(HTMLNames::heightAttr)) {
    444         iframeElement->setAttribute(HTMLNames::styleAttr, AtomicString("max-height: 100%", AtomicString::ConstructFromLiteral));
    445         iframeElement->setAttribute(HTMLNames::heightAttr, getAttribute(HTMLNames::heightAttr));
    446     }
    447     iframeElement->setAttribute(HTMLNames::srcAttr, src);
    448     iframeElement->setAttribute(HTMLNames::frameborderAttr, AtomicString("0", AtomicString::ConstructFromLiteral));
     438    RefPtr<HTMLIFrameElement> iframeElement = HTMLIFrameElement::create(iframeTag, document());
     439    if (hasAttribute(widthAttr))
     440        iframeElement->setAttribute(widthAttr, AtomicString("100%", AtomicString::ConstructFromLiteral));
     441    if (hasAttribute(heightAttr)) {
     442        iframeElement->setAttribute(styleAttr, AtomicString("max-height: 100%", AtomicString::ConstructFromLiteral));
     443        iframeElement->setAttribute(heightAttr, getAttribute(heightAttr));
     444    }
     445    iframeElement->setAttribute(srcAttr, src);
     446    iframeElement->setAttribute(frameborderAttr, AtomicString("0", AtomicString::ConstructFromLiteral));
    449447
    450448    // Disable frame flattening for this iframe.
    451     iframeElement->setAttribute(HTMLNames::scrollingAttr, AtomicString("no", AtomicString::ConstructFromLiteral));
     449    iframeElement->setAttribute(scrollingAttr, AtomicString("no", AtomicString::ConstructFromLiteral));
    452450    shadowElement->appendChild(iframeElement, ASSERT_NO_EXCEPTION);
    453451}
     
    611609}
    612610
     611static inline bool is100Percent(Length length)
     612{
     613    return length.isPercent() && length.percent() == 100;
     614}
     615
    613616void HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn(const URL& url)
    614617{
     
    695698    }
    696699
    697     RenderBox* renderEmbeddedObject = toRenderBox(renderer());
    698     Length styleWidth = renderEmbeddedObject->style().width();
    699     Length styleHeight = renderEmbeddedObject->style().height();
    700     LayoutRect contentBoxRect = renderEmbeddedObject->contentBoxRect();
    701     int contentWidth = contentBoxRect.width();
    702     int contentHeight = contentBoxRect.height();
    703     int contentArea = contentWidth * contentHeight;
    704     IntSize visibleViewSize = document().frame()->view()->visibleSize();
    705     int visibleArea = visibleViewSize.width() * visibleViewSize.height();
    706 
    707     if (inMainFrame && styleWidth.isPercent() && (styleWidth.percent() == 100)
    708         && styleHeight.isPercent() && (styleHeight.percent() == 100)
    709         && (static_cast<float>(contentArea) / visibleArea > sizingFullPageAreaRatioThreshold)) {
    710         LOG(Plugins, "%p Plug-in is top level full page, set to play", this);
    711         m_snapshotDecision = NeverSnapshot;
    712         return;
     700    auto& renderer = toRenderEmbeddedObject(*this->renderer());
     701    LayoutRect contentRect = renderer.contentBoxRect();
     702    int contentWidth = contentRect.width();
     703    int contentHeight = contentRect.height();
     704
     705    if (inMainFrame) {
     706        auto& style = renderer.style();
     707        bool isFullPage = is100Percent(style.width()) && is100Percent(style.height());
     708        IntSize visibleViewSize = document().frame()->view()->visibleSize();
     709        float contentArea = contentWidth * contentHeight;
     710        float visibleArea = visibleViewSize.width() * visibleViewSize.height();
     711        if (isFullPage && contentArea > visibleArea * sizingFullPageAreaRatioThreshold) {
     712            LOG(Plugins, "%p Plug-in is top level full page, set to play", this);
     713            m_snapshotDecision = NeverSnapshot;
     714            return;
     715        }
    713716    }
    714717
    715718    if (contentWidth <= sizingTinyDimensionThreshold || contentHeight <= sizingTinyDimensionThreshold) {
    716719        LOG(Plugins, "%p Plug-in is very small %dx%d, set to play", this, contentWidth, contentHeight);
    717         m_sizeWhenSnapshotted = IntSize(contentBoxRect.width().toInt(), contentBoxRect.height().toInt());
     720        m_sizeWhenSnapshotted = IntSize(contentWidth, contentHeight);
    718721        m_snapshotDecision = MaySnapshotWhenResized;
    719722        return;
     
    727730    }
    728731
    729     LOG(Plugins, "%p Plug-in from (%s, %s) is not auto-start, sized at %dx%d, set to wait for snapshot", this, document().page()->mainFrame().document()->baseURL().host().utf8().data(), url.host().utf8().data(), contentWidth, contentHeight);
     732    LOG(Plugins, "%p Plug-in from (%s, %s) is not auto-start, sized at %dx%d, set to wait for snapshot", this, document().topDocument().baseURL().host().utf8().data(), url.host().utf8().data(), contentWidth, contentHeight);
    730733    m_snapshotDecision = Snapshotted;
    731734    setDisplayState(WaitingForSnapshot);
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.h

    r166680 r166853  
    11/*
    2  * Copyright (C) 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2008, 2009, 2011, 2012, 2014 Apple Inc. All rights reserved.
    33 *
    44 * This library is free software; you can redistribute it and/or
     
    2424#include "HTMLPlugInElement.h"
    2525
    26 #include "RenderStyle.h"
    27 #include <wtf/OwnPtr.h>
    28 
    2926namespace WebCore {
    3027
    3128class HTMLImageLoader;
    32 class HTMLVideoElement;
    3329class FrameLoader;
    3430class Image;
    3531class MouseEvent;
     32class RenderStyle;
    3633class Widget;
    3734
     
    4138};
    4239
    43 enum PreferPlugInsForImagesOption {
    44     ShouldPreferPlugInsForImages,
    45     ShouldNotPreferPlugInsForImages
    46 };
    47 
    48 // Base class for HTMLObjectElement and HTMLEmbedElement
     40// Base class for HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement.
     41// FIXME: Should HTMLAppletElement inherit from HTMLPlugInElement directly instead?
    4942class HTMLPlugInImageElement : public HTMLPlugInElement {
    5043public:
     
    10598
    10699protected:
     100    enum PreferPlugInsForImagesOption { ShouldPreferPlugInsForImages, ShouldNotPreferPlugInsForImages };
    107101    HTMLPlugInImageElement(const QualifiedName& tagName, Document&, bool createdByParser, PreferPlugInsForImagesOption);
    108102
     103    virtual void didMoveToNewDocument(Document* oldDocument) override;
     104    virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) override final;
     105
    109106    bool isImageType();
    110 
    111     OwnPtr<HTMLImageLoader> m_imageLoader;
    112     String m_serviceType;
    113     String m_url;
    114     URL m_loadedUrl;
    115 
    116     static void updateWidgetCallback(Node&, unsigned);
    117     static void startLoadingImageCallback(Node&, unsigned);
    118 
    119     virtual void didAttachRenderers() override;
    120     virtual void willDetachRenderers() override;
     107    HTMLImageLoader* imageLoader() { return m_imageLoader.get(); }
    121108
    122109    bool allowedToLoadFrameURL(const String& url);
    123110    bool wouldLoadAsNetscapePlugin(const String& url, const String& serviceType);
    124111
    125     virtual void didMoveToNewDocument(Document* oldDocument) override;
     112    String m_serviceType;
     113    String m_url;
    126114
    127     virtual void documentWillSuspendForPageCache() override;
    128     virtual void documentDidResumeFromPageCache() override;
    129 
    130     virtual bool isRestartedPlugin() const override { return m_isRestartedPlugin; }
    131     virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) override;
     115    std::unique_ptr<HTMLImageLoader> m_imageLoader;
    132116
    133117private:
     118    virtual bool isPlugInImageElement() const override final { return true; }
     119    virtual bool isRestartedPlugin() const override final { return m_isRestartedPlugin; }
     120
     121    virtual void finishParsingChildren() override final;
     122    virtual void didAddUserAgentShadowRoot(ShadowRoot*) override final;
     123
    134124    virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override;
    135     virtual bool willRecalcStyle(Style::Change) override;
     125    virtual bool willRecalcStyle(Style::Change) override final;
     126    virtual void didAttachRenderers() override final;
     127    virtual void willDetachRenderers() override final;
    136128
    137     virtual void didAddUserAgentShadowRoot(ShadowRoot*) override;
     129    virtual void documentWillSuspendForPageCache() override final;
     130    virtual void documentDidResumeFromPageCache() override final;
    138131
    139     virtual void finishParsingChildren() override;
     132    virtual void defaultEventHandler(Event*) override final;
     133    virtual void dispatchPendingMouseClick() override final;
    140134
     135    virtual void updateSnapshot(PassRefPtr<Image>) override final;
     136
     137    void startLoadingImage();
    141138    void updateWidgetIfNecessary();
    142     void startLoadingImage();
    143139
    144     virtual void updateSnapshot(PassRefPtr<Image>) override;
    145     virtual void dispatchPendingMouseClick() override;
    146140    void simulatedMouseClickTimerFired(DeferrableOneShotTimer<HTMLPlugInImageElement>&);
    147141
    148142    void restartSimilarPlugIns();
    149 
    150     virtual bool isPlugInImageElement() const override { return true; }
    151 
    152143    void removeSnapshotTimerFired(Timer<HTMLPlugInImageElement>&);
    153144
    154     virtual void defaultEventHandler(Event*) override;
    155 
     145private:
     146    URL m_loadedUrl;
    156147    bool m_needsWidgetUpdate;
    157148    bool m_shouldPreferPlugInsForImages;
  • trunk/Source/WebCore/style/StyleResolveTree.cpp

    r166706 r166853  
    3030#include "AnimationController.h"
    3131#include "CSSFontSelector.h"
    32 #include "Element.h"
    3332#include "ElementIterator.h"
    3433#include "ElementRareData.h"
    3534#include "FlowThreadController.h"
    3635#include "InsertionPoint.h"
     36#include "LoaderStrategy.h"
    3737#include "NodeRenderStyle.h"
    3838#include "NodeRenderingTraversal.h"
    3939#include "NodeTraversal.h"
    40 #include "RenderElement.h"
     40#include "PlatformStrategies.h"
    4141#include "RenderFullScreen.h"
    4242#include "RenderNamedFlowThread.h"
     
    4444#include "RenderView.h"
    4545#include "RenderWidget.h"
     46#include "ResourceLoadScheduler.h"
    4647#include "Settings.h"
    4748#include "ShadowRoot.h"
     
    576577static void attachRenderTree(Element& current, ContainerNode& renderingParentNode, RenderTreePosition& renderTreePosition, PassRefPtr<RenderStyle> resolvedStyle)
    577578{
    578     PostAttachCallbackDisabler callbackDisabler(current.document());
     579    PostResolutionCallbackDisabler callbackDisabler(current.document());
    579580    WidgetHierarchyUpdatesSuspensionScope suspendWidgetHierarchyUpdates;
    580581
     
    968969}
    969970
    970 }
    971 }
     971static Vector<std::function<void ()>>& postResolutionCallbackQueue()
     972{
     973    static NeverDestroyed<Vector<std::function<void ()>>> vector;
     974    return vector;
     975}
     976
     977void queuePostResolutionCallback(std::function<void ()> callback)
     978{
     979    postResolutionCallbackQueue().append(callback);
     980}
     981
     982static void suspendMemoryCacheClientCalls(Document& document)
     983{
     984    Page* page = document.page();
     985    if (!page || !page->areMemoryCacheClientCallsEnabled())
     986        return;
     987
     988    page->setMemoryCacheClientCallsEnabled(false);
     989
     990    RefPtr<Document> protectedDocument = &document;
     991    postResolutionCallbackQueue().append([protectedDocument]{
     992        // FIXME: If the document becomes unassociated with the page during style resolution
     993        // then this won't work and the memory cache client calls will be permanently disabled.
     994        if (Page* page = protectedDocument->page())
     995            page->setMemoryCacheClientCallsEnabled(true);
     996    });
     997}
     998
     999static unsigned resolutionNestingDepth;
     1000
     1001PostResolutionCallbackDisabler::PostResolutionCallbackDisabler(Document& document)
     1002{
     1003    ++resolutionNestingDepth;
     1004
     1005    if (resolutionNestingDepth == 1)
     1006        platformStrategies()->loaderStrategy()->resourceLoadScheduler()->suspendPendingRequests();
     1007
     1008    // FIXME: It's strange to build this into the disabler.
     1009    suspendMemoryCacheClientCalls(document);
     1010}
     1011
     1012PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler()
     1013{
     1014    if (resolutionNestingDepth == 1) {
     1015        // Get size each time through the loop because a callback can add more callbacks to the end of the queue.
     1016        auto& queue = postResolutionCallbackQueue();
     1017        for (size_t i = 0; i < queue.size(); ++i)
     1018            queue[i]();
     1019        queue.clear();
     1020
     1021        platformStrategies()->loaderStrategy()->resourceLoadScheduler()->resumePendingRequests();
     1022    }
     1023
     1024    --resolutionNestingDepth;
     1025}
     1026
     1027bool postResolutionCallbacksAreSuspended()
     1028{
     1029    return resolutionNestingDepth;
     1030}
     1031
     1032}
     1033}
  • trunk/Source/WebCore/style/StyleResolveTree.h

    r166680 r166853  
    2727#define StyleResolveTree_h
    2828
     29#include <functional>
     30
    2931namespace WebCore {
    3032
     
    4850Change determineChange(const RenderStyle*, const RenderStyle*);
    4951
     52void queuePostResolutionCallback(std::function<void ()>);
     53bool postResolutionCallbacksAreSuspended();
     54
     55class PostResolutionCallbackDisabler {
     56public:
     57    explicit PostResolutionCallbackDisabler(Document&);
     58    ~PostResolutionCallbackDisabler();
     59};
     60
    5061}
    5162
  • trunk/Source/WebKit/mac/ChangeLog

    r166851 r166853  
     12014-03-23  Darin Adler  <darin@apple.com>
     2
     3        Refactor post-attach and HTMLObjectElement-related code
     4        https://bugs.webkit.org/show_bug.cgi?id=131282
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * WebCoreSupport/WebFrameLoaderClient.mm: Call toHTMLPlugInImageElement instead of
     9        doing a static_cast.
     10
    1112014-04-04  Brian J. Burg  <burg@cs.washington.edu>
    212
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r166680 r166853  
    21012101                    if (element->hasTagName(HTMLNames::embedTag) || element->hasTagName(HTMLNames::objectTag)) {
    21022102                        // Create a shadow subtree for the plugin element, the iframe player is injected in the shadow tree.
    2103                         HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(element);
    2104                         pluginElement->createShadowIFrameSubtree(embedSrc);
     2103                        toHTMLPlugInImageElement(*element).createShadowIFrameSubtree(embedSrc);
    21052104                        return nullptr;
    21062105                    }
Note: See TracChangeset for help on using the changeset viewer.