[chromium] Fix duplicate layout test expectation
https://bugs.webkit.org/show_bug.cgi?id=53378

Unreviewed gardening.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Implement IDBObjectStore.count() and IDBIndex.count()
https://bugs.webkit.org/show_bug.cgi?id=73686

Patch by Joshua Bell <jsbell@chromium.org> on 2011-12-16
Reviewed by Tony Chang.

Source/WebCore:

These new methods open an internal cursor and iterate through the
results, returning the number of items found. Note that only
passing an IDBKeyRange is supported, not an IDBKey. Supporting
that will require some IDL/binding monkeying; several other
methods also need the same Key-or-KeyRange behavior.

Tests: storage/indexeddb/index-count.html
       storage/indexeddb/objectstore-count.html

* bindings/v8/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::numberValue):
* bindings/v8/SerializedScriptValue.h:
* storage/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::count):
* storage/IDBIndex.h:
(WebCore::IDBIndex::count):
* storage/IDBIndex.idl:
* storage/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::countInternal):
(WebCore::IDBIndexBackendImpl::count):
* storage/IDBIndexBackendImpl.h:
* storage/IDBIndexBackendInterface.h:
* storage/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::count):
* storage/IDBObjectStore.h:
(WebCore::IDBObjectStore::count):
* storage/IDBObjectStore.idl:
* storage/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::count):
(WebCore::IDBObjectStoreBackendImpl::countInternal):
* storage/IDBObjectStoreBackendImpl.h:
* storage/IDBObjectStoreBackendInterface.h:

Source/WebKit/chromium:

Plumbing to support the new methods in Chromium.

* src/IDBIndexBackendProxy.cpp:
(WebKit::IDBIndexBackendProxy::count):
* src/IDBIndexBackendProxy.h:
* src/IDBObjectStoreBackendProxy.cpp:
(WebKit::IDBObjectStoreBackendProxy::count):
* src/IDBObjectStoreBackendProxy.h:
* src/WebIDBIndexImpl.cpp:
(WebKit::WebIDBIndexImpl::count):
* src/WebIDBIndexImpl.h:
* src/WebIDBObjectStoreImpl.cpp:
(WebKit::WebIDBObjectStoreImpl::count):
* src/WebIDBObjectStoreImpl.h:

LayoutTests:

* storage/indexeddb/index-basics-expected.txt:
* storage/indexeddb/index-basics.html:
* storage/indexeddb/index-count-expected.txt: Added.
* storage/indexeddb/index-count.html: Added.
* storage/indexeddb/objectstore-basics-expected.txt:
* storage/indexeddb/objectstore-basics.html:
* storage/indexeddb/objectstore-count-expected.txt: Added.
* storage/indexeddb/objectstore-count.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Further suppress media/video-transformed.html failures
https://bugs.webkit.org/show_bug.cgi?id=73905

Unreviewed gardening.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<!DOCTYPE html><pre>&#x0a;&#x0a;A</pre> doesn't parse correctly
https://bugs.webkit.org/show_bug.cgi?id=74658

Reviewed by Darin Adler.

Source/WebCore: 

Previously, we handled skipping newlines after <pre> in the tokenizer,
which isn't how the spec handles them.  Instead, the spec skips them in
the tree builder.  This isn't usually observable, except in the case of
an HTML entity.  In that case, the tokenzier sees '&' (because the
entity hasn't been decoded yet), but the tree builder sees '\n' (the
decoded entity).  This patch fixes the bug by more closely aligning our
implementation with the spec.

Test: html5lib/runner.html

* html/parser/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::reset):
(WebCore::HTMLTokenizer::nextToken):
* html/parser/HTMLTokenizer.h:
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::skipAtMostOneLeadingNewline):
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processCharacterBuffer):
* html/parser/HTMLTreeBuilder.h:
* xml/parser/MarkupTokenizerBase.h:

LayoutTests: 

Shows test progression.

* html5lib/runner-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow a PlatformCALayer to own its own sublayers
https://bugs.webkit.org/show_bug.cgi?id=74744

Reviewed by Anders Carlsson.

