WebCore:
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2007 17:15:19 +0000 (17:15 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2007 17:15:19 +0000 (17:15 +0000)
commit28faae088869b280749565ba6e59aad751722a15
tree279e32be975a3a73c0966b95699e425d6b30758f
parentf2d45bfa83e93253aac82328b18406e8d35ed95a
WebCore:

        Reviewed by Dave Hyatt.

        <rdar://problem/5569233> Add the ability to disable author and user CSS styles

        * WebCore.base.exp: Add the Settings::setAuthorAndUserStylesEnabled symbol.
        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::CSSStyleSelector): Add a new matchAuthorAndUserStyles parameter.
        (WebCore::CSSStyleSelector::styleForElement): Check m_matchAuthorAndUserStyles before
        matching user and author rules.
        (WebCore::CSSStyleSelector::pseudoStyleForElement): Ditto.
        (WebCore::CSSStyleSelector::styleRulesForElement): Ditto.
        * css/CSSStyleSelector.h: Add m_matchAuthorAndUserStyles and new constructor parameter.
        * dom/Document.cpp:
        (WebCore::Document::Document): Pass Settings::authorAndUserStylesEnabled to the CSSStyleSelector.
        (WebCore::Document::recalcStyleSelector): Skip collecting the author stylesheets if
        Settings::authorAndUserStylesEnabled is false, and pass that to the CSSStyleSelector.
        * page/Settings.cpp:
        (WebCore::Settings::Settings): Initialize m_authorAndUserStylesEnabled to true.
        (WebCore::Settings::setAuthorAndUserStylesEnabled): Recalc style in all the frames
        when the setting changes.
        * page/Settings.h: Add m_authorAndUserStylesEnabled.
        (WebCore::Settings::authorAndUserStylesEnabled): Return m_authorAndUserStylesEnabled.

WebKit/mac:

        Reviewed by Dave Hyatt.

        <rdar://problem/5569233> Add the ability to disable author and user CSS styles

        * WebView/WebPreferenceKeysPrivate.h: Define WebKitRespectStandardStyleKeyEquivalentsPreferenceKey.
        * WebView/WebPreferences.m:
        (+[WebPreferences initialize]): Default WebKitRespectStandardStyleKeyEquivalentsPreferenceKey to YES.
        (-[WebPreferences authorAndUserStylesEnabled]): Return the setting's BOOL value.
        (-[WebPreferences setAuthorAndUserStylesEnabled:]): Set the setting's BOOL value.
        * WebView/WebPreferencesPrivate.h: Add authorAndUserStylesEnabled and setAuthorAndUserStylesEnabled:.
        * WebView/WebView.mm:
        (-[WebView _preferencesChangedNotification:]): Update WebCore::Settings::authorAndUserStylesEnabled.

WebKitTools:

        Reviewed by Dave Hyatt.

        <rdar://problem/5569233> Add the ability to disable author and user CSS styles

        Add support for disabling author and user styles for testing.

        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
        * DumpRenderTree/LayoutTestController.cpp:
        (setAuthorAndUserStylesEnabledCallback):
        (LayoutTestController::staticFunctions):
        * DumpRenderTree/LayoutTestController.h:
        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
        (LayoutTestController::setAuthorAndUserStylesEnabled):
        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::setAuthorAndUserStylesEnabled):

LayoutTests:

        Reviewed by Dave Hyatt.

        Test for: <rdar://problem/5569233> Add the ability to disable author and user CSS styles

        * fast/css/disabled-author-styles.html: Added.
        * platform/mac/fast/css/disabled-author-styles-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/disabled-author-styles.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/disabled-author-styles-expected.txt [new file with mode: 0644]
LayoutTests/platform/win/Skipped
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/css/CSSStyleSelector.cpp
WebCore/css/CSSStyleSelector.h
WebCore/dom/Document.cpp
WebCore/page/Settings.cpp
WebCore/page/Settings.h
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebInspectorClient.mm
WebKit/mac/WebView/WebPreferenceKeysPrivate.h
WebKit/mac/WebView/WebPreferences.m
WebKit/mac/WebView/WebPreferencesPrivate.h
WebKit/mac/WebView/WebView.mm
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp