Title: [163412] trunk/Source/WebKit2
Revision
163412
Author
m...@apple.com
Date
2014-02-04 15:55:20 -0800 (Tue, 04 Feb 2014)

Log Message

[Cocoa] Expose more WKWebProcessPlugInNodeHandle properties
https://bugs.webkit.org/show_bug.cgi?id=128219

Reviewed by Anders Carlsson.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Declared new
properties.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle elementBounds]): Added.
(-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilled]): Added.
(-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilled:]): Added.
(-[WKWebProcessPlugInNodeHandle HTMLInputELementIsUserEdited]): Added.
(-[WKWebProcessPlugInNodeHandle HTMLTextAreaELementIsUserEdited]): Added.
(-[WKWebProcessPlugInNodeHandle HTMLTableCellElementCellAbove]): Added.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h: Rolled
Internal category into the class extension.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h: Declared
-clearWrappers.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
(-[WKWebProcessPlugInScriptWorld clearWrappers]): Added. Calls through to clearWrappers().
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h: Rolled
Internal category into the class extension.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (163411 => 163412)


--- trunk/Source/WebKit2/ChangeLog	2014-02-04 23:50:03 UTC (rev 163411)
+++ trunk/Source/WebKit2/ChangeLog	2014-02-04 23:55:20 UTC (rev 163412)
@@ -1,3 +1,29 @@
+2014-02-04  Dan Bernstein  <m...@apple.com>
+
+        [Cocoa] Expose more WKWebProcessPlugInNodeHandle properties
+        https://bugs.webkit.org/show_bug.cgi?id=128219
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Declared new
+        properties.
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
+        (-[WKWebProcessPlugInNodeHandle elementBounds]): Added.
+        (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilled]): Added.
+        (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilled:]): Added.
+        (-[WKWebProcessPlugInNodeHandle HTMLInputELementIsUserEdited]): Added.
+        (-[WKWebProcessPlugInNodeHandle HTMLTextAreaELementIsUserEdited]): Added.
+        (-[WKWebProcessPlugInNodeHandle HTMLTableCellElementCellAbove]): Added.
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h: Rolled
+        Internal category into the class extension.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h: Declared
+        -clearWrappers.
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
+        (-[WKWebProcessPlugInScriptWorld clearWrappers]): Added. Calls through to clearWrappers().
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h: Rolled
+        Internal category into the class extension.
+
 2014-02-04  Alexey Proskuryakov  <a...@apple.com>
 
         webKitCookieStorageCopyRequestHeaderFieldsForURL builds an empty Cookie header when there are no cookies

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h (163411 => 163412)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h	2014-02-04 23:50:03 UTC (rev 163411)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h	2014-02-04 23:55:20 UTC (rev 163412)
@@ -38,6 +38,12 @@
 + (WKWebProcessPlugInNodeHandle *)nodeHandleWithJSValue:(JSValue *)value inContext:(JSContext *)context;
 - (WKWebProcessPlugInFrame *)htmlIFrameElementContentFrame;
 
+@property (nonatomic, readonly) CGRect elementBounds;
+@property (nonatomic) BOOL HTMLInputElementIsAutoFilled;
+@property (nonatomic, readonly) BOOL HTMLInputElementIsUserEdited;
+@property (nonatomic, readonly) BOOL HTMLTextAreaElementIsUserEdited;
+@property (nonatomic, readonly) WKWebProcessPlugInNodeHandle *HTMLTableCellElementCellAbove;
+
 @end
 
 #endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm (163411 => 163412)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm	2014-02-04 23:50:03 UTC (rev 163411)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm	2014-02-04 23:55:20 UTC (rev 163412)
@@ -27,6 +27,7 @@
 #import "WKWebProcessPlugInNodeHandleInternal.h"
 
 #import "WKWebProcessPlugInFrameInternal.h"
+#import <WebCore/IntRect.h>
 
 #if WK_API_ENABLED
 