GraphicsLayerCA rebuilds the sublayer list of CALayers, which would
blow away any custom layers that a PlatformCALayer wants to maintain
as children.

Make it possible for a PlatformLayerCA to indicate that it wants
a specific list of sublayers to be maintained as the first layers
in the child list.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateSublayerList):
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::customSublayers):
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::PlatformCALayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Only EditCommandComposition should implement unapply and reapply
https://bugs.webkit.org/show_bug.cgi?id=74490

Reviewed by Eric Seidel.

Source/WebCore: 

Introduce new abstract class UndoStep to replace EditCommand for EditorClient, and make EditCommand
private to WebCore.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::create): Takes EditAction instead of boolean for CreateLinkCommand.
(WebCore::EditCommandComposition::EditCommandComposition): Ditto.
(WebCore::EditCommandComposition::unapply): Moved from EditCommand; we don't have to call isTopLevelCommand
anymore because EditCommandComposition is always top-level. In fact, the only thing unapply/reapply do
in addition to what doUnapply/doReapply do for sub-level commands is disabling and enabling delete button
and defining an event queue scope. However, these can be done at top-level command anyway, so we now only call
doApply for sub-level commands.
(WebCore::EditCommandComposition::reapply): Ditto.
(WebCore::EditCommandComposition::setStartingSelection): Added.
(WebCore::EditCommandComposition::setEndingSelection): Added.
(WebCore::applyCommand): Moved from EditCommand.
(WebCore::CompositeEditCommand::apply): Moved from EditCommand; doesn't call isTopLevelCommand for the same reason.
(WebCore::CompositeEditCommand::ensureComposition):
(WebCore::CompositeEditCommand::applyCommandToComposite): Call doApply instead of apply for the same reason.
* editing/CompositeEditCommand.h:
(WebCore::EditCommandComposition::wasCreateLinkCommand):
(WebCore::EditCommandComposition::startingSelection): Added.
(WebCore::EditCommandComposition::endingSelection): Added.
* editing/EditCommand.cpp:
(WebCore::EditCommand::setStartingSelection):
(WebCore::EditCommand::setEndingSelection):
(WebCore::SimpleEditCommand::doReapply): Moved from EditCommand.
* editing/EditCommand.h:
* editing/UndoStep.h: Added.
(WebCore::UndoStep::~UndoStep):
* loader/EmptyClients.h:
(WebCore::EmptyEditorClient::shouldInsertNode):
(WebCore::EmptyEditorClient::didSetSelectionTypesForPasteboard):
(WebCore::EmptyEditorClient::registerCommandForUndo): Takes UndoStep instead of EditCommand.
(WebCore::EmptyEditorClient::registerCommandForRedo): Ditto.
* page/EditorClient.h:

Source/WebKit/chromium: 

* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::registerCommandForUndo):
(WebKit::EditorClientImpl::registerCommandForRedo):
(WebKit::EditorClientImpl::undo):
(WebKit::EditorClientImpl::redo):
* src/EditorClientImpl.h:

Source/WebKit/efl: 

* WebCoreSupport/EditorClientEfl.cpp:
(WebCore::EditorClientEfl::registerCommandForUndo):
(WebCore::EditorClientEfl::registerCommandForRedo):
(WebCore::EditorClientEfl::undo):
(WebCore::EditorClientEfl::redo):
* WebCoreSupport/EditorClientEfl.h:

Source/WebKit/gtk: 

* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::registerCommandForUndo):
(WebKit::EditorClient::registerCommandForRedo):
(WebKit::EditorClient::undo):
(WebKit::EditorClient::redo):
* WebCoreSupport/EditorClientGtk.h:

Source/WebKit/mac: 

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(-[WebUndoStep initWithUndoStep:]):
(-[WebUndoStep dealloc]):
(+[WebUndoStep stepWithUndoStep:]):
(-[WebUndoStep step]):
(-[WebEditorUndoTarget undoEditing:]):
(-[WebEditorUndoTarget redoEditing:]):
(WebEditorClient::registerCommandForUndoOrRedo):
(WebEditorClient::registerCommandForUndo):
(WebEditorClient::registerCommandForRedo):

Source/WebKit/qt: 

