Should be able to build YARR JIT without the JS language JIT
https://bugs.webkit.org/show_bug.cgi?id=85242

Reviewed by Michael Saboff.

Some build macros are wrong.

* assembler/RepatchBuffer.h:
* jit/ExecutableAllocator.h:
(JSC):
* jit/JITExceptions.cpp:
* runtime/InitializeThreading.cpp:
(JSC::initializeThreadingOnce):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update LayoutUnit usage in InlineFlowBox and RenderWidget
https://bugs.webkit.org/show_bug.cgi?id=85239

Reviewed by Eric Seidel.

Updating LayoutUnit usage in a pair of remaining functions to minimize the remaining work to switching
to FractionalLayoutUnits for layout instead of integers.

No new tests. No change in behavior.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection): Though stored as a float, the top is always
set to an integer value. When we move to sub-pixel, we need to preserve this. Not preserving this
behavior affects text decorations, most notably underlines.
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::updateWidgetGeometry): Adding pixel snapping for the content box if it's
not transformed (absoluteContentBox includes pixel snapping), and properly treating the boundingBox
as an IntRect.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add absoluteValue method for LayoutUnits to allow overloading abs()
https://bugs.webkit.org/show_bug.cgi?id=85214

Reviewed by Eric Seidel.

Adding an absoluteValue free inline function that operates on LayoutUnits, which
allows us to have one function signature for ints or FractionalLayoutUnits. We
can't simply add a FractionalLayoutUnit flavor of abs because it confuses
some compilers due to the implicit FractionalLayoutUnit constructors that take
ints and floats.

No new tests. No change in behavior.

* page/SpatialNavigation.cpp:
(WebCore::distanceDataForNode):
* rendering/LayoutTypes.h:
(WebCore::absoluteValue):
(WebCore):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::checkPaginationAndFloatsAtEndLine):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::rangeIntersectsRect):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintAfterLayoutIfNeeded):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, test expectations update.

* platform/chromium/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Harden arithmetic in ImageBufferDataCG
https://bugs.webkit.org/show_bug.cgi?id=61373

Reviewed by Gavin Barraclough.

We have a checked type that allows us to automate many of the
bounds checks we want here, so let's replace the floating point
math, and just use Checked<> throughout.  We use a non-recording
Checked<> as no overflows should reach this point, so we'll take
a hard early failure, over the cost of many branches when
accessing the raw values in loops.

* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData):
(WebCore::ImageBufferData::putData):

Source/WTF: Investigate overflows in Canvas putImageData routine
https://bugs.webkit.org/show_bug.cgi?id=61373

Reviewed by Gavin Barraclough.

Allow floating point multiplies of checked types (complete with
bounds checks).

* wtf/CheckedArithmetic.h:
(Checked):
(WTF::Checked::operator*=):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Fixed layers are shaking when zoom level is not 1.0 due to a rounding error.
https://bugs.webkit.org/show_bug.cgi?id=84306

Reviewed by Noam Rosenthal.

