Title: [110960] trunk
Revision
110960
Author
commit-qu...@webkit.org
Date
2012-03-16 01:00:22 -0700 (Fri, 16 Mar 2012)

Log Message

[Gtk] Add computedStyleIncludingVisitedInfo to DumpRenderTreeSupport
https://bugs.webkit.org/show_bug.cgi?id=81232

Patch by Zan Dobersek <zandober...@gmail.com> on 2012-03-16
Reviewed by Philippe Normand.

Source/WebKit/gtk:

Add computedStyleIncludingVisitedInfo helper method to
DumpRenderTreeSupportGtk.

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo):
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
(DumpRenderTreeSupportGtk):

Tools:

Use the newly-added helper method in DumpRenderTreeSupportGtk.

* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::computedStyleIncludingVisitedInfo):

LayoutTests:

Unskip now-passing tests.

* platform/gtk/Skipped:
* platform/gtk/fast/history/nested-visited-test-expected.txt: Removed.
* platform/gtk/fast/history/self-is-visited-expected.txt: Removed.
* platform/gtk/fast/history/sibling-visited-test-expected.txt: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (110959 => 110960)


--- trunk/LayoutTests/ChangeLog	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/LayoutTests/ChangeLog	2012-03-16 08:00:22 UTC (rev 110960)
@@ -1,5 +1,19 @@
 2012-03-16  Zan Dobersek  <zandober...@gmail.com>
 
+        [Gtk] Add computedStyleIncludingVisitedInfo to DumpRenderTreeSupport
+        https://bugs.webkit.org/show_bug.cgi?id=81232
+
+        Reviewed by Philippe Normand.
+
+        Unskip now-passing tests.
+
+        * platform/gtk/Skipped:
+        * platform/gtk/fast/history/nested-visited-test-expected.txt: Removed.
+        * platform/gtk/fast/history/self-is-visited-expected.txt: Removed.
+        * platform/gtk/fast/history/sibling-visited-test-expected.txt: Removed.
+
+2012-03-16  Zan Dobersek  <zandober...@gmail.com>
+
         [Gtk] Properly set forms tests-specific settings
         https://bugs.webkit.org/show_bug.cgi?id=81237
 

Modified: trunk/LayoutTests/platform/gtk/Skipped (110959 => 110960)


--- trunk/LayoutTests/platform/gtk/Skipped	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/LayoutTests/platform/gtk/Skipped	2012-03-16 08:00:22 UTC (rev 110960)
@@ -1138,14 +1138,6 @@
 # https://bugs.webkit.org/show_bug.cgi?id=49179
 animations/stop-animation-on-suspend.html
 
-# computedStyleIncludingVisitedInfo is not implemented
-# https://bugs.webkit.org/show_bug.cgi?id=37336
-fast/history/nested-visited-test.html
-fast/history/self-is-visited.html
-fast/history/sibling-visited-test.html
-fast/history/multiple-classes-visited.html
-fast/loader/stateobjects/state-url-sets-links-visited.html
-
 # Rounding color problems inside pixman
 # https://bugs.webkit.org/show_bug.cgi?id=49964
 fast/canvas/canvas-getImageData.html

Deleted: trunk/LayoutTests/platform/gtk/fast/history/nested-visited-test-expected.txt (110959 => 110960)


--- trunk/LayoutTests/platform/gtk/fast/history/nested-visited-test-expected.txt	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/LayoutTests/platform/gtk/fast/history/nested-visited-test-expected.txt	2012-03-16 08:00:22 UTC (rev 110960)
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 20: TypeError: Result of _expression_ 'firstStyle' [undefined] is not an object.
-These two links should be different colors (green and orange):
-
-One Two
-
-PASS

Deleted: trunk/LayoutTests/platform/gtk/fast/history/self-is-visited-expected.txt (110959 => 110960)


--- trunk/LayoutTests/platform/gtk/fast/history/self-is-visited-expected.txt	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/LayoutTests/platform/gtk/fast/history/self-is-visited-expected.txt	2012-03-16 08:00:22 UTC (rev 110960)
@@ -1,5 +0,0 @@
-CONSOLE MESSAGE: line 14: TypeError: Result of _expression_ 'firstStyle' [undefined] is not an object.
-These two links should be different colors (green and orange):
-
-One Two
-PASS

Deleted: trunk/LayoutTests/platform/gtk/fast/history/sibling-visited-test-expected.txt (110959 => 110960)


