[Chromium-Android] Initialize font rendering in DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=89133

Reviewed by Adam Barth.

Source/WebKit/chromium:

* src/linuxish/WebFontRendering.cpp:
(WebKit::WebFontRendering::setSubpixelPositioning): Now calls WebFontInfo::setSubpixelPositioning to avoid API users from calling both and simplify platform differences at call sites.

Tools:

* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::reset):
(LayoutTestController::setTextSubpixelPositioning):
* DumpRenderTree/chromium/TestShellAndroid.cpp:
(platformInit):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderLayer subtrees without any self-painting layer shouldn't be walked during painting
https://bugs.webkit.org/show_bug.cgi?id=88888

Reviewed by Simon Fraser.

Performance optimization, covered by existing tests.

The gist of this change is to add a has-self-painting-layer-descendant flag (including an
invalidation logic) that is used to avoid walking subtrees without any self-painting layer.

On http://dglazkov.github.com/performance-tests/biggrid.html with a 100,000 rows
by 100 columns table, it brings the paint time during scrolling from ~45ms to ~6ms
on my machine. The test case is a pathologic example here but the optimization should
apply in other cases.

The new update logic piggy-backs on top of the existing updateVisibilityStatus() one that
got repurposed and renamed as part of this change.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::styleChanged):
These functions were updated to dirty / set the new flag.

(WebCore::RenderLayer::dirtyAncestorChainHasSelfPaintingLayerDescendantStatus):
(WebCore::RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant):
Added those functions to handle setting / invalidating the new flag.

(WebCore::RenderLayer::updateSelfPaintingLayerAfterStyleChange):
Added this function to handle style update.

(WebCore::RenderLayer::paintLayer):
(WebCore::RenderLayer::paintLayerContentsAndReflection):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintList):
Changed this logic to bail out if we have no self-painting descendants. This is what
is giving the performance improvement. Also added some performance ASSERTs to ensure
the methods are not called when they shouldn't.

(WebCore::RenderLayer::updateDescendantDependentFlags):
Renamed from updateVisibilityStatus to account for the new usage.

(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateLayerPositionsAfterScroll):
(WebCore::RenderLayer::collectLayers):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
Updated after updateVisibilityStatus rename.

* rendering/RenderLayer.h:
(WebCore::RenderLayer::hasSelfPaintingLayerDescendant):
Added the declaration of the new functions as well as the new flag and dirty bit.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r120393.
http://trac.webkit.org/changeset/120393
https://bugs.webkit.org/show_bug.cgi?id=89163

breaks cr-mac build (Requested by morrita on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-06-14

Source/WebCore:

* WebCore.gyp/WebCore.gyp:
* platform/image-decoders/ImageDecoder.h:
(ImageFrame):
(ImageDecoder):
* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(turboSwizzled):
(WebCore::JPEGImageReader::JPEGImageReader):
(WebCore::JPEGImageReader::close):
(WebCore::JPEGImageReader::decode):
(JPEGImageReader):
(WebCore::JPEGImageDecoder::outputScanlines):
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageReader::PNGImageReader):
(WebCore::PNGImageReader::close):
(WebCore::PNGImageReader::currentBufferSize):
(PNGImageReader):
(WebCore::PNGImageReader::decodingSizeOnly):
(WebCore::PNGImageReader::interlaceBuffer):
(WebCore::PNGImageReader::hasAlpha):
(WebCore::PNGImageReader::setHasAlpha):
(WebCore::PNGImageDecoder::headerAvailable):
(WebCore::PNGImageDecoder::rowAvailable):
* platform/image-decoders/skia/ImageDecoderSkia.cpp:
(WebCore):
(WebCore::resolveColorSpace):
(WebCore::createColorSpace):
(WebCore::ImageFrame::setColorProfile):
(WebCore::ImageFrame::setStatus):

Source/WTF:

* wtf/Platform.h:

LayoutTests:

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Validate form state strings in FormController::setStateForNewFormElements()
https://bugs.webkit.org/show_bug.cgi?id=88768

Reviewed by Hajime Morita.

.:

* Source/autotools/symbols.filter: Expose some symbols used by Internals.cpp.

Source/WebCore:

Reject invalid form state vectors. This state vectors are generated by
WebKit itself. However it can be invalid because
- Serialized state vectors can be corrupted
- A future version of WebKit might change the format