When zooming, we need to be careful about how to convert the visible rect from float to int.
Using toAlignedRect can produce inconsistent width and height when we are scrolling.
This patch carefully modifies each piece of the visible rect, to avoid such rounding errors.
In addition, the TransformationMatrix we use for painting, needs to be adjusted for the same rounding error.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::visibleContentsRect):
(QQuickWebViewFlickablePrivate::_q_contentViewportChanged):
* UIProcess/DrawingAreaProxy.h:
(WebCore):
(WebKit::DrawingAreaProxy::setVisibleContentsRect):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::setVisibleContentsRect):
* UIProcess/DrawingAreaProxyImpl.h:
(DrawingAreaProxyImpl):
* UIProcess/LayerTreeHostProxy.cpp:
(WebKit::LayerTreeHostProxy::setVisibleContentsRect):
* UIProcess/LayerTreeHostProxy.h:
(LayerTreeHostProxy):
* UIProcess/WebLayerTreeRenderer.cpp:
(WebKit::WebLayerTreeRenderer::paintToCurrentGLContext):
(WebKit::WebLayerTreeRenderer::setVisibleContentsRect):
* UIProcess/WebLayerTreeRenderer.h:
(WebLayerTreeRenderer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Should be able to use YARR JIT without the JS language JIT
https://bugs.webkit.org/show_bug.cgi?id=85252

Reviewed by Geoff Garen.

Need to split canUseRegExpJIT out of canUseJIT.

* runtime/JSGlobalData.cpp:
(JSC):
(JSC::useJIT):
(JSC::JSGlobalData::JSGlobalData):
    - replace m_canUseJIT with m_canUseAssembler
* runtime/JSGlobalData.h:
(JSGlobalData):
(JSC::JSGlobalData::canUseRegExpJIT):
    - Added canUseRegExpJIT, distinct from canUseJIT.
* runtime/RegExp.cpp:
(JSC::RegExp::compile):
(JSC::RegExp::compileMatchOnly):
    - Call canUseRegExpJIT instead of canUseJIT.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash when opening plug-ins in background tabs
https://bugs.webkit.org/show_bug.cgi?id=85255
<rdar://problem/11344053>

Reviewed by Dan Bernstein.

* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::setLayerHostingMode):
m_layerHostingContext can be null for plug-ins that don't use the Core Animation drawing model, so check for that.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add multichannel support for input of JavaScriptAudioNode
https://bugs.webkit.org/show_bug.cgi?id=84687

Patch by Xingnan Wang <xingnan.wang@intel.com> on 2012-04-30
Reviewed by Chris Rogers.

Source/WebCore:

Tests: webaudio/javascriptaudionode-downmix8-2channel-input.html
       webaudio/javascriptaudionode-upmix2-8channel-input.html

* Modules/webaudio/JavaScriptAudioNode.cpp:
(WebCore::JavaScriptAudioNode::create):
(WebCore::JavaScriptAudioNode::JavaScriptAudioNode):
(WebCore::JavaScriptAudioNode::initialize):
(WebCore::JavaScriptAudioNode::process):
* Modules/webaudio/JavaScriptAudioNode.h:
(JavaScriptAudioNode):

LayoutTests:

* webaudio/javascriptaudionode-downmix8-2channel-input-expected.txt: Added.
* webaudio/javascriptaudionode-downmix8-2channel-input.html: Added.
* webaudio/javascriptaudionode-upmix2-8channel-input-expected.txt: Added.
* webaudio/javascriptaudionode-upmix2-8channel-input.html: Added.
* webaudio/resources/javascriptaudionode-testing.js: Added.
(createBuffer):
(processAudioData):
(fillData):
(checkStereoOnlyData):
(runJSNodeTest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115699 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: editing/inserting/insert-bg-font.html fails on Lion
https://bugs.webkit.org/show_bug.cgi?id=82079

Patch by Koji Ishii <kojiishi@gmail.com> on 2012-04-30
Reviewed by Ryosuke Niwa.

The test fails only if "Correct spelling automatically" is turned on.
AutoCorrect kicks in because the test has "backgroundblue" as a word,
so changing it to "background blue" fixes the failure.

* editing/inserting/insert-bg-font-expected.txt: Change "backgroundblue" to "background blue".
* editing/inserting/insert-bg-font.html: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderObject incorrectly lists maximalOutlineSize as a LayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=85248

Reviewed by Eric Seidel.

Reverting RenderObject::maximalOutlineSize to int. This is a slop value for repaint
rects that doesn't affect layout. It also derives its value from RenderView's function
of the same name, which is already an integer.

No new tests. No change in behavior.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::maximalOutlineSize):
* rendering/RenderObject.h:
(RenderObject):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115701 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Fix Autofill popup visibility behavior
Prevent users from interacting with invisible Autofill popups rendered outside the main frame's contents view.
This is a recommit of r115400, restricted to just Autofill popups.
https://bugs.webkit.org/show_bug.cgi?id=84420

