Generated should not be supported for things with a shadow
https://bugs.webkit.org/show_bug.cgi?id=98836

Patch by Elliott Sprehn <esprehn@chromium.org> on 2012-10-23
Reviewed by Dimitri Glazkov.

Source/WebCore:

As far as CSS is concerned inputs and things with shadow content inside
shouldn't support pseudo elements like :before, :after or :first-letter.
Neither Gecko or Presto supports it, and we only accidentally supported
it.

Until the spec tells us what to do we should disable support. This is
also neccesary because the new generated content implementation doesn't
support shadows.

Test: fast/forms/pseudo-elements.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderListBox.h: Added missing canHaveGeneratedChildren() that returns false.
* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::updateBeforeAfterContent):

LayoutTests:

Change all pseudos on <input> tests to be ref tests and clean up the tests.
They now make sure we don't support generated content on things with a shadow.
Also added another test for the other form control types to ensure they don't
support pseudos either.

* fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.html: Added.
* fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
* fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements.html:
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.html: Added.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
* fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements.html:
* fast/forms/pseudo-elements-expected.html: Added.
* fast/forms/pseudo-elements.html: Added.
* fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.html: Added.
* fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
* fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements.html:
* fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.html: Added.
* fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.txt: Removed.
* fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements.html:
* platform/chromium-linux/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-linux/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-linux/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-linux/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-mac/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-win/fast/forms/date-multiple-fields/date-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-win/fast/forms/month-multiple-fields/month-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-win/fast/forms/time-multiple-fields/time-multiple-fields-appearance-pseudo-elements-expected.png: Removed.
* platform/chromium-win/fast/forms/week-multiple-fields/week-multiple-fields-appearance-pseudo-elements-expected.png: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shaders] Set FilterOperations on GraphicsLayer after the program of CSS Shaders is loaded.
https://bugs.webkit.org/show_bug.cgi?id=99908

Patch by Huang Dongsung <luxtella@company100.net> on 2012-10-23
Reviewed by Dean Jackson.

CSS Shaders can not render anything until the program is loaded. If there is
partial loaded shaders program, whole FilterOperations chain can not render
anything. It occurs a flash. So We have to wait until the program is loaded, to
prevent a flash as RenderLayerBacking::updateImageContents() waits until an
image is fully loaded.

No new tests, CSS Shaders on Accelerated Compositing are not activated yet.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateFilters):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Popup menus positioning needs to take multiple monitors into account.
https://bugs.webkit.org/show_bug.cgi?id=100158

Reviewed by Timothy Horton.

Add screen.x() to repositioning check to account for position of current monitor.

* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::calculatePositionAndSize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132271 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Remove extraneous conversion to String->NSString
https://bugs.webkit.org/show_bug.cgi?id=100044

Reviewed by Darin Adler.

Improve some unfortunate use of String->NSString.

* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification): The variable macNotification is ultimately
needed as NSString, and all its value are or can be NSString.
Convert the last 3 char* values to NSString literal and use NSString* all the way.

* loader/mac/LoaderNSURLExtras.h:
* loader/mac/LoaderNSURLExtras.mm:
(suggestedFilenameWithMIMEType):
We converted the String to NSString to pass to suggestedFilenameWithMIMEType. There is no need
for the string to be a NSSTring there, we can leave it in its original type.

The case checking for a nil MIMEType was dead code because the implicit conversion never returns nil.

* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
Use String's nsStringNilIfEmpty().