@@ -57,22 +58,52 @@
     return wrapper(*frame.release().leakRef());
 }
 
-#pragma mark WKObject protocol implementation
+- (CGRect)elementBounds
+{
+    return _nodeHandle->elementBounds();
+}
 
-- (API::Object&)_apiObject
+- (BOOL)HTMLInputElementIsAutoFilled
 {
-    return *_nodeHandle;
+    return _nodeHandle->isHTMLInputElementAutofilled();
 }
 
-@end
+- (void)setHTMLInputElementIsAutoFilled:(BOOL)isAutoFilled
+{
+    _nodeHandle->setHTMLInputElementAutofilled(isAutoFilled);
+}
 
-@implementation WKWebProcessPlugInNodeHandle (Internal)
+- (BOOL)HTMLInputELementIsUserEdited
+{
+    return _nodeHandle->htmlInputElementLastChangeWasUserEdit();
+}
 
+- (BOOL)HTMLTextAreaELementIsUserEdited
+{
+    return _nodeHandle->htmlTextAreaElementLastChangeWasUserEdit();
+}
+
+- (WKWebProcessPlugInNodeHandle *)HTMLTableCellElementCellAbove
+{
+    auto nodeHandle = _nodeHandle->htmlTableCellElementCellAbove();
+    if (!nodeHandle)
+        return nil;
+
+    return [wrapper(*nodeHandle.leakRef()) autorelease];
+}
+
 - (InjectedBundleNodeHandle&)_nodeHandle
 {
     return *_nodeHandle;
 }
 
+#pragma mark WKObject protocol implementation
+
+- (API::Object&)_apiObject
+{
+    return *_nodeHandle;
+}
+
 @end
 
 #endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h (163411 => 163412)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h	2014-02-04 23:50:03 UTC (rev 163411)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandleInternal.h	2014-02-04 23:55:20 UTC (rev 163412)
@@ -41,10 +41,7 @@
 }
 
 @interface WKWebProcessPlugInNodeHandle () <WKObject>
-@end
 
-@interface WKWebProcessPlugInNodeHandle (Internal)
-
 @property (readonly) WebKit::InjectedBundleNodeHandle& _nodeHandle;
 
 @end

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h (163411 => 163412)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h	2014-02-04 23:50:03 UTC (rev 163411)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h	2014-02-04 23:55:20 UTC (rev 163412)
@@ -35,6 +35,8 @@
 + (WKWebProcessPlugInScriptWorld *)world;
 + (WKWebProcessPlugInScriptWorld *)normalWorld;
 
+- (void)clearWrappers;
+
 @end
 
 #endif // WK_API_ENABLED

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm (163411 => 163412)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm	2014-02-04 23:50:03 UTC (rev 163411)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm	2014-02-04 23:55:20 UTC (rev 163412)
@@ -51,18 +51,19 @@
     [super dealloc];
 }
 
-#pragma mark WKObject protocol implementation
+- (void)clearWrappers
+{
+    _world->clearWrappers();
+}
 
-- (API::Object&)_apiObject
+- (InjectedBundleScriptWorld&)_scriptWorld
 {
     return *_world;
 }
 
-@end
+#pragma mark WKObject protocol implementation
 
-@implementation WKWebProcessPlugInScriptWorld (Internal)
-
-- (InjectedBundleScriptWorld&)_scriptWorld
+- (API::Object&)_apiObject
 {
     return *_world;
 }

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h (163411 => 163412)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h	2014-02-04 23:50:03 UTC (rev 163411)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorldInternal.h	2014-02-04 23:55:20 UTC (rev 163412)
@@ -41,10 +41,7 @@
 }
 
 @interface WKWebProcessPlugInScriptWorld () <WKObject>
-@end
 
-@interface WKWebProcessPlugInScriptWorld (Internal)
-
 @property (readonly) WebKit::InjectedBundleScriptWorld& _scriptWorld;
 
 @end
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to