Source/WebCore: Allow EventHandler to handle longpress gestures, including longpress selection on Android.
https://bugs.webkit.org/show_bug.cgi?id=98173

Patch by Oli Lan <olilan@chromium.org> on 2012-10-05
Reviewed by Ryosuke Niwa.

Adds handling for GestureLongPress to EventHandler::handleGestureEvent, with a new
handleGestureLongPress method. On Android, this method selects the closest word
if the gesture event was over non-link text.

This is tested via a new chromium test WebViewTest.LongPressSelection.

* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestWordFromHitTestResult):
(WebCore::EventHandler::selectClosestWordFromMouseEvent):
(WebCore):
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::handleGestureLongPress):
* page/EventHandler.h:
(EventHandler):

Source/WebKit/chromium: Allow EventHandler to handle longpress gestures, including longpress selection on Android.
https://bugs.webkit.org/show_bug.cgi?id=98173

Patch by Oli Lan <olilan@chromium.org> on 2012-10-05
Reviewed by Ryosuke Niwa.

This patch changes the longpress gesture handling code in WebViewImpl to call EventHandler::handleGestureEvent.
The WebCore part of this patch adds longpress handling to that method, including the long press selection behaviour
required for Android. This means that a long press gesture performed on word (that is not part of a link)
selects the word, without generating a context menu event.

A new test, WebViewTest.LongPressSelection has been added to test this.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::handleGestureEvent):
(WebViewImpl):
* tests/WebViewTest.cpp:
* tests/data/longpress_selection.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130547 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make tables which don't use col/row span much faster to layout
https://bugs.webkit.org/show_bug.cgi?id=98221

Reviewed by Julien Chaffraix.

My sense is that most tables on webpages do not use colspan/rowspan
so I stole another bit from RenderTableCell::m_column to avoid
having to re-parse the colSpan/rowSpan attributes for every cell
when doing table layout.
This made these symbols disappear from biggrid.html/redraw.html (dglazkov's spreadsheets benchmarks)
as well as moved our robohornet/resizecol.html number from an average of 3221ms to 2608ms (~20%!).

I removed m_hasHTMLTableCellElement (from http://trac.webkit.org/changeset/97691)
since it was attempting to do the same sort of optimization.

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
(WebCore::RenderTableCell::parseColSpanFromDOM):
(WebCore::RenderTableCell::parseRowSpanFromDOM):
(WebCore::RenderTableCell::layout):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::colSpan):
(WebCore::RenderTableCell::rowSpan):
(RenderTableCell):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130548 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Deprecated flexboxes subtract scrollbar width/height twice
https://bugs.webkit.org/show_bug.cgi?id=98552

Reviewed by Tony Chang.

Source/WebCore:

This is a regression from http://trac.webkit.org/changeset/119507.
The problem is that contentHeight subtracts the scrollbar and
RenderDeprecatedFlexbox subtracts the scrollbar.

-Make it so that we only access override sizes if one has been set.
I think this makes the calling code more clear.
-If we don't have one set, grab the height/width - borderAndPadding.
-Add a FIXME to change this all back to being borderbox sizes.
There's something trick with making table padding/border work right for that
though (noted in the original patch).

Test: fast/flexbox/flexing-overflow-scroll-item.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::overrideLogicalContentWidth):
(WebCore::RenderBox::overrideLogicalContentHeight):
(WebCore::RenderBox::availableLogicalHeightUsing):
* rendering/RenderBox.h:
(RenderBox):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::contentWidthForChild):
(WebCore):
(WebCore::contentHeightForChild):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
(WebCore::RenderDeprecatedFlexibleBox::allowedChildFlex):

LayoutTests:

* fast/flexbox/flexing-overflow-scroll-item-expected.txt: Added.
* fast/flexbox/flexing-overflow-scroll-item.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130549 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r130545.

* tests/WebFrameTest.cpp:
Avoid a warning about truncating the double constant on Windows. While touching the variable, changed
it to be proper camelCase.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Enhance support for transforms in LinkHighlight.
https://bugs.webkit.org/show_bug.cgi?id=94355

Reviewed by Adrienne Walker.

Improved handling of transformed highlight targets, where the transform goes beyond simple translation.

Source/WebKit/chromium:

* src/LinkHighlight.cpp:
(WebKit::convertTargetSpaceQuadToCompositedLayer): Converts target space quad to composited layer coordinates.
(WebKit):
(WebKit::addQuadToPath): Supports adding non-rectilinear quads to Path.
(WebKit::LinkHighlight::computeHighlightLayerPathAndPosition): Updated to deal with target's quadlist, transform individual quads according to transforms.
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::bestTouchLinkNode):

LayoutTests:

* platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-multi-line.html: Added.
* platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-rotated-div.html: Added.
* platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-rotated-link.html: Added.
* platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledX.html: Added.
* platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledY.html: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-ZIndex-expected.png: Removed.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-ZIndex-expected.txt: Removed.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-multi-line-expected.png: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-multi-line-expected.txt: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-rotated-div-expected.png: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-rotated-div-expected.txt: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-rotated-link-expected.png: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-rotated-link-expected.txt: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.png: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledX-expected.txt: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledY-expected.png: Added.
* platform/chromium-linux/platform/chromium-linux/compositing/gestures/gesture-tapHighlight-simple-scaledY-expected.txt: Added.


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