- 06 Jan, 2011 1 commit
-
-
jamesr@google.com authored
Reviewed by Simon Fraser. Implement mozilla's animationTime property https://bugs.webkit.org/show_bug.cgi?id=51952 Tests for window.webkitAnimationTime. * animations/animation-time-expected.txt: Added. * animations/animation-time.html: Added. * animations/script-tests/animation-time.js: Added. 2011-01-06 James Robinson <jamesr@chromium.org> Reviewed by Simon Fraser. Implement mozilla's animationTime property https://bugs.webkit.org/show_bug.cgi?id=51952 Chromium DRT support for webkitAnimationTime. * DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::paintInvalidatedRegion): 2011-01-06 James Robinson <jamesr@chromium.org> Reviewed by Simon Fraser. Implement mozilla's animationTime property https://bugs.webkit.org/show_bug.cgi?id=51952 Implements mozilla's animationTime property as described here: https://developer.mozilla.org/en/DOM/window.mozAnimationStartTime and http://hacks.mozilla.org/2010/08/more-efficient-javascript-animations-with-mozrequestanimationframe/ The property is called webkitAnimationTime as calling it the 'Start' time is not very informative. This property exposes a notion of a 'current' time to use for declarative animations and allows scripts to synchronize imperative animations with declarative ones if they choose to. Once queried this time is saved and used for all declarative animation updates until the embedder paints/composites the next frame and clears it, or 15ms elapse (in case the embedder isn't producing frames, for example if the page is in a background tab). This patch also ensures that all declarative animations started in the same script execution block are synchronized even if some time elapses while script is running. Test: fast/animation/animation-time.html * WebCore.gypi: * page/DOMWindow.cpp: (WebCore::DOMWindow::webkitAnimationTime): * page/DOMWindow.h: * page/DOMWindow.idl: * page/Frame.cpp: (WebCore::Frame::currentAnimationTime): * page/Frame.h: * page/Page.cpp: (WebCore::Page::Page): * page/Page.h: (WebCore::Page::animationTime): * page/animation/AnimationController.cpp: (WebCore::AnimationControllerPrivate::beginAnimationUpdateTime): * page/animation/AnimationTimeController.cpp: Added. (WebCore::AnimationTimeController::AnimationTimeController): (WebCore::AnimationTimeController::~AnimationTimeController): (WebCore::AnimationTimeController::currentAnimationTime): (WebCore::AnimationTimeController::clearCurrentAnimationTime): (WebCore::AnimationTimeController::clearCurrentAnimationTimeTimerFired): * page/animation/AnimationTimeController.h: Added. (WebCore::AnimationTimeController::create): 2011-01-06 James Robinson <jamesr@chromium.org> Reviewed by Simon Fraser. Implement mozilla's animationTime property https://bugs.webkit.org/show_bug.cgi?id=51952 WebKit API support for webkitAnimationTime. * public/WebWidget.h: * src/WebPopupMenuImpl.cpp: (WebKit::WebPopupMenuImpl::clearCurrentAnimationTime): * src/WebPopupMenuImpl.h: * src/WebViewImpl.cpp: (WebKit::WebViewImpl::clearCurrentAnimationTime): * src/WebViewImpl.h: 2011-01-06 James Robinson <jamesr@chromium.org> Reviewed by Simon Fraser. Implement mozilla's animationTime property https://bugs.webkit.org/show_bug.cgi?id=51952 Tells the page to clear the current animation time after producing a frame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::drawRect): * WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp: (WebKit::ChunkedUpdateDrawingArea::display): (WebKit::ChunkedUpdateDrawingArea::setSize): * WebProcess/WebPage/mac/LayerBackedDrawingAreaMac.mm: (WebKit::LayerBackedDrawingArea::syncCompositingLayers): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 03 Jan, 2011 1 commit
-
-
hyatt@apple.com authored
Reviewed by Simon Fraser. WebCore: Printing on a page with body { height: 100% } clips out the overflow contents. This happened because the computePageRects function was never correct. It was using the layer's width and height for the document's width and height, and the layer no longer includes overflow in its width and height. It was also incorrectly assuming the first page would begin at (0,0), and this is an invalid assumption in RTL or vertical text environments. Added printing/page-count-percentage-height.html * page/PrintContext.cpp: (WebCore::PrintContext::computePageRects): (WebCore::PrintContext::computePageRectsWithPageSizeInternal): LayoutTests: Add layout test for printing clipping bug. * printing/page-count-percentage-height-expected.txt: Added. * printing/page-count-percentage-height.html: Added. * printing/script-tests/page-count-percentage-height.js: Added. (test): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 21 Jun, 2010 1 commit
-
-
eric@webkit.org authored
Reviewed by Kent Tamura. Add tests for CSS3 Paged Media to make sure page breaks should happen at right places. Two tests (allowed-page-break and page-break-margin-collapsed) are expected to fail due to lack of support. https://bugs.webkit.org/show_bug.cgi?id=40770 * printing/allowed-page-breaks-expected.txt: Added. * printing/allowed-page-breaks.html: Added. * printing/no-content-empty-pages-expected.txt: Added. * printing/no-content-empty-pages.html: Added. * printing/page-break-display-none-expected.txt: Added. * printing/page-break-display-none.html: Added. * printing/page-break-margin-collapsed-expected.txt: Added. * printing/page-break-margin-collapsed.html: Added. * printing/script-tests/allowed-page-breaks.js: Added. (test): * printing/script-tests/no-content-empty-pages.js: Added. (test): * printing/script-tests/page-break-display-none.js: Added. (test): * printing/script-tests/page-break-margin-collapsed.js: Added. (test): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 17 Jun, 2010 1 commit
-
-
hamaji@chromium.org authored
Reviewed by Shinichiro Hamaji. Refactor layout tests for printing to use common code. https://bugs.webkit.org/show_bug.cgi?id=40559 * printing/numberOfPages-expected.txt: * printing/numberOfPages.html: * printing/page-break-always-expected.txt: * printing/page-break-always-for-overflow-expected.txt: * printing/page-break-always-for-overflow.html: * printing/page-break-always.html: * printing/page-break-inside-avoid-expected.txt: Added. * printing/page-break-inside-avoid.html: Added. * printing/page-break-inside-expected.txt: Removed. * printing/page-break-inside.html: Removed. * printing/pageNumerForElementById-expected.txt: * printing/pageNumerForElementById.html: * printing/resources/paged-media-test-utils.js: (numberOfPagesShouldBe): (ratioToPageHeightToPixels): (createBlockWithRatioToPageHeight): (createBlockWithNumberOfLines): * printing/script-tests/TEMPLATE.html: * printing/script-tests/numberOfPages.js: (test): * printing/script-tests/page-break-always-for-overflow.js: (test): * printing/script-tests/page-break-always.js: (test): * printing/script-tests/page-break-inside-avoid.js: Added. (test): * printing/script-tests/page-break-inside.js: Removed. * printing/script-tests/pageNumerForElementById.js: (test): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61309 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 09 Feb, 2010 1 commit
-
-
hamaji@chromium.org authored
Reviewed by Darin Adler. Provide a way to get total number of pages to be printed https://bugs.webkit.org/show_bug.cgi?id=34699 * platform/gtk/Skipped: * platform/qt/Skipped: * platform/win/Skipped: * printing/numberOfPages-expected.txt: Added. * printing/numberOfPages.html: Added. * printing/script-tests/numberOfPages.js: Added. (createParagraph): 2010-02-09 Shinichiro Hamaji <hamaji@chromium.org> Reviewed by Darin Adler. Provide a way to get total number of pages to be printed https://bugs.webkit.org/show_bug.cgi?id=34699 Test: printing/numberOfPages.html * WebCore.base.exp: * page/PrintContext.cpp: (WebCore::PrintContext::pageNumberForElement): (WebCore::PrintContext::numberOfPages): * page/PrintContext.h: (WebCore::PrintContext::pageRects): 2010-02-09 Shinichiro Hamaji <hamaji@chromium.org> Reviewed by Darin Adler. Provide a way to get total number of pages to be printed https://bugs.webkit.org/show_bug.cgi?id=34699 * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (-[WebFrame numberOfPages:pageWidthInPixels:]): 2010-02-09 Shinichiro Hamaji <hamaji@chromium.org> Reviewed by Darin Adler. Provide a way to get total number of pages to be printed https://bugs.webkit.org/show_bug.cgi?id=34699 * DumpRenderTree/LayoutTestController.cpp: (parsePageParameters): (pageNumberForElementByIdCallback): (numberOfPagesCallback): (LayoutTestController::staticFunctions): * DumpRenderTree/LayoutTestController.h: * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: (LayoutTestController::numberOfPages): * DumpRenderTree/mac/LayoutTestControllerMac.mm: (LayoutTestController::numberOfPages): * DumpRenderTree/win/LayoutTestControllerWin.cpp: (LayoutTestController::numberOfPages): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54533 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 01 Feb, 2010 1 commit
-
-
hamaji@chromium.org authored
Reviewed by Eric Seidel. Provide a way to get page number with layoutTestController https://bugs.webkit.org/show_bug.cgi?id=33840 * platform/gtk/Skipped: * platform/mac/Skipped: * platform/qt/Skipped: * platform/win/Skipped: * printing/page-break-always-expected.txt: Added. * printing/page-break-always.html: Added. * printing/pageNumerForElementById-expected.txt: Added. * printing/pageNumerForElementById.html: Added. * printing/script-tests/TEMPLATE.html: Added. * printing/script-tests/page-break-always.js: Added. (createParagraph): * printing/script-tests/pageNumerForElementById.js: Added. (createParagraph): 2010-02-01 Shinichiro Hamaji <hamaji@chromium.org> Reviewed by Eric Seidel. Provide a way to get page number with layoutTestController https://bugs.webkit.org/show_bug.cgi?id=33840 Test: printing/page-break-always.html * WebCore.base.exp: * WebCore.xcodeproj/project.pbxproj: * page/PrintContext.cpp: (WebCore::PrintContext::pageRect): Added a getter function. (WebCore::PrintContext::computePageRects): Move its logic into computePageRectsWithPageSize. (WebCore::PrintContext::computePageRectsWithPageSize): Factored out from computePageRects for pageNumberForElement. (WebCore::enclosingBoxModelObject): Added for pageNumberForElement. (WebCore::PrintContext::pageNumberForElement): Added for testing. * page/PrintContext.h: 2010-02-01 Shinichiro Hamaji <hamaji@chromium.org> Reviewed by Eric Seidel. Provide a way to get page number with layoutTestController https://bugs.webkit.org/show_bug.cgi?id=33840 * Misc/WebCoreStatistics.h: * Misc/WebCoreStatistics.mm: (-[WebFrame pageNumberForElement:element:pageWidth:]): 2010-02-01 Shinichiro Hamaji <hamaji@chromium.org> Reviewed by Eric Seidel. Provide a way to get page number with layoutTestController https://bugs.webkit.org/show_bug.cgi?id=33840 * DumpRenderTree/LayoutTestController.cpp: (pageNumberForElementByIdCallback): (LayoutTestController::staticFunctions): * DumpRenderTree/LayoutTestController.h: * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: (LayoutTestController::pageNumberForElementById): * DumpRenderTree/mac/LayoutTestControllerMac.mm: (LayoutTestController::pageNumberForElementById): * DumpRenderTree/win/LayoutTestControllerWin.cpp: (LayoutTestController::pageNumberForElementById): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 19 Sep, 2009 1 commit
-
-
hamaji@chromium.org authored
Rubber-stamped by Eric Seidel. js tests should move into jstests subdirectory instead of resources/ https://bugs.webkit.org/show_bug.cgi?id=25880 Migration for http, platform, plugins, traversal, and wml directories. * http/tests/cookies/double-quoted-value-with-semi-colon.html: * http/tests/cookies/multiple-cookies.html: * http/tests/cookies/resources/TEMPLATE.html: Removed. * http/tests/cookies/resources/double-quoted-value-with-semi-colon.js: Removed. * http/tests/cookies/resources/multiple-cookies.js: Removed. * http/tests/cookies/resources/simple-cookies-expired.js: Removed. * http/tests/cookies/resources/simple-cookies-max-age.js: Removed. * http/tests/cookies/script-tests: Added. * http/tests/cookies/script-tests/TEMPLATE.html: Copied from LayoutTests/http/tests/cookies/resources/TEMPLATE.html. * http/tests/cookies/script-tests/double-quoted-value-with-semi-colon.js: Copied from LayoutTests/http/tests/cookies/resources/double-quoted-value-with-semi-colon.js. * http/tests/cookies/script-tests/multiple-cookies.js: Copied from LayoutTests/http/tests/cookies/resources/multiple-cookies.js. * http/tests/cookies/script-tests/simple-cookies-expired.js: Copied from LayoutTests/http/tests/cookies/resources/simple-cookies-expired.js. * http/tests/cookies/script-tests/simple-cookies-max-age.js: Copied from LayoutTests/http/tests/cookies/resources/simple-cookies-max-age.js. * http/tests/cookies/simple-cookies-expired.html: * http/tests/cookies/simple-cookies-max-age.html: * http/tests/security/clipboard/clipboard-file-access.html: * http/tests/security/clipboard/resources/TEMPLATE.html: Removed. * http/tests/security/clipboard/resources/clipboard-file-access.js: Removed. * http/tests/security/clipboard/script-tests: Added. * http/tests/security/clipboard/script-tests/TEMPLATE.html: Copied from LayoutTests/http/tests/security/clipboard/resources/TEMPLATE.html. * http/tests/security/clipboard/script-tests/clipboard-file-access.js: Copied from LayoutTests/http/tests/security/clipboard/resources/clipboard-file-access.js. * http/tests/wml/access-target-domain-deny.html: * http/tests/wml/access-target-path-deny.html: * http/tests/wml/access-target.html: * http/tests/wml/go-task-get-method-accept-charset.html: * http/tests/wml/go-task-get-method.html: * http/tests/wml/go-task-post-method-accept-charset.html: * http/tests/wml/go-task-post-method.html: * http/tests/wml/post-data-to-server.html: * http/tests/wml/resources/TEMPLATE.html: Removed. * http/tests/wml/resources/access-target-domain-deny.js: Removed. * http/tests/wml/resources/access-target-path-deny.js: Removed. * http/tests/wml/resources/access-target.js: Removed. * http/tests/wml/resources/go-task-get-method-accept-charset.js: Removed. * http/tests/wml/resources/go-task-get-method.js: Removed. * http/tests/wml/resources/go-task-post-method-accept-charset.js: Removed. * http/tests/wml/resources/go-task-post-method.js: Removed. * http/tests/wml/resources/post-data-to-server.js: Removed. * http/tests/wml/script-tests: Added. * http/tests/wml/script-tests/TEMPLATE.html: Copied from LayoutTests/http/tests/wml/resources/TEMPLATE.html. * http/tests/wml/script-tests/access-target-domain-deny.js: Copied from LayoutTests/http/tests/wml/resources/access-target-domain-deny.js. * http/tests/wml/script-tests/access-target-path-deny.js: Copied from LayoutTests/http/tests/wml/resources/access-target-path-deny.js. * http/tests/wml/script-tests/access-target.js: Copied from LayoutTests/http/tests/wml/resources/access-target.js. * http/tests/wml/script-tests/go-task-get-method-accept-charset.js: Copied from LayoutTests/http/tests/wml/resources/go-task-get-method-accept-charset.js. * http/tests/wml/script-tests/go-task-get-method.js: Copied from LayoutTests/http/tests/wml/resources/go-task-get-method.js. * http/tests/wml/script-tests/go-task-post-method-accept-charset.js: Copied from LayoutTests/http/tests/wml/resources/go-task-post-method-accept-charset.js. * http/tests/wml/script-tests/go-task-post-method.js: Copied from LayoutTests/http/tests/wml/resources/go-task-post-method.js. * http/tests/wml/script-tests/post-data-to-server.js: Copied from LayoutTests/http/tests/wml/resources/post-data-to-server.js. * platform/gtk/editing/pasteboard/resources/TEMPLATE.html: Removed. * platform/gtk/editing/pasteboard/resources/middle-click-onpaste.js: Removed. * platform/gtk/editing/pasteboard/script-tests: Added. * platform/gtk/editing/pasteboard/script-tests/TEMPLATE.html: Copied from LayoutTests/platform/gtk/editing/pasteboard/resources/TEMPLATE.html. * platform/gtk/editing/pasteboard/script-tests/middle-click-onpaste.js: Copied from LayoutTests/platform/gtk/editing/pasteboard/resources/middle-click-onpaste.js. * platform/win/fast/events/context-click-events.html: * platform/win/fast/events/resources/TEMPLATE.html: Removed. * platform/win/fast/events/resources/context-click-events.js: Removed. * platform/win/fast/events/script-tests: Added. * platform/win/fast/events/script-tests/TEMPLATE.html: Copied from LayoutTests/platform/win/fast/events/resources/TEMPLATE.html. * platform/win/fast/events/script-tests/context-click-events.js: Copied from LayoutTests/platform/win/fast/events/resources/context-click-events.js. * plugins/netscape-identifier-conversion.html: * plugins/resources/TEMPLATE.html: Removed. * plugins/resources/netscape-identifier-conversion.js: Removed. * plugins/script-tests: Added. * plugins/script-tests/TEMPLATE.html: Copied from LayoutTests/plugins/resources/TEMPLATE.html. * plugins/script-tests/netscape-identifier-conversion.js: Copied from LayoutTests/plugins/resources/netscape-identifier-conversion.js. * traversal/acid3-test-2.html: * traversal/exception-forwarding.html: * traversal/resources/TEMPLATE.html: Removed. * traversal/resources/acid3-test-2.js: Removed. * traversal/resources/exception-forwarding.js: Removed. * traversal/script-tests: Added. * traversal/script-tests/TEMPLATE.html: Copied from LayoutTests/traversal/resources/TEMPLATE.html. * traversal/script-tests/acid3-test-2.js: Copied from LayoutTests/traversal/resources/acid3-test-2.js. * traversal/script-tests/exception-forwarding.js: Copied from LayoutTests/traversal/resources/exception-forwarding.js. * wml/access-target-deny.html: * wml/access-target.html: * wml/enter-card-with-events.html: * wml/enter-first-card-with-events.html: * wml/go-task-get-method-external-deck-with-href.html: * wml/go-task-get-method-external-deck.html: * wml/go-task-get-method-same-deck.html: * wml/input-format.html: * wml/newcontext-same-deck.html: * wml/onenterforward-event.html: * wml/onenterforward-inline-event.html: * wml/ontimer-event.html: * wml/ontimer-inline-event.html: * wml/option-element-onpick-recursion.html: * wml/option-element-onpick.html: * wml/resources/TEMPLATE.html: Removed. * wml/resources/access-target-deny.js: Removed. * wml/resources/access-target.js: Removed. * wml/resources/enter-card-with-events.js: Removed. * wml/resources/enter-first-card-with-events.js: Removed. * wml/resources/go-task-get-method-external-deck-with-href.js: Removed. * wml/resources/go-task-get-method-external-deck.js: Removed. * wml/resources/go-task-get-method-same-deck.js: Removed. * wml/resources/input-format.js: Removed. * wml/resources/newcontext-same-deck.js: Removed. * wml/resources/onenterforward-event.js: Removed. * wml/resources/onenterforward-inline-event.js: Removed. * wml/resources/ontimer-event.js: Removed. * wml/resources/ontimer-inline-event.js: Removed. * wml/resources/option-element-onpick-recursion.js: Removed. * wml/resources/option-element-onpick.js: Removed. * wml/resources/select-element-variables.js: Removed. * wml/resources/variable-reference-invalid-character.js: Removed. * wml/resources/variable-reference-valid.js: Removed. * wml/script-tests: Added. * wml/script-tests/TEMPLATE.html: Copied from LayoutTests/wml/resources/TEMPLATE.html. * wml/script-tests/access-target-deny.js: Copied from LayoutTests/wml/resources/access-target-deny.js. * wml/script-tests/access-target.js: Copied from LayoutTests/wml/resources/access-target.js. * wml/script-tests/enter-card-with-events.js: Copied from LayoutTests/wml/resources/enter-card-with-events.js. * wml/script-tests/enter-first-card-with-events.js: Copied from LayoutTests/wml/resources/enter-first-card-with-events.js. * wml/script-tests/go-task-get-method-external-deck-with-href.js: Copied from LayoutTests/wml/resources/go-task-get-method-external-deck-with-href.js. * wml/script-tests/go-task-get-method-external-deck.js: Copied from LayoutTests/wml/resources/go-task-get-method-external-deck.js. * wml/script-tests/go-task-get-method-same-deck.js: Copied from LayoutTests/wml/resources/go-task-get-method-same-deck.js. * wml/script-tests/input-format.js: Copied from LayoutTests/wml/resources/input-format.js. * wml/script-tests/newcontext-same-deck.js: Copied from LayoutTests/wml/resources/newcontext-same-deck.js. * wml/script-tests/onenterforward-event.js: Copied from LayoutTests/wml/resources/onenterforward-event.js. * wml/script-tests/onenterforward-inline-event.js: Copied from LayoutTests/wml/resources/onenterforward-inline-event.js. * wml/script-tests/ontimer-event.js: Copied from LayoutTests/wml/resources/ontimer-event.js. * wml/script-tests/ontimer-inline-event.js: Copied from LayoutTests/wml/resources/ontimer-inline-event.js. * wml/script-tests/option-element-onpick-recursion.js: Copied from LayoutTests/wml/resources/option-element-onpick-recursion.js. * wml/script-tests/option-element-onpick.js: Copied from LayoutTests/wml/resources/option-element-onpick.js. * wml/script-tests/select-element-variables.js: Copied from LayoutTests/wml/resources/select-element-variables.js. * wml/script-tests/variable-reference-invalid-character.js: Copied from LayoutTests/wml/resources/variable-reference-invalid-character.js. * wml/script-tests/variable-reference-valid.js: Copied from LayoutTests/wml/resources/variable-reference-valid.js. * wml/select-element-variables.html: * wml/variable-reference-invalid-character.html: * wml/variable-reference-valid.html: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 17 Mar, 2008 1 commit
-
-
eric@webkit.org authored
Fix _NPN_IntFromIdentifier (and export the symbol for use!) Test: plugins/netscape-identifier-conversion.html * WebCore.NPAPI.exp: * bridge/npruntime.cpp: (_NPN_IntFromIdentifier): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 10 Feb, 2008 1 commit
-
-
darin@apple.com authored
system incorrectly * fast/dom/SelectorAPI/resources/TEMPLATE.html: Fixed relative paths. * fast/events/event-instanceof.html: Regenerating this file revealed that the path to the stylesheet was wrong. Fixed by running the make-js-test-wrappers script. Didn't affect the text-only results, but the test looked wrong in the browser. * fast/events/resources/TEMPLATE.html: Copied from fast/js/resources/TEMPLATE.html. * traversal/resources/TEMPLATE.html: Fixed relative paths. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 08 Feb, 2008 1 commit
-
-
darin@apple.com authored
Reviewed by Eric. - fix http://bugs.webkit.org/show_bug.cgi?id=3492 TreeWalker implementation needs to be fixed (affects Acid3) - fix http://bugs.webkit.org/show_bug.cgi?id=4714 NodeIterator does not handle exceptions from the filter function (affects Acid3) - fix http://bugs.webkit.org/show_bug.cgi?id=4716 NodeIterator will crash if the filter function removes the current node from the document Test: traversal/exception-forwarding.html This turned into a near-rewrite of NodeIterator and TreeWalker. * bindings/js/JSNodeFilterCondition.h: * bindings/js/JSNodeFilterCondition.cpp: (WebCore::takeException): Added. (WebCore::JSNodeFilterCondition::acceptNode): Added an out parameter to return a JavaScript exception. * bindings/js/JSNodeFilterCustom.cpp: (WebCore::JSNodeFilter::acceptNode): Wrote a custom binding for this that raises a JavaScript exception if the out parameter is set. * bindings/js/JSNodeIteratorCustom.cpp: (WebCore::JSNodeIterator::nextNode): Wrote a custom binding for this that raises a JavaScript exception if the out parameter is set. (WebCore::JSNodeIterator::previousNode): Ditto. * bindings/js/JSTreeWalkerCustom.cpp: (WebCore::JSTreeWalker::parentNode): Wrote a custom binding for this that raises a JavaScript exception if the out parameter is set. (WebCore::JSTreeWalker::firstChild): Ditto. (WebCore::JSTreeWalker::lastChild): Ditto. (WebCore::JSTreeWalker::nextSibling): Ditto. (WebCore::JSTreeWalker::previousSibling): Ditto. (WebCore::JSTreeWalker::previousNode): Ditto. (WebCore::JSTreeWalker::nextNode): Ditto. * bindings/objc/DOM.mm: (WebCore::ObjCNodeFilterCondition::acceptNode): Updated to include new exception out parameter. (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]): Use RefPtr to make object lifetimes clearer. (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]): Ditto. * bindings/scripts/CodeGeneratorJS.pm: Added include of NodeFilter.h for JSDocument.cpp. * dom/Document.h: * dom/Document.cpp: (WebCore::Document::createNodeIterator): Changed to use PassRefPtr. (WebCore::Document::createTreeWalker): Ditto. * dom/NodeFilter.h: * dom/NodeFilter.cpp: (WebCore::NodeFilter::NodeFilter): Changed to use PassRefPtr. (WebCore::NodeFilter::acceptNode): Added an out parameter to return a JavaScript exception. * dom/NodeFilter.idl: Custom binding for acceptNode. * dom/NodeFilterCondition.h: * dom/NodeFilterCondition.cpp: (WebCore::NodeFilterCondition::acceptNode): Added an out parameter to return a JavaScript exception. * dom/NodeIterator.cpp: (WebCore::NodeIterator::NodeIterator): Changed to use PassRefPtr more. Eliminated m_doc, using the root node instead, and unnecessary check for null -- rootNode must be non-null and all nodes have a non-null document. (WebCore::NodeIterator::~NodeIterator): Changed to get document from root. (WebCore::NodeIterator::nextNode): Rewrote to use a RefPtr since the acceptNode function could do anything, including removing the last reference to the current node. Also folded findNextNode into this function since it's the only one that needs to call it. (WebCore::NodeIterator::previousNode): Same thing, but the other direction. (WebCore::NodeIterator::detach): Changed to use the root node as the indication that we're detached rather than a separate boolean. (WebCore::NodeIterator::notifyBeforeNodeRemoval): Removed some unnneeded checks. Removed incorrect use of findNextNode/findPreviousNode -- those functions call acceptNode and the DOM standard is quite clear that these functions do not take that into account, allowing the current node to become one that's not accepted. * dom/NodeIterator.h: Changed constructor to use PassRefPtr more. Changed nextNode and previousNode to have an out parameter with a JavaScript exception. Removed helper functions setReferenceNode, setPointerBeforeReferenceNode, detached, setDetached, document, findNextNode, and findPreviousNode. All were unnecessary. Removed data member m_doc which was just rootNode()->document(). * dom/NodeIterator.idl: Custom binding for nextNode and previousNode. * dom/Traversal.cpp: (WebCore::Traversal::Traversal): Use PassRefPtr more. (WebCore::Traversal::acceptNode): Added out parameter for JavaScript exception. Also rearranged the function a little bit for clarity. * dom/Traversal.h: Changed acceptNode to have an out parameter with a JavaScript exception and made it protected, since it's only for use by the derived classes. * dom/TreeWalker.cpp: (WebCore::TreeWalker::TreeWalker): Updated to use PassRefPtr. (WebCore::TreeWalker::setCurrentNode): Updated to use PassRefPtr and deleted the overloaded version since it's not needed. (WebCore::TreeWalker::parentNode): Rewrote to propagate the exception and also to implement rules about when to check things like whether we're in the tree. The previous fix where we called isDescendantOf was not entirely correct, because the specification allows you to walk outside the tree if you get there somehow. What it doesn't allow is walking outside the tree from inside. The new implementation handles this correctly. (WebCore::TreeWalker::firstChild): Ditto. (WebCore::TreeWalker::lastChild): Ditto. (WebCore::TreeWalker::previousSibling): Ditto. (WebCore::TreeWalker::nextSibling): Ditto. (WebCore::TreeWalker::previousNode): Ditto. Because of the need to check the acceptNode function on parents, this can't use traversePreviousNode (more's the pity, because it's a bit complicated). (WebCore::TreeWalker::nextNode): Ditto. * dom/TreeWalker.h: Changed constructor and setCurrentNode to use PassRefPtr more. Changed the navigation functions to have an out parameter with a JavaScript exception. Removed helper functions setCurrentNode and ancestorRejected. * dom/TreeWalker.idl: Custom binding for navigation functions. LayoutTests: Reviewed by Eric. - test for http://bugs.webkit.org/show_bug.cgi?id=4714 NodeIterator does not handle exceptions from the filter function (affects Acid3) - grabbed NodeIterator and TreeWalker tests from Hixie's site and KHTML * traversal/exception-forwarding-expected.txt: Added. * traversal/exception-forwarding.html: Added. * traversal/resources: Added. * traversal/resources/TEMPLATE.html: Copied from LayoutTests/fast/js/resources/TEMPLATE.html. * traversal/resources/exception-forwarding.js: Added. * traversal/node-iterator-001-expected.txt: Updated to reflect correct results. The old results reflected a bug in our NodeIterator. * traversal/node-iterator-001.html: Ditto. * traversal/node-iterator-006.html: Changed test so there's no whitespace node after the <span> elements inside the test root element (a <div>). The old test results were incorrect; the new NodeIterator implementation correctly returned the whitespace node for this test. * traversal/node-iterator-006a.html: Copied from traversal/node-iterator-006.html. Preserve the original test, which now has a strange result. But the result is correct, so it's worth keeping around. * traversal/node-iterator-006a-expected.txt: Added. * fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt: Regenerated. * fast/dom/TreeWalker/resources/TreeWalker-currentNode.js: Updated test to expect results that match the DOM specification. * traversal/hixie-node-iterator/001-expected.txt: Added. * traversal/hixie-node-iterator/001.xml: Added. * traversal/hixie-node-iterator/002-expected.txt: Added. * traversal/hixie-node-iterator/002.xml: Added. * traversal/hixie-node-iterator/003-expected.txt: Added. * traversal/hixie-node-iterator/003.xml: Added. * traversal/hixie-node-iterator/004-expected.txt: Added. * traversal/hixie-node-iterator/004.xml: Added. * traversal/hixie-node-iterator/005-expected.txt: Added. * traversal/hixie-node-iterator/005.xml: Added. * traversal/hixie-node-iterator/006-expected.txt: Added. * traversal/hixie-node-iterator/006.xml: Added. * traversal/hixie-node-iterator/007-expected.txt: Added. * traversal/hixie-node-iterator/007.xml: Added. * traversal/hixie-node-iterator/008-expected.txt: Added. * traversal/hixie-node-iterator/008.xml: Added. * traversal/hixie-node-iterator/009-expected.txt: Added. * traversal/hixie-node-iterator/009.xml: Added. * traversal/hixie-node-iterator/010-expected.txt: Added. * traversal/hixie-node-iterator/010.xml: Added. * traversal/hixie-node-iterator/origin.txt: Added. * traversal/tree-walker-filter-1-expected.txt: Added. * traversal/tree-walker-filter-1.html: Added. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 01 Feb, 2008 1 commit
-
-
eric@webkit.org authored
Add getSVGDocument to frame and iframe. Test: svg/custom/frame-getSVGDocument.html * html/HTMLEmbedElement.cpp: * html/HTMLEmbedElement.h: * html/HTMLFrameElement.idl: * html/HTMLFrameOwnerElement.cpp: (WebCore::HTMLFrameOwnerElement::getSVGDocument): * html/HTMLFrameOwnerElement.h: * html/HTMLIFrameElement.idl: * html/HTMLObjectElement.cpp: * html/HTMLObjectElement.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 01 Jan, 2008 1 commit
-
-
weinig@apple.com authored
Reviewed by Darin. Patch for http://bugs.webkit.org/show_bug.cgi?id=16691 Use real JS objects for the rest of the DOMExceptions (EventException, RangeException, etc) - Create JS objects for all the different types of exceptions, each with there own prototype and constructor. - Abstract all the logic and storage for exception classes in to an ExceptionBase class. - Move specialized ExceptionCodes into the exception classes. (ie. the EventExceptionCode enum is now in EventException). Tests: fast/dom/DOMException/EventException.html fast/dom/DOMException/RangeException.html fast/dom/DOMException/XPathException.html http/tests/xmlhttprequest/XMLHttpRequestException.html svg/custom/SVGException.html * DerivedSources.make: * WebCore.pro: * WebCore.vcproj/WebCore.vcproj: * WebCore.xcodeproj/project.pbxproj: * WebCoreSources.bkl: * bindings/js/JSSVGMatrixCustom.cpp: (WebCore::JSSVGMatrix::inverse): (WebCore::JSSVGMatrix::rotateFromVector): * bindings/js/kjs_binding.cpp: (KJS::setDOMException): * bindings/scripts/CodeGeneratorJS.pm: Use the constant values defined in the IDL as the ObjC bindings do. * bindings/scripts/CodeGeneratorObjC.pm: * dom/DOMCoreException.cpp: Removed. * dom/DOMCoreException.h: (WebCore::DOMCoreException::DOMCoreException): * dom/DOMCoreException.idl: * dom/Event.h: * dom/EventException.h: Copied from WebCore/dom/DOMCoreException.h. (WebCore::EventException::EventException): (WebCore::EventException::): * dom/EventException.idl: Copied from WebCore/dom/DOMCoreException.idl. * dom/EventTargetNode.cpp: (WebCore::EventTargetNode::dispatchEvent): * dom/ExceptionBase.cpp: Copied from WebCore/dom/DOMCoreException.cpp. (WebCore::ExceptionBase::ExceptionBase): (WebCore::ExceptionBase::toString): * dom/ExceptionBase.h: Copied from WebCore/dom/DOMCoreException.h. (WebCore::ExceptionBase::code): * dom/ExceptionCode.cpp: (WebCore::getExceptionCodeDescription): * dom/ExceptionCode.h: (WebCore::): * dom/Range.cpp: (WebCore::Range::insertNode): (WebCore::Range::checkNodeWOffset): (WebCore::Range::checkNodeBA): (WebCore::Range::selectNode): (WebCore::Range::selectNodeContents): (WebCore::Range::surroundContents): * dom/RangeException.h: (WebCore::RangeException::RangeException): (WebCore::RangeException::): * dom/RangeException.idl: * page/DOMWindow.idl: * svg/SVGColor.cpp: (WebCore::SVGColor::setRGBColor): * svg/SVGException.h: (WebCore::SVGException::SVGException): (WebCore::SVGException::): * svg/SVGException.idl: * svg/SVGLocatable.cpp: (WebCore::SVGLocatable::getTransformToElement): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::dispatchEvent): (WebCore::XMLHttpRequest::open): (WebCore::XMLHttpRequest::send): * xml/XMLHttpRequest.h: * xml/XMLHttpRequestException.h: Copied from WebCore/dom/DOMCoreException.h. (WebCore::XMLHttpRequestException::XMLHttpRequestException): (WebCore::XMLHttpRequestException::): * xml/XMLHttpRequestException.idl: Copied from WebCore/dom/DOMCoreException.idl. * xml/XPathEvaluator.h: * xml/XPathException.h: Copied from WebCore/dom/DOMCoreException.h. (WebCore::XPathException::XPathException): (WebCore::XPathException::): * xml/XPathException.idl: Copied from WebCore/dom/DOMCoreException.idl. * xml/XPathParser.cpp: (WebCore::XPath::Parser::parseStatement): * xml/XPathResult.cpp: (WebCore::XPathResult::convertTo): (WebCore::XPathResult::numberValue): (WebCore::XPathResult::stringValue): (WebCore::XPathResult::booleanValue): (WebCore::XPathResult::singleNodeValue): (WebCore::XPathResult::snapshotLength): (WebCore::XPathResult::iterateNext): (WebCore::XPathResult::snapshotItem): LayoutTests: Reviewed by Darin. Tests for http://bugs.webkit.org/show_bug.cgi?id=16691 Use real JS objects for the rest of the DOMExceptions (EventException, RangeException, etc) * fast/dom/DOMException/EventException-expected.txt: Added. * fast/dom/DOMException/EventException.html: Copied from LayoutTests/fast/dom/DOMException/prototype-object.html. * fast/dom/DOMException/RangeException-expected.txt: Added. * fast/dom/DOMException/RangeException.html: Copied from LayoutTests/fast/dom/DOMException/prototype-object.html. * fast/dom/DOMException/XPathException-expected.txt: Added. * fast/dom/DOMException/XPathException.html: Copied from LayoutTests/fast/dom/DOMException/prototype-object.html. * fast/dom/DOMException/resources/EventException.js: Copied from LayoutTests/fast/dom/DOMException/resources/prototype-object.js. * fast/dom/DOMException/resources/RangeException.js: Copied from LayoutTests/fast/dom/DOMException/resources/prototype-object.js. * fast/dom/DOMException/resources/XPathException.js: Copied from LayoutTests/fast/dom/DOMException/resources/prototype-object.js. * fast/dom/Window/window-properties-expected.txt: * http/tests/xmlhttprequest/XMLHttpRequestException-expected.txt: Added. * http/tests/xmlhttprequest/XMLHttpRequestException.html: Added. * svg/custom/SVGException-expected.txt: Added. * svg/custom/SVGException.html: Copied from LayoutTests/fast/dom/DOMException/prototype-object.html. * svg/custom/resources/SVGException.js: Copied from LayoutTests/fast/dom/DOMException/resources/prototype-object.js. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-