So we had better reject unexpected state vectors as possible.

Test: fast/forms/state-restore-broken-state.html

* WebCore.exp.in: Expose some symbols used by Internals.cpp.
* html/FormController.cpp:
(WebCore::isNotFormControlTypeCharacter): A helper for state validation.
(WebCore::FormController::setStateForNewFormElements):
Reject state vectors of which size is not a multiple of 3, or a type name is invalid.
* testing/Internals.cpp:
(WebCore::Internals::formControlStateOfPreviousHistoryItem):
Returns a form state vector of the previous document.
(WebCore::Internals::setFormControlStateOfPreviousHistoryItem):
Sets a form state vector for the previous document.
* testing/Internals.h: Declare new functions.
* testing/Internals.idl: ditto.

Source/WebKit2:

* win/WebKit2.def: Expose some symbols used by Internals.cpp.
* win/WebKit2CFLite.def: ditto.

LayoutTests:

* fast/forms/resources/state-restore-broken-state-1.html: Added.
* fast/forms/resources/state-restore-broken-state-2.html: Added.
* fast/forms/state-restore-broken-state-expected.txt: Added.
* fast/forms/state-restore-broken-state.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Make TiledLayerChromium robust to unexpected null tiles
https://bugs.webkit.org/show_bug.cgi?id=89143

Reviewed by James Robinson.

Although there shouldn't ever be null tiles in the map, it appears to
be occurring frequently enough to show up in crash reports. In the
short term, be robust to this so the tiler doesn't crash. This should
eventually be reverted.

* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::pushPropertiesTo):
(WebCore::TiledLayerChromium::setLayerTreeHost):
(WebCore::TiledLayerChromium::invalidateRect):
(WebCore::TiledLayerChromium::updateTiles):
(WebCore::TiledLayerChromium::resetUpdateState):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] empty plugin cause browser hang
https://bugs.webkit.org/show_bug.cgi?id=89091

Reviewed by Rob Buis.

Add check before clean pluginView in FrameLoaderBlackBerry in case
it didn't have any content.
RIM PR# 165336
Reviewed internally by George Staikos

* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::finishedLoading):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed expectation update.
- Marked cross-domain-message-event-dispatch.html and track-cue-rendering-snap-to-lines-not-set.html

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix framebuffer completeness test
https://bugs.webkit.org/show_bug.cgi?id=89127

Patch by Gregg Tavares <gman@google.com> on 2012-06-14
Reviewed by Kenneth Russell.

No new tests just fixing failing tests.

* html/canvas/WebGLFramebuffer.cpp:
(WebCore::WebGLFramebuffer::initializeAttachments):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::isTexInternalFormatColorBufferCombinationValid):
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::getClearBitsByAttachmentType):
(WebCore):
(WebCore::GraphicsContext3D::getClearBitsByFormat):
(WebCore::GraphicsContext3D::getChannelBitsByFormat):
* platform/graphics/GraphicsContext3D.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Check the result of FontCache::getCachedFontPlatformData()
https://bugs.webkit.org/show_bug.cgi?id=89141

Reviewed by Kent Tamura.

The value of FontCache::getCachedFontPlatformData() could be invalid,
so we should check the value before use it.

No new tests. No new functionality.

* platform/graphics/skia/FontCacheSkia.cpp:
(WebCore::FontCache::getFontDataForCharacters):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cast paddings to int in RenderTableCell
https://bugs.webkit.org/show_bug.cgi?id=88918

Reviewed by Levi Weintraub.

Source/WebCore: 

Table layout uses integers throughout yet the TableCell paddingLeft/
Right/Top/Bottom methods returns LayoutUnits. This causes inconsistent
rounding as some call sites cast the numbers to ints before doing
computation and others do computation before casting.

By changing the methods to always cast the padding values to int we
ensure consistent padding calculations.

Ideally we'd change the type of the return value for the methods but as
they are overriden that would likely cause more confusion.

Test: fast/sub-pixel/table-cells-with-padding-do-not-wrap.html

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paddingTop):
(WebCore::RenderTableCell::paddingBottom):
(WebCore::RenderTableCell::paddingLeft):
(WebCore::RenderTableCell::paddingRight):
(WebCore::RenderTableCell::paddingBefore):
(WebCore::RenderTableCell::paddingAfter):

LayoutTests: 

Add test ensuring that table cells does not wrap when using fractional
paddings.

