Changeset 173392 in webkit


Ignore:
Timestamp:
Sep 8, 2014 11:57:07 AM (10 years ago)
Author:
Simon Fraser
Message:

Use enum class for the RunPostLayoutTasks enum
https://bugs.webkit.org/show_bug.cgi?id=136640

Reviewed by Dean Jackson.

Use enum class for RunPostLayoutTasks fixing callers. Add an explanatory comment,
and add some spacing.

  • dom/Document.cpp:

(WebCore::Document::updateLayoutIgnorePendingStylesheets):

  • dom/Document.h:
  • html/HTMLAppletElement.cpp:

(WebCore::HTMLAppletElement::renderWidgetForJSBindings):

  • html/HTMLEmbedElement.cpp:

(WebCore::HTMLEmbedElement::renderWidgetForJSBindings):

  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::renderWidgetForJSBindings):

  • testing/Internals.cpp:

(WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r173391 r173392  
     12014-09-08  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Use enum class for the RunPostLayoutTasks enum
     4        https://bugs.webkit.org/show_bug.cgi?id=136640
     5
     6        Reviewed by Dean Jackson.
     7
     8        Use enum class for RunPostLayoutTasks fixing callers. Add an explanatory comment,
     9        and add some spacing.
     10
     11        * dom/Document.cpp:
     12        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
     13        * dom/Document.h:
     14        * html/HTMLAppletElement.cpp:
     15        (WebCore::HTMLAppletElement::renderWidgetForJSBindings):
     16        * html/HTMLEmbedElement.cpp:
     17        (WebCore::HTMLEmbedElement::renderWidgetForJSBindings):
     18        * html/HTMLObjectElement.cpp:
     19        (WebCore::HTMLObjectElement::renderWidgetForJSBindings):
     20        * testing/Internals.cpp:
     21        (WebCore::Internals::updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks):
     22
    1232014-09-08  peavo@outlook.com  <peavo@outlook.com>
    224
  • trunk/Source/WebCore/dom/Document.cpp

    r173365 r173392  
    18521852    updateLayout();
    18531853
    1854     if (runPostLayoutTasks == RunPostLayoutTasksSynchronously && view())
     1854    if (runPostLayoutTasks == RunPostLayoutTasks::Synchronously && view())
    18551855        view()->flushAnyPendingPostLayoutTasks();
    18561856
  • trunk/Source/WebCore/dom/Document.h

    r173176 r173392  
    592592    WEBCORE_EXPORT void updateStyleIfNeeded();
    593593    bool updateStyleIfNeededForNode(const Node&);
     594
    594595    WEBCORE_EXPORT void updateLayout();
    595     enum RunPostLayoutTasks {
    596         RunPostLayoutTasksAsynchronously,
    597         RunPostLayoutTasksSynchronously,
     596   
     597    // updateLayoutIgnorePendingStylesheets() forces layout even if we are waiting for pending stylesheet loads,
     598    // so calling this may cause a flash of unstyled content (FOUC).
     599    enum class RunPostLayoutTasks {
     600        Asynchronously,
     601        Synchronously,
    598602    };
    599     WEBCORE_EXPORT void updateLayoutIgnorePendingStylesheets(RunPostLayoutTasks = RunPostLayoutTasksAsynchronously);
     603    WEBCORE_EXPORT void updateLayoutIgnorePendingStylesheets(RunPostLayoutTasks = RunPostLayoutTasks::Asynchronously);
     604
    600605    PassRef<RenderStyle> styleForElementIgnoringPendingStylesheets(Element*);
    601606
  • trunk/Source/WebCore/html/HTMLAppletElement.cpp

    r170774 r173392  
    9292    // when JavaScript code accesses the plugin.
    9393    // FIXME: <rdar://16893708> Check if dispatching events here is safe.
    94     document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
     94    document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks::Synchronously);
    9595    return renderWidget();
    9696}
  • trunk/Source/WebCore/html/HTMLEmbedElement.cpp

    r173278 r173392  
    7676        // when JavaScript code accesses the plugin.
    7777        // FIXME: <rdar://16893708> Check if dispatching events here is safe.
    78         document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
     78        document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks::Synchronously);
    7979    }
    8080    return findWidgetRenderer(this);
  • trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r173278 r173392  
    8787    // when JavaScript code accesses the plugin.
    8888    // FIXME: <rdar://16893708> Check if dispatching events here is safe.
    89     document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
     89    document().updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks::Synchronously);
    9090    return renderWidget(); // This will return 0 if the renderer is not a RenderWidget.
    9191}
  • trunk/Source/WebCore/testing/Internals.cpp

    r173212 r173392  
    19271927    }
    19281928
    1929     document->updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasksSynchronously);
     1929    document->updateLayoutIgnorePendingStylesheets(Document::RunPostLayoutTasks::Synchronously);
    19301930}
    19311931
Note: See TracChangeset for help on using the changeset viewer.