Reviewed by Abhishek Arya

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::popupOpened): Hide popups rendered outside the main frame's contents view.
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::applyAutofillSuggestions): Fix up order of operations to support immediately hiding a popup if it would not be visible


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Add thunk headers for staging Prerendering API.
https://bugs.webkit.org/show_bug.cgi?id=84880

Reviewed by Adam Barth.

These empty headers will be replaced by the actual API when Bug 85005 is commited.

Source/Platform:

* Platform.gypi:
* chromium/public/WebPrerender.h: Added.
(WebKit):
(WebPrerender):
(ExtraData):
(WebKit::WebPrerender::ExtraData::~ExtraData):
(WebKit::WebPrerender::url):
(WebKit::WebPrerender::referrer):
(WebKit::WebPrerender::referrerPolicy):
(WebKit::WebPrerender::setExtraData):
(WebKit::WebPrerender::extraData):
(WebKit::WebPrerender::WebPrerender):
(WebKit::WebPrerender::~WebPrerender):
* chromium/public/WebPrerenderingSupport.h: Added.
(WebKit):
(WebPrerenderingSupport):
(WebKit::WebPrerenderingSupport::initialize):
(WebKit::WebPrerenderingSupport::shutdown):
(WebKit::WebPrerenderingSupport::current):
(WebKit::WebPrerenderingSupport::add):
(WebKit::WebPrerenderingSupport::cancel):
(WebKit::WebPrerenderingSupport::abandon):
(WebKit::WebPrerenderingSupport::WebPrerenderingSupport):
(WebKit::WebPrerenderingSupport::~WebPrerenderingSupport):

Source/WebKit/chromium:

* WebKit.gyp:
* public/WebPrerendererClient.h: Added.
(WebKit):
(WebPrerendererClient):
* public/WebView.h:
(WebKit):
(WebKit::WebView::setPrerendererClient):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
datalist: Inconsistent behavior of HTMLInputElement::list
https://bugs.webkit.org/show_bug.cgi?id=84351

Source/WebCore:

Each platform will have a different set of input types that support the datalist UI.
This patch makes shouldRespectListAttribute ask the RenderTheme if it supports datalist UI for that input type.
Thus making it possible to do feature detection with JS.

Reviewed by Kent Tamura.

* WebCore.gypi: Added RenderThemeChromiumCommon.{cpp,h}
* html/ColorInputType.cpp:
(WebCore::ColorInputType::shouldRespectListAttribute):
(WebCore):
* html/ColorInputType.h:
(ColorInputType):
* html/InputType.cpp:
(WebCore::InputType::themeSupportsDataListUI): Static method used by TextFieldInputType, RangeInputType, and ColorInputType.
(WebCore):
* html/InputType.h:
(InputType):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::shouldRespectListAttribute):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldRespectListAttribute):
* rendering/RenderTheme.h:
(RenderTheme):
(WebCore::RenderTheme::supportsDataListUI): Returns true if the platform can show the datalist suggestions for a given input type.
* rendering/RenderThemeChromiumCommon.cpp: Added.
(WebCore):
(WebCore::RenderThemeChromiumCommon::supportsDataListUI):
* rendering/RenderThemeChromiumCommon.h: Added.
(WebCore):
(RenderThemeChromiumCommon):
* rendering/RenderThemeChromiumMac.h:
(RenderThemeChromiumMac):
* rendering/RenderThemeChromiumMac.mm:
(WebCore::RenderThemeChromiumMac::supportsDataListUI):
(WebCore):
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumMac::supportsDataListUI):
(WebCore):
* rendering/RenderThemeChromiumSkia.h:
(RenderThemeChromiumSkia):

LayoutTests:

Reviewed by Kent Tamura.

* fast/forms/datalist/input-list-expected.txt:
* fast/forms/datalist/input-list.html: Added tests for all input types.
* platform/chromium/fast/forms/datalist/input-list-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move RenderTableCell's row index to RenderTableRow
https://bugs.webkit.org/show_bug.cgi?id=85229