EditCommandQt is to be renamed to UndoStepQt in a follow up patch.

* WebCoreSupport/EditCommandQt.cpp:
(EditCommandQt::EditCommandQt):
* WebCoreSupport/EditCommandQt.h:
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::registerCommandForUndo):
(WebCore::EditorClientQt::registerCommandForRedo):

Source/WebKit/win: 

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorUndoCommand::WebEditorUndoCommand):
(WebEditorUndoCommand::execute):
(WebEditorClient::registerCommandForUndo):
(WebEditorClient::registerCommandForRedo):
* WebCoreSupport/WebEditorClient.h:

Source/WebKit/wince: 

* WebCoreSupport/EditorClientWinCE.cpp:
(WebKit::EditorClientWinCE::registerCommandForUndo):
(WebKit::EditorClientWinCE::registerCommandForRedo):
* WebCoreSupport/EditorClientWinCE.h:

Source/WebKit2: 

Renamed WebEditCommand to WebUndoStep and made necessary changes.
Everything on WebProcess side should have the correct name now.

Names in the proxy and UIProcess are to be updated in a follow up.

* CMakeLists.txt:
* GNUmakefile.am:
* Target.pri:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::registerCommandForUndo):
(WebKit::WebEditorClient::registerCommandForRedo):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/WebEditCommand.cpp: Removed.
* WebProcess/WebPage/WebEditCommand.h: Removed.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::webUndoStep):
(WebKit::WebPage::addWebUndoStep):
(WebKit::WebPage::removeWebEditCommand):
(WebKit::WebPage::unapplyEditCommand):
(WebKit::WebPage::reapplyEditCommand):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebUndoStep.cpp: Copied from Source/WebKit2/WebProcess/WebPage/WebEditCommand.cpp.
(WebKit::generateUndoStep):
(WebKit::WebUndoStep::create):
* WebProcess/WebPage/WebUndoStep.h: Copied from Source/WebKit2/WebProcess/WebPage/WebEditCommand.h.
(WebKit::WebUndoStep::entry):
(WebKit::WebUndoStep::entryID):
(WebKit::WebUndoStep::WebUndoStep):
* win/WebKit2.vcproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Mark file-from-file-entry-sync as crash after r103095
https://bugs.webkit.org/show_bug.cgi?id=74746

Unreviewed gardening.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support HTML documents in XHR.responseXML
https://bugs.webkit.org/show_bug.cgi?id=74626

Latest W3C XHR spec details for the responseXML attribute:
http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-responsexml-attribute
http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#document-response-entity-body

XHR.responseXML was not compliant per the latest editor's draft of the XHR spec.
The following compliance issue have been corrected:
  - A responseType of "text" should disallow access to responseXML by throwing an InvalidState exception.
  - When the error flag is toggled, responseXML should return "null" immediately and not attempt to create a new Document.
  - responseXML should return a valid HTML document when the MIME type is "text/html", but only when the caller has
    explicitly set responseType to "document".

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Tests: fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-quirks.html
       fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-strict.html
       fast/xmlhttprequest/xmlhttprequest-responseXML-html-no-responsetype.html
       fast/xmlhttprequest/xmlhttprequest-responseXML-invalid-xml.html
       fast/xmlhttprequest/xmlhttprequest-responseXML-xml-document-responsetype.html
       fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseXML):
(WebCore::XMLHttpRequest::clearResponseBuffers):
* xml/XMLHttpRequest.h: Rename m_responseXML to m_responseDocument
(WebCore::XMLHttpRequest::optionalResponseXML):

LayoutTests:

* fast/frames/iframe-reparenting.html:
* fast/xmlhttprequest/resources/xmlhttprequest-get-invalid-data.xml: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-quirks-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-quirks.html: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-strict-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-html-document-responsetype-strict.html: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-html-no-responsetype-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-html-no-responsetype.html: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-invalid-xml-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-invalid-xml.html: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-xml-document-responsetype-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-xml-document-responsetype.html: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-responseXML-xml-text-responsetype.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103106 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, updating chromium expectations.

