2009-08-09 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
authorNikolas Zimmermann <zimmermann@kde.org>
Sun, 9 Aug 2009 23:33:54 +0000 (23:33 +0000)
committerNikolas Zimmermann <zimmermann@kde.org>
Sun, 9 Aug 2009 23:33:54 +0000 (23:33 +0000)
commit01d70db2e30d0be7e9c85ddeebcd8e87646a74bc
tree46388594a5d10a4ef78c6b8386b58487c5adc1d2
parent486c5089633716043237bf5cd60b74905e05b083
2009-08-09  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>

        Reviewed by George Staikos.

        [WML] Deck access control is completly broken
        https://bugs.webkit.org/show_bug.cgi?id=27721

        Synchronize WebFrameLoadType with FrameLoadType enum. Append 'WebFrameLoadTypeBackWMLDeckNotAccessible'.

        * WebView/WebFramePrivate.h:

2009-08-09  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>

        Reviewed by George Staikos.

        [WML] Deck access control is completly broken
        https://bugs.webkit.org/show_bug.cgi?id=27721

        Synchronize WebFrameLoadType with FrameLoadType enum. Append 'WebFrameLoadTypeBackWMLDeckNotAccessible'.

        * Interfaces/IWebFramePrivate.idl:

2009-08-09  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>

        Reviewed by George Staikos.

        [WML] Deck access control is completly broken
        https://bugs.webkit.org/show_bug.cgi?id=27721

        Rewrite WML deck access control, actually works now standalone and within LayoutTests.
        Added several new layout tests covering local & remote access support.

        In order to detect WML task execution failures from within the WML layout tests a new
        method Console::lastWMLErrorMessage() has been added, returning the last recorded WML
        error message. Change WML log messages to dump to InspectorClient, just like it's done
        for HTML - we used to behave like JSMessageSource, which is wrong.

        Tests: http/tests/wml/access-target-domain-deny.html
               http/tests/wml/access-target-path-deny.html
               http/tests/wml/access-target.html
               wml/access-target-deny.html
               wml/access-target.html

        * inspector/ConsoleMessage.h:
        (WebCore::ConsoleMessage::source): Added public method to fetch the message source type.
        (WebCore::ConsoleMessage::message): Added public method to access the error message.
        * inspector/InspectorController.h:
        (WebCore::InspectorController::consoleMessages): Added for Console::lastWMLErrorMessage(), to be able to crawl through the list of dumped messages.
        * loader/FrameLoader.cpp: Recognize 'FrameLoadTypeBackWMLDeckNotAccessible', all guarded by ENABLE(WML).
        (WebCore::isBackForwardLoadType):
        (WebCore::FrameLoader::restoreDocumentState):
        (WebCore::FrameLoader::transitionToCommitted):
        (WebCore::FrameLoader::loadItem):
        * loader/FrameLoaderTypes.h:
        (WebCore::): Add new load type 'FrameLoadTypeBackWMLDeckNotAccessible', behaving like FrameLoadTypeBack plus WML specific information.
        * page/Console.cpp:
        (WebCore::Console::addMessage): Don't dump WML messages using ChromeClient (as it's done for JSMessageSource), but go through InspectorController.
        (WebCore::Console::lastWMLErrorMessage): Crawl InspectorController::consoleMssages() to look up the last WML error message, if present.
        * page/Console.h:
        * page/Console.idl: Add "[DontEnum] DOMString lastWMLErrorMessage()".
        * wml/WMLAccessElement.cpp: Store path/domain as member variables and pass them to WMLPageState once in insertedIntoDocument().
        (WebCore::WMLAccessElement::parseMappedAttribute):
        (WebCore::WMLAccessElement::insertedIntoDocument):
        * wml/WMLAccessElement.h:
        * wml/WMLCardElement.cpp: Handle 'FrameLoadTypeBackWMLDeckNotAccessible' as deck-entry method. Report WML error in current deck.
        (WebCore::WMLCardElement::handleIntrinsicEventIfNeeded):
        * wml/WMLDocument.cpp: Enable deck-access control in finishedParsing. Take care of method name changes in WMLPageState.
        (WebCore::WMLDocument::finishedParsing):
        (WebCore::WMLDocument::initialize):
        * wml/WMLErrorHandling.cpp: Never report 'WMLErrorDeckNotAccessible' messages through the tokenizer, that would alter the page into error state.
        (WebCore::reportWMLError):
        * wml/WMLPageState.cpp: Completly rewrote access path/domain parsing & deck-access control, strictly following the WML spec. All covered by tests.
        (WebCore::WMLPageState::WMLPageState):
        (WebCore::normalizedHostName):
        (WebCore::hostFromURL):
        (WebCore::urlForHistoryItem):
        (WebCore::tryAccessHistoryURLs):
        (WebCore::WMLPageState::processAccessControlData):
        (WebCore::WMLPageState::resetAccessControlData):
        (WebCore::WMLPageState::canAccessDeck):
        (WebCore::WMLPageState::hostIsAllowedToAccess):
        (WebCore::WMLPageState::pathIsAllowedToAccess):
        * wml/WMLPageState.h:

