Changeset 242278 in webkit
- Timestamp:
- Mar 1, 2019 11:55:48 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r242275 r242278 1 2019-03-01 Sihui Liu <sihui_liu@apple.com> 2 3 Add a quirk for bostongloble.com and latimes.com 4 https://bugs.webkit.org/show_bug.cgi?id=195155 5 6 Reviewed by Geoffrey Garen. 7 8 Covered by manual testing. 9 10 * Modules/webdatabase/DOMWindowWebDatabase.idl: 11 * bindings/scripts/CodeGeneratorJS.pm: 12 (GenerateRuntimeEnableConditionalString): 13 * bindings/scripts/IDLAttributes.json: 14 * bindings/scripts/preprocess-idls.pl: 15 (GenerateConstructorAttributes): 16 * page/Quirks.cpp: 17 (WebCore::Quirks::hasWebSQLSupportQuirk const): 18 * page/Quirks.h: 19 1 20 2019-03-01 Zalan Bujtas <zalan@apple.com> 2 21 -
trunk/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.idl
r237210 r242278 27 27 [ 28 28 EnabledAtRuntime=WebSQL, 29 EnabledByQuirk=hasWebSQLSupport, 29 30 ] 30 31 partial interface DOMWindow { -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r241602 r242278 3750 3750 AddToImplIncludes("RuntimeEnabledFeatures.h"); 3751 3751 3752 my @flags = split(/&/, $context->extendedAttributes->{EnabledAtRuntime}); 3753 foreach my $flag (@flags) { 3754 push(@conjuncts, "RuntimeEnabledFeatures::sharedFeatures()." . ToMethodName($flag) . "Enabled()"); 3752 if ($context->extendedAttributes->{EnabledByQuirk}) { 3753 AddToImplIncludes("Document.h"); 3754 AddToImplIncludes("Quirks.h"); 3755 3756 assert("EnabledByQuirks can only be used by interfaces only exposed to the Window") if $interface->extendedAttributes->{Exposed} && $interface->extendedAttributes->{Exposed} ne "Window"; 3757 3758 my @quirkFlags = split(/&/, $context->extendedAttributes->{EnabledByQuirk}); 3759 my @runtimeFlags = split(/&/, $context->extendedAttributes->{EnabledAtRuntime}); 3760 my @quirks; 3761 my @runtimes; 3762 foreach my $flag (@quirkFlags) { 3763 push(@quirks, "downcast<Document>(jsCast<JSDOMGlobalObject*>(" . $globalObjectPtr . ")->scriptExecutionContext())->quirks()." . ToMethodName($flag) . "Quirk()"); 3764 } 3765 foreach my $flag (@runtimeFlags) { 3766 push(@runtimes, "RuntimeEnabledFeatures::sharedFeatures()." . ToMethodName($flag) . "Enabled()"); 3767 } 3768 push(@conjuncts, "(" . join(" && ", @quirks) . " || " . join(" && ", @runtimes) .")"); 3769 } else { 3770 my @flags = split(/&/, $context->extendedAttributes->{EnabledAtRuntime}); 3771 foreach my $flag (@flags) { 3772 push(@conjuncts, "RuntimeEnabledFeatures::sharedFeatures()." . ToMethodName($flag) . "Enabled()"); 3773 } 3755 3774 } 3756 3775 } -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.json
r241602 r242278 189 189 "values": ["*"] 190 190 }, 191 "EnabledByQuirk": { 192 "contextsAllowed": ["interface", "dictionary", "enum", "attribute", "operation", "constant"], 193 "values": ["*"] 194 }, 191 195 "EnabledForWorld": { 192 196 "contextsAllowed": ["attribute", "operation"], -
trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl
r239472 r242278 275 275 next unless ($attributeName eq "Conditional" || $attributeName eq "EnabledAtRuntime" || $attributeName eq "EnabledForWorld" 276 276 || $attributeName eq "EnabledBySetting" || $attributeName eq "SecureContext" || $attributeName eq "PrivateIdentifier" 277 || $attributeName eq "PublicIdentifier" || $attributeName eq "DisabledByQuirk" );277 || $attributeName eq "PublicIdentifier" || $attributeName eq "DisabledByQuirk" || $attributeName eq "EnabledByQuirk"); 278 278 my $extendedAttribute = $attributeName; 279 279 $extendedAttribute .= "=" . $extendedAttributes->{$attributeName} unless $extendedAttributes->{$attributeName} eq "VALUE_IS_MISSING"; -
trunk/Source/WebCore/page/Quirks.cpp
r240112 r242278 57 57 } 58 58 59 bool Quirks::hasWebSQLSupportQuirk() const 60 { 61 if (!m_document || !m_document->settings().needsSiteSpecificQuirks()) 62 return false; 63 64 if (m_hasWebSQLSupportQuirk) 65 return m_hasWebSQLSupportQuirk.value(); 66 67 auto domain = m_document->securityOrigin().domain().convertToASCIILowercase(); 68 69 m_hasWebSQLSupportQuirk = domain == "bostongloble.com" 70 || domain.endsWith(".bostongloble.com") 71 || domain == "latimes.com" 72 || domain.endsWith(".latimes.com"); 73 74 return m_hasWebSQLSupportQuirk.value(); 59 75 } 76 77 } -
trunk/Source/WebCore/page/Quirks.h
r239427 r242278 39 39 40 40 bool hasBrokenEncryptedMediaAPISupportQuirk() const; 41 bool hasWebSQLSupportQuirk() const; 41 42 42 43 private: … … 44 45 45 46 mutable Optional<bool> m_hasBrokenEncryptedMediaAPISupportQuirk; 47 mutable Optional<bool> m_hasWebSQLSupportQuirk; 46 48 }; 47 49
Note: See TracChangeset
for help on using the changeset viewer.