* platform/chromium/test_expectations.txt: fast/replaced/embed-display-none.html has been
passing and fast/replaced/width100percent-textarea.html is flaky.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Include BlackBerryPlatformLog.h instead of BlackBerryPlatformMisc.h

Rubber-stamped by Antonio Gomes.

BlackBerry::Platform::logV() is declared in BlackBerryPlatformLog.h. That is, it isn't
declared in BlackBerryPlatformMisc.h. Hence, we should include BlackBerryPlatformLog.h
instead of BlackBerryPlatformMisc.h.

* wtf/Assertions.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<!doctype html><div><body><frameset> doesn't parse correctly
https://bugs.webkit.org/show_bug.cgi?id=74745

Reviewed by Eric Seidel.

Source/WebCore: 

We were missing one place the spec tells us to set this bool.

Tests: html5lib/runner.html

* html/parser/HTMLTreeBuilder.cpp:

LayoutTests: 

Show test progression.

* html5lib/runner-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a #elsif fumble in my earlier commit.

* WebView/WebHTMLView.mm:
(-[WebHTMLView attachRootLayer:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Mark many SVG tests on Mac failing after r103091
https://bugs.webkit.org/show_bug.cgi?id=53378

Unreviewed gardening.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Give PlatformEvents a base class
https://bugs.webkit.org/show_bug.cgi?id=74685

Reviewed by Anders Carlsson.

Add a base class for PlatformMouseEvent, PlatformKeyboardEvent, PlatformWheelEvent
and PlatformGestureEvent and move Type enumeration and modifiers down to it.

../WebCore: 

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Add new files.

* platform/PlatformEvent.cpp: Added.
* platform/PlatformEvent.h: Added.
(WebCore::PlatformEvent::type):
(WebCore::PlatformEvent::shiftKey):
(WebCore::PlatformEvent::ctrlKey):
(WebCore::PlatformEvent::altKey):
(WebCore::PlatformEvent::metaKey):
(WebCore::PlatformEvent::modifiers):
(WebCore::PlatformEvent::PlatformEvent):
Add new class.

* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
* dom/KeyboardEvent.cpp:
(WebCore::eventTypeForKeyboardEventType):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::create):
* page/DragController.cpp:
(WebCore::createMouseEvent):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::fakeMouseMoveEventTimerFired):
(WebCore::EventHandler::handleAccessKey):
(WebCore::EventHandler::keyEvent):
(WebCore::EventHandler::handleDrag):
* page/blackberry/EventHandlerBlackBerry.cpp:
(WebCore::EventHandler::accessKeyModifiers):
* page/chromium/EventHandlerChromium.cpp:
(WebCore::EventHandler::accessKeyModifiers):
* page/efl/EventHandlerEfl.cpp:
(WebCore::EventHandler::accessKeyModifiers):
* page/gtk/EventHandlerGtk.cpp:
(WebCore::EventHandler::accessKeyModifiers):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::accessKeyModifiers):
* page/qt/EventHandlerQt.cpp:
(WebCore::EventHandler::accessKeyModifiers):
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::accessKeyModifiers):
* page/wx/EventHandlerWx.cpp:
(WebCore::EventHandler::accessKeyModifiers):
* platform/PlatformGestureEvent.h:
(WebCore::PlatformGestureEvent::PlatformGestureEvent):
* platform/PlatformKeyboardEvent.h:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::isKeypad):
* platform/PlatformMouseEvent.h:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
(WebCore::PlatformMouseEvent::button):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/ScrollAnimatorNone.cpp:
(WebCore::ScrollAnimatorNone::zoom):
(WebCore::ScrollAnimatorNone::handleGestureEvent):
* platform/blackberry/PlatformKeyboardEventBlackBerry.cpp:
(WebCore::toWebCorePlatformKeyboardEventType):
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
* platform/chromium/GestureRecognizerChromium.cpp:
(WebCore::GestureRecognizerChromium::appendTapDownGestureEvent):
(WebCore::GestureRecognizerChromium::appendClickGestureEvent):
(WebCore::GestureRecognizerChromium::appendDoubleClickGestureEvent):
(WebCore::GestureRecognizerChromium::appendScrollGestureBegin):
(WebCore::GestureRecognizerChromium::appendScrollGestureEnd):
(WebCore::GestureRecognizerChromium::appendScrollGestureUpdate):
* platform/chromium/PlatformKeyboardEventChromium.cpp:
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
* platform/chromium/PopupContainer.cpp:
(WebCore::PopupContainer::handleGestureEvent):
* platform/chromium/PopupListBox.cpp:
(WebCore::isCharacterTypeEvent):
(WebCore::PopupListBox::handleKeyEvent):
* platform/chromium/ScrollAnimatorChromiumMac.mm:
(WebCore::ScrollAnimatorChromiumMac::handleGestureEvent):
* platform/efl/PlatformKeyboardEventEfl.cpp:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
* platform/efl/PlatformMouseEventEfl.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/efl/PlatformWheelEventEfl.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/mac/PlatformMouseEventMac.mm:
(WebCore::mouseEventForNSEvent):
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::handleGestureEvent):
* platform/mac/WheelEventMac.mm:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/qt/PlatformKeyboardEventQt.cpp:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
* platform/qt/PlatformMouseEventQt.cpp:
(WebCore::mouseEventTypeAndMouseButtonFromQEvent):
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/qt/WheelEventQt.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/win/KeyEventWin.cpp:
(WebCore::isKeypadEvent):
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/win/PlatformMouseEventWin.cpp:
(WebCore::messageToEventType):
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/wx/KeyboardEventWx.cpp:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
* platform/wx/MouseEventWx.cpp:
(WebCore::typeFromMouseEvent):
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/wx/MouseWheelEventWx.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* plugins/mac/PluginViewMac.mm:
(WebCore::PluginView::handleKeyboardEvent):
* testing/Internals.cpp:
(WebCore::Internals::setZoomAnimatorTransform):
Switch to using new names/class modifier as necessary.

