WebKit Bugzilla
Attachment 346298 Details for
Bug 188226
: Optionally expose Attr::style to JavaScript
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Expose Attr::style to JS when _WKProcessPoolConfiguration.attrStyleEnabled is YES
bug-188226-20180801142259.patch (text/plain), 21.69 KB, created by
mitz
on 2018-08-01 14:23:00 PDT
(
hide
)
Description:
Expose Attr::style to JS when _WKProcessPoolConfiguration.attrStyleEnabled is YES
Filename:
MIME Type:
Creator:
mitz
Created:
2018-08-01 14:23:00 PDT
Size:
21.69 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 234460) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,19 @@ >+2018-08-01 Dan Bernstein <mitz@apple.com> >+ >+ Optionally expose Attr::style to JavaScript >+ https://bugs.webkit.org/show_bug.cgi?id=188226 >+ <rdar://problem/42818113> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm >+ >+ * dom/Attr.idl: Define the style attribute, enabled at runtime by the AttrStyle feature. >+ >+ * page/RuntimeEnabledFeatures.h: >+ (WebCore::RuntimeEnabledFeatures::setAttrStyleEnabled): Added this accessor. >+ (WebCore::RuntimeEnabledFeatures::attrStyleEnabled const): Ditto. >+ > 2018-08-01 Yusuke Suzuki <utatane.tea@gmail.com> > > Add TransformationMatrix::Identity >Index: Source/WebCore/dom/Attr.idl >=================================================================== >--- Source/WebCore/dom/Attr.idl (revision 234460) >+++ Source/WebCore/dom/Attr.idl (working copy) >@@ -32,4 +32,6 @@ > readonly attribute Element? ownerElement; > > readonly attribute boolean specified; // Useless; always returns true. >+ >+ [EnabledAtRuntime=AttrStyle] readonly attribute CSSStyleDeclaration style; > }; >Index: Source/WebCore/page/RuntimeEnabledFeatures.h >=================================================================== >--- Source/WebCore/page/RuntimeEnabledFeatures.h (revision 234460) >+++ Source/WebCore/page/RuntimeEnabledFeatures.h (working copy) >@@ -276,6 +276,9 @@ public: > bool systemPreviewEnabled() const { return m_systemPreviewEnabled; } > #endif > >+ void setAttrStyleEnabled(bool isEnabled) { m_attrStyleEnabled = isEnabled; } >+ bool attrStyleEnabled() const { return m_attrStyleEnabled; } >+ > WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); > > private: >@@ -416,6 +419,8 @@ private: > bool m_systemPreviewEnabled { false }; > #endif > >+ bool m_attrStyleEnabled { false }; >+ > friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; > }; > >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 234460) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,35 @@ >+2018-08-01 Dan Bernstein <mitz@apple.com> >+ >+ Optionally expose Attr::style to JavaScript >+ https://bugs.webkit.org/show_bug.cgi?id=188226 >+ <rdar://problem/42818113> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/WebProcessCreationParameters.cpp: >+ (WebKit::WebProcessCreationParameters::encode const): Encode new attrStyleEnabled member. >+ (WebKit::WebProcessCreationParameters::decode): Decode new attrStyleEnabled member. >+ * Shared/WebProcessCreationParameters.h: Define new attrStyleEnabled member, initialized to >+ false. >+ >+ * UIProcess/API/APIProcessPoolConfiguration.cpp: >+ (API::ProcessPoolConfiguration::copy): Copy new m_attrStyleEnabled member. >+ * UIProcess/API/APIProcessPoolConfiguration.h: Define new m_attrStyleEnabled member. >+ >+ * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Declare new attrStyleEnabled boolean >+ property. >+ * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: >+ (-[_WKProcessPoolConfiguration attrStyleEnabled]): New accessor. >+ (-[_WKProcessPoolConfiguration setAttrStyleEnabled:]): Ditto. >+ >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::initializeNewWebProcess): Initialize parameters.attrStyleEnabled >+ from the configuration. >+ >+ * WebProcess/WebProcess.cpp: >+ (WebKit::WebProcess::initializeWebProcess): Set the attrStyleEnabled runtime feature based >+ on the creation parameters. >+ > 2018-08-01 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r234443 and r234445. >Index: Source/WebKit/Shared/WebProcessCreationParameters.cpp >=================================================================== >--- Source/WebKit/Shared/WebProcessCreationParameters.cpp (revision 234460) >+++ Source/WebKit/Shared/WebProcessCreationParameters.cpp (working copy) >@@ -125,6 +125,7 @@ void WebProcessCreationParameters::encod > encoder << plugInAutoStartOriginHashes; > encoder << plugInAutoStartOrigins; > encoder << memoryCacheDisabled; >+ encoder << attrStyleEnabled; > > #if ENABLE(SERVICE_CONTROLS) > encoder << hasImageServices; >@@ -368,6 +369,8 @@ bool WebProcessCreationParameters::decod > return false; > if (!decoder.decode(parameters.memoryCacheDisabled)) > return false; >+ if (!decoder.decode(parameters.attrStyleEnabled)) >+ return false; > > #if ENABLE(SERVICE_CONTROLS) > if (!decoder.decode(parameters.hasImageServices)) >Index: Source/WebKit/Shared/WebProcessCreationParameters.h >=================================================================== >--- Source/WebKit/Shared/WebProcessCreationParameters.h (revision 234460) >+++ Source/WebKit/Shared/WebProcessCreationParameters.h (working copy) >@@ -133,6 +133,7 @@ struct WebProcessCreationParameters { > bool resourceLoadStatisticsEnabled { false }; > bool fullKeyboardAccessEnabled { false }; > bool memoryCacheDisabled { false }; >+ bool attrStyleEnabled { false }; > > #if ENABLE(SERVICE_CONTROLS) > bool hasImageServices { false }; >Index: Source/WebKit/UIProcess/WebProcessPool.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebProcessPool.cpp (revision 234460) >+++ Source/WebKit/UIProcess/WebProcessPool.cpp (working copy) >@@ -926,6 +926,7 @@ void WebProcessPool::initializeNewWebPro > parameters.plugInAutoStartOrigins = copyToVector(m_plugInAutoStartProvider.autoStartOrigins()); > > parameters.memoryCacheDisabled = m_memoryCacheDisabled; >+ parameters.attrStyleEnabled = m_configuration->attrStyleEnabled(); > > #if ENABLE(SERVICE_CONTROLS) > auto& serviceController = ServicesController::singleton(); >Index: Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp >=================================================================== >--- Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp (revision 234460) >+++ Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.cpp (working copy) >@@ -117,6 +117,7 @@ Ref<ProcessPoolConfiguration> ProcessPoo > copy->m_additionalReadAccessAllowedPaths = this->m_additionalReadAccessAllowedPaths; > copy->m_fullySynchronousModeIsAllowedForTesting = this->m_fullySynchronousModeIsAllowedForTesting; > copy->m_ignoreSynchronousMessagingTimeoutsForTesting = this->m_ignoreSynchronousMessagingTimeoutsForTesting; >+ copy->m_attrStyleEnabled = this->m_attrStyleEnabled; > copy->m_overrideLanguages = this->m_overrideLanguages; > copy->m_sourceApplicationBundleIdentifier = this->m_sourceApplicationBundleIdentifier; > copy->m_sourceApplicationSecondaryIdentifier = this->m_sourceApplicationSecondaryIdentifier; >Index: Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h >=================================================================== >--- Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h (revision 234460) >+++ Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h (working copy) >@@ -109,6 +109,9 @@ public: > bool ignoreSynchronousMessagingTimeoutsForTesting() const { return m_ignoreSynchronousMessagingTimeoutsForTesting; } > void setIgnoreSynchronousMessagingTimeoutsForTesting(bool allowed) { m_ignoreSynchronousMessagingTimeoutsForTesting = allowed; } > >+ bool attrStyleEnabled() const { return m_attrStyleEnabled; } >+ void setAttrStyleEnabled(bool enabled) { m_attrStyleEnabled = enabled; } >+ > const Vector<WTF::String>& overrideLanguages() const { return m_overrideLanguages; } > void setOverrideLanguages(Vector<WTF::String>&& languages) { m_overrideLanguages = WTFMove(languages); } > >@@ -178,6 +181,7 @@ private: > Vector<WTF::CString> m_additionalReadAccessAllowedPaths; > bool m_fullySynchronousModeIsAllowedForTesting { false }; > bool m_ignoreSynchronousMessagingTimeoutsForTesting { false }; >+ bool m_attrStyleEnabled { false }; > Vector<WTF::String> m_overrideLanguages; > WTF::String m_sourceApplicationBundleIdentifier; > WTF::String m_sourceApplicationSecondaryIdentifier; >Index: Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h (revision 234460) >+++ Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h (working copy) >@@ -37,6 +37,7 @@ WK_CLASS_AVAILABLE(macosx(10.10), ios(8. > @property (nonatomic) NSUInteger maximumProcessCount; > > @property (nonatomic) BOOL ignoreSynchronousMessagingTimeoutsForTesting WK_API_AVAILABLE(macosx(10.12), ios(10.0)); >+@property (nonatomic) BOOL attrStyleEnabled WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > > @property (nonatomic, copy) NSArray<NSURL *> *additionalReadAccessAllowedURLs WK_API_AVAILABLE(macosx(10.13), ios(11.0)); > >Index: Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm (revision 234460) >+++ Source/WebKit/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm (working copy) >@@ -102,6 +102,16 @@ - (void)setIgnoreSynchronousMessagingTim > _processPoolConfiguration->setIgnoreSynchronousMessagingTimeoutsForTesting(ignoreSynchronousMessagingTimeoutsForTesting); > } > >+- (BOOL)attrStyleEnabled >+{ >+ return _processPoolConfiguration->attrStyleEnabled(); >+} >+ >+- (void)setAttrStyleEnabled:(BOOL)enabled >+{ >+ return _processPoolConfiguration->setAttrStyleEnabled(enabled); >+} >+ > - (NSArray<NSURL *> *)additionalReadAccessAllowedURLs > { > auto paths = _processPoolConfiguration->additionalReadAccessAllowedPaths(); >Index: Source/WebKit/WebProcess/WebProcess.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebProcess.cpp (revision 234460) >+++ Source/WebKit/WebProcess/WebProcess.cpp (working copy) >@@ -110,6 +110,7 @@ > #include <WebCore/ResourceLoadObserver.h> > #include <WebCore/ResourceLoadStatistics.h> > #include <WebCore/RuntimeApplicationChecks.h> >+#include <WebCore/RuntimeEnabledFeatures.h> > #include <WebCore/SchemeRegistry.h> > #include <WebCore/SecurityOrigin.h> > #include <WebCore/ServiceWorkerContextData.h> >@@ -390,6 +391,8 @@ void WebProcess::initializeWebProcess(We > > setMemoryCacheDisabled(parameters.memoryCacheDisabled); > >+ WebCore::RuntimeEnabledFeatures::sharedFeatures().setAttrStyleEnabled(parameters.attrStyleEnabled); >+ > #if ENABLE(SERVICE_CONTROLS) > setEnabledServices(parameters.hasImageServices, parameters.hasSelectionServices, parameters.hasRichContentServices); > #endif >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 234472) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2018-08-01 Dan Bernstein <mitz@apple.com> >+ >+ Optionally expose Attr::style to JavaScript >+ https://bugs.webkit.org/show_bug.cgi?id=188226 >+ <rdar://problem/42818113> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.html: Added. >+ * TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm: Added. >+ (TEST): >+ > 2018-08-01 Jonathan Bedard <jbedard@apple.com> > > Use iPhone SE as the default simulated device >Index: Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >=================================================================== >--- Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (revision 234460) >+++ Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (working copy) >@@ -130,9 +130,11 @@ > 33E79E06137B5FD900E32D99 /* mouse-move-listener.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 33E79E05137B5FCE00E32D99 /* mouse-move-listener.html */; }; > 370CE22A1F57343400E7410B /* WKContentViewTargetForAction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 370CE2291F57343400E7410B /* WKContentViewTargetForAction.mm */; }; > 371195AB1FE5797700A1FB92 /* WKWebViewAlwaysShowsScroller.mm in Sources */ = {isa = PBXBuildFile; fileRef = 371195AA1FE5797700A1FB92 /* WKWebViewAlwaysShowsScroller.mm */; }; >+ 37137E4B21124D01002BEEA4 /* AttrStyle.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 3760C4F221124BD000233ACC /* AttrStyle.html */; }; > 374B7A601DF36EEE00ACCB6C /* BundleEditingDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 374B7A5E1DF36EEE00ACCB6C /* BundleEditingDelegate.mm */; }; > 374B7A611DF371CF00ACCB6C /* BundleEditingDelegatePlugIn.mm in Sources */ = {isa = PBXBuildFile; fileRef = 374B7A5F1DF36EEE00ACCB6C /* BundleEditingDelegatePlugIn.mm */; }; > 375E0E171D66674400EFEC2C /* WKNSNumber.mm in Sources */ = {isa = PBXBuildFile; fileRef = 375E0E151D66674400EFEC2C /* WKNSNumber.mm */; }; >+ 3760C4F1211249AF00233ACC /* AttrStyle.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3760C4F0211249AF00233ACC /* AttrStyle.mm */; }; > 376C8C061D6E197C007D2BB9 /* FrameHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 376C8C041D6E197C007D2BB9 /* FrameHandle.cpp */; }; > 378E64771632655E00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 378E64751632655D00B6C676 /* InjectedBundleFrameHitTest_Bundle.cpp */; }; > 378E64791632707400B6C676 /* link-with-title.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 378E647816326FDF00B6C676 /* link-with-title.html */; }; >@@ -924,6 +926,7 @@ > F4856CA31E649EA8009D7EE7 /* attachment-element.html in Copy Resources */, > B55F11B71517D03300915916 /* attributedStringCustomFont.html in Copy Resources */, > 7C9ED98B17A19F4B00E4DC33 /* attributedStringStrikethrough.html in Copy Resources */, >+ 37137E4B21124D01002BEEA4 /* AttrStyle.html in Copy Resources */, > CD9E292E1C90C33F000BB800 /* audio-only.html in Copy Resources */, > 76E182DF154767E600F1FADD /* auto-submitting-form.html in Copy Resources */, > F41AB99F1EF4696B0083FA08 /* autofocus-contenteditable.html in Copy Resources */, >@@ -1354,6 +1357,8 @@ > 374B7A621DF3734C00ACCB6C /* BundleEditingDelegateProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BundleEditingDelegateProtocol.h; sourceTree = "<group>"; }; > 3751AF7A169518F800764319 /* DOMNodeFromJSObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMNodeFromJSObject.mm; sourceTree = "<group>"; }; > 375E0E151D66674400EFEC2C /* WKNSNumber.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNSNumber.mm; sourceTree = "<group>"; }; >+ 3760C4F0211249AF00233ACC /* AttrStyle.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AttrStyle.mm; sourceTree = "<group>"; }; >+ 3760C4F221124BD000233ACC /* AttrStyle.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = AttrStyle.html; sourceTree = "<group>"; }; > 376C8C041D6E197C007D2BB9 /* FrameHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameHandle.cpp; sourceTree = "<group>"; }; > 3776BC62150946BC0043A66D /* DeviceScaleFactorInDashboardRegions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DeviceScaleFactorInDashboardRegions.mm; sourceTree = "<group>"; }; > 378E64711632646D00B6C676 /* InjectedBundleFrameHitTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFrameHitTest.cpp; sourceTree = "<group>"; }; >@@ -2233,6 +2238,7 @@ > 2DE71AFD1D49C0BD00904094 /* AnimatedResize.mm */, > 63F668201F97C3AA0032EE51 /* ApplicationManifest.mm */, > 834138C6203261B900F26960 /* AsyncPolicyForNavigationResponse.mm */, >+ 3760C4F0211249AF00233ACC /* AttrStyle.mm */, > 754CEC801F6722DC00D0039A /* AutoFillAvailable.mm */, > 2DD355351BD08378005DF4A7 /* AutoLayoutIntegration.mm */, > 07CD32F52065B5420064A4BE /* AVFoundationPreference.mm */, >@@ -2552,6 +2558,7 @@ > 5C9E593F1D3EB1DE00E3C62E /* ApplicationCache.db-shm */, > 5C9E59401D3EB1DE00E3C62E /* ApplicationCache.db-wal */, > F4856CA21E6498A8009D7EE7 /* attachment-element.html */, >+ 3760C4F221124BD000233ACC /* AttrStyle.html */, > F41AB9981EF4692C0083FA08 /* autofocus-contenteditable.html */, > 93CFA8661CEB9DE1000565A8 /* autofocused-text-input.html */, > 2E14A5281D3FE8B80010F35B /* autoplaying-video-with-audio.html */, >@@ -3597,6 +3604,7 @@ > 6354F4D11F7C3AB500D89DF3 /* ApplicationManifestParser.cpp in Sources */, > 834138C7203261CA00F26960 /* AsyncPolicyForNavigationResponse.mm in Sources */, > 7CCE7EB41A411A7E00447C4C /* AttributedString.mm in Sources */, >+ 3760C4F1211249AF00233ACC /* AttrStyle.mm in Sources */, > CDC8E48D1BC5CB4500594FEC /* AudioSessionCategoryIOS.mm in Sources */, > 7C83E0B91D0A64F100FEBCF3 /* AutoLayoutIntegration.mm in Sources */, > 07CD32F62065B5430064A4BE /* AVFoundationPreference.mm in Sources */, >Index: Tools/TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.html >=================================================================== >--- Tools/TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.html (nonexistent) >+++ Tools/TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.html (working copy) >@@ -0,0 +1,4 @@ >+<body background="https://example.com/body.png" dir="rtl" marginheight=20> >+ <div id="target" align="center"> >+ </div> >+</body> >Index: Tools/TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm >=================================================================== >--- Tools/TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm (nonexistent) >+++ Tools/TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm (working copy) >@@ -0,0 +1,86 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+ >+#if WK_API_ENABLED >+ >+#import "TestNavigationDelegate.h" >+#import "Utilities.h" >+#import <WebKit/WKProcessPoolPrivate.h> >+#import <WebKit/_WKProcessPoolConfiguration.h> >+#import <wtf/RetainPtr.h> >+ >+TEST(WebKit, AttrStyle) >+{ >+ auto poolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]); >+ [poolConfiguration setAttrStyleEnabled:YES]; >+ auto pool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:poolConfiguration.get()]); >+ auto viewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]); >+ [viewConfiguration setProcessPool:pool.get()]; >+ auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:viewConfiguration.get()]); >+ auto navigationDelegate = adoptNS([[TestNavigationDelegate alloc] init]); >+ [webView setNavigationDelegate:navigationDelegate.get()]; >+ >+ [webView loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"AttrStyle" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]]; >+ [navigationDelegate waitForDidFinishNavigation]; >+ >+ __block bool isDone = false; >+ [webView evaluateJavaScript:@"'style' in Attr.prototype" completionHandler:^(NSNumber *result, NSError *error) { >+ EXPECT_TRUE(result.boolValue); >+ isDone = true; >+ }]; >+ TestWebKitAPI::Util::run(&isDone); >+ >+ isDone = false; >+ [webView evaluateJavaScript:@"document.body.getAttributeNode('background').style.cssText" completionHandler:^(NSString *result, NSError *error) { >+ EXPECT_STREQ("background-image: url(\"https://example.com/body.png\");", result.UTF8String); >+ isDone = true; >+ }]; >+ TestWebKitAPI::Util::run(&isDone); >+ >+ isDone = false; >+ [webView evaluateJavaScript:@"document.body.getAttributeNode('dir').style.cssText" completionHandler:^(NSString *result, NSError *error) { >+ EXPECT_STREQ("direction: rtl; unicode-bidi: embed;", result.UTF8String); >+ isDone = true; >+ }]; >+ TestWebKitAPI::Util::run(&isDone); >+ >+ isDone = false; >+ [webView evaluateJavaScript:@"document.body.getAttributeNode('marginheight').style.cssText" completionHandler:^(NSString *result, NSError *error) { >+ EXPECT_STREQ("margin-bottom: 20px; margin-top: 20px;", result.UTF8String); >+ isDone = true; >+ }]; >+ TestWebKitAPI::Util::run(&isDone); >+ >+ isDone = false; >+ [webView evaluateJavaScript:@"document.getElementById('target').getAttributeNode('align').style.cssText" completionHandler:^(NSString *result, NSError *error) { >+ EXPECT_STREQ("text-align: -webkit-center;", result.UTF8String); >+ isDone = true; >+ }]; >+ TestWebKitAPI::Util::run(&isDone); >+} >+ >+#endif // WK_API_ENABLED
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
darin
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188226
: 346298 |
346356