Changeset 144547 in webkit


Ignore:
Timestamp:
Mar 2, 2013 4:08:44 PM (11 years ago)
Author:
benjamin@webkit.org
Message:

Move computedStyleIncludingVisitedInfo from TestRunner to Internals
https://bugs.webkit.org/show_bug.cgi?id=109772

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-03-02
Reviewed by Andreas Kling.

Source/WebCore:

The function computedStyleIncludingVisitedInfo() is purely internal to WebCore,
it is better defined on Internals than on TestRunner.

  • testing/Internals.cpp:

(WebCore::Internals::computedStyleIncludingVisitedInfo):

  • testing/Internals.h:
  • testing/Internals.idl:

Source/WebKit/blackberry:

  • WebKitSupport/DumpRenderTreeSupport.cpp:
  • WebKitSupport/DumpRenderTreeSupport.h:

(DumpRenderTreeSupport):

Source/WebKit/efl:

  • WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
  • WebCoreSupport/DumpRenderTreeSupportEfl.h:

Source/WebKit/gtk:

  • WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
  • WebCoreSupport/DumpRenderTreeSupportGtk.h:

(DumpRenderTreeSupportGtk):

Source/WebKit/mac:

  • WebView/WebView.mm:
  • WebView/WebViewPrivate.h:

Source/WebKit/qt:

  • WebCoreSupport/DumpRenderTreeSupportQt.cpp:
  • WebCoreSupport/DumpRenderTreeSupportQt.h:

Source/WebKit2:

  • WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
  • WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
  • WebProcess/WebPage/WebFrame.cpp:
  • WebProcess/WebPage/WebFrame.h:

(WebFrame):

Tools:

  • DumpRenderTree/TestRunner.cpp:

(TestRunner::staticFunctions):

  • DumpRenderTree/TestRunner.h:

(TestRunner):

  • DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
  • DumpRenderTree/efl/TestRunnerEfl.cpp:
  • DumpRenderTree/gtk/TestRunnerGtk.cpp:
  • DumpRenderTree/mac/TestRunnerMac.mm:
  • DumpRenderTree/qt/TestRunnerQt.cpp:
  • DumpRenderTree/qt/TestRunnerQt.h:

(TestRunner):

  • DumpRenderTree/win/TestRunnerWin.cpp:
  • DumpRenderTree/wx/TestRunnerWx.cpp:
  • WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
  • WebKitTestRunner/InjectedBundle/TestRunner.cpp:
  • WebKitTestRunner/InjectedBundle/TestRunner.h:

(TestRunner):

LayoutTests:

Update the tests.

  • fast/history/multiple-classes-visited.html:
  • fast/history/nested-visited-test.html:
  • fast/history/self-is-visited.html:
  • fast/history/sibling-visited-test.html:
  • fast/loader/stateobjects/state-url-sets-links-visited.html:
  • platform/win/TestExpectations: unskip the tests.
  • platform/chromium/TestExpectations:
Location:
trunk
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r144542 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        Update the tests.
     9
     10        * fast/history/multiple-classes-visited.html:
     11        * fast/history/nested-visited-test.html:
     12        * fast/history/self-is-visited.html:
     13        * fast/history/sibling-visited-test.html:
     14        * fast/loader/stateobjects/state-url-sets-links-visited.html:
     15        * platform/win/TestExpectations: unskip the tests.
     16        * platform/chromium/TestExpectations:
     17
    1182013-03-02  Rob Buis  <rbuis@rim.com>
    219
  • trunk/LayoutTests/fast/history/multiple-classes-visited.html

    r144152 r144547  
    1010function compareStyles()
    1111{
    12     if (window.testRunner) {
    13         firstStyle = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('one'));
    14         secondStyle = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('two'));
     12    if (window.internals) {
     13        firstStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('one'));
     14        secondStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('two'));
    1515        shouldBecomeEqual('firstStyle.color', 'secondStyle.color', finishJSTest);
    1616    }
  • trunk/LayoutTests/fast/history/nested-visited-test.html

    r144152 r144547  
    1616    document.getElementById('enclosure').appendChild(anchor);
    1717
    18     if (window.testRunner) {
    19         firstStyle = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('one'));
    20         secondStyle = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('two'));
     18    if (window.internals) {
     19        firstStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('one'));
     20        secondStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('two'));
    2121        shouldBecomeDifferent('firstStyle.color', 'secondStyle.color', finishJSTest);
    2222    }
  • trunk/LayoutTests/fast/history/self-is-visited.html

    r144152 r144547  
    1010function compareStyles()
    1111{
    12     if (window.testRunner) {
    13         firstStyle = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('one'));
    14         secondStyle = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('two'));
     12    if (window.internals) {
     13        firstStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('one'));
     14        secondStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('two'));
    1515        shouldBecomeDifferent('firstStyle.color', 'secondStyle.color', function() {
    1616            shouldBecomeDifferent('firstStyle.backgroundColor', 'secondStyle.backgroundColor', finishJSTest);
  • trunk/LayoutTests/fast/history/sibling-visited-test.html

    r144152 r144547  
    1010function compareStyles()
    1111{
    12     if (window.testRunner) {
    13         firstStyle = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('one'));
    14         secondStyle = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('two'));
     12    if (window.internals) {
     13        firstStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('one'));
     14        secondStyle = internals.computedStyleIncludingVisitedInfo(document.getElementById('two'));
    1515        shouldBecomeDifferent('firstStyle.color', 'secondStyle.color', finishJSTest);
    1616    }
  • trunk/LayoutTests/fast/loader/stateobjects/state-url-sets-links-visited.html

    r143860 r144547  
    1515    window.history.pushState(null, "Title", "pushedURL.html");
    1616
    17     if (window.testRunner) {
    18         style1 = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('link1'));
    19         style2 = testRunner.computedStyleIncludingVisitedInfo(document.getElementById('link2'));
     17    if (window.internals) {
     18        style1 = internals.computedStyleIncludingVisitedInfo(document.getElementById('link1'));
     19        style2 = internals.computedStyleIncludingVisitedInfo(document.getElementById('link2'));
    2020
    2121        // The style is not necessarily updated synchronously in response to history.replaceState and history.pushState.
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r144535 r144547  
    22022202webkit.org/b/37283 fast/overflow/scrollbar-restored-and-then-locked.html [ Failure ]
    22032203
    2204 webkit.org/b/37297 fast/history/nested-visited-test.html [ Failure Timeout ]
    2205 webkit.org/b/37297 fast/history/self-is-visited.html [ Failure Timeout ]
    2206 webkit.org/b/37297 fast/history/sibling-visited-test.html [ Failure Timeout ]
    2207 webkit.org/b/37297 fast/loader/stateobjects/state-url-sets-links-visited.html [ Failure Timeout ]
    2208 webkit.org/b/58000 [ Mac Android ] fast/history/visited-link-background-color.html [ Failure ]
    2209 
    2210 # Added in http://trac.webkit.org/changeset/57476. Fails in Chromium because
    2211 # LayoutTestController::computedStyleWithVisitedInfo() is missing.
    2212 crbug.com/41206 fast/history/multiple-classes-visited.html [ Failure Timeout ]
     2204# Chromium DumpRenderTree does not have support for visited links.
     2205# It always return false in response to isLinkVisited().
     2206webkit.org/b/111031 fast/history/multiple-classes-visited.html [ Failure ]
     2207webkit.org/b/111031 fast/history/nested-visited-test.html [ Failure ]
     2208webkit.org/b/111031 fast/history/self-is-visited.html [ Failure ]
     2209webkit.org/b/111031 fast/history/sibling-visited-test.html [ Failure ]
     2210webkit.org/b/111031 fast/loader/stateobjects/state-url-sets-links-visited.html [ Failure ]
     2211webkit.org/b/111031 [ Mac Android ] fast/history/visited-link-background-color.html [ Failure ]
    22132212
    22142213# Tests that work with KURL, but fail with GURL
  • trunk/LayoutTests/platform/win/TestExpectations

    r144516 r144547  
    924924# Need to add functionality to DumpRenderTree to handle error pages
    925925fast/history/back-forward-reset-after-error-handling.html
    926 
    927 # Need to implement computedStyleWithVisitedInfo
    928 fast/history/multiple-classes-visited.html
    929 fast/history/nested-visited-test.html
    930 fast/history/self-is-visited.html
    931 fast/history/sibling-visited-test.html
    932926
    933927# ACCELERATED_COMPOSITING tests that have incorrect layout
  • trunk/Source/WebCore/ChangeLog

    r144546 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        The function computedStyleIncludingVisitedInfo() is purely internal to WebCore,
     9        it is better defined on Internals than on TestRunner.
     10
     11        * testing/Internals.cpp:
     12        (WebCore::Internals::computedStyleIncludingVisitedInfo):
     13        * testing/Internals.h:
     14        * testing/Internals.idl:
     15
    1162013-03-02  David Kilzer  <ddkilzer@apple.com>
    217
  • trunk/Source/WebCore/testing/Internals.cpp

    r144524 r144547  
    11/*
    22 * Copyright (C) 2012 Google Inc. All rights reserved.
     3 * Copyright (C) 2013 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    660661}
    661662
     663PassRefPtr<CSSComputedStyleDeclaration> Internals::computedStyleIncludingVisitedInfo(Node* node, ExceptionCode& ec) const
     664{
     665    if (!node) {
     666        ec = INVALID_ACCESS_ERR;
     667        return 0;
     668    }
     669
     670    bool allowVisitedStyle = true;
     671    return CSSComputedStyleDeclaration::create(node, allowVisitedStyle);
     672}
     673
    662674Internals::ShadowRootIfShadowDOMEnabledOrNode* Internals::ensureShadowRoot(Element* host, ExceptionCode& ec)
    663675{
  • trunk/Source/WebCore/testing/Internals.h

    r144524 r144547  
    2828#define Internals_h
    2929
     30#include "CSSComputedStyleDeclaration.h"
    3031#include "ContextDestructionObserver.h"
    3132#include "ExceptionCodePlaceholder.h"
     
    7778
    7879    size_t numberOfScopedHTMLStyleChildren(const Node*, ExceptionCode&) const;
     80    PassRefPtr<CSSComputedStyleDeclaration> computedStyleIncludingVisitedInfo(Node*, ExceptionCode&) const;
    7981
    8082#if ENABLE(SHADOW_DOM)
  • trunk/Source/WebCore/testing/Internals.idl

    r144524 r144547  
    3535
    3636    unsigned long numberOfScopedHTMLStyleChildren(in Node scope) raises(DOMException);
     37    CSSStyleDeclaration computedStyleIncludingVisitedInfo(in Node node) raises(DOMException);
    3738
    3839#if defined(ENABLE_SHADOW_DOM) && ENABLE_SHADOW_DOM
  • trunk/Source/WebKit/blackberry/ChangeLog

    r144515 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebKitSupport/DumpRenderTreeSupport.cpp:
     9        * WebKitSupport/DumpRenderTreeSupport.h:
     10        (DumpRenderTreeSupport):
     11
    1122013-03-01  Iris Wu  <shuwu@rim.com>
    213
  • trunk/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp

    r144274 r144547  
    2121#include "DumpRenderTreeSupport.h"
    2222
    23 #include "CSSComputedStyleDeclaration.h"
    2423#include "DeviceOrientationClientMock.h"
    2524#include "DeviceOrientationController.h"
     
    123122}
    124123
    125 JSValueRef DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
    126 {
    127     ExecState* exec = toJS(context);
    128     JSLockHolder lock(exec);
    129     if (!value)
    130         return JSValueMakeUndefined(context);
    131     JSValue jsValue = toJS(exec, value);
    132     if (!jsValue.inherits(&JSElement::s_info))
    133         return JSValueMakeUndefined(context);
    134     JSElement* jsElement = static_cast<JSElement*>(asObject(jsValue));
    135     Element* element = jsElement->impl();
    136     RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element, true);
    137     return toRef(exec, toJS(exec, jsElement->globalObject(), style.get()));
    138 }
    139 
    140124#if ENABLE(DEVICE_ORIENTATION)
    141125DeviceOrientationClientMock* toDeviceOrientationClientMock(DeviceOrientationClient* client)
  • trunk/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.h

    r144274 r144547  
    5959    static void setMockDeviceOrientation(BlackBerry::WebKit::WebPage*, bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
    6060    static void scalePageBy(BlackBerry::WebKit::WebPage*, float, float, float);
    61     static JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
    6261
    6362private:
  • trunk/Source/WebKit/efl/ChangeLog

    r144530 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
     9        * WebCoreSupport/DumpRenderTreeSupportEfl.h:
     10
    1112013-02-28  Alexey Proskuryakov  <ap@apple.com>
    212
  • trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp

    r144530 r144547  
    3131#include <APICast.h>
    3232#include <AnimationController.h>
    33 #include <CSSComputedStyleDeclaration.h>
    3433#include <DocumentLoader.h>
    3534#include <EditorClientEfl.h>
     
    557556}
    558557
    559 JSValueRef DumpRenderTreeSupportEfl::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
    560 {
    561     if (!value)
    562         return JSValueMakeUndefined(context);
    563 
    564     JSC::ExecState* exec = toJS(context);
    565     JSC::JSValue jsValue = toJS(exec, value);
    566     if (!jsValue.inherits(&WebCore::JSElement::s_info))
    567         return JSValueMakeUndefined(context);
    568 
    569     WebCore::JSElement* jsElement = static_cast<WebCore::JSElement*>(asObject(jsValue));
    570     WebCore::Element* element = jsElement->impl();
    571     RefPtr<WebCore::CSSComputedStyleDeclaration> style = WebCore::CSSComputedStyleDeclaration::create(element, true);
    572     return toRef(exec, toJS(exec, jsElement->globalObject(), style.get()));
    573 }
    574 
    575558void DumpRenderTreeSupportEfl::setAuthorAndUserStylesEnabled(Evas_Object* ewkView, bool enabled)
    576559{
  • trunk/Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.h

    r144524 r144547  
    110110    static void setInteractiveFormValidationEnabled(Evas_Object* ewkView, bool enabled);
    111111    static void setValidationMessageTimerMagnification(Evas_Object* ewkView, int value);
    112     static JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
    113112    static void setAuthorAndUserStylesEnabled(Evas_Object* ewkView, bool);
    114113    static void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const String& scheme);
  • trunk/Source/WebKit/gtk/ChangeLog

    r144530 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
     9        * WebCoreSupport/DumpRenderTreeSupportGtk.h:
     10        (DumpRenderTreeSupportGtk):
     11
    1122013-02-28  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp

    r144524 r144547  
    2929#include "AnimationController.h"
    3030#include "ApplicationCacheStorage.h"
    31 #include "CSSComputedStyleDeclaration.h"
    3231#include "Chrome.h"
    3332#include "ChromeClientGtk.h"
     
    695694}
    696695
    697 JSValueRef DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef nodeObject)
    698 {
    699     JSC::ExecState* exec = toJS(context);
    700     if (!nodeObject)
    701         return JSValueMakeUndefined(context);
    702 
    703     JSValue jsValue = toJS(exec, nodeObject);
    704     if (!jsValue.inherits(&JSElement::s_info))
    705         return JSValueMakeUndefined(context);
    706 
    707     JSElement* jsElement = static_cast<JSElement*>(asObject(jsValue));
    708     Element* element = jsElement->impl();
    709     RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element, true);
    710     return toRef(exec, toJS(exec, jsElement->globalObject(), style.get()));
    711 }
    712 
    713696void DumpRenderTreeSupportGtk::deliverAllMutationsIfNecessary()
    714697{
  • trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h

    r144524 r144547  
    7171    static bool shouldClose(WebKitWebFrame*);
    7272    static bool elementDoesAutoCompleteForElementWithId(WebKitWebFrame*, JSStringRef);
    73     static JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
    7473
    7574    // WebKitWebView
  • trunk/Source/WebKit/mac/ChangeLog

    r144545 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebView/WebView.mm:
     9        * WebView/WebViewPrivate.h:
     10
    1112013-03-02  David Kilzer  <ddkilzer@apple.com>
    212
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r144495 r144547  
    117117#import <WebCore/MemoryCache.h>
    118118#import <WebCore/ColorMac.h>
    119 #import <WebCore/CSSComputedStyleDeclaration.h>
    120119#import <WebCore/Cursor.h>
    121120#import <WebCore/DatabaseManager.h>
     
    67096708@end
    67106709
    6711 @implementation WebView (WebViewPrivateStyleInfo)
    6712 
    6713 - (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value
    6714 {
    6715     ExecState* exec = toJS(context);
    6716     JSLockHolder lock(exec);
    6717     if (!value)
    6718         return JSValueMakeUndefined(context);
    6719     JSC::JSValue jsValue = toJS(exec, value);
    6720     if (!jsValue.inherits(&JSElement::s_info))
    6721         return JSValueMakeUndefined(context);
    6722     JSElement* jsElement = static_cast<JSElement*>(asObject(jsValue));
    6723     Element* element = jsElement->impl();
    6724     RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element, true);
    6725     return toRef(exec, toJS(exec, jsElement->globalObject(), style.get()));
    6726 }
    6727 
    6728 @end
    6729 
    67306710@implementation WebView (WebViewFullScreen)
    67316711
  • trunk/Source/WebKit/mac/WebView/WebViewPrivate.h

    r144495 r144547  
    748748@end
    749749
    750 @interface WebView (WebViewPrivateStyleInfo)
    751 - (JSValueRef)_computedStyleIncludingVisitedInfo:(JSContextRef)context forElement:(JSValueRef)value;
    752 @end
    753 
    754750@interface NSObject (WebViewFrameLoadDelegatePrivate)
    755751- (void)webView:(WebView *)sender didFirstLayoutInFrame:(WebFrame *)frame;
  • trunk/Source/WebKit/qt/ChangeLog

    r144530 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
     9        * WebCoreSupport/DumpRenderTreeSupportQt.h:
     10
    1112013-02-28  Alexey Proskuryakov  <ap@apple.com>
    212
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp

    r144524 r144547  
    2626#include "APICast.h"
    2727#include "ApplicationCacheStorage.h"
    28 #include "CSSComputedStyleDeclaration.h"
    2928#include "ChromeClientQt.h"
    3029#include "ContainerNode.h"
     
    376375}
    377376
    378 static QString convertToPropertyName(const QString& name)
    379 {
    380     QStringList parts = name.split(QLatin1Char('-'));
    381     QString camelCaseName;
    382     for (int j = 0; j < parts.count(); ++j) {
    383         QString part = parts.at(j);
    384         if (j)
    385             camelCaseName.append(part.replace(0, 1, part.left(1).toUpper()));
    386         else
    387             camelCaseName.append(part);
    388     }
    389     return camelCaseName;
    390 }
    391 
    392 QVariantMap DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(const QWebElement& element)
    393 {
    394     QVariantMap res;
    395 
    396     WebCore::Element* webElement = element.m_element;
    397     if (!webElement)
    398         return res;
    399 
    400     RefPtr<WebCore::CSSComputedStyleDeclaration> computedStyleDeclaration = CSSComputedStyleDeclaration::create(webElement, true);
    401     CSSStyleDeclaration* style = static_cast<WebCore::CSSStyleDeclaration*>(computedStyleDeclaration.get());
    402     for (unsigned i = 0; i < style->length(); i++) {
    403         QString name = style->item(i);
    404         QString value = style->getPropertyValue(name);
    405         res[convertToPropertyName(name)] = QVariant(value);
    406     }
    407     return res;
    408 }
    409 
    410377QVariantList DumpRenderTreeSupportQt::selectedRange(QWebPageAdapter *adapter)
    411378{
  • trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h

    r144524 r144547  
    139139    static void setMockGeolocationPositionUnavailableError(QWebPageAdapter*, const QString& message);
    140140    static int numberOfPendingGeolocationPermissionRequests(QWebPageAdapter*);
    141 
    142     static QVariantMap computedStyleIncludingVisitedInfo(const QWebElement&);
    143141
    144142    static void dumpFrameLoader(bool);
  • trunk/Source/WebKit2/ChangeLog

    r144530 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
     9        * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h:
     10        * WebProcess/WebPage/WebFrame.cpp:
     11        * WebProcess/WebPage/WebFrame.h:
     12        (WebFrame):
     13
    1142013-03-01  Kiran Muppala  <cmuppala@apple.com>
    215
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp

    r144530 r144547  
    124124}
    125125
    126 JSValueRef WKBundleFrameGetComputedStyleIncludingVisitedInfo(WKBundleFrameRef frameRef, JSObjectRef element)
    127 {
    128     return toImpl(frameRef)->computedStyleIncludingVisitedInfo(element);
    129 }
    130 
    131126WKStringRef WKBundleFrameCopyCounterValue(WKBundleFrameRef frameRef, JSObjectRef element)
    132127{
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h

    r144524 r144547  
    4040WK_EXPORT WKStringRef WKBundleFrameCopyInnerText(WKBundleFrameRef frame);
    4141WK_EXPORT WKStringRef WKBundleFrameCopyCounterValue(WKBundleFrameRef frame, JSObjectRef element);
    42 WK_EXPORT JSValueRef WKBundleFrameGetComputedStyleIncludingVisitedInfo(WKBundleFrameRef frame, JSObjectRef element);
    4342WK_EXPORT unsigned WKBundleFrameGetPendingUnloadCount(WKBundleFrameRef frame);
    4443WK_EXPORT WKStringRef WKBundleFrameCopyLayerTreeAsText(WKBundleFrameRef frame);
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp

    r144524 r144547  
    4444#include <JavaScriptCore/JSValueRef.h>
    4545#include <WebCore/ArchiveResource.h>
    46 #include <WebCore/CSSComputedStyleDeclaration.h>
    4746#include <WebCore/Chrome.h>
    4847#include <WebCore/DocumentLoader.h>
     
    622621}
    623622
    624 JSValueRef WebFrame::computedStyleIncludingVisitedInfo(JSObjectRef element)
    625 {
    626     if (!m_coreFrame)
    627         return 0;
    628 
    629     JSDOMWindow* globalObject = m_coreFrame->script()->globalObject(mainThreadNormalWorld());
    630     ExecState* exec = globalObject->globalExec();
    631 
    632     if (!toJS(element)->inherits(&JSElement::s_info))
    633         return JSValueMakeUndefined(toRef(exec));
    634 
    635     RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(static_cast<JSElement*>(toJS(element))->impl(), true);
    636 
    637     JSLockHolder lock(exec);
    638     return toRef(exec, toJS(exec, globalObject, style.get()));
    639 }
    640 
    641623String WebFrame::counterValue(JSObjectRef element)
    642624{
  • trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.h

    r144524 r144547  
    9393    WebFrame* parentFrame() const;
    9494    PassRefPtr<ImmutableArray> childFrames();
    95     JSValueRef computedStyleIncludingVisitedInfo(JSObjectRef element);
    9695    JSGlobalContextRef jsContext();
    9796    JSGlobalContextRef jsContextForWorld(InjectedBundleScriptWorld*);
  • trunk/Source/autotools/symbols.filter

    r144524 r144547  
    3838_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ShadowRootE;
    3939_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_14ClientRectListE;
     40_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_19CSSStyleDeclarationE;
    4041_ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_5RangeE;
    4142_ZN7WebCore5Range6createEN3WTF10PassRefPtrINS_8DocumentEEENS2_INS_4NodeEEEiS6_i;
     
    109110_ZN7WebCore25computeViewportAttributesENS_17ViewportArgumentsEiiifNS_7IntSizeE;
    110111_ZN7WebCore25jsStringWithCacheSlowCaseEPN3JSC9ExecStateERN3WTF7HashMapIPNS3_10StringImplENS0_4WeakINS0_8JSStringEEENS3_7PtrHashIS6_EENS3_10HashTraitsIS6_EENSC_IS9_EEEES6_;
     112_ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS1_6StringE;
    111113_ZN7WebCore28InspectorFrontendClientLocal12moveWindowByEff;
    112114_ZN7WebCore28InspectorFrontendClientLocal12openInNewTabERKN3WTF6StringE;
  • trunk/Tools/ChangeLog

    r144527 r144547  
     12013-03-02  Benjamin Poulain  <bpoulain@apple.com>
     2
     3        Move computedStyleIncludingVisitedInfo from TestRunner to Internals
     4        https://bugs.webkit.org/show_bug.cgi?id=109772
     5
     6        Reviewed by Andreas Kling.
     7
     8        * DumpRenderTree/TestRunner.cpp:
     9        (TestRunner::staticFunctions):
     10        * DumpRenderTree/TestRunner.h:
     11        (TestRunner):
     12        * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
     13        * DumpRenderTree/efl/TestRunnerEfl.cpp:
     14        * DumpRenderTree/gtk/TestRunnerGtk.cpp:
     15        * DumpRenderTree/mac/TestRunnerMac.mm:
     16        * DumpRenderTree/qt/TestRunnerQt.cpp:
     17        * DumpRenderTree/qt/TestRunnerQt.h:
     18        (TestRunner):
     19        * DumpRenderTree/win/TestRunnerWin.cpp:
     20        * DumpRenderTree/wx/TestRunnerWx.cpp:
     21        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
     22        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
     23        * WebKitTestRunner/InjectedBundle/TestRunner.h:
     24        (TestRunner):
     25
    1262013-03-01  Ilya Tikhonovsky  <loislo@chromium.org>
    227
  • trunk/Tools/DumpRenderTree/TestRunner.cpp

    r144524 r144547  
    681681}
    682682
    683 static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    684 {
    685     if (argumentCount != 1)
    686         return JSValueMakeUndefined(context);
    687    
    688     // Has mac implementation
    689     TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
    690     return controller->computedStyleIncludingVisitedInfo(context, arguments[0]);
    691 }
    692 
    693683static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    694684{
     
    20712061        { "clearPersistentUserStyleSheet", clearPersistentUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    20722062        { "closeWebInspector", closeWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    2073         { "computedStyleIncludingVisitedInfo", computedStyleIncludingVisitedInfoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    20742063        { "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
    20752064        { "disallowIncreaseForApplicationCacheQuota", disallowIncreaseForApplicationCacheQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
  • trunk/Tools/DumpRenderTree/TestRunner.h

    r144524 r144547  
    6767    bool isCommandEnabled(JSStringRef name);
    6868    void keepWebHistory();
    69     JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
    7069    void notifyDone();
    7170    int numberOfPendingGeolocationPermissionRequests();
  • trunk/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp

    r144524 r144547  
    506506}
    507507
    508 JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
    509 {
    510     return DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(context, value);
    511 }
    512 
    513508void TestRunner::setPluginsEnabled(bool flag)
    514509{
  • trunk/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp

    r144524 r144547  
    113113}
    114114
    115 JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
    116 {
    117     return DumpRenderTreeSupportEfl::computedStyleIncludingVisitedInfo(context, value);
    118 }
    119 
    120115size_t TestRunner::webHistoryItemCount()
    121116{
  • trunk/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp

    r144524 r144547  
    107107{
    108108    // FIXME: implement
    109 }
    110 
    111 JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
    112 {
    113     return DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo(context, value);
    114109}
    115110
  • trunk/Tools/DumpRenderTree/mac/TestRunnerMac.mm

    r144524 r144547  
    274274}
    275275
    276 JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
    277 {   
    278     return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value];
    279 }
    280 
    281276int TestRunner::numberOfPendingGeolocationPermissionRequests()
    282277{
  • trunk/Tools/DumpRenderTree/qt/TestRunnerQt.cpp

    r144524 r144547  
    746746}
    747747
    748 QVariantMap TestRunnerQt::computedStyleIncludingVisitedInfo(const QWebElement& element) const
    749 {
    750     return DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(element);
    751 }
    752 
    753748bool TestRunnerQt::elementDoesAutoCompleteForElementWithId(const QString& elementId)
    754749{
  • trunk/Tools/DumpRenderTree/qt/TestRunnerQt.h

    r144524 r144547  
    248248    void setScrollbarPolicy(const QString& orientation, const QString& policy);
    249249
    250     QVariantMap computedStyleIncludingVisitedInfo(const QWebElement&) const;
    251 
    252250    // Simulate a request an embedding application could make, populating per-session credential storage.
    253251    void authenticateSession(const QString& url, const QString& username, const QString& password);
  • trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp

    r144524 r144547  
    161161}
    162162
    163 JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
    164 {
    165     // FIXME: Implement this.
    166     return JSValueMakeUndefined(context);
    167 }
    168 
    169163void TestRunner::waitForPolicyDelegate()
    170164{
  • trunk/Tools/DumpRenderTree/wx/TestRunnerWx.cpp

    r144524 r144547  
    459459}
    460460
    461 JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef)
    462 {
    463     return 0;
    464 }
    465 
    466461void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
    467462{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl

    r144524 r144547  
    7575    // Special DOM functions.
    7676    void clearBackForwardList();
    77     object computedStyleIncludingVisitedInfo(in object element);
    7877    void execCommand(in DOMString name, in DOMString argument);
    7978    boolean isCommandEnabled(in DOMString name);
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp

    r144524 r144547  
    191191}
    192192
    193 JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSValueRef element)
    194 {
    195     // FIXME: Is it OK this works only for the main frame?
    196     WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
    197     JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
    198     if (!JSValueIsObject(context, element))
    199         return JSValueMakeUndefined(context);
    200     JSValueRef value = WKBundleFrameGetComputedStyleIncludingVisitedInfo(mainFrame, const_cast<JSObjectRef>(element));
    201     if (!value)
    202         return JSValueMakeUndefined(context);
    203     return value;
    204 }
    205 
    206193void TestRunner::execCommand(JSStringRef name, JSStringRef argument)
    207194{
  • trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

    r144524 r144547  
    118118
    119119    // Special DOM functions.
    120     JSValueRef computedStyleIncludingVisitedInfo(JSValueRef element);
    121120    void clearBackForwardList();
    122121    void execCommand(JSStringRef name, JSStringRef argument);
Note: See TracChangeset for help on using the changeset viewer.