Changeset 233510 in webkit


Ignore:
Timestamp:
Jul 4, 2018 8:50:56 PM (6 years ago)
Author:
Antti Koivisto
Message:

Reparse user stylesheets when _useSystemAppearance changes
https://bugs.webkit.org/show_bug.cgi?id=187312
<rdar://problem/38565834>

Reviewed by Tim Horton.

Source/WebCore:

This setting may affect user stylesheet parsing. Reparse if it changes.

Test: fast/media/use-system-appearance-user-stylesheet-parsing.html

  • page/Page.cpp:

(WebCore::Page::setUseSystemAppearance):

  • page/Page.h:

(WebCore::Page::setUseSystemAppearance): Deleted.

  • testing/Internals.cpp:

(WebCore::Internals::setUseSystemAppearance):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

  • fast/media/use-system-appearance-user-stylesheet-parsing-expected.txt: Added.
  • fast/media/use-system-appearance-user-stylesheet-parsing.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r233507 r233510  
     12018-07-04  Antti Koivisto  <antti@apple.com>
     2
     3        Reparse user stylesheets when _useSystemAppearance changes
     4        https://bugs.webkit.org/show_bug.cgi?id=187312
     5        <rdar://problem/38565834>
     6
     7        Reviewed by Tim Horton.
     8
     9        * fast/media/use-system-appearance-user-stylesheet-parsing-expected.txt: Added.
     10        * fast/media/use-system-appearance-user-stylesheet-parsing.html: Added.
     11
    1122018-07-04  Alicia Boya García  <aboya@igalia.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r233509 r233510  
     12018-07-04  Antti Koivisto  <antti@apple.com>
     2
     3        Reparse user stylesheets when _useSystemAppearance changes
     4        https://bugs.webkit.org/show_bug.cgi?id=187312
     5        <rdar://problem/38565834>
     6
     7        Reviewed by Tim Horton.
     8
     9        This setting may affect user stylesheet parsing. Reparse if it changes.
     10
     11        Test: fast/media/use-system-appearance-user-stylesheet-parsing.html
     12
     13        * page/Page.cpp:
     14        (WebCore::Page::setUseSystemAppearance):
     15        * page/Page.h:
     16        (WebCore::Page::setUseSystemAppearance): Deleted.
     17        * testing/Internals.cpp:
     18        (WebCore::Internals::setUseSystemAppearance):
     19        * testing/Internals.h:
     20        * testing/Internals.idl:
     21
    1222018-07-04  Thibault Saunier  <tsaunier@igalia.com>
    223
  • trunk/Source/WebCore/page/Page.cpp

    r233178 r233510  
    23702370}
    23712371
     2372void Page::setUseSystemAppearance(bool value)
     2373{
     2374    if (m_useSystemAppearance == value)
     2375        return;
     2376    m_useSystemAppearance = value;
     2377
     2378    for (auto* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
     2379        auto* document = frame->document();
     2380        if (!document)
     2381            continue;
     2382        // System apperance change may affect stylesheet parsing. We need to reparse.
     2383        document->extensionStyleSheets().clearPageUserSheet();
     2384        document->extensionStyleSheets().invalidateInjectedStyleSheetCache();
     2385    }
     2386}
     2387
    23722388bool Page::defaultAppearance() const
    23732389{
  • trunk/Source/WebCore/page/Page.h

    r233178 r233510  
    341341   
    342342    bool useSystemAppearance() const { return m_useSystemAppearance; }
    343     void setUseSystemAppearance(bool a) { m_useSystemAppearance = a; }
     343    WEBCORE_EXPORT void setUseSystemAppearance(bool);
    344344   
    345345    WEBCORE_EXPORT bool defaultAppearance() const;
  • trunk/Source/WebCore/testing/Internals.cpp

    r233490 r233510  
    46304630        frame->loader().reload(ReloadOption::DisableContentBlockers);
    46314631}
    4632    
     4632
     4633void Internals::setUseSystemAppearance(bool value)
     4634{
     4635    if (!contextDocument() || !contextDocument()->page())
     4636        return;
     4637    contextDocument()->page()->setUseSystemAppearance(value);
     4638}
     4639
    46334640} // namespace WebCore
  • trunk/Source/WebCore/testing/Internals.h

    r233490 r233510  
    716716    void reloadWithoutContentExtensions();
    717717
     718    void setUseSystemAppearance(bool);
     719
    718720private:
    719721    explicit Internals(Document&);
  • trunk/Source/WebCore/testing/Internals.idl

    r233490 r233510  
    653653
    654654    void reloadWithoutContentExtensions();
    655 };
     655
     656    void setUseSystemAppearance(boolean value);
     657};
Note: See TracChangeset for help on using the changeset viewer.