⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285731 in webkit


Ignore:
Timestamp:
Nov 12, 2021, 10:29:14 AM (5 years ago)
Author:
Chris Dumez
Message:

Disable MathML when in Captive Portal Mode
https://bugs.webkit.org/show_bug.cgi?id=233013
<rdar://84567129>

Reviewed by Brent Fulgham.

Source/WebCore:

Add runtime feature flag for MathML and update implementation in WebCore to only support
MathML when the flag is on.

  • bindings/js/WebCoreBuiltinNames.h:
  • dom/Document.cpp:

(WebCore::Document::createElement):

  • mathml/MathMLElement.idl:
  • mathml/MathMLMathElement.idl:

Source/WebKit:

Turn off MathML support when in Captive Portal Mode.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::updatePreferences):

Source/WTF:

Add runtime feature flag for MathML.

  • Scripts/Preferences/WebPreferences.yaml:

Tools:

Add API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r285726 r285731  
     12021-11-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Disable MathML when in Captive Portal Mode
     4        https://bugs.webkit.org/show_bug.cgi?id=233013
     5        <rdar://84567129>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Add runtime feature flag for MathML.
     10
     11        * Scripts/Preferences/WebPreferences.yaml:
     12
    1132021-11-12  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml

    r285376 r285731  
    13411341      default: false
    13421342
     1343MathMLEnabled:
     1344  type: bool
     1345  condition: ENABLE(MATHML)
     1346  defaultValue:
     1347    WebKitLegacy:
     1348      default: true
     1349    WebKit:
     1350      default: true
     1351    WebCore:
     1352      default: true
     1353
    13431354MaxParseDuration:
    13441355  type: double
  • trunk/Source/WebCore/ChangeLog

    r285730 r285731  
     12021-11-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Disable MathML when in Captive Portal Mode
     4        https://bugs.webkit.org/show_bug.cgi?id=233013
     5        <rdar://84567129>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Add runtime feature flag for MathML and update implementation in WebCore to only support
     10        MathML when the flag is on.
     11
     12        * bindings/js/WebCoreBuiltinNames.h:
     13        * dom/Document.cpp:
     14        (WebCore::Document::createElement):
     15        * mathml/MathMLElement.idl:
     16        * mathml/MathMLMathElement.idl:
     17
    1182021-11-11  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h

    r285564 r285731  
    198198    macro(Lock) \
    199199    macro(LockManager) \
     200    macro(MathMLElement) \
     201    macro(MathMLMathElement) \
    200202    macro(MediaCapabilities) \
    201203    macro(MediaCapabilitiesInfo) \
  • trunk/Source/WebCore/dom/Document.cpp

    r285449 r285731  
    12571257        element = SVGElementFactory::createElement(name, *this, createdByParser);
    12581258#if ENABLE(MATHML)
    1259     else if (name.namespaceURI() == MathMLNames::mathmlNamespaceURI)
     1259    else if (settings().mathMLEnabled() && name.namespaceURI() == MathMLNames::mathmlNamespaceURI)
    12601260        element = MathMLElementFactory::createElement(name, *this, createdByParser);
    12611261#endif
  • trunk/Source/WebCore/mathml/MathMLElement.idl

    r267893 r285731  
    2626[
    2727    Conditional=MATHML,
     28    EnabledBySetting=MathMLEnabled,
    2829    JSGenerateToNativeObject,
    2930    Exposed=Window
  • trunk/Source/WebCore/mathml/MathMLMathElement.idl

    r267813 r285731  
    2626[
    2727    Conditional=MATHML,
     28    EnabledBySetting=MathMLEnabled,
    2829    Exposed=Window
    2930] interface MathMLMathElement : MathMLElement {
  • trunk/Source/WebKit/ChangeLog

    r285729 r285731  
     12021-11-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Disable MathML when in Captive Portal Mode
     4        https://bugs.webkit.org/show_bug.cgi?id=233013
     5        <rdar://84567129>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Turn off MathML support when in Captive Portal Mode.
     10
     11        * WebProcess/WebPage/WebPage.cpp:
     12        (WebKit::WebPage::updatePreferences):
     13
    1142021-11-12  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r285717 r285731  
    40754075        settings.setPeerConnectionEnabled(false);
    40764076#endif
     4077#if ENABLE(MATHML)
     4078        settings.setMathMLEnabled(false);
     4079#endif
    40774080    }
    40784081
  • trunk/Tools/ChangeLog

    r285720 r285731  
     12021-11-12  Chris Dumez  <cdumez@apple.com>
     2
     3        Disable MathML when in Captive Portal Mode
     4        https://bugs.webkit.org/show_bug.cgi?id=233013
     5        <rdar://84567129>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Add API test coverage.
     10
     11        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
     12
    1132021-11-12  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

    r285717 r285731  
    76717671    EXPECT_EQ(runJSCheck("!!navigator.mediaDevices"_s), shouldBeEnabled == ShouldBeEnabled::Yes); // GetUserMedia (Media Capture).
    76727672    EXPECT_EQ(runJSCheck("!!navigator.getUserMedia"_s), false); // Legacy GetUserMedia (currently always disabled).
     7673    EXPECT_EQ(runJSCheck("!!window.MathMLElement"_s), shouldBeEnabled == ShouldBeEnabled::Yes); // MathML.
     7674    EXPECT_EQ(runJSCheck("!!window.MathMLMathElement"_s), shouldBeEnabled == ShouldBeEnabled::Yes); // MathML.
     7675    String mathMLCheck = makeString("document.createElementNS('http://www.w3.org/1998/Math/MathML','mspace').__proto__ == ", shouldBeEnabled == ShouldBeEnabled::Yes ? "MathMLElement" : "Element", ".prototype");
     7676    EXPECT_EQ(runJSCheck(mathMLCheck), true); // MathML.
    76737677}
    76747678
Note: See TracChangeset for help on using the changeset viewer.