Changeset 201090 in webkit


Ignore:
Timestamp:
May 18, 2016, 12:06:27 PM (10 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r200534) Command-+ no longer zooms pages
https://bugs.webkit.org/show_bug.cgi?id=157826
rdar://problem/26334636

Reviewed by Dean Jackson.

Source/WebCore:

When text autosizing was enabled on Mac, we started to parse and respect
-webkit-text-size-adjust. Fix by cutting this off in CSSParser if the feature
is disabled.

Also fix InternalSettings to reset page and text zoom, since WebKit1 aliases
the zoom levels causing DRT to fail to reset them between tests.

Test: fast/text-autosizing/mac/text-size-adjust-text-zoom.html

  • css/CSSParser.cpp:

(WebCore::CSSParserContext::CSSParserContext):
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::isTextAutosizingEnabled):

  • css/CSSParser.h:
  • css/CSSParserMode.h:
  • testing/InternalSettings.cpp:

(WebCore::InternalSettings::resetToConsistentState):

Tools:

  • DumpRenderTree/mac/DumpRenderTree.mm:

(resetWebPreferencesToConsistentValues): Remove ENABLE() #ifdefs that do nothing (see http://webkit.org/b/157828).

LayoutTests:

Need to call internals.settings.setTextAutosizingEnabled(true) earlier in some tests.

  • fast/text-autosizing/ios/line-height-text-autosizing.html:
  • fast/text-autosizing/ios/percent-adjust-length-line-height.html:
  • fast/text-autosizing/ios/percent-adjust-number-line-height.html:
  • fast/text-autosizing/ios/percent-adjust-percent-line-height.html:
  • fast/text-autosizing/mac/text-size-adjust-text-zoom-expected.html: Added.
  • fast/text-autosizing/mac/text-size-adjust-text-zoom.html: Added.
  • platform/mac-wk2/TestExpectations:
  • platform/mac/TestExpectations:
