Changeset 260491 in webkit
- Timestamp:
- Apr 21, 2020 8:03:43 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r260489 r260491 1 2020-04-21 Cathie Chen <cathiechen@igalia.com> 2 3 REGRESSION (r254790): No longer get smooth scrolling on music.apple.com 4 https://bugs.webkit.org/show_bug.cgi?id=210634 5 6 Reviewed by Darin Adler. 7 8 "scrollBehavior" is not available in CSSStyleDeclaration if the flag is off. 9 It's available if the flag is on. 10 11 * fast/scrolling/scroll-behavior-invalidate-if-disabled-expected.txt: Added. 12 * fast/scrolling/scroll-behavior-invalidate-if-disabled.html: Added. 13 * fast/scrolling/scroll-behavior-validate-if-enabled-expected.txt: Added. 14 * fast/scrolling/scroll-behavior-validate-if-enabled.html: Added. 15 1 16 2020-04-21 Yusuke Suzuki <ysuzuki@apple.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r260489 r260491 1 2020-04-21 Cathie Chen <cathiechen@igalia.com> 2 3 REGRESSION (r254790): No longer get smooth scrolling on music.apple.com 4 https://bugs.webkit.org/show_bug.cgi?id=210634 5 6 Reviewed by Darin Adler. 7 8 The page uses the access of "scrollBehavior" in CSSStyleDeclaration as the support of scroll-behavior. 9 If supported, it will use scroll-behavior. Otherwise, it will perform a JS smooth scroll. 10 Currently, "scrollBehavior" is still available when CSSOMViewSmoothScrolling is off, only the value 11 "smooth" is invalidated. 12 In order to fix this, CSSStyleDeclaration will take account of CSSOMViewSmoothScrolling in Settings. 13 This patch also tries to provide an interface which let flags in Settings can enable/disable a property. 14 However, it is not complete, for there are some scenarios that Settings isn't accessible. By adding 15 "settings-flag" to CSSProperties.json, it would be effective to control the property access in CSSStyleDeclaration. 16 17 Tests: fast/scrolling/scroll-behavior-invalidate-if-disabled.html 18 fast/scrolling/scroll-behavior-validate-if-enabled.html 19 20 * css/CSSProperties.json: 21 * css/CSSStyleDeclaration.cpp: 22 (WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName): 23 (WebCore::CSSStyleDeclaration::namedItem): 24 (WebCore::CSSStyleDeclaration::setNamedItem): 25 (WebCore::CSSStyleDeclaration::supportedPropertyNames const): 26 * css/makeprop.pl: 27 (addProperty): 28 * css/parser/CSSPropertyParser.cpp: 29 (WebCore::cssPropertyID): 30 * inspector/InspectorStyleSheet.cpp: 31 (WebCore::InspectorStyle::collectProperties const): 32 * inspector/agents/InspectorCSSAgent.cpp: 33 (WebCore::InspectorCSSAgent::getSupportedCSSProperties): 34 1 35 2020-04-21 Yusuke Suzuki <ysuzuki@apple.com> 2 36 -
trunk/Source/WebCore/css/CSSProperties.json
r259532 r260491 131 131 "that conditionally enables the property.", 132 132 "", 133 "* settings-flag:", 134 "The name of the flag on Settings (e.g. \"CSSOMViewSmoothScrolling\")", 135 "that conditionally enables the property.", 136 "", 133 137 "2. Lesser known capabilities of this file format", 134 138 "", … … 3573 3577 } 3574 3578 }, 3575 "scroll-behavior": {3576 "values": [3577 "auto",3578 "smooth"3579 ],3580 "specification": {3581 "category": "cssom-view",3582 "url": "https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior"3583 }3584 },3585 3579 "shape-rendering": { 3586 3580 "inherited": true, … … 6516 6510 ], 6517 6511 "codegen-properties": { 6512 "settings-flag": "CSSOMViewSmoothScrolling", 6518 6513 "converter": "SmoothScrolling", 6519 6514 "name-for-methods": "UseSmoothScrolling" -
trunk/Source/WebCore/css/CSSStyleDeclaration.cpp
r252392 r260491 30 30 #include "CSSPropertyParser.h" 31 31 #include "DeprecatedGlobalSettings.h" 32 #include "Document.h" 32 33 #include "HashTools.h" 33 34 #include "RuntimeEnabledFeatures.h" 35 #include "Settings.h" 36 #include "StyledElement.h" 34 37 #include <wtf/IsoMallocInlines.h> 35 38 #include <wtf/Optional.h> … … 150 153 }; 151 154 152 static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName )155 static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName, const Settings* settingsPtr) 153 156 { 154 157 using CSSPropertyInfoMap = HashMap<String, CSSPropertyInfo>; … … 248 251 if (auto propertyID = hashTableEntry ? hashTableEntry->id : 0) { 249 252 auto id = static_cast<CSSPropertyID>(propertyID); 250 if (isEnabledCSSProperty(id) ) {253 if (isEnabledCSSProperty(id) && isCSSPropertyEnabledBySettings(id, settingsPtr)) { 251 254 propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix; 252 255 propertyInfo.propertyID = id; … … 261 264 CSSPropertyID CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName(const AtomString& propertyName) 262 265 { 263 return parseJavaScriptCSSPropertyName(propertyName ).propertyID;266 return parseJavaScriptCSSPropertyName(propertyName, nullptr).propertyID; 264 267 } 265 268 266 269 Optional<Variant<String, double>> CSSStyleDeclaration::namedItem(const AtomString& propertyName) 267 270 { 268 auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName); 271 auto* settingsPtr = parentElement() ? &parentElement()->document().settings() : nullptr; 272 auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName, settingsPtr); 269 273 if (!propertyInfo.propertyID) 270 274 return WTF::nullopt; … … 288 292 ExceptionOr<void> CSSStyleDeclaration::setNamedItem(const AtomString& propertyName, String value, bool& propertySupported) 289 293 { 290 auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName); 294 auto* settingsPtr = parentElement() ? &parentElement()->document().settings() : nullptr; 295 auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName, settingsPtr); 291 296 if (!propertyInfo.propertyID) { 292 297 propertySupported = false; … … 322 327 for (int i = 0; i < numCSSProperties; ++i) { 323 328 CSSPropertyID id = static_cast<CSSPropertyID>(firstCSSProperty + i); 329 // FIXME: Should take account for flags in settings(). 324 330 if (isEnabledCSSProperty(id)) 325 331 names[numNames++] = getJSPropertyName(id); -
trunk/Source/WebCore/css/makeprop.pl
r260335 r260491 64 64 my @internalProprerties; 65 65 my %runtimeFlags; 66 my %settingsFlags; 66 67 my $numPredefinedProperties = 2; 67 68 my %nameIsInherited; … … 252 253 } elsif ($codegenOptionName eq "runtime-flag") { 253 254 $runtimeFlags{$name} = $codegenProperties->{"runtime-flag"}; 255 } elsif ($codegenOptionName eq "settings-flag") { 256 $settingsFlags{$name} = $codegenProperties->{"settings-flag"}; 254 257 } else { 255 258 die "Unrecognized codegen property \"$codegenOptionName\" for $name property."; … … 297 300 #include \"HashTools.h\" 298 301 #include "RuntimeEnabledFeatures.h" 302 #include "Settings.h" 299 303 #include <wtf/ASCIICType.h> 300 304 #include <wtf/text/AtomString.h> … … 390 394 } 391 395 396 bool isCSSPropertyEnabledBySettings(const CSSPropertyID id, const Settings* settings) 397 { 398 if (!settings) 399 return true; 400 401 switch (id) { 402 EOF 403 404 foreach my $name (keys %settingsFlags) { 405 print GPERF " case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n"; 406 print GPERF " return settings->" . $settingsFlags{$name} . "Enabled();\n"; 407 } 408 409 print GPERF << "EOF"; 410 default: 411 return true; 412 } 413 return true; 414 } 415 392 416 const char* getPropertyName(CSSPropertyID id) 393 417 { … … 522 546 523 547 namespace WebCore { 548 549 class Settings; 524 550 525 551 enum CSSPropertyID : uint16_t { … … 577 603 bool isInternalCSSProperty(const CSSPropertyID); 578 604 bool isEnabledCSSProperty(const CSSPropertyID); 605 bool isCSSPropertyEnabledBySettings(const CSSPropertyID, const Settings* = nullptr); 579 606 const char* getPropertyName(CSSPropertyID); 580 607 const WTF::AtomString& getPropertyNameAtomString(CSSPropertyID id); -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r259659 r260491 144 144 if (hashTableEntry) { 145 145 auto propertyID = static_cast<CSSPropertyID>(hashTableEntry->id); 146 // FIXME: Should take account for flags in settings(). 146 147 if (isEnabledCSSProperty(propertyID)) 147 148 return propertyID; -
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
r260069 r260491 605 605 for (auto i = firstCSSProperty; i < lastCSSProperty; ++i) { 606 606 auto id = convertToCSSPropertyID(i); 607 // FIXME: Should take account for flags in settings(). 607 608 if (isInternalCSSProperty(id) || !isEnabledCSSProperty(id)) 608 609 continue; -
trunk/Source/WebCore/inspector/agents/InspectorCSSAgent.cpp
r260069 r260491 781 781 for (int i = firstCSSProperty; i <= lastCSSProperty; ++i) { 782 782 CSSPropertyID propertyID = convertToCSSPropertyID(i); 783 // FIXME: Should take account for flags in settings(). 783 784 if (isInternalCSSProperty(propertyID) || !isEnabledCSSProperty(propertyID)) 784 785 continue; -
trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h
r256512 r260491 215 215 216 216 #define WebKitCSSOMViewScrollingAPIEnabledPreferenceKey "WebKitCSSOMViewScrollingAPIEnabled" 217 217 218 #define WebKitCSSOMViewSmoothScrollingEnabledPreferenceKey "WebKitCSSOMViewSmoothScrollingEnabled" 218 219 -
trunk/Tools/ChangeLog
r260486 r260491 1 2020-04-21 Cathie Chen <cathiechen@igalia.com> 2 3 REGRESSION (r254790): No longer get smooth scrolling on music.apple.com 4 https://bugs.webkit.org/show_bug.cgi?id=210634 5 6 Reviewed by Darin Adler. 7 8 Add settings-flag. Add support for CSSOMViewSmoothScrolling on Windows DumpRenderTree. 9 10 * DumpRenderTree/win/DumpRenderTree.cpp: 11 (enableExperimentalFeatures): 12 (setWebPreferencesForTestOptions): 13 * Scripts/webkitpy/style/checkers/jsonchecker.py: 14 (JSONCSSPropertiesChecker.check_codegen_properties): 15 1 16 2020-04-21 Peng Liu <peng.liu6@apple.com> 2 17 -
trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp
r256512 r260491 804 804 // FIXME: WebGL2 805 805 // FIXME: WebRTC 806 prefsPrivate->setCSSOMViewSmoothScrollingEnabled(TRUE); 806 807 } 807 808 … … 922 923 preferences->setPrivateBrowsingEnabled(options.useEphemeralSession); 923 924 preferences->setUsesPageCache(options.enableBackForwardCache); 925 prefsPrivate->setCSSOMViewSmoothScrollingEnabled(options.enableCSSOMViewSmoothScrolling); 924 926 } 925 927 -
trunk/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py
r259006 r260491 291 291 'runtime-flag': self.validate_string, 292 292 'setter': self.validate_string, 293 'settings-flag': self.validate_string, 293 294 'skip-builder': self.validate_boolean, 294 295 'skip-codegen': self.validate_boolean,
Note: See TracChangeset
for help on using the changeset viewer.