Reviewed by Ojan Vafai.

Source/WebCore:

Covered by the existing table tests.

Row index is a RenderTableRow concept and as such this change moves
the relevant logic into the class.

While touching the code, renamed row() -> rowIndex() as now RenderTableCell
can return its parent RenderTableRow and we were returning an index, not the row
itself.

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::cellForColumnAndRow):
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::rowIndexRange):
(WebCore::AccessibilityTableCell::titleUIElement):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::cellAbove):
(WebCore::RenderTable::cellBelow):
(WebCore::RenderTable::cellBefore):
(WebCore::RenderTable::cellAfter):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
Updated after the renaming RenderTableCell::row() -> rowIndex().

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::RenderTableCell):
(WebCore::RenderTableCell::computeCollapsedBeforeBorder):
(WebCore::RenderTableCell::computeCollapsedAfterBorder):
Updated after m_rowIndex removal and row() -> rowIndex() renaming.

(WebCore::RenderTableCell::styleDidChange):
Switched the rowWasSet check to an ASSERT. The new logic guarantees that
row index was set straight when we insert the row. The previous logic was
opened to some race conditions as we could wait for a recalcCells call before
setting the index on the rows which made this check necessary.

* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::row):
Added this RenderTableRow getter.

(WebCore::RenderTableCell::rowIndex):
Renamed from row().

* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::RenderTableRow):
(WebCore::RenderTableRow::styleDidChange):
Updated after adding m_rowIndex / rowIndex().

* rendering/RenderTableRow.h:
(WebCore::RenderTableRow::setRowIndex):
(WebCore::RenderTableRow::rowIndex):
Added those getter / setter. Also kept m_rowIndex's smaller size
for future optimization and for symmetry with the column index on
RenderTableCell.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
(WebCore::RenderTableSection::recalcCells):
Made sure that whenever we insert or update our row index
we do call setRowIndex().

(WebCore::RenderTableSection::addCell):
This logic now doesn't need to query insertionRow as the cell's
should have the index of the row in which it is inserted.

(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::layoutRows):
(WebCore::compareCellPositionsWithOverflowingCells):
More updates after row() -> rowIndex() renaming.

* rendering/RenderTableSection.h:
Removed rowIndexForRenderer now that the row caches this informatin.

Source/WebKit/chromium:

* tests/RenderTableCellTest.cpp:
Updated after the refactoring.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r113511.
http://trac.webkit.org/changeset/113511
https://bugs.webkit.org/show_bug.cgi?id=66032
https://bugs.webkit.org/show_bug.cgi?id=85150

Regression: Many autofilled form fields lack the default
autofill background even when authors don’t override the
autofill colors


Source/WebCore:

* css/html.css:
(input:-webkit-autofill): Restore !important modifiers

LayoutTests:

* fast/forms/input-autofilled-expected.txt:
* fast/forms/input-autofilled.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change RenderBoxModelObject::calculateBackgroundImageGeometry to use roundToInt
https://bugs.webkit.org/show_bug.cgi?id=85249

Reviewed by Eric Seidel.

Prepare RenderBoxModelObject for FractionalLayoutUnits by adding rounding
logic to calculateBackgroundImageGeometry. Background images, as all
images, needs to be layed out on pixel boundaries thus we need to convert
it to a integer value.

No new tests, no change in functionality.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/11352575> Many CGImageRefs leaked during media layout tests

Reviewed by Brian Weinstein.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect): Adopt the CGImageRef.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/11312198> Many leaks during fast/events/dropzone-002.html

Reviewed by Darin Adler.

* platform/mac/ClipboardMac.mm:
(WebCore::utiTypeFromCocoaType): Adopt the result of createCFString.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@115709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix another leak due to misuse of createCFString.

Reviewed by Darin Adler.

* plugins/mac/PluginPackageMac.cpp:
(WebCore::PluginPackage::fetchInfo): Adopt the result of createCFString.

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