2009-08-09  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>

        Reviewed by George Staikos.

        [WML] Deck access control is completly broken
        https://bugs.webkit.org/show_bug.cgi?id=27721

        Add several new tests covering WML deck-access control.
        Update variable-reference-invalid-character.html result, as console messages aren't dump to the results anymore.

        * http/tests/wml/access-target-domain-deny-expected.txt: Added.
        * http/tests/wml/access-target-domain-deny.html: Added.
        * http/tests/wml/access-target-expected.txt: Added.
        * http/tests/wml/access-target-path-deny-expected.txt: Added.
        * http/tests/wml/access-target-path-deny.html: Added.
        * http/tests/wml/access-target.html: Added.
        * http/tests/wml/resources/access-target-domain-deny.js: Added.
        (setupTestDocument):
        (prepareTest):
        (executeTest):
        * http/tests/wml/resources/access-target-domain-deny.wml: Added.
        * http/tests/wml/resources/access-target-path-deny.js: Added.
        (setupTestDocument):
        (prepareTest):
        (executeTest):
        * http/tests/wml/resources/access-target-path-deny.wml: Added.
        * http/tests/wml/resources/access-target.js: Added.
        (setupTestDocument):
        (prepareTest):
        (executeTest):
        * http/tests/wml/resources/access-target.wml: Added.
        * http/tests/wml/resources/locked-deck.wml: Added.
        * http/tests/wml/resources/unreachable-domain.wml: Added.
        * http/tests/wml/resources/unreachable-path.wml: Added.
        * wml/access-target-deny-expected.txt: Added.
        * wml/access-target-deny.html: Added.
        * wml/access-target-expected.txt: Added.
        * wml/access-target.html: Added.
        * wml/resources/access-target-deny.js: Added.
        (setupTestDocument):
        (prepareTest):
        (executeTest):
        * wml/resources/access-target-deny.wml: Added.
        * wml/resources/access-target.js: Added.
        (setupTestDocument):
        (prepareTest):
        (executeTest):
        * wml/resources/access-target.wml: Added.
        * wml/resources/locked-deck.wml: Added.
        * wml/variable-reference-invalid-character-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/wml/access-target-domain-deny-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/wml/access-target-domain-deny.html [new file with mode: 0644]
LayoutTests/http/tests/wml/access-target-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/wml/access-target-path-deny-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/wml/access-target-path-deny.html [new file with mode: 0644]
LayoutTests/http/tests/wml/access-target.html [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/access-target-domain-deny.js [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/access-target-domain-deny.wml [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/access-target-path-deny.js [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/access-target-path-deny.wml [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/access-target.js [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/access-target.wml [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/locked-deck.wml [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/unreachable-domain.wml [new file with mode: 0644]
LayoutTests/http/tests/wml/resources/unreachable-path.wml [new file with mode: 0644]
LayoutTests/wml/access-target-deny-expected.txt [new file with mode: 0644]
LayoutTests/wml/access-target-deny.html [new file with mode: 0644]
LayoutTests/wml/access-target-expected.txt [new file with mode: 0644]
LayoutTests/wml/access-target.html [new file with mode: 0644]
LayoutTests/wml/resources/access-target-deny.js [new file with mode: 0644]
LayoutTests/wml/resources/access-target-deny.wml [new file with mode: 0644]
LayoutTests/wml/resources/access-target.js [new file with mode: 0644]
LayoutTests/wml/resources/access-target.wml [new file with mode: 0644]
LayoutTests/wml/resources/locked-deck.wml [new file with mode: 0644]
LayoutTests/wml/variable-reference-invalid-character-expected.txt
WebCore/ChangeLog
WebCore/inspector/ConsoleMessage.h
WebCore/inspector/InspectorController.h
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoaderTypes.h
WebCore/page/Console.cpp
WebCore/page/Console.h
WebCore/page/Console.idl
WebCore/wml/WMLAccessElement.cpp
WebCore/wml/WMLAccessElement.h
WebCore/wml/WMLCardElement.cpp
WebCore/wml/WMLDocument.cpp
WebCore/wml/WMLErrorHandling.cpp
WebCore/wml/WMLPageState.cpp
WebCore/wml/WMLPageState.h
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebFramePrivate.h
WebKit/win/ChangeLog
WebKit/win/Interfaces/IWebFramePrivate.idl