Move CSSRule specific virtuals from StyleBase down into CSSRule.
https://bugs.webkit.org/show_bug.cgi?id=70240

Reviewed by Darin Adler.

Move all the isFooRule() virtuals except isImportRule() to CSSRule
since they only make sense for its subclasses. isRule() remains in
StyleBase since we still need it for the parent chain traversal.
isImportRule() remains because XSLImportRule implements it.

Also moved insertedIntoParent() and removed its usage in
XSLStyleSheet since it is only reimplemented by CSSImportRule.

* css/CSSRule.h:
(WebCore::CSSRule::isCharsetRule):
(WebCore::CSSRule::isFontFaceRule):
(WebCore::CSSRule::isKeyframeRule):
(WebCore::CSSRule::isKeyframesRule):
(WebCore::CSSRule::isMediaRule):
(WebCore::CSSRule::isPageRule):
(WebCore::CSSRule::isStyleRule):
(WebCore::CSSRule::isRegionStyleRule):
(WebCore::CSSRule::insertedIntoParent):
* css/StyleBase.h:
(WebCore::StyleBase::isImportRule):
(WebCore::StyleBase::isCSSStyleSheet):
* xml/XSLStyleSheet.h:
(WebCore::XSLStyleSheet::append):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-07  Andrey Kosyakov  <caseq@chromium.org>

        [Chromium] suppress console output from DevTools window
        https://bugs.webkit.org/show_bug.cgi?id=69632

        Reviewed by Pavel Feldman.

        * DumpRenderTree/chromium/TestShell.cpp:
        (TestShell::showDevTools):
        * DumpRenderTree/chromium/WebViewHost.cpp:
        (WebViewHost::didAddMessageToConsole):
        (WebViewHost::reset):
        (WebViewHost::setLogConsoleOutput):
        * DumpRenderTree/chromium/WebViewHost.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Send mouse move events when we handle HoverEnter/Leave in QDesktopWebView
https://bugs.webkit.org/show_bug.cgi?id=70297

Reviewed by Simon Hausmann.

Qt treat the first and last hover movements as special HoverMove and HoverLeave events, but
WebKit doesn't make the difference, so we need to create move events for them.

While HoverEnter is in practice equivalent to HoverMove, the HoverLeave event is a bit
different because we want to emulate that the mouse is not only leaving the current node, but
completely leaving the whole document. The way to do this is to manufacture a move event with
a very far position, and was inspired by WebView::handleMouseEvent() in
Source/WebKit/win/WebView.cpp.

This patch fixes DesktopWebViewLinkHovered QML tests.

* UIProcess/qt/qdesktopwebpageproxy.cpp:
(QDesktopWebPageProxy::handleEvent):
(QDesktopWebPageProxy::handleHoverLeaveEvent):
* UIProcess/qt/qdesktopwebpageproxy.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r97248): :visited as descendant selector broken
https://bugs.webkit.org/show_bug.cgi?id=70122

Source/WebCore: 

Reviewed by Nikolas Zimmerman.
        
Make ":visited foo" and similar selectors work correctly again. They can affect 
the visited style of an element inside a visited link.

Test: fast/selectors/visited-descendant.html

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyDeclarations): 
        
    Apply visited style to children of visited links too.
            
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkSelector): 
        
    Don't disable visited matching until we run into first ancestor link or use combinator other than child/descendant.

(WebCore::SelectorChecker::determineLinkMatchType):
        
    Look into child/descendant component selectors too to determine the link match type.

LayoutTests: 

Reviewed by Nikolas Zimmerman.

* fast/selectors/visited-descendant.html: Added.
* platform/mac/fast/selectors/visited-descendant-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97745 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] Support for client-based geolocation
https://bugs.webkit.org/show_bug.cgi?id=64970

Patch by Zan Dobersek <zandobersek@gmail.com> on 2011-10-18
Reviewed by Martin Robinson.

.:

Remove flag for enabling client-based geolocation since
it is used by default on Gtk port and hence not configurable.

* configure.ac:

Source/WebCore:

Add feature defines for client-based geolocation when geolocation is enabled,
since this is the providing method that is now used by default. Remove
service-based providing method completely as it is not needed anymore.

* GNUmakefile.am: Add feature defines for client-based geolocation.
* GNUmakefile.list.am: Remove GeolocationServiceGtk.* files from compilation.
* platform/gtk/GeolocationServiceGtk.cpp: Removed.
* platform/gtk/GeolocationServiceGtk.h: Removed.