--- trunk/LayoutTests/platform/gtk/fast/history/sibling-visited-test-expected.txt	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/LayoutTests/platform/gtk/fast/history/sibling-visited-test-expected.txt	2012-03-16 08:00:22 UTC (rev 110960)
@@ -1,6 +0,0 @@
-CONSOLE MESSAGE: line 14: TypeError: Result of _expression_ 'firstStyle' [undefined] is not an object.
-These two links should be different colors (green and orange):
-
-One Two
-
-PASS

Modified: trunk/Source/WebKit/gtk/ChangeLog (110959 => 110960)


--- trunk/Source/WebKit/gtk/ChangeLog	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/Source/WebKit/gtk/ChangeLog	2012-03-16 08:00:22 UTC (rev 110960)
@@ -1,5 +1,20 @@
 2012-03-16  Zan Dobersek  <zandober...@gmail.com>
 
+        [Gtk] Add computedStyleIncludingVisitedInfo to DumpRenderTreeSupport
+        https://bugs.webkit.org/show_bug.cgi?id=81232
+
+        Reviewed by Philippe Normand.
+
+        Add computedStyleIncludingVisitedInfo helper method to
+        DumpRenderTreeSupportGtk.
+
+        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+        (DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo):
+        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+        (DumpRenderTreeSupportGtk):
+
+2012-03-16  Zan Dobersek  <zandober...@gmail.com>
+
         [Gtk] Properly set forms tests-specific settings
         https://bugs.webkit.org/show_bug.cgi?id=81237
 

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp (110959 => 110960)


--- trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp	2012-03-16 08:00:22 UTC (rev 110960)
@@ -26,6 +26,7 @@
 #include "AXObjectCache.h"
 #include "AccessibilityObject.h"
 #include "AnimationController.h"
+#include "CSSComputedStyleDeclaration.h"
 #include "DOMWrapperWorld.h"
 #include "Document.h"
 #include "EditorClientGtk.h"
@@ -41,6 +42,7 @@
 #include "GeolocationPosition.h"
 #include "GraphicsContext.h"
 #include "HTMLInputElement.h"
+#include "JSCSSStyleDeclaration.h"
 #include "JSDOMWindow.h"
 #include "JSDocument.h"
 #include "JSElement.h"
@@ -888,6 +890,22 @@
     return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete();
 }
 
+JSValueRef DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef nodeObject)
+{
+    JSC::ExecState* exec = toJS(context);
+    if (!nodeObject)
+        return JSValueMakeUndefined(context);
+
+    JSValue jsValue = toJS(exec, nodeObject);
+    if (!jsValue.inherits(&JSElement::s_info))
+        return JSValueMakeUndefined(context);
+
+    JSElement* jsElement = static_cast<JSElement*>(asObject(jsValue));
+    Element* element = jsElement->impl();
+    RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element, true);
+    return toRef(exec, toJS(exec, jsElement->globalObject(), style.get()));
+}
+
 void DumpRenderTreeSupportGtk::deliverAllMutationsIfNecessary()
 {
 #if ENABLE(MUTATION_OBSERVERS)

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h (110959 => 110960)


--- trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h	2012-03-16 08:00:22 UTC (rev 110960)
@@ -83,6 +83,7 @@
     static void setValueForUser(JSContextRef, JSValueRef, JSStringRef);
     static bool shouldClose(WebKitWebFrame*);
     static bool elementDoesAutoCompleteForElementWithId(WebKitWebFrame*, JSStringRef);
+    static JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
 
     // WebKitWebView
     static void executeCoreCommandByName(WebKitWebView*, const gchar* name, const gchar* value);

Modified: trunk/Tools/ChangeLog (110959 => 110960)


--- trunk/Tools/ChangeLog	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/Tools/ChangeLog	2012-03-16 08:00:22 UTC (rev 110960)
@@ -1,3 +1,15 @@
+2012-03-16  Zan Dobersek  <zandober...@gmail.com>
+
+        [Gtk] Add computedStyleIncludingVisitedInfo to DumpRenderTreeSupport
+        https://bugs.webkit.org/show_bug.cgi?id=81232
+
+        Reviewed by Philippe Normand.
+
+        Use the newly-added helper method in DumpRenderTreeSupportGtk.
+
+        * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+        (LayoutTestController::computedStyleIncludingVisitedInfo):
+
 2012-03-15  Eric Seidel  <e...@webkit.org>
 
         Move parse_bug_id into config/urls in preparation for re-use elsewhere.

Modified: trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp (110959 => 110960)


--- trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp	2012-03-16 07:57:34 UTC (rev 110959)
+++ trunk/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp	2012-03-16 08:00:22 UTC (rev 110960)
@@ -120,8 +120,7 @@
 
 JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
 {
-    // FIXME: Implement this.
-    return JSValueMakeUndefined(context);
+    return DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo(context, value);
 }
 
 JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to