Changeset 147034 in webkit
- Timestamp:
- Mar 27, 2013 5:25:18 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r147030 r147034 1 2013-03-27 Yongjun Zhang <yongjun_zhang@apple.com> 2 3 Add a settings to disallow initializing background-size if background shorthand doesn't include it. 4 https://bugs.webkit.org/show_bug.cgi?id=113363 5 6 Reviewed by David Kilzer. 7 8 Add test for the new settings useLegacyBackgroundSizeShorthandBehavior. 9 10 * fast/backgrounds/background-shorthand-after-set-backgroundSize-expected.txt: Added. 11 * fast/backgrounds/background-shorthand-after-set-backgroundSize.html: Added. 12 1 13 2013-03-27 Andrey Lushnikov <lushnikov@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r147033 r147034 1 2013-03-27 KyungTae Kim <ktf.kim@samsung.com> and Yongjun Zhang <yongjun_zhang@apple.com> 2 3 Add a settings to disallow initializing background-size if background shorthand doesn't include it. 4 https://bugs.webkit.org/show_bug.cgi?id=113363 5 6 Reviewed by David Kilzer. 7 8 This is based on KyungTae Kim's patch in https://bugs.webkit.org/show_bug.cgi?id=97761. Many legacy sites set 9 background-size first and then set background for setting background-image. For backward-compatibility 10 in some WebKit based clients, if 'background' shorthand have no 'background-size' attribute, we could add 11 a settings to let the css parser not initialize 'background-size'. 12 13 Test: fast/backgrounds/background-shorthand-after-set-backgroundSize.html 14 15 * css/CSSParser.cpp: 16 (WebCore::CSSParserContext::CSSParserContext): initialize useLegacyBackgroundSizeShorthandBehavior. 17 (WebCore::operator==): 18 (WebCore::CSSParser::useLegacyBackgroundSizeShorthandBehavior): add a method to return if we want background-size 19 to be initialized by background shorthand. 20 (WebCore): 21 (WebCore::CSSParser::parseFillShorthand): don't initialize background-size in background shorthand if we have 22 useLegacyBackgroundSizeShorthandBehavior set to true. 23 * css/CSSParser.h: 24 (CSSParser): 25 * css/CSSParserMode.h: add member useLegacyBackgroundSizeShorthandBehavior to CSSParserContext. 26 (CSSParserContext): 27 * page/Settings.in: initialize useLegacyBackgroundSizeShorthandBehavior to false. 28 * testing/InternalSettings.cpp: 29 (WebCore::InternalSettings::Backup::Backup): add the new settings useLegacyBackgroundSizeShorthandBehavior to Backup. 30 (WebCore::InternalSettings::Backup::restoreTo): restore useLegacyBackgroundSizeShorthandBehavior from Backup. 31 (WebCore::InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior): 32 (WebCore): 33 * testing/InternalSettings.h: 34 (Backup): 35 (InternalSettings): 36 * testing/InternalSettings.idl: add a JS testing API setUseLegacyBackgroundSizeShorthandBehavior to turn on/off 37 the new settings. 38 1 39 2013-03-27 Florin Malita <fmalita@chromium.org> 2 40 -
trunk/Source/WebCore/css/CSSParser.cpp
r147028 r147034 266 266 , needsSiteSpecificQuirks(false) 267 267 , enforcesCSSMIMETypeInNoQuirksMode(true) 268 , useLegacyBackgroundSizeShorthandBehavior(false) 268 269 { 269 270 } … … 284 285 , needsSiteSpecificQuirks(document->settings() ? document->settings()->needsSiteSpecificQuirks() : false) 285 286 , enforcesCSSMIMETypeInNoQuirksMode(!document->settings() || document->settings()->enforceCSSMIMETypeInNoQuirksMode()) 287 , useLegacyBackgroundSizeShorthandBehavior(document->settings() ? document->settings()->useLegacyBackgroundSizeShorthandBehavior() : false) 286 288 { 287 289 } … … 302 304 #endif 303 305 && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks 304 && a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode; 306 && a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode 307 && a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior; 305 308 } 306 309 … … 3127 3130 } 3128 3131 3132 bool CSSParser::useLegacyBackgroundSizeShorthandBehavior() const 3133 { 3134 return m_context.useLegacyBackgroundSizeShorthandBehavior; 3135 } 3136 3129 3137 const int cMaxFillProperties = 9; 3130 3138 … … 3257 3265 } else if ((properties[i] == CSSPropertyBackgroundClip || properties[i] == CSSPropertyWebkitMaskClip) && !foundClip) 3258 3266 // Value is already set while updating origin 3267 continue; 3268 else if (properties[i] == CSSPropertyBackgroundSize && !parsedProperty[i] && useLegacyBackgroundSizeShorthandBehavior()) 3259 3269 continue; 3260 3270 else -
trunk/Source/WebCore/css/CSSParser.h
r146781 r147034 598 598 #endif 599 599 600 bool useLegacyBackgroundSizeShorthandBehavior() const; 601 600 602 int (CSSParser::*m_lexFunc)(void*); 601 603 -
trunk/Source/WebCore/css/CSSParserMode.h
r145784 r147034 75 75 bool needsSiteSpecificQuirks; 76 76 bool enforcesCSSMIMETypeInNoQuirksMode; 77 bool useLegacyBackgroundSizeShorthandBehavior; 77 78 }; 78 79 -
trunk/Source/WebCore/page/Settings.in
r146924 r147034 207 207 208 208 selectionIncludesAltImageText initial=false 209 useLegacyBackgroundSizeShorthandBehavior initial=false -
trunk/Source/WebCore/testing/InternalSettings.cpp
r146924 r147034 99 99 , m_defaultVideoPosterURL(settings->defaultVideoPosterURL()) 100 100 , m_originalTimeWithoutMouseMovementBeforeHidingControls(settings->timeWithoutMouseMovementBeforeHidingControls()) 101 , m_useLegacyBackgroundSizeShorthandBehavior(settings->useLegacyBackgroundSizeShorthandBehavior()) 101 102 { 102 103 } … … 136 137 settings->setDefaultVideoPosterURL(m_defaultVideoPosterURL); 137 138 settings->setTimeWithoutMouseMovementBeforeHidingControls(m_originalTimeWithoutMouseMovementBeforeHidingControls); 139 settings->setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior); 138 140 } 139 141 … … 492 494 } 493 495 494 } 496 void InternalSettings::setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode& ec) 497 { 498 InternalSettingsGuardForSettings(); 499 settings()->setUseLegacyBackgroundSizeShorthandBehavior(enabled); 500 } 501 502 } -
trunk/Source/WebCore/testing/InternalSettings.h
r146924 r147034 84 84 String m_defaultVideoPosterURL; 85 85 bool m_originalTimeWithoutMouseMovementBeforeHidingControls; 86 bool m_useLegacyBackgroundSizeShorthandBehavior; 86 87 }; 87 88 … … 128 129 void setDefaultVideoPosterURL(const String& url, ExceptionCode&); 129 130 void setTimeWithoutMouseMovementBeforeHidingControls(double time, ExceptionCode&); 131 void setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode&); 130 132 131 133 private: -
trunk/Source/WebCore/testing/InternalSettings.idl
r146924 r147034 60 60 void setDefaultVideoPosterURL(in DOMString poster) raises(DOMException); 61 61 void setTimeWithoutMouseMovementBeforeHidingControls(in double time) raises(DOMException); 62 void setUseLegacyBackgroundSizeShorthandBehavior(in boolean enabled) raises(DOMException); 62 63 };
Note: See TracChangeset
for help on using the changeset viewer.