* fast/sub-pixel/table-cells-with-padding-do-not-wrap-expected.txt: Added.
* fast/sub-pixel/table-cells-with-padding-do-not-wrap.html: Added.
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
* platform/chromium-linux/tables/mozilla_expected_failures/bugs/bug89315-expected.png:
* platform/chromium-win/tables/mozilla_expected_failures/bugs/bug89315-expected.txt:
* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Selection - Crash when manipulating selection by dragging handle
https://bugs.webkit.org/show_bug.cgi?id=89160

RIMBUG:164970
Avoid to set position in shadow tree to the new selection's base. It
crashes when setting a shadow position to a selection' base.

Patch by Sean Wang <Xuewen.Wang@torchmobile.com.cn> on 2012-06-14
Reviewed by Antonio Gomes.

* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::visiblePositionForPointIgnoringClipping):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cast paddings to int in RenderTableCell
https://bugs.webkit.org/show_bug.cgi?id=88918

Patch by Emil A Eklund <eae@chromium.org> on 2012-06-14
Reviewed by Levi Weintraub.

Add test ensuring that table cells does not wrap when using fractional
paddings.

* fast/sub-pixel/table-cells-with-padding-do-not-wrap-expected.txt: Added.
* fast/sub-pixel/table-cells-with-padding-do-not-wrap.html: Added.
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
* platform/chromium-linux/tables/mozilla_expected_failures/bugs/bug89315-expected.png:
* platform/chromium-win/tables/mozilla_expected_failures/bugs/bug89315-expected.txt:
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Remove unused CanvasLayerChromium.h/cpp from the tree
https://bugs.webkit.org/show_bug.cgi?id=89152

Patch by James Robinson <jamesr@chromium.org> on 2012-06-14
Reviewed by Adrienne Walker.

These files have been unused and not in the build system since r119769

* platform/graphics/chromium/CanvasLayerChromium.cpp: Removed.
* platform/graphics/chromium/CanvasLayerChromium.h: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use testRunner instead of layoutTestController in battery status and canvas tests
https://bugs.webkit.org/show_bug.cgi?id=88761

Reviewed by Tony Chang.

* batterystatus/resources/event-after-navigation-new.html:
* batterystatus/script-tests/event-after-navigation.js:
* canvas/philip/tests.js:
(_addTest.endTest):
(_addTest.window.onload):
(_addTest):
* canvas/philip/tests/2d.text-custom-font-load-crash.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove support for counterValueForElementById from chromium port
https://bugs.webkit.org/show_bug.cgi?id=88851

Reviewed by Adam Barth.

Moved the counterValueForElementById from LayoutTestCotroller to Internals so
remove the old platform specific implementations as it exclusively tests WebCore functionality.

* public/WebFrame.h:
(WebFrame):
* src/WebFrameImpl.cpp:
(WebKit):
* src/WebFrameImpl.h:
(WebFrameImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed rebaseline for mac chromium following r120403.

* platform/chromium-mac/tables/mozilla/bugs/bug55527-expected.txt: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support file extensions in HTMLInputElement::accept
https://bugs.webkit.org/show_bug.cgi?id=88298

Reviewed by Hajime Morita.

Source/WebCore:

The WHATWG specification added file extensions supoprt for
HTMLInputElement::accept recently.

In the WebCore FileChooser interface, we rejected invalid MIME type
strings in HTMLInputElement::acceptMIMETypes(), and platform file
choosers don't expect that it containts file extensions. So, this patch
introduces additional member "acceptFileExtensions" to
FileChooserSettings, and it contains only file extensions specified by
an accept attribute.

* html/FileInputType.cpp:
Sets HTMLInputElement::acceptFileExtensions() to
FileChooserSettings::acceptFileExtensions.
(WebCore::FileInputType::handleDOMActivateEvent):
(WebCore::FileInputType::receiveDropForDirectoryUpload):
* html/HTMLInputElement.cpp:
(WebCore::isValidFileExtension): Added.
(WebCore::parseAcceptAttribute):
Common part for acceptMIMETyps() and acceptFileExtensions().
(WebCore::HTMLInputElement::acceptMIMETypes):
Uses parseAcceptAttribute() with isValidMIMEType().
(WebCore::HTMLInputElement::acceptFileExtensions):
Added. Uses parseAcceptAttribute() with isValidFileExtension().
* html/HTMLInputElement.h:
(HTMLInputElement): Add acceptFileExtensions().
* platform/FileChooser.h:
(FileChooserSettings): Add acceptFileExtensions and acceptTypes().
* platform/FileChooser.cpp:
(WebCore::FileChooserSettings::acceptTypes): Added.

Source/WebKit/chromium:

* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::runOpenPanel):
Use FileChooserSettings::acceptTypes() to get both of MIME types and file extensions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add color property to input type=range
https://bugs.webkit.org/show_bug.cgi?id=89067