../WebKit/chromium: 

* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::interpretKeyEvent):
(WebKit::EditorClientImpl::handleEditingKeyboardEvent):
* src/WebAccessibilityObject.cpp:
(WebKit::WebAccessibilityObject::keyboardShortcut):
* src/WebInputEventConversion.cpp:
(WebKit::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
(WebKit::PlatformWheelEventBuilder::PlatformWheelEventBuilder):
(WebKit::PlatformGestureEventBuilder::PlatformGestureEventBuilder):
(WebKit::toPlatformKeyboardEventType):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::dragSourceEndedAt):
* tests/InnerGestureRecognizerTest.cpp:
(SimulateAndTestFirstClick):
(TEST_F):
* tests/KeyboardTest.cpp:
(WebKit::KeyboardTest::interpretKeyEvent):
(WebKit::KeyboardTest::interpretOSModifierKeyPress):
(WebKit::KeyboardTest::interpretCtrlKeyPress):
(WebKit::KeyboardTest::interpretTab):
(WebKit::KeyboardTest::interpretNewLine):
(WebKit::TEST_F):
* tests/PopupMenuTest.cpp:
(WebKit::SelectPopupMenuTest::simulateLeftMouseDownEvent):
(WebKit::SelectPopupMenuTest::simulateLeftMouseUpEvent):
(WebKit::TEST_F):

../WebKit/efl: 

* WebCoreSupport/EditorClientEfl.cpp:
(WebCore::EditorClientEfl::handleEditingKeyboardEvent):

../WebKit/gtk: 

* WebCoreSupport/EditorClientGtk.cpp:
(WebKit::EditorClient::handleKeyboardEvent):
* webkit/webkitwebview.cpp:
(webkit_web_view_popup_menu_handler):

../WebKit/mac: 

* WebView/WebFrame.mm:
(-[WebFrame _dragSourceEndedAt:operation:]):
* WebView/WebHTMLView.mm:
(currentKeyboardEvent):
(-[WebHTMLView _interpretKeyEvent:savingCommands:]):
* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):

../WebKit/qt: 

* WebCoreSupport/DragClientQt.cpp:
(WebCore::DragClientQt::startDrag):
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::handleKeyboardEvent):

../WebKit/win: 

