[Qt][WK2] Commit the preedit string in the input method when focus is about to be moved.
https://bugs.webkit.org/show_bug.cgi?id=97774

Reviewed by Kenneth Rohde Christiansen.

Implements the handler for willSetInputMethodState in WebKit2 in Qt.
This is needed to tell the input method instance in Qt to commit its
preedit content when the focus has moved to another node to prevent a
bug where the old preedit string was kept as the preedit string and
the editor moved focus back to the old node when continuing to enter
text via the input method.

This behavior is analog to the behavior of the QtQuick text input
elements.

* UIProcess/API/qt/raw/qrawwebview.cpp:
(QRawWebViewPrivate::handleWillSetInputMethodState):
* UIProcess/API/qt/raw/qrawwebview_p_p.h:
(QRawWebViewPrivate):
* UIProcess/PageClient.h:
(PageClient):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/qt/QtPageClient.cpp:
(WebKit::QtPageClient::handleWillSetInputMethodState):
(WebKit):
* UIProcess/qt/QtPageClient.h:
(QtPageClient):
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::handleWillSetInputMethodState):
(WebKit):
* UIProcess/qt/QtWebPageEventHandler.h:
(QtWebPageEventHandler):
* UIProcess/qt/WebPageProxyQt.cpp:
(WebKit::WebPageProxy::willSetInputMethodState):
(WebKit):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::willSetInputMethodState):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test svg/animations/mpath-remove-from-dependents-on-delete-crash.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=103375

Unreviewed expectations update.

The test is no longer flakey after yeterdays test modification.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Chromium expectations cleanup

* platform/chromium-mac-snowleopard/fast/css/font-weight-1-expected.png: Removed. Should not have been added ever.
* platform/chromium-mac-snowleopard/fast/css/font-weight-1-expected.txt: Removed. Should not have been added ever.
* platform/chromium-mac/fast/css/font-weight-1-expected.png: Removed. Should not have been added ever.
* platform/chromium-mac/fast/css/font-weight-1-expected.txt: Removed. Should not have been added ever.
* platform/chromium-win/fast/css/font-weight-1-expected.png: Removed. Should not have been added ever.
* platform/chromium/TestExpectations: Removed tests now passing
* platform/chromium/fast/css/font-weight-1-expected.png: Copied from LayoutTests/platform/chromium-win/fast/css/font-weight-1-expected.png.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Possible to resize out of bounds
https://bugs.webkit.org/show_bug.cgi?id=103521

Reviewed by Jocelyn Turcotte.

Enforce the viewportBounds after resize, and ensure a user fitted page remains
fit on viewport resize, but not on content growth.

* UIProcess/API/qt/tests/qmltests/WebView/tst_resize.qml: Added.
* UIProcess/PageViewportController.cpp:
(WebKit::PageViewportController::didChangeContentsSize):
(WebKit::PageViewportController::didChangeViewportAttributes):
(WebKit::PageViewportController::updateMinimumScaleToFit):
* UIProcess/PageViewportController.h:
(PageViewportController):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed, update Mac expectation after r136128.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: HTMLMediaElement's .textTracks property does not reflect <track> element
https://bugs.webkit.org/show_bug.cgi?id=103420

Reviewed by Eric Carlson.

There were some assumptions that <track> elements are valid only
if the parent <media> is in document. This change relaxes this
assumption so that <track> is valid when it has <media> as a
parent regardless whether the <media> is in the document or not.

HTMLMediaElement::didAddTrack and didRemoveTrack are now called
when the <track> is inserted to or removed from the parent <media>
element.

Test: media/track/track-node-add-remove.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didRemoveTrack):
Renamed from willRemoveTrack() to reflect the timing. This was once called from
Node::willRemove(), which was removed a while ago.
* html/HTMLMediaElement.h:
(HTMLMediaElement):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::insertedInto):
The old code notified parent <media> only if the subtree became a part of the document.
Now it notifies the <media> when this <track> becomes a child of that <media>.

(WebCore::HTMLTrackElement::removedFrom):
The old code notifies the parent <media> every time as long as the parent is available.
Now it notifies the <media> only if this <track> is removed from the parent <media>.
This matches how corresponding notification is done in insertedInto().

* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::trackElementIndex):

LayoutTests: HTMLMediaElement's .textTracks property does not reflect <track> element
https://bugs.webkit.org/show_bug.cgi?id=103420

Reviewed by Eric Carlson.

* media/track/track-node-add-remove-expected.txt: Added.
* media/track/track-node-add-remove.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Typo in 'autofocus' sandboxing error message.
https://bugs.webkit.org/show_bug.cgi?id=103616

Reviewed by Jochen Eisinger.

Source/WebCore:

The sandbox attribute name is 'allow-scripts', not 'allow-script'. :(

* html/HTMLFormControlElement.cpp:
(WebCore::shouldAutofocus):

LayoutTests:

* fast/frames/sandboxed-iframe-autofocus-denied-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] TiledBackingStore: User events are sent to web page before it is shown
https://bugs.webkit.org/show_bug.cgi?id=101753

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-11-29
Reviewed by Jocelyn Turcotte.

User events are suppressed on WEB process side while drawing area is frozen.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::wheelEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::gestureEvent):
(WebKit::WebPage::touchEvent):
(WebKit::WebPage::sendIfEventCannotBeHandled):
(WebKit):
(WebKit::WebPage::didCompletePageTransition):
* WebProcess/WebPage/WebPage.h:
(WebPage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
run-perf-tests --chromium-android fails due to Skia INFO logging
https://bugs.webkit.org/show_bug.cgi?id=103585

Reviewed by Adam Barth.

Ignore all INFO logging from Chromium code.
Also added some basic testing of the ignored-stderr lines code.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest):
* Scripts/webkitpy/performance_tests/perftest_unittest.py:
(MainTest.test_ignored_stderr_lines):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GraphicsSurfaceGLX: remove redundant parameter from resolveGLMethods.
https://bugs.webkit.org/show_bug.cgi?id=103636

Reviewed by Kenneth Rohde Christiansen.

* platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
(WebCore::resolveGLMethods):
(WebCore::GraphicsSurface::platformCreate):
(WebCore::GraphicsSurface::platformImport):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Update BB10 form theme.
https://bugs.webkit.org/show_bug.cgi?id=100760

Patch by Tiancheng Jiang <tijiang@rim.com> on 2012-11-29
Reviewed by Rob Buis.

Internally Reviewed by Eli Fidler.
Set text color after buttons are pressed.

* css/themeBlackBerry.css:
(input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, button:active):
(select:active):
* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore):
(WebCore::RenderThemeBlackBerry::paintButton):
(WebCore::RenderThemeBlackBerry::paintMenuList):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for WinCE after r136096.

* wtf/StringPrintStream.cpp: Added missing include file.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Add code supppression flags for skia

Unreviewed addition of Skia build flags to allow for their removal from Chromium's skia.gyp.

* skia_webkit.gyp: Added defines for SK_DISABLE_DITHER_32BIT_GRADIENT and SK_DISABLE_DASHING_OPTIMIZATION


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CoordinatedGraphics] Have LayerTreeRenderer::ensureLayer() return the layer
https://bugs.webkit.org/show_bug.cgi?id=103645

Reviewed by Noam Rosenthal.

The current LayerTreeRenderer code keep calling ensureLayer() and then
LayerMap::find() to retrieve the layer. Since ensureLayer() already has
a pointer to the layer, we can simply have the function return it.
This is slightly more efficient and it makes the code a bit simpler.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::setLayerChildren):
(WebKit::LayerTreeRenderer::setLayerFilters):
(WebKit::LayerTreeRenderer::setLayerState):
(WebKit::LayerTreeRenderer::ensureLayer):
* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speculative Windows build fix after r136086.

Unreviewed build fix.

Suspect that ?setDumpsGeneratedCode@BytecodeGenerator@JSC@@SAX_N@Z needs to be removed from Windows
export list since the symbol was removed in r136086.

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build after r136095
https://bugs.webkit.org/show_bug.cgi?id=103629

Unreviewed.

Add a static_cast to fix the build.

Patch by Andrei Bucur <abucur@adobe.com> on 2012-11-29