Source/WebKit/gtk:

Add DumpRenderTree support functions for client-based geolocation tests
and implement GeolocationClientGtk. The implementation is based on Zecke's
implementation of GeolocationService class in WebCore, which is now redundant
and subsequently removed.

* GNUmakefile.am: Add GeolocationClientGtk.* files to compilation.
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp: Add support functions to operate
with GeolocationClientMock.
(DumpRenderTreeSupportGtk::resetGeolocationClientMock):
(DumpRenderTreeSupportGtk::setMockGeolocationPermission):
(DumpRenderTreeSupportGtk::setMockGeolocationPosition):
(DumpRenderTreeSupportGtk::setMockGeolocationError):
(DumpRenderTreeSupportGtk::numberOfPendingGeolocationPermissionRequests):
* WebCoreSupport/DumpRenderTreeSupportGtk.h:
* WebCoreSupport/GeolocationClientGtk.cpp: Added.
(WebKit::getPositionCallback):
(WebKit::positionChangedCallback):
(WebKit::GeolocationClient::GeolocationClient):
(WebKit::GeolocationClient::geolocationDestroyed):
(WebKit::GeolocationClient::startUpdating):
(WebKit::GeolocationClient::stopUpdating):
(WebKit::GeolocationClient::setEnableHighAccuracy):
(WebKit::GeolocationClient::lastPosition):
(WebKit::GeolocationClient::requestPermission):
(WebKit::GeolocationClient::cancelPermissionRequest):
(WebKit::GeolocationClient::positionChanged):
(WebKit::GeolocationClient::updatePosition):
(WebKit::GeolocationClient::errorOccured):
* WebCoreSupport/GeolocationClientGtk.h: Added.
* webkit/webkitwebview.cpp:
(webkit_web_view_init): Use GeolocationClientMock as geolocation client
when running in DumpRenderTree.

Tools:

Add support for testing client-based geolocation tests in DumpRenderTree.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues): Reset GeolocationClientMock.
(createWebView): Create web view after declaring DumpRenderTree mode.
That way a mock client for geolocation is used instead of a GeoClue
client if a web view is created when testing.
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Implement functions for
geolocation layout tests.
(LayoutTestController::setMockGeolocationPosition):
(LayoutTestController::setMockGeolocationError):
(LayoutTestController::setGeolocationPermission):
(LayoutTestController::numberOfPendingGeolocationPermissionRequests):
* Scripts/build-webkit: Note that the Gtk port is using client-based
geolocation, even though changing this flag has no effect on compilation.

LayoutTests:

Unskip geolocation tests that now pass.

* platform/gtk/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Some QML tests were accidentally committed.
https://bugs.webkit.org/show_bug.cgi?id=70321

Reviewed by Andreas Kling.

These tests were committed by accident. They should not be there.

* UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_preferences.qml:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix linkHoveredDoesntEmitRepeated test in the bot
https://bugs.webkit.org/show_bug.cgi?id=70329

Reviewed by Andreas Kling.

Use LoadSpy::wait() instead of the TestCase::tryCompare(). They should be equivalent,
but I'm getting strange results with tryCompare(). This commit also adds an extra check
to make sure the hovered link is the correct one.

* UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_linkHovered.qml:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Remove const modifier from ctx_menu functions.
https://bugs.webkit.org/show_bug.cgi?id=70090

Patch by Grzegorz Czajkowski <g.czajkowski@samsung.com> on 2011-10-18
Reviewed by Andreas Kling.

Functions ewk_context_menu_show and ewk_context_menu_custom_get
have got const modifer to ensure that Ewk_Context_Menu won't be
changed. The methods emit events through
evas_object_smart_callback_call with Ewk_Context_Menu as parameter
which is converted to void *. In this case an application which
receives those events may change Ewk_Context_Menu.

Additionaly the name of ewk_context_menu_custom_get has been changed
to ewk_context_menu_customize because an application is able to
modify the items of context menu.

* ewk/ewk_contextmenu.cpp:
(ewk_context_menu_customize):
(ewk_context_menu_show):
* ewk/ewk_private.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Qt rebaseline after r97738.

* platform/qt/fast/dom/Window/window-properties-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
XSLStyleSheet only needs to manage XSLImportRule children.
https://bugs.webkit.org/show_bug.cgi?id=70326

Reviewed by Antti Koivisto.

