Changeset 260723 in webkit for trunk/Source/WebCore/css/CSSStyleDeclaration.cpp
- Timestamp:
- Apr 26, 2020, 12:37:24 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/css/CSSStyleDeclaration.cpp
r260491 r260723 153 153 }; 154 154 155 static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName , const Settings* settingsPtr)155 static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName) 156 156 { 157 157 using CSSPropertyInfoMap = HashMap<String, CSSPropertyInfo>; … … 251 251 if (auto propertyID = hashTableEntry ? hashTableEntry->id : 0) { 252 252 auto id = static_cast<CSSPropertyID>(propertyID); 253 if (isEnabledCSSProperty(id) && isCSSPropertyEnabledBySettings(id, settingsPtr)) { 254 propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix; 255 propertyInfo.propertyID = id; 256 propertyInfoCache.get().add(propertyNameString, propertyInfo); 257 } 253 propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix; 254 propertyInfo.propertyID = id; 255 propertyInfoCache.get().add(propertyNameString, propertyInfo); 258 256 } 259 257 return propertyInfo; 260 258 } 261 259 260 static CSSPropertyInfo propertyInfoFromJavaScriptCSSPropertyName(const AtomString& propertyName, const Settings* settings) 261 { 262 auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName); 263 auto id = propertyInfo.propertyID; 264 if (!isEnabledCSSProperty(id) || !isCSSPropertyEnabledBySettings(id, settings)) 265 return { CSSPropertyInvalid, false }; 266 return propertyInfo; 267 } 268 262 269 } 263 270 264 271 CSSPropertyID CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName(const AtomString& propertyName) 265 272 { 266 return p arseJavaScriptCSSPropertyName(propertyName, nullptr).propertyID;273 return propertyInfoFromJavaScriptCSSPropertyName(propertyName, nullptr).propertyID; 267 274 } 268 275 269 276 Optional<Variant<String, double>> CSSStyleDeclaration::namedItem(const AtomString& propertyName) 270 277 { 271 auto* settings Ptr= parentElement() ? &parentElement()->document().settings() : nullptr;272 auto propertyInfo = p arseJavaScriptCSSPropertyName(propertyName, settingsPtr);278 auto* settings = parentElement() ? &parentElement()->document().settings() : nullptr; 279 auto propertyInfo = propertyInfoFromJavaScriptCSSPropertyName(propertyName, settings); 273 280 if (!propertyInfo.propertyID) 274 281 return WTF::nullopt; … … 292 299 ExceptionOr<void> CSSStyleDeclaration::setNamedItem(const AtomString& propertyName, String value, bool& propertySupported) 293 300 { 294 auto* settings Ptr= parentElement() ? &parentElement()->document().settings() : nullptr;295 auto propertyInfo = p arseJavaScriptCSSPropertyName(propertyName, settingsPtr);301 auto* settings = parentElement() ? &parentElement()->document().settings() : nullptr; 302 auto propertyInfo = propertyInfoFromJavaScriptCSSPropertyName(propertyName, settings); 296 303 if (!propertyInfo.propertyID) { 297 304 propertySupported = false;
Note:
See TracChangeset
for help on using the changeset viewer.