* AccessibleBase.cpp:
(AccessibleBase::get_accKeyboardShortcut):
* WebDropSource.cpp:
(generateMouseEvent):
* WebView.cpp:
(WebView::keyUp):
(WebView::handleEditingKeyboardEvent):
(WebView::keyDown):
(WebView::keyPress):

../WebKit/wince: 

* WebCoreSupport/EditorClientWinCE.cpp:
(WebKit::EditorClientWinCE::handleEditingKeyboardEvent):
* WebView.cpp:
(WebView::handleKeyDown):
(WebView::handleKeyPress):
(WebView::handleKeyUp):

../WebKit/wx: 

* WebKitSupport/EditorClientWx.cpp:
(WebCore::EditorClientWx::handleEditingKeyboardEvent):
(WebCore::EditorClientWx::interpretKeyEvent):

../WebKit2: 

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
(WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent):
(WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
(WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::handleKeyboardEvent):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleMouseEvent):
(WebKit::WebPage::setInitialFocus):
(WebKit::WebPage::handleEditingKeyboardEvent):
(WebKit::WebPage::dragEnded):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::executeKeypressCommandsInternal):
(WebKit::WebPage::handleEditingKeyboardEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Mark more worker regressions from r103095
https://bugs.webkit.org/show_bug.cgi?id=74746

Unreviewed gardening.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a pretty dumb tile cache to WebTileCacheLayer
https://bugs.webkit.org/show_bug.cgi?id=74753

Reviewed by Simon Fraser.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::requiresTiledLayer):
If a layer is a tile cache layer, we never want to swap it out for a tiled layer.

(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
Assert that we don't have a tile cache layer.

* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::PlatformCALayer):
If we have a tile cache layer, add its tile container to the list of custom sublayers.

* platform/graphics/ca/mac/TileCache.h: Added.
(WebCore::TileCache::tileContainerLayer):
Return the tile container layer.

* platform/graphics/ca/mac/TileCache.mm: Added.
(WebCore::TileCache::tileCacheLayerBoundsChanged):
Resize the tile grid if necessary.

(WebCore::TileCache::setNeedsDisplayInRect):
Invalidate the necessary tiles.

(WebCore::TileCache::drawLayer):
Set up the transform and draw the layer.

(WebCore::TileCache::getTileRangeForRect):
Given a rect, return the range of tiles that it covers.

(WebCore::TileCache::numTilesForGridSize):
Given a size, return how many tiles are needed to completely cover it.

(WebCore::TileCache::resizeTileGrid):
Create new tile layers if needed, or reuse already existing ones.

(WebCore::TileCache::tileLayerAtPosition):
Given a position in the grid, return the tile layer.

(WebCore::TileCache::createTileLayer):
Create a WebTileLayer and set it up.

* platform/graphics/ca/mac/WebTileCacheLayer.h:
* platform/graphics/ca/mac/WebTileCacheLayer.mm:
(-[WebTileCacheLayer setBounds:]):
(-[WebTileCacheLayer setNeedsDisplayInRect:]):
(-[WebTileCacheLayer tileContainerLayer]):
Call down to the tile cache object.

* platform/graphics/ca/mac/WebTileLayer.h: Added.
* platform/graphics/ca/mac/WebTileLayer.mm: Added.

(-[WebTileLayer drawInContext:]):
Ask the tile cache to draw the given layer.

(-[WebTileLayer setTileCache:WebCore::]):

Source/WebKit2:

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
Always do a layout here, to prevent an ASSERT(!needsLayout()) when painting.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cache and reuse HTMLCollections exposed by Document.
<http://webkit.org/b/71956>

Reviewed by Antti Koivisto.

Source/WebCore: 

Let Document cache the various HTMLCollection objects it exposes.
This is a behavior change in two ways:

1) The lifetime of returned collections is now tied to the lifetime
   of the Document. This matches the behavior of Firefox and Opera.

2) The cached collections returned by document are now exactly equal
   to those returned by subsequent calls to the same getters.

This reduces memory consumption by ~800 kB (on 64-bit) when loading
the full HTML5 spec. document.links was called 34001 times, yielding
34001 separate HTMLCollections, and now we only need 1.

