Changeset 220052 in webkit


Ignore:
Timestamp:
Jul 30, 2017, 2:44:01 PM (8 years ago)
Author:
Darin Adler
Message:

Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
https://bugs.webkit.org/show_bug.cgi?id=130653

Reviewed by Antti Koivisto.

Source/WebCore:

Also fixes a bug where load events are delivered prematurely in some cases
when an object, embed, frame, or iframe element is still loading.

  • dom/Document.cpp:

(WebCore::Document::loadEventDelayTimerFired): Added a call to
FrameLoader::checkLoadComplete. Goes along with the change to
FrameLoader::checkLoadCompleteForThisFrame, which now respects the
isDelayingLoadEvent flag.

  • html/HTMLAppletElement.cpp:

(WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument,
no longer needed by the base class.
(WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of
the process of creating any object in a class derived from HTMLPlugInImageElement.
(WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
is only called when it's becoming false; avoids a false/true/false round trip that can
cause trouble.

  • html/HTMLAppletElement.h: Updated for the above.
  • html/HTMLEmbedElement.cpp:

(WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument,
no longer needed by the base class.
(WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of
the process of creating any object in a class derived from HTMLPlugInImageElement.
(WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call
updateImageLoaderWithNewURLSoon to do the image loading logic.
(WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
is only called when it's becoming false; avoids a false/true/false round trip that can
cause trouble.

  • html/HTMLEmbedElement.h: Updated for the above.
  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when
transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata
event in the past. This matches what the HTML specification calls for, but only if you
read it carefully. Without this change, and with the more complete implementation of
load event delay below, one of the regression tests hangs because are permanently stuck
dealying load events. Also added a FIXME about other code that likely has a similar
problem; the symptom is likely to be subtle and minor, though.

  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument,
no longer needed by the base class.
(WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of
the process of creating any object in a class derived from HTMLPlugInImageElement.
(WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use
updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution
since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient.
(WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
is only called when it's becoming false; avoids a false/true/false round trip that can
cause trouble.
(WebCore::HTMLObjectElement::childrenChanged): Added calls to the new
scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
(WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to
updateStyleIfNeeded. This is the main change that the title of this bug refers to.

  • html/HTMLObjectElement.h: Updated for the above. Also removed the

clearUseFallbackContent function because it's clearer to set the data member in
line at the single call site in HTMLObjectElement::parseAttribute.

  • html/HTMLPlugInImageElement.cpp:

(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser
argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now.
(WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating
an element to do work that can't be done in a constructor.
(WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new
scheduleUpdateForAfterStyleResolution function.
(WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this
function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base
class; cleans things up, even though it's just an assertion.
(WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to
setNeedsWidgetUpdate(true) here; no longer needed because the new logic already
does the right thing in this case.
(WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by
updateAfterStyleResolution instead.
(WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates
after parsing all the children now comes naturally out of the new implementation.
(WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added.
Schedules a call to updateAfterStyleResolution when needed, and equally importantly,
increments the load event delay count to make sure that loads that are part of that
update can participate in decision about whether it's time for the load event.
(WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added.
Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new
m_needsImageReload boolean in cases where no actual loading is done.
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay
count when moving an element that is in the middle of loading. This lets the
updateAfterStyleResolution function do the right thing even when the element is
moved without leaving anything stuck in a strange state.
(WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new
scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
(WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by
updateAfterStyleResolution instead.
(WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all
the right things for when an image URL is changed; for use by the concrete derived classes.

  • html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader

private rather than protected, and added the two new boolean data members.

  • html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for

applet, embed, and object.

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is
delaying a load event.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if
isDelayingLoadEvent is true; otherwise this function can have a side effect of
triggering the load event.
(WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not
just a checkCompleted. This is relevant if the frame we are detaching was delaying
a load event because it no longer will be and so the load might be complete.

Tools:

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::InjectedBundlePage::didFinishLoadForFrame): Omit now-unneeded "shouldDump" argument
when calling frameDidChangeLocation.
(WTR::InjectedBundlePage::frameDidChangeLocation): Removed "shouldDump" argument. This was
causing WebKitTestRunner to not dump anything in cases where DumpRenderTree will dump, and
thus causing mysterious failures of a couple of tests. There are two remaining issues:
1) WebKitTestRunner won't run its dump code if there is no "page", and there is no such
consideration in DumpRenderTree and 2) Both DumpRenderTree and WebKitTestRunner share the
same logic flaw that causes "top loading frame" to get set to one of the subframes in
tests where the following sequence occurs: test calls waitUntilDone, main frame finishes
loading, subframe starts loading. It would be good to clean that up some day, but for now
this patch makes the two work identically rather than changing both.

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Updated for change above.

LayoutTests:

  • fast/text/international/embed-bidi-style-in-isolate-crash.html: Removed onerror attribute

in the audio element in this test. The error event does fire during the test, which causes
the test to fail. Before, the test was prematurely exiting before the load failed, preventing
the test from failing, but also meaning we didn't finish running the test.

  • imported/blink/fast/dom/Window/open-window-features-fuzz.html: Use waitUntilDone and

notifyDone to prevent the test from exiting prematurely. Use a URL that won't trigger loading
outside the web browser; the URL is not what mattered to this test. Before, the test was
prematurely exiting before the test ran. Note also, that I don't think this is testing
much effectively; not sure we are getting any benefit from this test since before it was
not really running to completion anyway.

  • media/event-queue-crash-expected.txt: Updated expectations to expect syntax error. Before

there was a race and often the test exited before the syntax error could be logged.

  • platform/mac/TestExpectations: Removed flakiness expectation from the

media/event-queue-crash.html test. What made it flaky was a race with the load event,
and that race should be fixed by the change to FrameLoader::checkLoadCompleteForThisFrame.
The same race existed on all platforms, not just Mac, so this flakiness expectation should
be in the main TextExpectations file if anywhere. But I believe it is not needed at all.
For media/modern-media-controls/media-documents/background-color-and-centering.html,
added image failure expectation because under modern WebKit on Mac the image now captures
the upper left hand corner of the controls overlay. Still seems to pass on iOS and the bug
this was created for was iOS-specific, so should be OK for now.

  • webarchive/loading/video-in-webarchive-expected.txt: Updated. The old result shows evidence

of a premature load event, fixed by the change to FrameLoader::checkLoadCompleteForThisFrame.

Location:
trunk
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/LayoutTests/ChangeLog

    r220050 r220052  
     12017-07-30  Darin Adler  <darin@apple.com>
     2
     3        Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
     4        https://bugs.webkit.org/show_bug.cgi?id=130653
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/text/international/embed-bidi-style-in-isolate-crash.html: Removed onerror attribute
     9        in the audio element in this test. The error event does fire during the test, which causes
     10        the test to fail. Before, the test was prematurely exiting before the load failed, preventing
     11        the test from failing, but also meaning we didn't finish running the test.
     12
     13        * imported/blink/fast/dom/Window/open-window-features-fuzz.html: Use waitUntilDone and
     14        notifyDone to prevent the test from exiting prematurely. Use a URL that won't trigger loading
     15        outside the web browser; the URL is not what mattered to this test. Before, the test was
     16        prematurely exiting before the test ran. Note also, that I don't think this is testing
     17        much effectively; not sure we are getting any benefit from this test since before it was
     18        not really running to completion anyway.
     19
     20        * media/event-queue-crash-expected.txt: Updated expectations to expect syntax error. Before
     21        there was a race and often the test exited before the syntax error could be logged.
     22
     23        * platform/mac/TestExpectations: Removed flakiness expectation from the
     24        media/event-queue-crash.html test. What made it flaky was a race with the load event,
     25        and that race should be fixed by the change to FrameLoader::checkLoadCompleteForThisFrame.
     26        The same race existed on all platforms, not just Mac, so this flakiness expectation should
     27        be in the main TextExpectations file if anywhere. But I believe it is not needed at all.
     28        For media/modern-media-controls/media-documents/background-color-and-centering.html,
     29        added image failure expectation because under modern WebKit on Mac the image now captures
     30        the upper left hand corner of the controls overlay. Still seems to pass on iOS and the bug
     31        this was created for was iOS-specific, so should be OK for now.
     32
     33        * webarchive/loading/video-in-webarchive-expected.txt: Updated. The old result shows evidence
     34        of a premature load event, fixed by the change to FrameLoader::checkLoadCompleteForThisFrame.
     35
    1362017-07-30  Sam Weinig  <sam@webkit.org>
    237
  • TabularUnified trunk/LayoutTests/fast/text/international/embed-bidi-style-in-isolate-crash.html

    r154281 r220052  
    33    <em  dir="ltr">
    44        <embed></embed>
    5         <audio onerror="open()" src="foo"></audio>
     5        <audio src="foo"></audio>
    66    </em>
    77</bdi>
  • TabularUnified trunk/LayoutTests/imported/blink/fast/dom/Window/open-window-features-fuzz.html

    r190629 r220052  
    22
    33if (window.testRunner) {
     4  testRunner.waitUntilDone();
    45  testRunner.dumpAsText();
    56  testRunner.setCanOpenWindows();
     
    78
    89function handler() {
    9   var url = 'rV1IRI:I';
     10  var url = 'file:///';
    1011  var name = 'listing';
    1112  var features = unescape('%udc10%u0130%u07b2%u037c%ufb3b%u3bf0%u3e4d%u16c3%u3c4f%u3fe7%u12b3%ub73c%u6c25%u938d%u645c%u2470%udbc3%ud2d4');
    1213  window.open(url, name, features);
     14  if (window.testRunner)
     15    testRunner.notifyDone();
    1316}
    1417
  • TabularUnified trunk/LayoutTests/media/event-queue-crash-expected.txt

    r124843 r220052  
     1CONSOLE MESSAGE: line 34: SyntaxError: Unexpected token '}'. Expected '(' to start an 'if' condition.
    12When an element containing video is removed, WebKit should not crash.
    23
  • TabularUnified trunk/LayoutTests/platform/mac/TestExpectations

    r219983 r220052  
    868868webkit.org/b/142152 media/track/track-in-band-cues-added-once.html [ Failure Timeout ]
    869869webkit.org/b/147944 media/video-seek-to-current-time.html [ Pass Failure ]
    870 webkit.org/b/114177 media/event-queue-crash.html [ Pass Failure ]
    871870webkit.org/b/150408 http/tests/media/video-load-suspend.html [ Pass Timeout ]
    872871webkit.org/b/155956 media/track/track-remove-track.html [ Pass Failure Timeout ]
     
    16031602media/modern-media-controls/scrubber-support/ipad [ Skip ]
    16041603
     1604# This test relies on the control overlay not being visible in the top left. But the test now fails on Mac because
     1605# the image is dumped after the video is loaded and the control overlay is displayed. It seems the test still works
     1606# on iOS, and the bug it was created to regression-test was iOS-only, so there is no hurry to make it work on Mac.
     1607media/modern-media-controls/media-documents/background-color-and-centering.html [ Pass ImageOnlyFailure ]
     1608
    16051609# These tests use Picture-in-Picture which isn't supported on El Capitan.
    16061610[ ElCapitan ] media/modern-media-controls/placard-support/placard-support-pip.html [ Skip ]
  • TabularUnified trunk/LayoutTests/webarchive/loading/video-in-webarchive-expected.txt

    r143630 r220052  
    1111frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1212frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
     13frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
     14main frame - didHandleOnloadEventsForFrame
    1315frame "<!--framePath //<!--frame0-->-->" - didFailLoadWithError
    1416main frame - didFinishLoadForFrame
    15 frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1617
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r220050 r220052  
     12017-07-30  Darin Adler  <darin@apple.com>
     2
     3        Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
     4        https://bugs.webkit.org/show_bug.cgi?id=130653
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Also fixes a bug where load events are delivered prematurely in some cases
     9        when an object, embed, frame, or iframe element is still loading.
     10
     11        * dom/Document.cpp:
     12        (WebCore::Document::loadEventDelayTimerFired): Added a call to
     13        FrameLoader::checkLoadComplete. Goes along with the change to
     14        FrameLoader::checkLoadCompleteForThisFrame, which now respects the
     15        isDelayingLoadEvent flag.
     16
     17        * html/HTMLAppletElement.cpp:
     18        (WebCore::HTMLAppletElement::HTMLAppletElement): Removed the createdByParser argument,
     19        no longer needed by the base class.
     20        (WebCore::HTMLAppletElement::create): Added call to finishCreating, which is now part of
     21        the process of creating any object in a class derived from HTMLPlugInImageElement.
     22        (WebCore::HTMLAppletElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
     23        is only called when it's becoming false; avoids a false/true/false round trip that can
     24        cause trouble.
     25        * html/HTMLAppletElement.h: Updated for the above.
     26
     27        * html/HTMLEmbedElement.cpp:
     28        (WebCore::HTMLEmbedElement::HTMLEmbedElement): Removed the createdByParser argument,
     29        no longer needed by the base class.
     30        (WebCore::HTMLEmbedElement::create): Added call to finishCreating, which is now part of
     31        the process of creating any object in a class derived from HTMLPlugInImageElement.
     32        (WebCore::HTMLEmbedElement::parseAttribute): Changed srcAttr to call
     33        updateImageLoaderWithNewURLSoon to do the image loading logic.
     34        (WebCore::HTMLEmbedElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
     35        is only called when it's becoming false; avoids a false/true/false round trip that can
     36        cause trouble.
     37        * html/HTMLEmbedElement.h: Updated for the above.
     38
     39        * html/HTMLMediaElement.cpp:
     40        (WebCore::HTMLMediaElement::setReadyState): Call setShouldDelayLoadEvent(false) when
     41        transitioning to HAVE_CURRENT_DATA (or beyond), even if we have already fired a loadeddata
     42        event in the past. This matches what the HTML specification calls for, but only if you
     43        read it carefully. Without this change, and with the more complete implementation of
     44        load event delay below, one of the regression tests hangs because are permanently stuck
     45        dealying load events. Also added a FIXME about other code that likely has a similar
     46        problem; the symptom is likely to be subtle and minor, though.
     47
     48        * html/HTMLObjectElement.cpp:
     49        (WebCore::HTMLObjectElement::HTMLObjectElement): Removed the createdByParser argument,
     50        no longer needed by the base class.
     51        (WebCore::HTMLObjectElement::create): Added call to finishCreating, which is now part of
     52        the process of creating any object in a class derived from HTMLPlugInImageElement.
     53        (WebCore::HTMLObjectElement::parseAttribute): Changed dataAttr to use
     54        updateImageLoaderWithNewURLSoon. Explicitly call scheduleUpdateForAfterStyleResolution
     55        since just calling invalidateStyleAndRenderersForSubtree alone is no longer sufficient.
     56        (WebCore::HTMLObjectElement::updateWidget): Rearranged logic so setNeedsWidgetUpdate
     57        is only called when it's becoming false; avoids a false/true/false round trip that can
     58        cause trouble.
     59        (WebCore::HTMLObjectElement::childrenChanged): Added calls to the new
     60        scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
     61        (WebCore::HTMLObjectElement::renderFallbackContent): Remove the call to
     62        updateStyleIfNeeded. This is the main change that the title of this bug refers to.
     63        * html/HTMLObjectElement.h: Updated for the above. Also removed the
     64        clearUseFallbackContent function because it's clearer to set the data member in
     65        line at the single call site in HTMLObjectElement::parseAttribute.
     66
     67        * html/HTMLPlugInImageElement.cpp:
     68        (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Removed the createdByParser
     69        argument; no need to set an m_needsWidgetUpdate flag differently for parser cases now.
     70        (WebCore::HTMLPlugInImageElement::finshCreating): Added. To be called after creating
     71        an element to do work that can't be done in a constructor.
     72        (WebCore::HTMLPlugInImageElement::didRecalcStyle): Added. Calls the new
     73        scheduleUpdateForAfterStyleResolution function.
     74        (WebCore::HTMLPlugInImageElement::didAttachRenderers): Moved all the logic from this
     75        function into scheduleUpdateForAfterStyleResolution. Also added a call through to the base
     76        class; cleans things up, even though it's just an assertion.
     77        (WebCore::HTMLPlugInImageElement::willDetachRenderers): Removed the call to
     78        setNeedsWidgetUpdate(true) here; no longer needed because the new logic already
     79        does the right thing in this case.
     80        (WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary): Deleted. Now handled by
     81        updateAfterStyleResolution instead.
     82        (WebCore::HTMLPlugInImageElement::finishParsingChildren): Deleted. Handling updates
     83        after parsing all the children now comes naturally out of the new implementation.
     84        (WebCore::HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution): Added.
     85        Schedules a call to updateAfterStyleResolution when needed, and equally importantly,
     86        increments the load event delay count to make sure that loads that are part of that
     87        update can participate in decision about whether it's time for the load event.
     88        (WebCore::HTMLPlugInImageElement::updateAfterStyleResolution): Added.
     89        Combines updateWidgetIfNecessary and startLoadingImage, and also deals with the new
     90        m_needsImageReload boolean in cases where no actual loading is done.
     91        (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Update load event delay
     92        count when moving an element that is in the middle of loading. This lets the
     93        updateAfterStyleResolution function do the right thing even when the element is
     94        moved without leaving anything stuck in a strange state.
     95        (WebCore::HTMLPlugInImageElement::prepareForDocumentSuspension): Call the new
     96        scheduleUpdateForAfterStyleResolution since invalidating style is no longer sufficient.
     97        (WebCore::HTMLPlugInImageElement::startLoadingImage): Deleted. Now handled by
     98        updateAfterStyleResolution instead.
     99        (WebCore::HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon): Added. Does all
     100        the right things for when an image URL is changed; for use by the concrete derived classes.
     101        * html/HTMLPlugInImageElement.h: Updated for above changes. Also made m_imageLoader
     102        private rather than protected, and added the two new boolean data members.
     103
     104        * html/HTMLTagNames.in: Removed unneeded constructorNeedsCreatedByParser flags for
     105        applet, embed, and object.
     106
     107        * loader/DocumentLoader.cpp:
     108        (WebCore::DocumentLoader::isLoadingInAPISense): Return true if the document is
     109        delaying a load event.
     110
     111        * loader/FrameLoader.cpp:
     112        (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Don't do any work if
     113        isDelayingLoadEvent is true; otherwise this function can have a side effect of
     114        triggering the load event.
     115        (WebCore::FrameLoader::detachFromParent): Schedule a checkLoadComplete here, too, not
     116        just a checkCompleted. This is relevant if the frame we are detaching was delaying
     117        a load event because it no longer will be and so the load might be complete.
     118
    11192017-07-30  Sam Weinig  <sam@webkit.org>
    2120
  • TabularUnified trunk/Source/WebCore/dom/Document.cpp

    r219954 r220052  
    51615161        m_documentTiming.domContentLoadedEventEnd = MonotonicTime::now();
    51625162
    5163     if (RefPtr<Frame> f = frame()) {
     5163    if (RefPtr<Frame> frame = this->frame()) {
    51645164        // FrameLoader::finishedParsing() might end up calling Document::implicitClose() if all
    51655165        // resource loads are complete. HTMLObjectElements can start loading their resources from
     
    51715171        updateStyleIfNeeded();
    51725172
    5173         f->loader().finishedParsing();
    5174 
    5175         InspectorInstrumentation::domContentLoadedEventFired(*f);
     5173        frame->loader().finishedParsing();
     5174        InspectorInstrumentation::domContentLoadedEventFired(*frame);
    51765175    }
    51775176
     
    62246223void Document::loadEventDelayTimerFired()
    62256224{
     6225    // FIXME: Should the call to FrameLoader::checkLoadComplete be moved inside Document::checkCompleted?
     6226    // FIXME: Should this also call DocumentLoader::checkLoadComplete?
     6227    // FIXME: Not obvious why checkCompleted needs to go first. The order these are called is
     6228    // visible to WebKit clients, but it's more like a race than a well-defined relationship.
    62266229    checkCompleted();
     6230    if (auto* frame = this->frame())
     6231        frame->loader().checkLoadComplete();
    62276232}
    62286233
     
    66076612        return;
    66086613
    6609     // FIXME: We should call loader()->checkLoadComplete() as well here,
     6614    // FIXME: We should call DocumentLoader::checkLoadComplete as well here,
    66106615    // but it seems to cause http/tests/security/feed-urls-from-remote.html
    66116616    // to timeout on Mac WK1; see http://webkit.org/b/110554 and http://webkit.org/b/110401.
  • TabularUnified trunk/Source/WebCore/html/HTMLAppletElement.cpp

    r211964 r220052  
    4141using namespace HTMLNames;
    4242
    43 HTMLAppletElement::HTMLAppletElement(const QualifiedName& tagName, Document& document, bool createdByParser)
    44     : HTMLPlugInImageElement(tagName, document, createdByParser)
     43inline HTMLAppletElement::HTMLAppletElement(const QualifiedName& tagName, Document& document)
     44    : HTMLPlugInImageElement(tagName, document)
    4545{
    4646    ASSERT(hasTagName(appletTag));
    4747
    48     m_serviceType = "application/x-java-applet";
     48    m_serviceType = ASCIILiteral { "application/x-java-applet" };
    4949}
    5050
    51 Ref<HTMLAppletElement> HTMLAppletElement::create(const QualifiedName& tagName, Document& document, bool createdByParser)
     51Ref<HTMLAppletElement> HTMLAppletElement::create(const QualifiedName& tagName, Document& document)
    5252{
    53     return adoptRef(*new HTMLAppletElement(tagName, document, createdByParser));
     53    auto result = adoptRef(*new HTMLAppletElement(tagName, document));
     54    result->finishCreating();
     55    return result;
    5456}
    5557
     
    105107void HTMLAppletElement::updateWidget(CreatePlugins createPlugins)
    106108{
    107     setNeedsWidgetUpdate(false);
    108109    // FIXME: This should ASSERT isFinishedParsingChildren() instead.
    109     if (!isFinishedParsingChildren())
     110    if (!isFinishedParsingChildren()) {
     111        setNeedsWidgetUpdate(false);
    110112        return;
     113    }
    111114
    112115#if PLATFORM(IOS)
     
    116119    //        See http://trac.webkit.org/changeset/25128 and
    117120    //        plugins/netscape-plugin-setwindow-size.html
    118     if (createPlugins == CreatePlugins::No) {
    119         // Ensure updateWidget() is called again during layout to create the plug-in.
    120         setNeedsWidgetUpdate(true);
     121    if (createPlugins == CreatePlugins::No)
    121122        return;
    122     }
     123
     124    setNeedsWidgetUpdate(false);
    123125
    124126    RenderEmbeddedObject* renderer = renderEmbeddedObject();
  • TabularUnified trunk/Source/WebCore/html/HTMLAppletElement.h

    r208179 r220052  
    2929class HTMLAppletElement final : public HTMLPlugInImageElement {
    3030public:
    31     static Ref<HTMLAppletElement> create(const QualifiedName&, Document&, bool createdByParser);
     31    static Ref<HTMLAppletElement> create(const QualifiedName&, Document&);
    3232
    3333private:
    34     HTMLAppletElement(const QualifiedName&, Document&, bool createdByParser);
     34    HTMLAppletElement(const QualifiedName&, Document&);
    3535
    3636    void parseAttribute(const QualifiedName&, const AtomicString&) final;
  • TabularUnified trunk/Source/WebCore/html/HTMLEmbedElement.cpp

    r212350 r220052  
    4444using namespace HTMLNames;
    4545
    46 inline HTMLEmbedElement::HTMLEmbedElement(const QualifiedName& tagName, Document& document, bool createdByParser)
    47     : HTMLPlugInImageElement(tagName, document, createdByParser)
     46inline HTMLEmbedElement::HTMLEmbedElement(const QualifiedName& tagName, Document& document)
     47    : HTMLPlugInImageElement(tagName, document)
    4848{
    4949    ASSERT(hasTagName(embedTag));
    5050}
    5151
    52 Ref<HTMLEmbedElement> HTMLEmbedElement::create(const QualifiedName& tagName, Document& document, bool createdByParser)
    53 {
    54     return adoptRef(*new HTMLEmbedElement(tagName, document, createdByParser));
     52Ref<HTMLEmbedElement> HTMLEmbedElement::create(const QualifiedName& tagName, Document& document)
     53{
     54    auto result = adoptRef(*new HTMLEmbedElement(tagName, document));
     55    result->finishCreating();
     56    return result;
    5557}
    5658
    5759Ref<HTMLEmbedElement> HTMLEmbedElement::create(Document& document)
    5860{
    59     return adoptRef(*new HTMLEmbedElement(embedTag, document, false));
     61    return create(embedTag, document);
    6062}
    6163
     
    113115    } else if (name == codeAttr) {
    114116        m_url = stripLeadingAndTrailingHTMLSpaces(value);
    115         // FIXME: Why no call to the image loader?
     117        // FIXME: Why no call to updateImageLoaderWithNewURLSoon?
    116118        // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right!
    117119    } else if (name == srcAttr) {
    118120        m_url = stripLeadingAndTrailingHTMLSpaces(value);
    119         document().updateStyleIfNeeded();
    120         if (renderer() && isImageType()) {
    121             if (!m_imageLoader)
    122                 m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
    123             m_imageLoader->updateFromElementIgnoringPreviousError();
    124         }
     121        updateImageLoaderWithNewURLSoon();
    125122        // FIXME: If both code and src attributes are specified, last one parsed/changed wins. That can't be right!
    126123    } else
     
    145142    ASSERT(!renderEmbeddedObject()->isPluginUnavailable());
    146143    ASSERT(needsWidgetUpdate());
    147     setNeedsWidgetUpdate(false);
    148 
    149     if (m_url.isEmpty() && m_serviceType.isEmpty())
    150         return;
     144
     145    if (m_url.isEmpty() && m_serviceType.isEmpty()) {
     146        setNeedsWidgetUpdate(false);
     147        return;
     148    }
    151149
    152150    // Note these pass m_url and m_serviceType to allow better code sharing with
    153151    // <object> which modifies url and serviceType before calling these.
    154     if (!allowedToLoadFrameURL(m_url))
    155         return;
     152    if (!allowedToLoadFrameURL(m_url)) {
     153        setNeedsWidgetUpdate(false);
     154        return;
     155    }
    156156
    157157    // FIXME: It's sadness that we have this special case here.
    158158    //        See http://trac.webkit.org/changeset/25128 and
    159159    //        plugins/netscape-plugin-setwindow-size.html
    160     if (createPlugins == CreatePlugins::No && wouldLoadAsPlugIn(m_url, m_serviceType)) {
    161         // Ensure updateWidget() is called again during layout to create the Netscape plug-in.
    162         setNeedsWidgetUpdate(true);
    163         return;
    164     }
     160    if (createPlugins == CreatePlugins::No && wouldLoadAsPlugIn(m_url, m_serviceType))
     161        return;
     162
     163    setNeedsWidgetUpdate(false);
    165164
    166165    // FIXME: These should be joined into a PluginParameters class.
  • TabularUnified trunk/Source/WebCore/html/HTMLEmbedElement.h

    r208658 r220052  
    3030public:
    3131    static Ref<HTMLEmbedElement> create(Document&);
    32     static Ref<HTMLEmbedElement> create(const QualifiedName&, Document&, bool createdByParser);
     32    static Ref<HTMLEmbedElement> create(const QualifiedName&, Document&);
    3333
    3434private:
    35     HTMLEmbedElement(const QualifiedName&, Document&, bool createdByParser);
     35    HTMLEmbedElement(const QualifiedName&, Document&);
    3636
    3737    void parseAttribute(const QualifiedName&, const AtomicString&) final;
  • TabularUnified trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r220035 r220052  
    24162416    bool shouldUpdateDisplayState = false;
    24172417
    2418     if (m_readyState >= HAVE_CURRENT_DATA && oldState < HAVE_CURRENT_DATA && !m_haveFiredLoadedData) {
    2419         m_haveFiredLoadedData = true;
    2420         shouldUpdateDisplayState = true;
    2421         scheduleEvent(eventNames().loadeddataEvent);
     2418    if (m_readyState >= HAVE_CURRENT_DATA && oldState < HAVE_CURRENT_DATA) {
     2419        if (!m_haveFiredLoadedData) {
     2420            m_haveFiredLoadedData = true;
     2421            scheduleEvent(eventNames().loadeddataEvent);
     2422            // FIXME: It's not clear that it's correct to skip these two operations just
     2423            // because m_haveFiredLoadedData is already true. At one time we were skipping
     2424            // the call to setShouldDelayLoadEvent, which was definitely incorrect.
     2425            shouldUpdateDisplayState = true;
     2426            applyMediaFragmentURI();
     2427        }
    24222428        setShouldDelayLoadEvent(false);
    2423         applyMediaFragmentURI();
    24242429    }
    24252430
  • TabularUnified trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r219858 r220052  
    6161using namespace HTMLNames;
    6262
    63 inline HTMLObjectElement::HTMLObjectElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form, bool createdByParser)
    64     : HTMLPlugInImageElement(tagName, document, createdByParser)
     63inline HTMLObjectElement::HTMLObjectElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
     64    : HTMLPlugInImageElement(tagName, document)
    6565    , FormAssociatedElement(form)
    6666{
     
    6868}
    6969
    70 inline HTMLObjectElement::~HTMLObjectElement()
    71 {
    72 }
    73 
    74 Ref<HTMLObjectElement> HTMLObjectElement::create(const QualifiedName& tagName, Document& document, HTMLFormElement* form, bool createdByParser)
    75 {
    76     return adoptRef(*new HTMLObjectElement(tagName, document, form, createdByParser));
     70Ref<HTMLObjectElement> HTMLObjectElement::create(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
     71{
     72    auto result = adoptRef(*new HTMLObjectElement(tagName, document, form));
     73    result->finishCreating();
     74    return result;
    7775}
    7876
     
    113111    } else if (name == dataAttr) {
    114112        m_url = stripLeadingAndTrailingHTMLSpaces(value);
    115         document().updateStyleIfNeeded();
    116         if (isImageType() && renderer()) {
    117             if (!m_imageLoader)
    118                 m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
    119             m_imageLoader->updateFromElementIgnoringPreviousError();
    120         }
    121113        invalidateRenderer = !hasAttributeWithoutSynchronization(classidAttr);
    122114        setNeedsWidgetUpdate(true);
     115        updateImageLoaderWithNewURLSoon();
    123116    } else if (name == classidAttr) {
    124117        invalidateRenderer = true;
     
    130123        return;
    131124
    132     clearUseFallbackContent();
     125    m_useFallbackContent = false;
     126    scheduleUpdateForAfterStyleResolution();
    133127    invalidateStyleAndRenderersForSubtree();
    134128}
     
    216210}
    217211
    218    
    219212bool HTMLObjectElement::hasFallbackContent() const
    220213{
     
    272265    ASSERT(!renderEmbeddedObject()->isPluginUnavailable());
    273266    ASSERT(needsWidgetUpdate());
    274     setNeedsWidgetUpdate(false);
     267
    275268    // FIXME: This should ASSERT isFinishedParsingChildren() instead.
    276     if (!isFinishedParsingChildren())
    277         return;
     269    if (!isFinishedParsingChildren()) {
     270        setNeedsWidgetUpdate(false);
     271        return;
     272    }
    278273
    279274    // FIXME: I'm not sure it's ever possible to get into updateWidget during a
    280275    // removal, but just in case we should avoid loading the frame to prevent
    281276    // security bugs.
    282     if (!SubframeLoadingDisabler::canLoadFrame(*this))
    283         return;
     277    if (!SubframeLoadingDisabler::canLoadFrame(*this)) {
     278        setNeedsWidgetUpdate(false);
     279        return;
     280    }
    284281
    285282    String url = this->url();
     
    292289
    293290    // Note: url is modified above by parametersForPlugin.
    294     if (!allowedToLoadFrameURL(url))
    295         return;
     291    if (!allowedToLoadFrameURL(url)) {
     292        setNeedsWidgetUpdate(false);
     293        return;
     294    }
    296295
    297296    // FIXME: It's sadness that we have this special case here.
    298297    //        See http://trac.webkit.org/changeset/25128 and
    299298    //        plugins/netscape-plugin-setwindow-size.html
    300     if (createPlugins == CreatePlugins::No && wouldLoadAsPlugIn(url, serviceType)) {
    301         // Ensure updateWidget() is called again during layout to create the Netscape plug-in.
    302         setNeedsWidgetUpdate(true);
    303         return;
    304     }
     299    if (createPlugins == CreatePlugins::No && wouldLoadAsPlugIn(url, serviceType))
     300        return;
     301
     302    setNeedsWidgetUpdate(false);
    305303
    306304    Ref<HTMLObjectElement> protectedThis(*this); // beforeload and plugin loading can make arbitrary DOM mutations.
     
    339337    if (isConnected() && !m_useFallbackContent) {
    340338        setNeedsWidgetUpdate(true);
     339        scheduleUpdateForAfterStyleResolution();
    341340        invalidateStyleForSubtree();
    342341    }
     
    362361        return;
    363362
     363    scheduleUpdateForAfterStyleResolution();
    364364    invalidateStyleAndRenderersForSubtree();
    365365
     
    376376
    377377    m_useFallbackContent = true;
    378 
    379     // This was added to keep Acid 2 non-flaky. A style recalc is required to make fallback resources load.
    380     // Without forcing, this may happen after all the other resources have been loaded and the document is already
    381     // considered complete. FIXME: Would be better to address this with incrementLoadEventDelayCount instead
    382     // or disentangle loading from style entirely.
    383     document().updateStyleIfNeeded();
    384378}
    385379
     
    517511bool HTMLObjectElement::canContainRangeEndPoint() const
    518512{
    519     // Call through to HTMLElement because we need to skip HTMLPlugInElement
    520     // when calling through to the derived class since returns false unconditionally.
    521     // An object element with fallback content should basically be treated like
    522     // a generic HTML element.
     513    // Call through to HTMLElement because HTMLPlugInElement::canContainRangeEndPoint
     514    // returns false unconditionally. An object element using fallback content is
     515    // treated like a generic HTML element.
    523516    return m_useFallbackContent && HTMLElement::canContainRangeEndPoint();
    524517}
  • TabularUnified trunk/Source/WebCore/html/HTMLObjectElement.h

    r219858 r220052  
    3232class HTMLObjectElement final : public HTMLPlugInImageElement, public FormAssociatedElement {
    3333public:
    34     static Ref<HTMLObjectElement> create(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
    35     virtual ~HTMLObjectElement();
     34    static Ref<HTMLObjectElement> create(const QualifiedName&, Document&, HTMLFormElement*);
    3635
    3736    bool isExposed() const { return m_isExposed; }
     
    5857
    5958private:
    60     HTMLObjectElement(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
     59    HTMLObjectElement(const QualifiedName&, Document&, HTMLFormElement*);
    6160
    6261    void parseAttribute(const QualifiedName&, const AtomicString&) final;
     
    8887    bool shouldAllowQuickTimeClassIdQuirk();
    8988    bool hasValidClassId();
    90     void clearUseFallbackContent() { m_useFallbackContent = false; }
    9189
    9290    void refFormAssociatedElement() final { ref(); }
  • TabularUnified trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp

    r218794 r220052  
    9393};
    9494
    95 HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document& document, bool createdByParser)
     95HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document& document)
    9696    : HTMLPlugInElement(tagName, document)
    97     , m_needsWidgetUpdate(!createdByParser) // Set true in finishParsingChildren.
    9897    , m_simulatedMouseClickTimer(*this, &HTMLPlugInImageElement::simulatedMouseClickTimerFired, simulatedMouseClickTimerDelay)
    9998    , m_removeSnapshotTimer(*this, &HTMLPlugInImageElement::removeSnapshotTimerFired)
     
    101100{
    102101    setHasCustomStyleResolveCallbacks();
     102}
     103
     104void HTMLPlugInImageElement::finishCreating()
     105{
     106    scheduleUpdateForAfterStyleResolution();
    103107}
    104108
     
    206210    // FIXME: There shoudn't be need to force render tree reconstruction here.
    207211    // It is only done because loading and load event dispatching is tied to render tree construction.
    208     if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageType() && (displayState() != DisplayingSnapshot))
     212    if (!useFallbackContent() && needsWidgetUpdate() && renderer() && !isImageType() && displayState() != DisplayingSnapshot)
    209213        invalidateStyleAndRenderersForSubtree();
    210214}
    211215
     216void HTMLPlugInImageElement::didRecalcStyle(Style::Change styleChange)
     217{
     218    scheduleUpdateForAfterStyleResolution();
     219
     220    HTMLPlugInElement::didRecalcStyle(styleChange);
     221}
     222
    212223void HTMLPlugInImageElement::didAttachRenderers()
    213224{
    214     if (!isImageType()) {
    215         RefPtr<HTMLPlugInImageElement> element = this;
    216         Style::queuePostResolutionCallback([element]{
    217             element->updateWidgetIfNecessary();
    218         });
    219         return;
    220     }
    221     if (!renderer() || useFallbackContent())
    222         return;
    223 
    224     // Image load might complete synchronously and cause us to re-enter.
    225     RefPtr<HTMLPlugInImageElement> element = this;
    226     Style::queuePostResolutionCallback([element]{
    227         element->startLoadingImage();
    228     });
     225    m_needsWidgetUpdate = true;
     226    scheduleUpdateForAfterStyleResolution();
     227
     228    HTMLPlugInElement::didAttachRenderers();
    229229}
    230230
    231231void HTMLPlugInImageElement::willDetachRenderers()
    232232{
    233     // FIXME: Because of the insanity that is HTMLPlugInImageElement::willRecalcStyle,
    234     // we can end up detaching during an attach() call, before we even have a
    235     // renderer. In that case, don't mark the widget for update.
    236     if (renderer() && !useFallbackContent()) {
    237         // Update the widget the next time we attach (detaching destroys the plugin).
    238         setNeedsWidgetUpdate(true);
    239     }
    240 
    241233    auto* widget = pluginWidget(PluginLoadingPolicy::DoNotLoad);
    242234    if (is<PluginViewBase>(widget))
     
    246238}
    247239
    248 void HTMLPlugInImageElement::updateWidgetIfNecessary()
    249 {
    250     document().updateStyleIfNeeded();
    251 
    252     if (!needsWidgetUpdate() || useFallbackContent() || isImageType())
    253         return;
    254 
    255     if (!renderEmbeddedObject() || renderEmbeddedObject()->isPluginUnavailable())
    256         return;
    257 
    258     updateWidget(CreatePlugins::No);
    259 }
    260 
    261 void HTMLPlugInImageElement::finishParsingChildren()
    262 {
    263     HTMLPlugInElement::finishParsingChildren();
    264     if (useFallbackContent())
    265         return;
    266 
    267     // HTMLObjectElement needs to delay widget updates until after all children are parsed,
    268     // For HTMLEmbedElement this delay is unnecessary, but there is no harm in doing the same.
    269     setNeedsWidgetUpdate(true);
    270     if (isConnected())
    271         invalidateStyleForSubtree();
     240void HTMLPlugInImageElement::scheduleUpdateForAfterStyleResolution()
     241{
     242    if (m_hasUpdateScheduledForAfterStyleResolution)
     243        return;
     244
     245    document().incrementLoadEventDelayCount();
     246
     247    m_hasUpdateScheduledForAfterStyleResolution = true;
     248
     249    Style::queuePostResolutionCallback([protectedThis = makeRef(*this)] {
     250        protectedThis->updateAfterStyleResolution();
     251    });
     252}
     253
     254void HTMLPlugInImageElement::updateAfterStyleResolution()
     255{
     256    m_hasUpdateScheduledForAfterStyleResolution = false;
     257
     258    // Do this after style resolution, since the image or widget load might complete synchronously
     259    // and cause us to re-enter otherwise. Also, we can't really answer the question "do I have a renderer"
     260    // accurately until after style resolution.
     261
     262    if (renderer() && !useFallbackContent()) {
     263        if (isImageType()) {
     264            if (!m_imageLoader)
     265                m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
     266            if (m_needsImageReload)
     267                m_imageLoader->updateFromElementIgnoringPreviousError();
     268            else
     269                m_imageLoader->updateFromElement();
     270        } else {
     271            if (needsWidgetUpdate() && renderEmbeddedObject() && !renderEmbeddedObject()->isPluginUnavailable())
     272                updateWidget(CreatePlugins::No);
     273        }
     274    }
     275
     276    // Either we reloaded the image just now, or we had some reason not to.
     277    // Either way, clear the flag now, since we don't need to remember to try again.
     278    m_needsImageReload = false;
     279
     280    document().decrementLoadEventDelayCount();
    272281}
    273282
     
    283292        m_imageLoader->elementDidMoveToNewDocument();
    284293
     294    if (m_hasUpdateScheduledForAfterStyleResolution) {
     295        oldDocument.decrementLoadEventDelayCount();
     296        newDocument.incrementLoadEventDelayCount();
     297    }
     298
    285299    HTMLPlugInElement::didMoveToNewDocument(oldDocument, newDocument);
    286300}
     
    296310void HTMLPlugInImageElement::resumeFromDocumentSuspension()
    297311{
     312    scheduleUpdateForAfterStyleResolution();
    298313    invalidateStyleAndRenderersForSubtree();
    299314
    300315    HTMLPlugInElement::resumeFromDocumentSuspension();
    301 }
    302 
    303 void HTMLPlugInImageElement::startLoadingImage()
    304 {
    305     if (!m_imageLoader)
    306         m_imageLoader = std::make_unique<HTMLImageLoader>(*this);
    307     m_imageLoader->updateFromElement();
    308316}
    309317
     
    778786}
    779787
     788void HTMLPlugInImageElement::updateImageLoaderWithNewURLSoon()
     789{
     790    if (m_needsImageReload)
     791        return;
     792
     793    m_needsImageReload = true;
     794    scheduleUpdateForAfterStyleResolution();
     795    invalidateStyle();
     796}
     797
    780798} // namespace WebCore
  • TabularUnified trunk/Source/WebCore/html/HTMLPlugInImageElement.h

    r217876 r220052  
    8282
    8383protected:
    84     HTMLPlugInImageElement(const QualifiedName& tagName, Document&, bool createdByParser);
     84    HTMLPlugInImageElement(const QualifiedName& tagName, Document&);
     85    void finishCreating();
    8586
    8687    void didMoveToNewDocument(Document& oldDocument, Document& newDocument) override;
     88
    8789    bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) final;
    8890
    8991    bool isImageType();
    9092    HTMLImageLoader* imageLoader() { return m_imageLoader.get(); }
     93    void updateImageLoaderWithNewURLSoon();
    9194
    9295    bool allowedToLoadFrameURL(const String& url);
    9396    bool wouldLoadAsPlugIn(const String& url, const String& serviceType);
    9497
     98    void scheduleUpdateForAfterStyleResolution();
     99
    95100    String m_serviceType;
    96101    String m_url;
    97 
    98     std::unique_ptr<HTMLImageLoader> m_imageLoader;
    99102
    100103private:
     
    104107    bool allowedToLoadPluginContent(const String& url, const String& mimeType) const;
    105108
    106     void finishParsingChildren() final;
    107109    void didAddUserAgentShadowRoot(ShadowRoot*) final;
    108110
     
    110112    bool childShouldCreateRenderer(const Node&) const override;
    111113    void willRecalcStyle(Style::Change) final;
     114    void didRecalcStyle(Style::Change) final;
    112115    void didAttachRenderers() final;
    113116    void willDetachRenderers() final;
     
    121124    void updateSnapshot(Image*) final;
    122125
    123     void startLoadingImage();
    124     void updateWidgetIfNecessary();
     126    void updateAfterStyleResolution();
    125127
    126128    void simulatedMouseClickTimerFired();
     
    147149    SnapshotDecision m_snapshotDecision { SnapshotNotYetDecided };
    148150    bool m_plugInDimensionsSpecified { false };
     151    std::unique_ptr<HTMLImageLoader> m_imageLoader;
     152    bool m_needsImageReload { false };
     153    bool m_hasUpdateScheduledForAfterStyleResolution { false };
    149154};
    150155
  • TabularUnified trunk/Source/WebCore/html/HTMLTagNames.in

    r210763 r220052  
    99acronym interfaceName=HTMLElement
    1010address interfaceName=HTMLElement
    11 applet constructorNeedsCreatedByParser
     11applet
    1212area
    1313article interfaceName=HTMLElement
     
    4545dt interfaceName=HTMLElement
    4646em interfaceName=HTMLElement
    47 embed constructorNeedsCreatedByParser
     47embed
    4848fieldset interfaceName=HTMLFieldSetElement, constructorNeedsFormElement
    4949figcaption interfaceName=HTMLElement
     
    9191noframes interfaceName=HTMLElement
    9292nolayer interfaceName=HTMLElement
    93 object constructorNeedsFormElement, constructorNeedsCreatedByParser
     93object constructorNeedsFormElement
    9494ol interfaceName=HTMLOListElement
    9595optgroup interfaceName=HTMLOptGroupElement
  • TabularUnified trunk/Source/WebCore/loader/DocumentLoader.cpp

    r219905 r220052  
    10491049        if (m_cachedResourceLoader->requestCount())
    10501050            return true;
     1051        if (document.isDelayingLoadEvent())
     1052            return true;
    10511053        if (document.processingLoadEvent())
    10521054            return true;
  • TabularUnified trunk/Source/WebCore/loader/FrameLoader.cpp

    r219733 r220052  
    22362236    ASSERT(m_client.hasWebView());
    22372237
     2238    // FIXME: Should this check be done in checkLoadComplete instead of here?
     2239    // FIXME: Why does this one check need to be repeated here, and not the many others from checkCompleted?
     2240    if (m_frame.document()->isDelayingLoadEvent())
     2241        return;
     2242
    22382243    switch (m_state) {
    22392244        case FrameStateProvisional: {
     
    25762581        parent->loader().closeAndRemoveChild(m_frame);
    25772582        parent->loader().scheduleCheckCompleted();
     2583        parent->loader().scheduleCheckLoadComplete();
    25782584    } else {
    25792585        m_frame.setView(nullptr);
  • TabularUnified trunk/Tools/ChangeLog

    r220051 r220052  
     12017-07-30  Darin Adler  <darin@apple.com>
     2
     3        Remove code in HTMLObjectElement attribute parsing that forces style resolution and layout
     4        https://bugs.webkit.org/show_bug.cgi?id=130653
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
     9        (WTR::InjectedBundlePage::didFinishLoadForFrame): Omit now-unneeded "shouldDump" argument
     10        when calling frameDidChangeLocation.
     11        (WTR::InjectedBundlePage::frameDidChangeLocation): Removed "shouldDump" argument. This was
     12        causing WebKitTestRunner to not dump anything in cases where DumpRenderTree will dump, and
     13        thus causing mysterious failures of a couple of tests. There are two remaining issues:
     14        1) WebKitTestRunner won't run its dump code if there is no "page", and there is no such
     15        consideration in DumpRenderTree and 2) Both DumpRenderTree and WebKitTestRunner share the
     16        same logic flaw that causes "top loading frame" to get set to one of the subframes in
     17        tests where  the following sequence occurs: test calls waitUntilDone, main frame finishes
     18        loading, subframe starts loading. It would be good to clean that up some day, but for now
     19        this patch makes the two work identically rather than changing both.
     20        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Updated for change above.
     21
    1222017-07-30  Wenson Hsieh  <wenson_hsieh@apple.com>
    223
  • TabularUnified trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp

    r218014 r220052  
    935935        dumpLoadEvent(frame, "didFinishLoadForFrame");
    936936
    937     frameDidChangeLocation(frame, /*shouldDump*/ true);
     937    frameDidChangeLocation(frame);
    938938}
    939939
     
    20102010#endif
    20112011
    2012 void InjectedBundlePage::frameDidChangeLocation(WKBundleFrameRef frame, bool shouldDump)
     2012void InjectedBundlePage::frameDidChangeLocation(WKBundleFrameRef frame)
    20132013{
    20142014    auto& injectedBundle = InjectedBundle::singleton();
     
    20262026    }
    20272027
    2028     if (shouldDump)
     2028    if (injectedBundle.pageCount())
    20292029        injectedBundle.page()->dump();
    20302030    else
  • TabularUnified trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h

    r174866 r220052  
    172172    String platformResponseMimeType(WKURLResponseRef);
    173173
    174     void frameDidChangeLocation(WKBundleFrameRef, bool shouldDump = false);
     174    void frameDidChangeLocation(WKBundleFrameRef);
    175175
    176176    WKBundlePageRef m_page;
Note: See TracChangeset for help on using the changeset viewer.