Changeset 260491 in webkit for trunk/Source/WebCore/css/CSSStyleDeclaration.cpp
- Timestamp:
- Apr 21, 2020, 8:03:43 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note:
See TracChangeset
for help on using the changeset viewer.