Reviewed by Kent Tamura.

Source/WebCore:

Adding color property to input type=range in preparation for
supporting tick marks for datalist for input type=range.

* css/html.css:
(input[type="range"]): Setting color property for input type=range.
This will set the color of tick mark when we implement <datalist>.
* css/themeChromiumLinux.css:
(input[type=range]):
* css/themeWin.css:
(input[type="range"]):

LayoutTests:

* fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt:
* fast/repaint/slider-thumb-float-expected.txt:
* platform/chromium-linux/fast/dom/HTMLInputElement/input-slider-update-expected.txt: Copied from LayoutTests/platform/chromium-win/fast/dom/HTMLInputElement/input-slider-update-expected.txt.
* platform/chromium-linux/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt: Copied from LayoutTests/fast/dom/HTMLInputElement/input-slider-update-styled-expected.txt.
* platform/chromium-linux/fast/forms/box-shadow-override-expected.txt:
* platform/chromium-linux/fast/forms/input-appearance-height-expected.txt:
* platform/chromium-linux/fast/forms/range/slider-thumb-stylability-expected.txt: Copied from LayoutTests/platform/mac/fast/forms/range/slider-thumb-stylability-expected.txt.
* platform/chromium-linux/fast/repaint/slider-thumb-drag-release-expected.txt: Copied from LayoutTests/platform/chromium-win/fast/repaint/slider-thumb-drag-release-expected.txt.
* platform/chromium-linux/fast/repaint/slider-thumb-float-expected.txt: Copied from LayoutTests/fast/repaint/slider-thumb-float-expected.txt.
* platform/chromium-mac/fast/forms/box-shadow-override-expected.txt:
* platform/chromium-mac/fast/forms/input-appearance-height-expected.txt:
* platform/chromium-mac/fast/forms/range/input-appearance-range-expected.txt:
* platform/chromium-win/fast/dom/HTMLInputElement/input-slider-update-expected.txt:
* platform/chromium-win/fast/forms/box-shadow-override-expected.txt:
* platform/chromium-win/fast/forms/input-appearance-height-expected.txt:
* platform/chromium-win/fast/forms/range/input-appearance-range-expected.txt:
* platform/chromium-win/fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/chromium-win/fast/forms/range/slider-padding-expected.txt:
* platform/chromium-win/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/chromium-win/fast/forms/range/slider-thumb-stylability-expected.txt: Copied from LayoutTests/platform/mac/fast/forms/range/slider-thumb-stylability-expected.txt.
* platform/chromium-win/fast/repaint/slider-thumb-drag-release-expected.txt:
* platform/mac/fast/dom/HTMLInputElement/input-slider-update-expected.txt:
* platform/mac/fast/forms/range/range-thumb-height-percentage-expected.txt:
* platform/mac/fast/forms/range/slider-padding-expected.txt:
* platform/mac/fast/forms/range/slider-thumb-shared-style-expected.txt:
* platform/mac/fast/forms/range/slider-thumb-stylability-expected.txt:
* platform/mac/fast/repaint/slider-thumb-drag-release-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed typo fix for r120405.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r110340.
http://trac.webkit.org/changeset/110340
https://bugs.webkit.org/show_bug.cgi?id=88749

Source/WebCore:

r110340 added a broken implementation of
HTMLSelectElement::selectedOptions. This roll out removes
HTMLSelectElement::selectedOptions.

* html/CollectionType.h:
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::shouldIncludeChildren):
(WebCore::HTMLCollection::isAcceptableElement):
* html/HTMLSelectElement.cpp:
* html/HTMLSelectElement.h:
(HTMLSelectElement):
* html/HTMLSelectElement.idl:

LayoutTests:

* fast/dom/HTMLSelectElement/select-selectedOptions-expected.txt: Removed.
* fast/dom/HTMLSelectElement/select-selectedOptions.html: Removed.

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