* platform/mac/HTMLConverter.mm:
(-[WebHTMLConverter _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
Fix the coding style. Do the conversion to NSString only when needed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add measurePageLoadTime function to PerfTestRunner
https://bugs.webkit.org/show_bug.cgi?id=100029

Reviewed by Ryosuke Niwa.

Adopt chunk based loading logic from html5-full-render.html into measurePageLoadTime function,
this is needed to measure the performance and the memory consumption of the PageLoadTests as
we do it for all other performancetests.

* Parser/html5-full-render.html: Move the behavior to runner.js.
* resources/runner.js:
(.): Add measurePageLoadTime function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132273 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change setTargetValueAtTime() to setTargetAtTime()
https://bugs.webkit.org/show_bug.cgi?id=100153

Reviewed by Adam Barth.

Source/WebCore:

The AudioParam method name has changed due to Web Audio API spec review.
Keep legacy support for the old name.

Test: webaudio/audioparam-setTargetAtTime.html

* Modules/webaudio/AudioParam.h:
(WebCore::AudioParam::setTargetAtTime):
* Modules/webaudio/AudioParam.idl:
* Modules/webaudio/AudioParamTimeline.cpp:
(WebCore::AudioParamTimeline::setTargetAtTime):
(WebCore::AudioParamTimeline::valuesForTimeRangeImpl):
* Modules/webaudio/AudioParamTimeline.h:
(AudioParamTimeline):

LayoutTests:

* webaudio/audioparam-setTargetAtTime-expected.txt: Renamed from LayoutTests/webaudio/audioparam-setTargetValueAtTime-expected.txt.
* webaudio/audioparam-setTargetAtTime.html: Renamed from LayoutTests/webaudio/audioparam-setTargetValueAtTime.html.
* webaudio/resources/audioparam-testing.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Enable threaded/IPC animations
https://bugs.webkit.org/show_bug.cgi?id=93146

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Add enablers to TextureMapper and GraphicsLayerAnimation so that they could be used
across processes with IPC. Added some public accessors to GraphicsLayerAnimation,
and allowed a GraphicsLayerTextureMapper to receive a full list of animations.

Covered by existing animation and compositing tests.

* platform/graphics/GraphicsLayerAnimation.cpp:
(WebCore::GraphicsLayerAnimation::GraphicsLayerAnimation):
    Initialize the animation with the startTime instead of the offset.

(WebCore::GraphicsLayerAnimations::getActiveAnimations):
* platform/graphics/GraphicsLayerAnimation.h:
(WebCore::GraphicsLayerAnimation::setState):
    Allow setting the pause time as well.

(WebCore::GraphicsLayerAnimation::boxSize):
(WebCore::GraphicsLayerAnimation::startTime):
(WebCore::GraphicsLayerAnimation::pauseTime):
(WebCore::GraphicsLayerAnimation::animation):
(WebCore::GraphicsLayerAnimation::keyframes):
(WebCore::GraphicsLayerAnimation::listsMatch):
(WebCore::GraphicsLayerAnimations::size):
(WebCore::GraphicsLayerAnimations::animations):
    Add public accessors to GraphicsLayerAnimation properties.

(GraphicsLayerAnimation):
(GraphicsLayerAnimations):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::addAnimation):
(WebCore::GraphicsLayerTextureMapper::setAnimations):
    Allow replacing the entire list of animations.

(WebCore):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
(GraphicsLayerTextureMapper):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::applyAnimationsRecursively):
(WebCore):
* platform/graphics/texmap/TextureMapperLayer.h:
(TextureMapperLayer):

Source/WebKit2:

Re-enable UI-process animations for Coordinated-Graphics/TextureMapper.
- Added an argument coder for GraphicsLayerAnimations.
- Allow LayerTreeCoordinator to manage the animations per layer with the proxy,
  as opposed to applying the animation values in the web process as before.
- LayerTreeRenderer now calls updateViewport() after painting when an animation is active.

To overcome the problem we've had in the past with synchronizing UI-side and web-side
animations, we now lock the animations in the UI process when a frame starts rendering,
and unlock it when the frame finishes rendering, or if after the layout there is no visible
changes pending on the screen.

* Scripts/webkit2/messages.py:
(headers_for_type):
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(CoreIPC):
(CoreIPC::encodeTimingFunction):
(CoreIPC::decodeTimingFunction):
(CoreIPC::::encode):
(CoreIPC::::decode):
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
(WebCore):
    Added argument coders for GraphicsLayerAnimations.

* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.cpp:
(WebKit::LayerTreeCoordinatorProxy::setLayerAnimations):
(WebKit::LayerTreeCoordinatorProxy::setAnimationsLocked):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.h:
(LayerTreeCoordinatorProxy):
* UIProcess/CoordinatedGraphics/LayerTreeCoordinatorProxy.messages.in:
    Added an option to sync the layer's animations, and also to lock/unlock animations.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::LayerTreeRenderer):
(WebKit::LayerTreeRenderer::paintToCurrentGLContext):
    Sync animations if they're not locked, and call updateViewport() if we have animations.