The document.all collection retains the old behavior, as caching it
will be a bit more complicated.

To avoid a reference cycle between Document and HTMLCollection,
collections that are cached on Document do not retained their base
node pointer (controlled by a m_baseIsRetained flag.)

Tests: fast/dom/document-collection-idempotence.html
       fast/dom/gc-9.html

* dom/Document.cpp:
(WebCore::Document::detach):
(WebCore::Document::cachedCollection):
(WebCore::Document::images):
(WebCore::Document::applets):
(WebCore::Document::embeds):
(WebCore::Document::plugins):
(WebCore::Document::objects):
(WebCore::Document::scripts):
(WebCore::Document::links):
(WebCore::Document::forms):
(WebCore::Document::anchors):
* dom/Document.h:
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
(WebCore::HTMLCollection::createForCachingOnDocument):
(WebCore::HTMLCollection::~HTMLCollection):
(WebCore::HTMLCollection::itemAfter):
* html/HTMLCollection.h:
(WebCore::HTMLCollection::base):

LayoutTests: 

Added a test to verify that collections returned by document (excluding .all)
are equal to the collections returned by subsequent calls to the same getters.

Also update fast/dom/gc-9.html to cover the new lifetime behavior of
HTMLCollection objects returned by document.

* fast/dom/document-collection-idempotence-expected.txt: Added.
* fast/dom/document-collection-idempotence.html: Added.
* fast/dom/gc-9-expected.txt:
* fast/dom/gc-9.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
invalidateNodeListsCacheAfterAttributeChanged has too many callers
https://bugs.webkit.org/show_bug.cgi?id=74692

Reviewed by Sam Weinig.

Source/WebCore: 

Call invalidateNodeListsCacheAfterAttributeChanged in Element::updateAfterAttributeChanged instead of
parsedMappedAttribute of various elements. Also make invalidateNodeListsCacheAfterAttributeChanged take
the qualified name of the changed attribute so that we can exit early when the changed attribute isn't
one of attributes we care.

In addition, added a missing call to invalidateNodeListsCacheAfterAttributeChanged in Attr::setValue.

Test: fast/dom/Attr/invalidate-nodelist-after-attr-setvalue.html

* dom/Attr.cpp:
(WebCore::Attr::childrenChanged):
* dom/Element.cpp:
(WebCore::Element::updateAfterAttributeChanged):
* dom/NamedNodeMap.cpp:
(WebCore::NamedNodeMap::addAttribute):
(WebCore::NamedNodeMap::removeAttribute):
* dom/Node.cpp:
(WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged):
* dom/Node.h:
* dom/StyledElement.cpp:
(WebCore::StyledElement::classAttributeChanged):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseMappedAttribute):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::parseMappedAttribute):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseMappedAttribute):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::parseMappedAttribute):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::parseMappedAttribute):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::parseMappedAttribute):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::parseMappedAttribute):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseMappedAttribute):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::parseMappedAttribute):
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::parseMappedAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseMappedAttribute):
* html/HTMLParamElement.cpp:
(WebCore::HTMLParamElement::parseMappedAttribute):

LayoutTests: 

Add a regression test for setting Attr's value. WebKit should invalidate the cache as needed.

* fast/dom/Attr/invalidate-nodelist-after-attr-setvalue-expected.txt: Added.
* fast/dom/Attr/invalidate-nodelist-after-attr-setvalue.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel antialiasing not working in tiled mode
https://bugs.webkit.org/show_bug.cgi?id=74759

Reviewed by Simon Fraser.

Call setContentsOpaque(true) on the main frame render view layer so subpixel aa will be used
when drawing text into that layer.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Canvas should respect backing store scale ratio when used as drawImage() source
https://bugs.webkit.org/show_bug.cgi?id=74758
<rdar://problem/10350194>

Reviewed by Simon Fraser.

Interpret the source rectangle passed into drawImage() when using a Canvas source in the source Canvas coordinate space,
instead of in the backing store coordinate space, without changing the behavior of drawImage(canvas, x, y).

No new tests.

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::convertDeviceToLogical):
* html/HTMLCanvasElement.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawImage):


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