[Qt] Let Page create the main Frame.
https://bugs.webkit.org/show_bug.cgi?id=120349

Adjust to latest changes in WebCore::Page to create the main frame.

Patch by Arunprasad Rajkumar <arurajku@cisco.com> on 2013-08-27
Reviewed by Simon Hausmann.

* WebCoreSupport/QWebFrameAdapter.cpp:
(QWebFrameData::QWebFrameData):
* WebCoreSupport/QWebPageAdapter.cpp:
(QWebPageAdapter::initializeWebCorePage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Assertion while scrolling news.google.com
https://bugs.webkit.org/show_bug.cgi?id=115303

Reviewed by Anders Carlsson.

Do not relayout when accessing script elements during painting.

* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::renderWidgetForJSBindings):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement DOM3 wheel event
https://bugs.webkit.org/show_bug.cgi?id=94081

Reviewed by Darin Adler.

Source/WebCore:

Add support for DOM Level 3 WheelEvent:
http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent

Firefox, IE10 and since recently Blink already support it so
it increases our cross-browser compatibility.

The non-standard 'mousewheel' event is still supported for backward
compatibility. Note that the deltas returned by the mousewheel and
the wheel events are not identical:
- They have opposite signs.
- The wheel event reports the actual amount of pixels that should be
scrolled while the legacy mousewheel event reports a factor of the
number of mouse wheel ticks (using a constant multiplier).

Tests: fast/events/wheelevent-basic.html
       fast/events/wheelevent-constructor.html
       fast/events/wheelevent-mousewheel-interaction.html

* dom/Document.h:
* dom/Document.idl:
* dom/Element.h:
* dom/Element.idl:
* dom/EventNames.h:
* dom/EventTarget.cpp:
(WebCore::legacyType):
(WebCore::EventTarget::shouldObserveLegacyType):
(WebCore::EventTarget::setupLegacyTypeObserverIfNeeded):
(WebCore::EventTarget::fireEventListeners):
* dom/EventTarget.h:
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
* dom/WheelEvent.cpp:
(WebCore::WheelEventInit::WheelEventInit):
(WebCore::WheelEvent::WheelEvent):
(WebCore::WheelEvent::initWheelEvent):
* dom/WheelEvent.h:
(WebCore::WheelEvent::deltaX):
(WebCore::WheelEvent::deltaY):
(WebCore::WheelEvent::deltaZ):
(WebCore::WheelEvent::wheelDelta):
(WebCore::WheelEvent::wheelDeltaX):
(WebCore::WheelEvent::wheelDeltaY):
* dom/WheelEvent.idl:
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::eventNameForAttributeName):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* page/EventHandler.cpp:
(WebCore::EventHandler::defaultWheelEventHandler):
* plugins/blackberry/PluginViewBlackBerry.cpp:
(WebCore::PluginView::handleWheelEvent):
* svg/SVGElementInstance.cpp:
* svg/SVGElementInstance.h:
* svg/SVGElementInstance.idl:

LayoutTests:

Add several layout tests to check support for DOM3 wheel event.

* fast/events/wheelevent-basic-expected.txt: Added.
* fast/events/wheelevent-basic.html: Added.
* fast/events/wheelevent-constructor-expected.txt: Added.
* fast/events/wheelevent-constructor.html: Added.
* fast/events/wheelevent-mousewheel-interaction-expected.txt: Added.
* fast/events/wheelevent-mousewheel-interaction.html: Added.
* platform/efl/fast/events/wheelevent-basic-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Font's fast code path doesn't handle partial runs correctly when kerning or ligatures are enabled
https://bugs.webkit.org/show_bug.cgi?id=100050

Reviewed by Darin Adler.

Renamed m_characterIndex to m_characterIndexOfGlyph and gave it an inline size of 10,
which covers around 66% of all cases. The rest of the cases are now preallocated to the
upper limit which is length of the original TextRun.