Location:
trunk
Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r201087 r201090  
     12016-05-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r200534) Command-+ no longer zooms pages
     4        https://bugs.webkit.org/show_bug.cgi?id=157826
     5        rdar://problem/26334636
     6
     7        Reviewed by Dean Jackson.
     8
     9        Need to call internals.settings.setTextAutosizingEnabled(true) earlier in some tests.
     10
     11        * fast/text-autosizing/ios/line-height-text-autosizing.html:
     12        * fast/text-autosizing/ios/percent-adjust-length-line-height.html:
     13        * fast/text-autosizing/ios/percent-adjust-number-line-height.html:
     14        * fast/text-autosizing/ios/percent-adjust-percent-line-height.html:
     15        * fast/text-autosizing/mac/text-size-adjust-text-zoom-expected.html: Added.
     16        * fast/text-autosizing/mac/text-size-adjust-text-zoom.html: Added.
     17        * platform/mac-wk2/TestExpectations:
     18        * platform/mac/TestExpectations:
     19
    1202016-05-18  Joanmarie Diggs  <jdiggs@igalia.com>
    221
  • trunk/LayoutTests/fast/text-autosizing/ios/line-height-text-autosizing.html

    r200534 r201090  
    22<html>
    33<head>
     4    <script>
     5    if (window.internals) {
     6        internals.settings.setTextAutosizingEnabled(true);
     7        internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
     8    }
     9    </script>
    410<script src="../../../resources/js-test-pre.js"></script>
    511<style>
     
    1218}
    1319</style>
    14 <script>
    15 if (window.internals) {
    16     window.internals.settings.setTextAutosizingEnabled(true);
    17     window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
    18 }
    19 </script>
    2020</head>
    2121<boby>
  • trunk/LayoutTests/fast/text-autosizing/ios/percent-adjust-length-line-height.html

    r200589 r201090  
    33    <meta name="viewport" content="user-scalable=no, width=320">
    44    <title>&lt;rdar://problem/6646628&gt; Text Autosizing: Overlapping text in message</title>
     5    <script>
     6    if (window.internals) {
     7        internals.settings.setTextAutosizingEnabled(true);
     8        internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
     9    }
     10    </script>
    511    <style>
    612    body {
     
    1319    </style>
    1420    <script src="../../../resources/js-test-pre.js"></script>
    15     <script>
    16     if (window.internals) {
    17         window.internals.settings.setTextAutosizingEnabled(true);
    18         window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
    19     }
    20     </script>
    2121</head>
    2222<body>
  • trunk/LayoutTests/fast/text-autosizing/ios/percent-adjust-number-line-height.html

    r200589 r201090  
    33    <meta name="viewport" content="user-scalable=no, width=320">
    44    <title>&lt;rdar://problem/6646628&gt; Text Autosizing: Overlapping text in message</title>
     5    <script>
     6    if (window.internals) {
     7        internals.settings.setTextAutosizingEnabled(true);
     8        internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
     9    }
     10    </script>
    511    <style>
    612    #expected {
     
    1622    </style>
    1723    <script src="../../../resources/js-test-pre.js"></script>
    18     <script>
    19     if (window.internals) {
    20         window.internals.settings.setTextAutosizingEnabled(true);
    21         window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
    22     }
    23     </script>
    2424</head>
    2525<body>
  • trunk/LayoutTests/fast/text-autosizing/ios/percent-adjust-percent-line-height.html

    r200589 r201090  
    33    <meta name="viewport" content="user-scalable=no, width=320">
    44    <title>&lt;rdar://problem/12607898&gt; incorrect behavior of -webkit-text-size-adjust in UIWebView on iOS6</title>
     5    <script>
     6    if (window.internals) {
     7        internals.settings.setTextAutosizingEnabled(true);
     8        internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
     9    }
     10    </script>
    511    <style>
    612    #expected {
     
    1622    </style>
    1723    <script src="../../../resources/js-test-pre.js"></script>
    18     <script>
    19     if (window.internals) {
    20         window.internals.settings.setTextAutosizingEnabled(true);
    21         window.internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
    22     }
    23     </script>
    2424</head>
    2525<body>
  • trunk/LayoutTests/platform/mac-wk2/TestExpectations

    r200579 r201090  
    1010
    1111fast/text-autosizing/ios [ Pass ]
     12fast/text-autosizing/mac [ Pass ]
    1213
    1314fast/events/cancelled-force-click-link-navigation.html [ Pass ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r200879 r201090  
    1818
    1919fast/text-autosizing/ios [ Pass ]
     20fast/text-autosizing/mac [ Pass ]
    2021
    2122#//////////////////////////////////////////////////////////////////////////////////////////
  • trunk/Source/WebCore/ChangeLog

    r201088 r201090  
     12016-05-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r200534) Command-+ no longer zooms pages
     4        https://bugs.webkit.org/show_bug.cgi?id=157826
     5        rdar://problem/26334636
     6
     7        Reviewed by Dean Jackson.
     8
     9        When text autosizing was enabled on Mac, we started to parse and respect
     10        -webkit-text-size-adjust. Fix by cutting this off in CSSParser if the feature
     11        is disabled.
     12
     13        Also fix InternalSettings to reset page and text zoom, since WebKit1 aliases
     14        the zoom levels causing DRT to fail to reset them between tests.
     15
     16        Test: fast/text-autosizing/mac/text-size-adjust-text-zoom.html
     17
     18        * css/CSSParser.cpp:
     19        (WebCore::CSSParserContext::CSSParserContext):
     20        (WebCore::isValidKeywordPropertyAndValue):
     21        (WebCore::CSSParser::parseValue):
     22        (WebCore::CSSParser::isTextAutosizingEnabled):
     23        * css/CSSParser.h:
     24        * css/CSSParserMode.h:
     25        * testing/InternalSettings.cpp:
     26        (WebCore::InternalSettings::resetToConsistentState):
     27
    1282016-05-18  Dave Hyatt  <hyatt@apple.com>
    229
  • trunk/Source/WebCore/css/CSSParser.cpp

    r201036 r201090  
    246246    : baseURL(baseURL)
    247247    , mode(mode)
    248     , isHTMLDocument(false)
    249248#if ENABLE(CSS_GRID_LAYOUT)
    250249    , cssGridLayoutEnabled(RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled())
    251250#endif
    252     , needsSiteSpecificQuirks(false)
    253     , enforcesCSSMIMETypeInNoQuirksMode(true)
    254     , useLegacyBackgroundSizeShorthandBehavior(false)
    255251{
    256252#if PLATFORM(IOS)
     
    270266    , cssGridLayoutEnabled(document.isCSSGridLayoutEnabled())
    271267#endif
    272     , needsSiteSpecificQuirks(document.settings() ? document.settings()->needsSiteSpecificQuirks() : false)
    273     , enforcesCSSMIMETypeInNoQuirksMode(!document.settings() || document.settings()->enforceCSSMIMETypeInNoQuirksMode())
    274     , useLegacyBackgroundSizeShorthandBehavior(document.settings() ? document.settings()->useLegacyBackgroundSizeShorthandBehavior() : false)
    275 {
     268{
     269    if (Settings* settings = document.settings()) {
     270        needsSiteSpecificQuirks = settings->needsSiteSpecificQuirks();
     271        enforcesCSSMIMETypeInNoQuirksMode = settings->enforceCSSMIMETypeInNoQuirksMode();
     272        useLegacyBackgroundSizeShorthandBehavior = settings->useLegacyBackgroundSizeShorthandBehavior();
     273#if ENABLE(IOS_TEXT_AUTOSIZING)
     274        textAutosizingEnabled = settings->textAutosizingEnabled();
     275        WTFLogAlways("CSSParserContext %p CSSParserContext textAutosizingEnabled=%d", this, textAutosizingEnabled);
     276#endif
     277    }
     278
    276279#if PLATFORM(IOS)
    277280    // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
     
    971974#if ENABLE(IOS_TEXT_AUTOSIZING)
    972975    case CSSPropertyWebkitTextSizeAdjust:
     976        if (!parserContext.textAutosizingEnabled)
     977            return false;
     978
    973979        if (valueID == CSSValueAuto || valueID == CSSValueNone)
    974980            return true;
     
    29142920#if ENABLE(IOS_TEXT_AUTOSIZING)
    29152921    case CSSPropertyWebkitTextSizeAdjust:
     2922        if (!isTextAutosizingEnabled())
     2923            return false;
     2924
    29162925        if (id == CSSValueAuto || id == CSSValueNone)
    29172926            validPrimitive = true;
     
    1024610255#endif
    1024710256
     10257#if ENABLE(IOS_TEXT_AUTOSIZING)
     10258bool CSSParser::isTextAutosizingEnabled() const
     10259{
     10260    return m_context.textAutosizingEnabled;
     10261}
     10262#endif
     10263
    1024810264#if ENABLE(CSS_GRID_LAYOUT)
    1024910265bool CSSParser::isCSSGridLayoutEnabled() const
  • trunk/Source/WebCore/css/CSSParser.h

    r201000 r201090  
    205205    bool parseColumnsShorthand(bool important);
    206206
     207#if ENABLE(IOS_TEXT_AUTOSIZING)
     208    bool isTextAutosizingEnabled() const;
     209#endif
     210
    207211#if ENABLE(CSS_GRID_LAYOUT)
    208212    bool isCSSGridLayoutEnabled() const;
  • trunk/Source/WebCore/css/CSSParserMode.h

    r200524 r201090  
    6363    URL baseURL;
    6464    String charset;
    65     CSSParserMode mode;
    66     bool isHTMLDocument;
     65    CSSParserMode mode { CSSStrictMode };
     66    bool isHTMLDocument { false };
    6767#if ENABLE(CSS_GRID_LAYOUT)
    68     bool cssGridLayoutEnabled;
     68    bool cssGridLayoutEnabled { false };
    6969#endif
    70     bool needsSiteSpecificQuirks;
    71     bool enforcesCSSMIMETypeInNoQuirksMode;
    72     bool useLegacyBackgroundSizeShorthandBehavior;
     70#if ENABLE(IOS_TEXT_AUTOSIZING)
     71    bool textAutosizingEnabled { false };
     72#endif
     73    bool needsSiteSpecificQuirks { false };
     74    bool enforcesCSSMIMETypeInNoQuirksMode { true };
     75    bool useLegacyBackgroundSizeShorthandBehavior { false };
    7376};
    7477
  • trunk/Source/WebCore/testing/InternalSettings.cpp

    r200534 r201090  
    227227void InternalSettings::resetToConsistentState()
    228228{
    229     page()->setPageScaleFactor(1, IntPoint(0, 0));
     229    page()->setPageScaleFactor(1, { 0, 0 });
     230    page()->mainFrame().setPageAndTextZoomFactors(1, 1);
    230231    page()->setCanStartMedia(true);
    231232    page()->settings().setForcePendingWebGLPolicy(false);
    232233#if ENABLE(WIRELESS_PLAYBACK_TARGET)
    233     m_page->settings().setAllowsAirPlayForMediaPlayback(false);
     234    page()->settings().setAllowsAirPlayForMediaPlayback(false);
    234235#endif
    235236
  • trunk/Tools/ChangeLog

    r201087 r201090  
     12016-05-18  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r200534) Command-+ no longer zooms pages
     4        https://bugs.webkit.org/show_bug.cgi?id=157826
     5        rdar://problem/26334636
     6
     7        Reviewed by Dean Jackson.
     8
     9        * DumpRenderTree/mac/DumpRenderTree.mm:
     10        (resetWebPreferencesToConsistentValues): Remove ENABLE() #ifdefs that do nothing (see http://webkit.org/b/157828).
     11
    1122016-05-18  Joanmarie Diggs  <jdiggs@igalia.com>
    213
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r200534 r201090  
    954954#endif
    955955
    956 #if ENABLE(IOS_TEXT_AUTOSIZING)
    957956    [preferences _setTextAutosizingEnabled:NO];
    958 #endif
    959957
    960958    // The back/forward cache is causing problems due to layouts during transition from one page to another.
     
    972970#endif
    973971
    974 #if ENABLE(WEB_AUDIO)
    975972    [preferences setWebAudioEnabled:YES];
    976 #endif
    977 
    978 #if ENABLE(MEDIA_SOURCE)
    979973    [preferences setMediaSourceEnabled:YES];
    980 #endif
    981974
    982975    [preferences setShadowDOMEnabled:YES];
Note: See TracChangeset for help on using the changeset viewer.