* css/StyleBase.h:
* xml/XSLImportRule.h:
* css/CSSRule.h:
(WebCore::CSSRule::isImportRule):

    Move StyleBase::isImportRule() down to CSSRule. Since XSLImportRule no longer
    implements it, it's now specific to CSSImportRule.

* xml/XSLStyleSheet.h:

    Change m_children to be a vector of XSLImportRules. Also remove length(),
    item() and append() since they were only used internally to modify m_children.

* xml/XSLStyleSheetQt.cpp:
(WebCore::XSLStyleSheet::~XSLStyleSheet):
* xml/XSLStyleSheetLibxslt.cpp:
(WebCore::XSLStyleSheet::~XSLStyleSheet):
(WebCore::XSLStyleSheet::isLoading):
(WebCore::XSLStyleSheet::clearDocuments):
(WebCore::XSLStyleSheet::loadChildSheet):
(WebCore::XSLStyleSheet::locateStylesheetSubResource):

    Remove now-unnecessary isImportRule() checks and tidy up the code a bit.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaList: Remove inheritance from StyleBase.
https://bugs.webkit.org/show_bug.cgi?id=70203

Reviewed by Darin Adler.

* css/MediaList.h:
(WebCore::MediaList::parentStyleSheet):
(WebCore::MediaList::setParentStyleSheet):
* css/MediaList.cpp:
(WebCore::MediaList::MediaList):
(WebCore::MediaList::notifyChanged):

    Change MediaList to no longer inherit from StyleBase. The parent()/setParent()
    mechanism was replaced by explicit parentStyleSheet()/setParentStyleSheet().

* css/CSSImportRule.cpp:
(WebCore::CSSImportRule::CSSImportRule):
(WebCore::CSSImportRule::~CSSImportRule):
* css/CSSMediaRule.cpp:
(WebCore::CSSMediaRule::CSSMediaRule):
(WebCore::CSSMediaRule::~CSSMediaRule):

    Change StyleBase::setParent() calls to MediaList::setParentStyleSheet().
    CSSRules are never moved between stylesheets, so the parent style sheet pointer
    is valid for the MediaList's lifetime.

* css/StyleSheet.cpp:
(WebCore::StyleSheet::~StyleSheet):

    Change StyleBase::setParent() calls to MediaList::setParentStyleSheet().

(WebCore::StyleSheet::setMedia):

    Change StyleBase::setParent() calls to MediaList::setParentStyleSheet().
    Assert that the parent sheet is either null, or this, as MediaLists should never
    be reparented to other sheets.
    Assert that the StyleSheet is indeed a CSSStyleSheet.  XSLStyleSheet inherits from
    StyleSheet, but it shouldn't be using the MediaList.

* bindings/js/JSDOMBinding.h:
(WebCore::root):

    Add MediaList* specific overload for root() since it can't fall back
    to root(StyleBase*) anymore.

* WebCore.xcodeproj/project.pbxproj:

    Add some PrivateHeaders to accomodate the JSDOMBinding.h changes.

* css/CSSMediaRule.h:

    Remove unnecessary forward-declaration of MediaList.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: buttons of number type <input> controls are not fully accessible
https://bugs.webkit.org/show_bug.cgi?id=70241

Expose the spin button object to the AX hierarchy. Since there is no distinct
render object that backs this object, a mock object needs to be created for the entire
spin button and the actual increment and decrement buttons inside.

This will be a staged commit since the first time around Windows layout tests started crashing for an undeterminable reason.

Reviewed by Darin Adler.

* html/shadow/TextControlInnerElements.cpp:
(WebCore::SpinButtonElement::step):
(WebCore::SpinButtonElement::repeatingTimerFired):
* html/shadow/TextControlInnerElements.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix distcheck.

Patch by Gustavo Noronha Silva <gns@gnome.org> on 2011-10-18

Source/JavaScriptCore
* GNUmakefile.list.am: fix a typo and add a missing header to the
list.

Source/WebKit/gtk/po
* GNUmakefile.am: create po directory when it's not there yet both
when updating the pot and the po files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: buttons of number type <input> controls are not fully accessible
https://bugs.webkit.org/show_bug.cgi?id=70241

../WebCore: 

Phase 2 of the staged commit.

Reviewed by Darin Adler.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::boundingBoxForQuads):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isSpinButton):
(WebCore::AccessibilityObject::isSpinButtonPart):
(WebCore::AccessibilityObject::isMockObject):