* platform/graphics/FontFastPath.cpp:
(WebCore::Font::getGlyphsAndAdvancesForSimpleText):
(WebCore::Font::selectionRectForSimpleText):
(WebCore::Font::offsetForPositionForSimpleText):
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::WidthIterator):
(WebCore::WidthIterator::advanceInternal):
* platform/graphics/WidthIterator.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
grammar-markers.html and grammar-markers-hidpi.html pass even if element does not have grammar marker
https://bugs.webkit.org/show_bug.cgi?id=119797

Reviewed by Ryosuke Niwa.

After tenth attempts of verifying the grammar marker, the tests call'notifyDone'
even if grammar marker was not be found.

Both grammar-marker.html and grammar-marker-hidpi.html call the text checker
asynchronously. Therefore, we need to wait until either the grammar marker
is found or number of attempts is reached.

Dump more information whether the grammar marker was found to be sure that
the tests do not pass when the element does not have the marker.

* editing/spelling/grammar-markers-expected.txt:
* editing/spelling/grammar-markers-hidpi-expected.txt:
Update the expectations.

* editing/spelling/grammar-markers-hidpi.html:
* editing/spelling/grammar-markers.html:
Dump more information.
Additionally, pass 'document' to hasGrammarMarker instead of
'target' as the method does not work for target/source elements.

* platform/mac/editing/spelling/grammar-markers-expected.png:
* platform/mac/editing/spelling/grammar-markers-hidpi-expected.png: Added.
Update the expectations for Mac.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Document's renderer is always a RenderView.
<https://webkit.org/b/120304>

Reviewed by Darin Adler.

Let's enforce this better by storing a RenderView* instead of a plain RenderObject*.
We should switch callers that grab at Document::renderer() to calling renderView()
instead, but that's better done separately.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::setRenderView):
(WebCore::Document::createRenderTree):
(WebCore::Document::detach):
(WebCore::Document::setInPageCache):
* dom/Document.h:
(WebCore::Document::renderView):
(WebCore::Document::renderer):
* html/parser/HTMLResourcePreloader.cpp:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::setStyle):
* rendering/RenderView.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::updateCurrentTranslate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[l10n] Updated Polish translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=119986

Patch by Piotr Drąg <piotrdrag@gmail.com> on 2013-08-27
Reviewed by Gustavo Noronha Silva.

* pl.po: updated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FocusController::focusedOrMainFrame() should return a reference.
<https://webkit.org/b/120339>

Reviewed by Antti Koivisto.

Now that Page::mainFrame() returns a reference, we can make this return a reference
too, since there's always either a focused or a main frame.

One hectogram of null checks removed as a result.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Switch some more code to element child/descendant iterators
https://bugs.webkit.org/show_bug.cgi?id=120355

Reviewed by Andreas Kling.

Move from Traversal<ElementType>::next() and Traversal<ElementType>::nextSibling() to iterators.

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::getFontData):
* dom/Document.cpp:
(WebCore::Document::removeTitle):
(WebCore::Document::updateBaseURL):
(WebCore::Document::processBaseElement):
* dom/TreeScope.cpp:
(WebCore::TreeScope::labelElementForId):
(WebCore::TreeScope::findAnchor):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::invalidateDisabledStateUnder):
(WebCore::HTMLFieldSetElement::childrenChanged):
* html/HTMLLabelElement.cpp:
(WebCore::HTMLLabelElement::control):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parametersForPlugin):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::isSVGFilterPrimitiveStandardAttributes):
(WebCore::SVGFilterPrimitiveStandardAttributes):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::hasSingleSecurityOrigin):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Added new accessibility expectations after r153798.
https://bugs.webkit.org/show_bug.cgi?id=120354

Unreviewed EFL gardening.

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-08-27