* Shared/mac/ObjCObjectGraphCoders.mm:
(WebKit::ObjCObjectGraphEncoder::baseEncode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/12771885> Support ruby-position: {before, after}
https://bugs.webkit.org/show_bug.cgi?id=103569

Reviewed by Anders Carlsson.

Source/WebCore: 

Specified in <http://www.w3.org/TR/2011/WD-css3-ruby-20110630/#rubypos>, the ruby-position
property takes four values: before, after, inter-character, and inline. This change adds
support for the values before and after.

Test: fast/ruby/position-after.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Handle ruby-position.
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue): Accept before and after as valid values for
ruby-position.
(WebCore::isKeywordPropertyID): Added ruby-position to the list of properties with keyword
values.
(WebCore::CSSParser::parseValue): Added ruby-position to the switch statement.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added mapping from RubyPosition.
(WebCore::CSSPrimitiveValue::operator RubyPosition): Added mapping from CSSPrimitiveValue.
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty): Added ruby-position as an inherited property.
* css/CSSPropertyNames.in: Added -webkit-ruby-position.
* css/CSSValueKeywords.in: Added after and before.
* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder): Added a handler for ruby-position.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty): Added ruby-position.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection): Changed to choose which of
hasAnnotationsBefore and hasAnnotationsAfter to set based on ruby position.
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment): Changed to adjust only for
ruby positioned before the base.
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment): Added adjustment for ruby
positioned after the base.
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layout): Account for ruby-position when positioning the ruby text
relative to the base.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff): Made a ruby-position difference a layout difference.
* rendering/style/RenderStyle.h: Added rubyPosition(), setRubyPosition(), and 
initialRubyPosition().
* rendering/style/RenderStyleConstants.h: Added the RubyPosition enum.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData): Added initialized for
m_rubyPosition. Added copying the value of this member to the copy constructor.
(WebCore::StyleRareInheritedData::operator==): Added comparison of m_rubyPosition.
* rendering/style/StyleRareInheritedData.h:
(StyleRareInheritedData): Added m_rubyPosition member variable.

LayoutTests: 

* fast/ruby/position-after.html: Added.
* platform/mac/fast/ruby/position-after-expected.png: Added.
* platform/mac/fast/ruby/position-after-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] LayoutTests/fast/js/string-replacement-outofmemory.html crashes
https://bugs.webkit.org/show_bug.cgi?id=103348

Reviewed by Abhishek Arya.

Add a comment to explain that the crash is expected and is performed in an
orderly fashion.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Console: hovering node wrappers in object tree should highlight them on the page
https://bugs.webkit.org/show_bug.cgi?id=101150

Reviewed by Vsevolod Vlasov.

- Introduced a way to highlight nodes by object id in addition to node id.
- Decorated nodes in the object tree outline and added on-hover highlighting.

* inspector/Inspector.json:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightNode):
* inspector/InspectorDOMAgent.h:
(InspectorDOMAgent):
* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreview):
* inspector/front-end/DOMAgent.js:
(WebInspector.DOMAgent.prototype.highlightDOMNode):
* inspector/front-end/DOMPresentationUtils.js:
(WebInspector.DOMPresentationUtils.createSpansForNodeTitle):
* inspector/front-end/ObjectPropertiesSection.js:
(WebInspector.ObjectPropertyTreeElement.prototype.update):
(WebInspector.ObjectPropertyTreeElement.prototype._mouseMove):
(WebInspector.ObjectPropertyTreeElement.prototype._mouseOut):
* inspector/front-end/RemoteObject.js:
(WebInspector.RemoteObject.prototype.highlightAsDOMNode):
(WebInspector.RemoteObject.prototype.hideDOMNodeHighlight):
* inspector/front-end/TestController.js:
* inspector/front-end/externs.js:
* inspector/front-end/inspector.css:
(.console-formatted-node:hover):
* inspector/front-end/utilities.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: introduce fast case for within-chunk edit
https://bugs.webkit.org/show_bug.cgi?id=103545

Reviewed by Vsevolod Vlasov.

Special-casing edits within the chunk for faster operation.

* inspector/front-end/DOMExtension.js:
(removeSubsequentNodes):
* inspector/front-end/DefaultTextEditor.js:
(WebInspector.TextEditorMainPanel.prototype._updateChunksForRanges):


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