../WebKit/chromium: 

Reviewed by Darin Adler.

* public/WebAccessibilityRole.h:
* src/AssertMatchingEnums.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: buttons of number type <input> controls are not fully accessible
https://bugs.webkit.org/show_bug.cgi?id=70241

Staged commit part 3. Committing the new spin button classes.

Reviewed by Darin Adler.

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AccessibilitySpinButton.cpp: Added.
(WebCore::AccessibilitySpinButton::create):
(WebCore::AccessibilitySpinButton::AccessibilitySpinButton):
(WebCore::AccessibilitySpinButton::~AccessibilitySpinButton):
(WebCore::AccessibilitySpinButton::incrementButton):
(WebCore::AccessibilitySpinButton::decrementButton):
(WebCore::AccessibilitySpinButton::elementRect):
(WebCore::AccessibilitySpinButton::addChildren):
(WebCore::AccessibilitySpinButton::step):
(WebCore::AccessibilitySpinButtonPart::AccessibilitySpinButtonPart):
(WebCore::AccessibilitySpinButtonPart::create):
(WebCore::AccessibilitySpinButtonPart::elementRect):
(WebCore::AccessibilitySpinButtonPart::press):
* accessibility/AccessibilitySpinButton.h: Added.
(WebCore::AccessibilitySpinButton::setSpinButtonElement):
(WebCore::AccessibilitySpinButton::roleValue):
(WebCore::AccessibilitySpinButton::accessibilityIsIgnored):
(WebCore::AccessibilitySpinButton::isSpinButton):
(WebCore::AccessibilitySpinButtonPart::~AccessibilitySpinButtonPart):
(WebCore::AccessibilitySpinButtonPart::isIncrementor):
(WebCore::AccessibilitySpinButtonPart::setIsIncrementor):
(WebCore::AccessibilitySpinButtonPart::roleValue):
(WebCore::AccessibilitySpinButtonPart::isSpinButtonPart):
(WebCore::AccessibilitySpinButtonPart::accessibilityIsIgnored):
(WebCore::toAccessibilitySpinButton):
(WebCore::toAccessibilitySpinButtonPart):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97756 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: buttons of number type <input> controls are not fully accessible
https://bugs.webkit.org/show_bug.cgi?id=70241

Staged commit part 4.

Reviewed by Darin Adler.

* accessibility/AccessibilityMockObject.h:
(WebCore::AccessibilityMockObject::isMockObject):
(WebCore::AccessibilityMockObject::detachFromParent):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::elementAccessibilityHitTest):
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(-[WebAccessibilityObjectWrapper accessibilityActionNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move default stylesheet loading to a separate function
https://bugs.webkit.org/show_bug.cgi?id=70331

Reviewed by Andreas Kling.
        
- Move default stylesheet loading out from CSSStyleSelector::styleForElement()
- Rename e -> element
- Remove pointless reffing of the placeholder style.

* css/CSSStyleSelector.cpp:
(WebCore::ensureDefaultStyleSheetsForElement):
(WebCore::isAtShadowBoundary):
(WebCore::CSSStyleSelector::styleForElement):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: buttons of number type <input> controls are not fully accessible
https://bugs.webkit.org/show_bug.cgi?id=70241

Staged commit, part 5.

Reviewed by Darin Adler.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::getOrCreate):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::boundingBoxRect):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] ASSERT when displaying context menu in input field
https://bugs.webkit.org/show_bug.cgi?id=69859

Patch by Dinu Jacob <dinu.jacob@nokia.com> on 2011-10-18
Reviewed by Simon Hausmann.

When creating a submenu in the context menu, the submenu of type
QWidget is statically cast to QObject before calling setParent on
it. QObject::setParent asserts if the object is a QWidget. So, call
setParent of QWidget itself.

* UIProcess/qt/WebContextMenuProxyQt.cpp:
(WebKit::WebContextMenuProxyQt::createContextMenu):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change TextTrack to use the word DISABLED instead of OFF for mode
https://bugs.webkit.org/show_bug.cgi?id=70268

Reviewed by Daniel Bates.

No new tests. No new functionality.

* html/TextTrack.cpp:
(WebCore::TextTrack::setMode): use Disabled instead of Off
* html/TextTrack.h: update Mode enum to use Disabled instead of Off


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97762 268f45cc-cd09-0410-ab3c-d52691b4dbfc