(WebKit::LayerTreeRenderer::flushLayerChanges):
(WebKit::LayerTreeRenderer::setLayerAnimations):
(WebKit::LayerTreeRenderer::setAnimationsLocked):

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.h:
(LayerTreeRenderer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::didChangeAnimations):
(WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::syncAnimations):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::addAnimation):
(WebCore::CoordinatedGraphicsLayer::pauseAnimation):
(WebCore::CoordinatedGraphicsLayer::removeAnimation):
(WebCore::CoordinatedGraphicsLayer::animationStartedTimerFired):
(WebCore):
    Pass the animation info to the UI process instead of applying it in the web process.

(WebCore::CoordinatedGraphicsLayer::hasPendingVisibleChanges):
    Compute whether a layer tree might have sync issues or flickers if rendered while
    background animations are ongoing.

(WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
(WebCore::CoordinatedGraphicsLayer::selfOrAncestorHaveNonAffineTransforms):
    Don't allow progressive tiling for layers with animations.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(WebCore):
(CoordinatedGraphicsLayerClient):
(CoordinatedGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::LayerTreeCoordinator):
(WebKit::LayerTreeCoordinator::lockAnimations):
(WebKit):
(WebKit::LayerTreeCoordinator::unlockAnimations):
(WebKit::LayerTreeCoordinator::performScheduledLayerFlush):
(WebKit::LayerTreeCoordinator::setLayerAnimations):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.h:
(LayerTreeCoordinator):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Allow tests to run with a tile cache, and optionally dump the tile cache via layerTreeAsText()
https://bugs.webkit.org/show_bug.cgi?id=100159

Reviewed by Tim Horton.

Source/WebCore:

Add a LAYER_TREE_INCLUDES_PAGE_TILE_CACHE flag for layerTreeAsText(), and plumb it
through to GraphicsLayerCA, which dumps the TiledBacking tile coverage rect.

Test: platform/mac/tiled-drawing/use-tiled-drawing.html

* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::tiledBacking):
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::tiledBacking):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/GraphicsLayerCA.h:
(GraphicsLayerCA):
* platform/graphics/ca/mac/TileCache.h:
(WebCore::TileCache::tileCoverageRect):
(TileCache):
* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::computeTileCoverageRect):
(WebCore::TileCache::revalidateTiles):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::Internals::layerTreeAsText):
* testing/Internals.h:
* testing/Internals.idl:

Tools:

Make WebKitTestRunner use a WKView with a tile cache for tests run in a directory
whose path includes "tiled-drawing". It does this by passing around a WKDictionary
of options, and if the current PlatformWebView doesn't support those options, it will
create a new one.

* WebKitTestRunner/PlatformWebView.h:
(PlatformWebView): Add a WKDictionaryRef options dictionary argument.
(WTR::PlatformWebView::viewSupportsOptions): Returns true if the view
supports the options in the WKDictionaryRef.
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize): Call createWebViewWithOptions() with
no options in the normal case.
(WTR::TestController::createWebViewWithOptions): Moved code into this fuction
so we can call it in two places.
(WTR::TestController::ensureViewSupportsOptions): If the current view
doesn't support the given options, throw it away and makea  new one that does.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::shouldUseTiledDrawing): Return true if the directory contains "tiled-drawing".
(WTR::updateTiledDrawingForCurrentTest): Tell the TestController to check whether
the view supports the given options. No-op for non-Mac platforms.
(WTR::TestInvocation::invoke): Call updateTiledDrawingForCurrentTest().
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):  New constructor parameter.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(-[TestRunnerWKView initWithFrame:contextRef:pageGroupRef:useTiledDrawing:]):
(-[TestRunnerWKView _shouldUseTiledDrawingArea]): Subclass the WKView so we can return
a custom value from this method.
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::viewSupportsOptions):
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.
* WebKitTestRunner/win/PlatformWebViewWin.cpp:
(WTR::PlatformWebView::PlatformWebView): New constructor parameter.

LayoutTests:

A new test that dumps tile cache data for a large page.

* platform/mac/tiled-drawing/use-tiled-drawing-expected.txt: Added.
* platform/mac/tiled-drawing/use-tiled-drawing.html: Added.

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