Title: [133097] trunk/Source/WebKit/blackberry
Revision
133097
Author
[email protected]
Date
2012-10-31 17:03:49 -0700 (Wed, 31 Oct 2012)

Log Message

[BLACKBERRY] Custom WebWorks context menus don't always work.
https://bugs.webkit.org/show_bug.cgi?id=100891

Patch by Genevieve Mak <[email protected]> on 2012-10-31
Reviewed by Rob Buis.

Walk up the dom tree until we find the webworks attribute or run out
of parent nodes.
PR# 227732

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (133096 => 133097)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-11-01 00:03:09 UTC (rev 133096)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-11-01 00:03:49 UTC (rev 133097)
@@ -2361,12 +2361,6 @@
     if (node->isElementNode()) {
         Element* element = static_cast<Element*>(node->shadowAncestorNode());
 
-        String webWorksContext(DOMSupport::webWorksContext(element));
-        if (!webWorksContext.stripWhiteSpace().isEmpty()) {
-            context.setFlag(Platform::WebContext::IsWebWorksContext);
-            context.setWebWorksContext(webWorksContext);
-        }
-
         if (DOMSupport::isTextBasedContentEditableElement(element)) {
             if (!canStartSelection) {
                 // Input fields host node is by spec non-editable unless the field itself has content editable enabled.
@@ -2393,6 +2387,20 @@
     if (node->isFocusable())
         context.setFlag(Platform::WebContext::IsFocusable);
 
+    // Walk up the node tree looking for our custom webworks context attribute.
+    while (node) {
+        if (node->isElementNode()) {
+            Element* element = static_cast<Element*>(node->shadowAncestorNode());
+            String webWorksContext(DOMSupport::webWorksContext(element));
+            if (!webWorksContext.stripWhiteSpace().isEmpty()) {
+                context.setFlag(Platform::WebContext::IsWebWorksContext);
+                context.setWebWorksContext(webWorksContext);
+                break;
+            }
+        }
+        node = node->parentNode();
+    }
+
     return context;
 }
 

Modified: trunk/Source/WebKit/blackberry/ChangeLog (133096 => 133097)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-11-01 00:03:09 UTC (rev 133096)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-11-01 00:03:49 UTC (rev 133097)
@@ -1,3 +1,17 @@
+2012-10-31  Genevieve Mak  <[email protected]>
+
+        [BLACKBERRY] Custom WebWorks context menus don't always work.
+        https://bugs.webkit.org/show_bug.cgi?id=100891
+
+        Reviewed by Rob Buis.
+
+        Walk up the dom tree until we find the webworks attribute or run out
+        of parent nodes.
+        PR# 227732
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::webContext):
+
 2012-10-31  Otto Derek Cheung  <[email protected]>
 
         [BlackBerry] Adding window.external to our port
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to