* platform/efl-wk1/accessibility/image-link-expected.txt: Added.
* platform/efl-wk1/accessibility/image-map2-expected.txt: Added.
* platform/efl-wk1/accessibility/table-cell-spans-expected.txt: Added.
* platform/efl-wk1/accessibility/table-cells-expected.txt: Added.
* platform/efl-wk2/accessibility/image-link-expected.txt: Added.
* platform/efl-wk2/accessibility/image-map2-expected.txt: Added.
* platform/efl-wk2/accessibility/table-cell-spans-expected.txt:
* platform/efl-wk2/accessibility/table-cells-expected.txt:
* platform/efl/TestExpectations:
* platform/efl/accessibility/image-link-expected.txt: Removed.
* platform/efl/accessibility/image-map2-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Column Breakpoint not working, may be off by 1
https://bugs.webkit.org/show_bug.cgi?id=120334

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-08-27
Reviewed by David Kilzer.

Source/WebCore:

JavaScriptCore changed to 1-based column numbers at some point. We
need to update the ScriptDebugger assumption that they were 0-based.

Test: inspector-protocol/debugger/column-breakpoint.html

* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::createCallFrame):
(WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded):

LayoutTests:

Write a protocol test for setting a breakpoint at a line:column.

* inspector-protocol/debugger/column-breakpoint-expected.txt: Added.
* inspector-protocol/debugger/column-breakpoint.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove branch from DescendantIteratorAdapter::begin() when invoking for ContainerNode
https://bugs.webkit.org/show_bug.cgi?id=120358

Reviewed by Andreas Kling.

* dom/ContainerNode.h:
        
    Delete isContainerNode() so it can't be called if there is static knowledge that the object is a ContainerNode.

* dom/DescendantIterator.h:
(WebCore::::DescendantIterator):

    Make DescendantIterator use Node* as root instead of ContainerNode*. It is only used for equality comparison.

(WebCore::::begin):
        
    Remove branch. Rely on ElementTraversal specialization for ContainerNodes.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[gstreamer] Make sure gstreamer source element is thread-safe
https://bugs.webkit.org/show_bug.cgi?id=115352

Patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk> on 2013-08-27
Reviewed by Philippe Normand.

Source/WebCore:

GStreamer source element may be created by any gstreamer element on any thread by calling
gst_element_make_from_uri with the URIs handled by the source element.
This patch makes sure the gstreamer source element is thread-safe to avoid issues with it
being created outside the main thread.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init):
(webKitWebSrcDispose):
(webKitWebSrcFinalize):
(webKitWebSrcSetProperty):
(webKitWebSrcGetProperty):
(removeTimeoutSources):
(webKitWebSrcStop):
(webKitWebSrcStart):
(webKitWebSrcChangeState):
(webKitWebSrcQueryWithParent):
(webKitWebSrcGetUri):
(webKitWebSrcSetUri):
(webKitWebSrcNeedDataMainCb):
(webKitWebSrcNeedDataCb):
(webKitWebSrcEnoughDataMainCb):
(webKitWebSrcEnoughDataCb):
(webKitWebSrcSeekMainCb):
(webKitWebSrcSeekDataCb):
(webKitWebSrcSetMediaPlayer):
(StreamingClient::StreamingClient):
(StreamingClient::~StreamingClient):
(StreamingClient::createReadBuffer):
(StreamingClient::handleResponseReceived):
(StreamingClient::handleDataReceived):
(StreamingClient::handleNotifyFinished):
(CachedResourceStreamingClient::CachedResourceStreamingClient):
(CachedResourceStreamingClient::~CachedResourceStreamingClient):
(CachedResourceStreamingClient::loadFailed):
(CachedResourceStreamingClient::setDefersLoading):
(CachedResourceStreamingClient::getOrCreateReadBuffer):
(CachedResourceStreamingClient::responseReceived):
(CachedResourceStreamingClient::dataReceived):
(CachedResourceStreamingClient::notifyFinished):
(ResourceHandleStreamingClient::ResourceHandleStreamingClient):
(ResourceHandleStreamingClient::~ResourceHandleStreamingClient):
(ResourceHandleStreamingClient::loadFailed):
(ResourceHandleStreamingClient::setDefersLoading):
(ResourceHandleStreamingClient::getOrCreateReadBuffer):
(ResourceHandleStreamingClient::willSendRequest):
(ResourceHandleStreamingClient::didReceiveResponse):
(ResourceHandleStreamingClient::didReceiveData):
(ResourceHandleStreamingClient::didFinishLoading):
(ResourceHandleStreamingClient::didFail):
(ResourceHandleStreamingClient::wasBlocked):
(ResourceHandleStreamingClient::cannotShowURL):
Make element thread-safe, add support to use the element without a player associated (e.g.
the DASH plugin using the webkitsrc to download fragments), use GMutexLocker to simplify
locks and other general improvements.

Source/WTF:

Add convenience class that simplifies locking and unlocking a GMutex.

* GNUmakefile.list.am:
* wtf/gobject/GMutexLocker.h: Added.
(WebCore::GMutexLocker::GMutexLocker):
(WebCore::GMutexLocker::~GMutexLocker):
(WebCore::GMutexLocker::lock):
(WebCore::GMutexLocker::unlock):
(WebCore::GMutexLocker::mutex):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Added new accessibility expectations after r154332
https://bugs.webkit.org/show_bug.cgi?id=120359

Unreviewed EFL gardening.

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-08-27

* platform/efl-wk1/accessibility/file-upload-button-stringvalue-expected.txt: Added.
* platform/efl-wk2/accessibility/file-upload-button-stringvalue-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLAppletElement: Use child iterator to walk <param> children.
<https://webkit.org/b/120361>

Reviewed by Antti Koivisto.

Take Antti's fancy new child iterator for a quick spin.

* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::updateWidget):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderView::flowThreadController() should return a reference.
<https://webkit.org/b/120363>

Reviewed by Antti Koivisto.

This function does lazy construction and always returns an object.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Delete unnecessary empty directory.
Unreviewed gardening.

* platform/qt-5.0-wk2/tables: Removed.
* platform/qt-5.0-wk2/tables/layering: Removed.
* platform/qt-5.0-wk2/tables/mozilla: Removed.
* platform/qt-5.0-wk2/tables/mozilla/bugs: Removed.
* platform/qt-5.0-wk2/tables/mozilla/collapsing_borders: Removed.
* platform/qt-5.0-wk2/tables/mozilla/core: Removed.
* platform/qt-5.0-wk2/tables/mozilla/dom: Removed.
* platform/qt-5.0-wk2/tables/mozilla/marvin: Removed.
* platform/qt-5.0-wk2/tables/mozilla/other: Removed.
* platform/qt-5.0-wk2/tables/mozilla_expected_failures: Removed.
* platform/qt-5.0-wk2/tables/mozilla_expected_failures/bugs: Removed.
* platform/qt-5.0-wk2/tables/mozilla_expected_failures/collapsing_borders: Removed.
* platform/qt-5.0-wk2/tables/mozilla_expected_failures/core: Removed.
* platform/qt-5.0-wk2/tables/mozilla_expected_failures/dom: Removed.
* platform/qt-5.0-wk2/tables/mozilla_expected_failures/marvin: Removed.
* platform/qt-5.0-wk2/tables/mozilla_expected_failures/other: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify some more Settings access where we have a Frame in reach.
<https://webkit.org/b/120256>

Reviewed by Darin Adler.

RenderObjects can always find Settings through the Frame.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderView::availableLogicalHeight() should be self-contained.
<https://webkit.org/b/120356>

Reviewed by Antti Koivisto.

Instead of checking isRenderView() in RenderBox::availableLogicalHeightUsing()
and doing an early return, do everything needed without leaving RenderView instead.
Document style never has min-/max-height so there's no need to apply constraints.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::availableLogicalHeightUsing):
* rendering/RenderView.cpp:
(WebCore::RenderView::availableLogicalHeight):

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

* rendering/svg/RenderSVGResourceFilter.cpp:

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