Source/JavaScriptCore: Support computed property names in object literals
https://bugs.webkit.org/show_bug.cgi?id=123112

Reviewed by Michael Saboff.

Add support for computed property names to the parser.

* bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createProperty):
(JSC::ASTBuilder::getName):
* parser/NodeConstructors.h:
(JSC::PropertyNode::PropertyNode):
* parser/Nodes.h:
(JSC::PropertyNode::expressionName):
(JSC::PropertyNode::name):
* parser/Parser.cpp:
(JSC::::parseProperty):
(JSC::::parseStrictObjectLiteral):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::Property::Property):
(JSC::SyntaxChecker::createProperty):
(JSC::SyntaxChecker::operatorStackPop):

LayoutTests: Support expression property names in object literals
https://bugs.webkit.org/show_bug.cgi?id=123112

Reviewed by Michael Saboff.

Add tests

* js/basic-computed-property-name-expected.txt: Added.
* js/basic-computed-property-name.html: Added.
* js/parser-syntax-check-expected.txt:
* js/script-tests/basic-computed-property-name.js: Added.
(a.string_appeared_here.runTest):
* js/script-tests/parser-syntax-check.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] The layers from the flow thread should be collected under the regions' layers.
https://bugs.webkit.org/show_bug.cgi?id=120457

Patch by Mihai Maerean <mmaerean@adobe.com> on 2013-10-21
Reviewed by David Hyatt.

Source/WebCore:

This patch is based on the work of Alexandru Chiculita at https://bugs.webkit.org/attachment.cgi?id=203872&action=review

The composited layers inside the named flow threads are collected as part of the regions (as children of the
GraphicsLayer of the layer that corresponds to the region (which is attached to the parent renderer of
RenderNameFlowFragment)).
When a region displays a layer that needs accelerated compositing we activate the accelerated compositing for
that region too (inside RenderLayerCompositor::computeRegionCompositingRequirements).

This patch has landed before (as http://trac.webkit.org/changeset/156451), but was reverted because
fast/multicol/mixed-positioning-stacking-order.html failed. The fix is inside RenderLayerCompositor::canBeComposited
that only enables compositing for layers inside flow threads that collect the graphics layers under the regions.

Another change from changeset #156451 is that now the region renderers are created as anonymous renderers under
the element that has the flow-from property. When a composited layer is needed for the region, it sits in it's
parent renderer, not in the region renderer (RenderNamedFlowFragment).

Tests: compositing/regions/crash-transform-inside-region.html
       compositing/regions/floated-region-with-transformed-child.html
       compositing/regions/move-layer-from-one-region-to-another.html
       compositing/regions/propagate-region-box-shadow-border-padding-for-video.html
       compositing/regions/propagate-region-box-shadow-border-padding.html
       compositing/regions/region-as-layer-in-another-flowthread.html
       compositing/regions/transform-transparent-positioned-video-inside-region.html
       compositing/regions/transformed-layer-inside-transformed-layer.html
       compositing/regions/z-index-update.html
       compositing/regions/z-index.html

* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::propagateStyleToAnonymousChildren): Not for RenderFlowThreads, as they are updated
through the RenderView::styleDidChange function.
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::layout): When the layout of the flow thread is over (including the 2 phase layout),
we update all the mappings between the layers inside the flow thread and the regions where those layers will be
painted.
(WebCore::RenderFlowThread::hasCompositingRegionDescendant): Whether any of the regions has a compositing descendant.
(WebCore::RenderFlowThread::getLayerListForRegion):
(WebCore::RenderFlowThread::regionForCompositedLayer):
(WebCore::RenderFlowThread::cachedRegionForCompositedLayer):
(WebCore::RenderFlowThread::collectsGraphicsLayersUnderRegions):
(WebCore::RenderFlowThread::updateLayerToRegionMappings): Triggers an update of the layers if a layer has moved
from a region to another since the last update.
(WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
* rendering/RenderFlowThread.h:
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushRenderFlowThread):
* rendering/RenderGeometryMap.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::enclosingFlowThreadAncestor):
(WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions):
(WebCore::RenderLayer::hitTestList):
(WebCore::RenderLayer::calculateLayerBounds): When we calculate the bounds of the RenderView, we ignore those
flow threads that collect the graphics layers under the regions.
(WebCore::RenderLayer::dirtyZOrderLists):
(WebCore::RenderLayer::dirtyNormalFlowList):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldClipCompositedBounds): Not if it's a flow thread that collects the graphics
layers under the regions
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Now adjusts the ancestorCompositingBounds for the FlowThread.
(WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): Make sure that the region propagates
its borders, paddings, outlines or box-shadows to layers inside it.
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements): Now calls computeRegionCompositingRequirements.
(WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Do not iterate the RenderFlowThread directly if
we are going to collect the composited layers as part of regions.
(WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree):
(WebCore::RenderLayerCompositor::canBeComposited): CSS Regions flow threads do not need to be composited as we
use composited RenderRegions to render the background of the RenderFlowThread.
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason): If it's a container of a css region.
* rendering/RenderLayerCompositor.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderNamedFlowFragment.h:
(WebCore::RenderNamedFlowFragment::layerOwner): When the content inside the region requires the region to have a
layer, the layer will be created on the region's parent renderer instead. This method returns that renderer
holding the layer. The return value may be null.
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::RenderNamedFlowThread):
(WebCore::RenderNamedFlowThread::nextRendererForNode):
(WebCore::RenderNamedFlowThread::previousRendererForNode):
(WebCore::RenderNamedFlowThread::addFlowChild):
(WebCore::RenderNamedFlowThread::removeFlowChild):
(WebCore::RenderNamedFlowThread::collectsGraphicsLayersUnderRegions):
* rendering/RenderNamedFlowThread.h: m_flowThreadChildList is now allocated through an OwnPtr to keep the render
arena under the size limit.
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect):
* rendering/RenderRegion.h:
(WebCore::toRenderRegion):
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):
* WebCore.exp.in: WebCore::RenderLayer::isFlowThreadCollectingGraphicsLayersUnderRegions

LayoutTests:

* compositing/regions/crash-transform-inside-region-expected.html: Added.
* compositing/regions/crash-transform-inside-region.html: Added.
* compositing/regions/floated-region-with-transformed-child-expected.html: Added.
* compositing/regions/floated-region-with-transformed-child.html: Added.
* compositing/regions/move-layer-from-one-region-to-another-expected.html: Added.
* compositing/regions/move-layer-from-one-region-to-another.html: Added.
* compositing/regions/propagate-region-box-shadow-border-padding-expected.html: Added.
* compositing/regions/propagate-region-box-shadow-border-padding-for-video-expected.html: Added.
* compositing/regions/propagate-region-box-shadow-border-padding-for-video.html: Added.
* compositing/regions/propagate-region-box-shadow-border-padding.html: Added.
* compositing/regions/region-as-layer-in-another-flowthread-expected.html: Added.
* compositing/regions/region-as-layer-in-another-flowthread.html: Added.
* compositing/regions/transform-transparent-positioned-video-inside-region-expected.html: Added.
* compositing/regions/transform-transparent-positioned-video-inside-region.html: Added.
* compositing/regions/transformed-layer-inside-transformed-layer-expected.html: Added.
* compositing/regions/transformed-layer-inside-transformed-layer.html: Added.
* compositing/regions/webkit-flow-renderer-layer-compositing-expected.html:
* compositing/regions/webkit-flow-renderer-layer-compositing.html:
* compositing/regions/z-index-expected.html: Added.
* compositing/regions/z-index-update-expected.html: Added.
* compositing/regions/z-index-update.html: Added.
* compositing/regions/z-index.html: Added.
* fast/multicol/mixed-positioning-stacking-order-expected.html:
* fast/multicol/mixed-positioning-stacking-order.html:
* fast/repaint/region-painting-composited-element-expected.html:
* fast/repaint/region-painting-composited-element.html:
* platform/mac-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderScrollbarPart doesn't need styleWillChange().
<https://webkit.org/b/123113>

We will call setInline(false) in styleDidChange(), there's no need
to override styleWillChange() just to do it twice.

Reviewed by Darin Adler.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Restore accidentally removed files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remote Layer Tree: Backing store should take contentsScale into account
https://bugs.webkit.org/show_bug.cgi?id=123106

Reviewed by Simon Fraser.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::ensureBackingStore):
(PlatformCALayerRemote::setNeedsDisplay):
(PlatformCALayerRemote::setContentsScale):
Inform the backing store of the contentsScale, and when it changes.

* WebProcess/WebPage/mac/RemoteLayerBackingStore.h:
(WebKit::RemoteLayerBackingStore::scale): Added.
(WebKit::RemoteLayerBackingStore::mapToContentCoordinates): Added.
* WebProcess/WebPage/mac/RemoteLayerBackingStore.mm:
(RemoteLayerBackingStore::RemoteLayerBackingStore):
(RemoteLayerBackingStore::encode):
(RemoteLayerBackingStore::decode):
(RemoteLayerBackingStore::mapToContentCoordinates):
Factor out flipping so we can use it for repaints in multiple places.

(RemoteLayerBackingStore::setNeedsDisplay):
(RemoteLayerBackingStore::display):
Create a buffer scaled up by contentsScale, take the scale into account
when copying clean bits from the front buffer, and apply the scale before
painting into the back buffer.

* WebCore.exp.in:
Export FloatRect::scale.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes][CSS Regions] Don't apply shape-inside when we have multiple auto-height regions and the height is not resolved
https://bugs.webkit.org/show_bug.cgi?id=123103

Reviewed by David Hyatt.

When we have multiple regions with auto-height, the region's height is not resolved from other elements we can't apply the
the shape on the region. This patch prevents to apply the shape and fixes the behavior for these cases.

Source/WebCore:

Test: fast/regions/shape-inside/shape-inside-on-multiple-autoheight-regions.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutShapeInsideInfo):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateShapeAndSegmentsForCurrentLineInFlowThread):

LayoutTests:

* fast/regions/shape-inside/shape-inside-on-multiple-autoheight-regions-expected.html: Added.
* fast/regions/shape-inside/shape-inside-on-multiple-autoheight-regions.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Transition most use of IDBBackingStoreLevelDB to IDBBackingStoreInterface
https://bugs.webkit.org/show_bug.cgi?id=123105

Reviewed by Anders Carlsson.

Source/WebCore:

Export more required headers:
* WebCore.xcodeproj/project.pbxproj:

Flesh out many of the pure virtual methods on IDBBackingStoreInterface, as well as
the RecordIdentifier and Cursor classes:

* Modules/indexeddb/IDBBackingStoreInterface.h:
(WebCore::IDBBackingStoreInterface::RecordIdentifier::~RecordIdentifier):
(WebCore::IDBBackingStoreInterface::Cursor::~Cursor):

Use IDBBackingStoreInterface, IDBBackingStoreInterface::RecordIdentifier, and
IDBBackingStoreInterface::Cursor wherever possible:

* Modules/indexeddb/IDBFactoryBackendInterface.cpp:
* Modules/indexeddb/IDBFactoryBackendInterface.h:

* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
(WebCore::IDBBackingStoreLevelDB::putRecord):
(WebCore::IDBBackingStoreLevelDB::deleteRecord):
(WebCore::IDBBackingStoreLevelDB::keyExistsInObjectStore):
(WebCore::IDBBackingStoreLevelDB::putIndexDataForRecord):
(WebCore::ObjectStoreKeyCursorImpl::clone):
(WebCore::ObjectStoreCursorImpl::clone):
(WebCore::IndexKeyCursorImpl::clone):
(WebCore::IndexCursorImpl::clone):
(WebCore::IDBBackingStoreLevelDB::openObjectStoreCursor):
(WebCore::IDBBackingStoreLevelDB::openObjectStoreKeyCursor):
(WebCore::IDBBackingStoreLevelDB::openIndexKeyCursor):
(WebCore::IDBBackingStoreLevelDB::openIndexCursor):
(WebCore::IDBBackingStoreLevelDB::Transaction::Transaction):
(WebCore::IDBBackingStoreLevelDB::Transaction::begin):
* Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
(WebCore::IDBBackingStoreLevelDB::RecordIdentifier::RecordIdentifier):

* Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.cpp:
(WebCore::IDBCursorBackendLevelDB::IDBCursorBackendLevelDB):
* Modules/indexeddb/leveldb/IDBCursorBackendLevelDB.h:

(WebCore::IDBCursorBackendLevelDB::create):
* Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.cpp:
(WebCore::IDBDatabaseBackendLevelDB::create):
(WebCore::IDBDatabaseBackendLevelDB::IDBDatabaseBackendLevelDB):
(WebCore::IDBDatabaseBackendLevelDB::backingStore):
(WebCore::IDBDatabaseBackendLevelDB::setIndexKeys):
(WebCore::IDBDatabaseBackendLevelDB::createTransaction):
* Modules/indexeddb/leveldb/IDBDatabaseBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
(WebCore::IDBFactoryBackendLevelDB::createTransactionBackend):
* Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.cpp:
(WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::verifyIndexKeys):
(WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::writeIndexKeys):
(WebCore::IDBObjectStoreBackendLevelDB::IndexWriter::addingKeyAllowed):
(WebCore::IDBObjectStoreBackendLevelDB::makeIndexWriters):
(WebCore::IDBObjectStoreBackendLevelDB::generateKey):
(WebCore::IDBObjectStoreBackendLevelDB::updateKeyGenerator):
* Modules/indexeddb/leveldb/IDBObjectStoreBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.cpp:
(WebCore::IDBTransactionBackendLevelDB::create):
(WebCore::IDBTransactionBackendLevelDB::IDBTransactionBackendLevelDB):
* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDB.h:

* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.cpp:
(WebCore::GetOperation::perform):
(WebCore::OpenCursorOperation::perform):
(WebCore::CountOperation::perform):
(WebCore::DeleteRangeOperation::perform):
* Modules/indexeddb/leveldb/IDBTransactionBackendLevelDBOperations.h:
(WebCore::CreateObjectStoreOperation::create):
(WebCore::CreateObjectStoreOperation::CreateObjectStoreOperation):
(WebCore::DeleteObjectStoreOperation::create):
(WebCore::DeleteObjectStoreOperation::DeleteObjectStoreOperation):
(WebCore::CreateIndexOperation::create):
(WebCore::CreateIndexOperation::CreateIndexOperation):
(WebCore::DeleteIndexOperation::create):
(WebCore::DeleteIndexOperation::DeleteIndexOperation):
(WebCore::GetOperation::create):
(WebCore::GetOperation::GetOperation):
(WebCore::PutOperation::create):
(WebCore::PutOperation::PutOperation):
(WebCore::OpenCursorOperation::create):
(WebCore::OpenCursorOperation::OpenCursorOperation):
(WebCore::CountOperation::create):
(WebCore::CountOperation::CountOperation):
(WebCore::DeleteRangeOperation::create):
(WebCore::DeleteRangeOperation::DeleteRangeOperation):
(WebCore::ClearOperation::create):
(WebCore::ClearOperation::ClearOperation):

Source/WebKit2:

Stub out a new pure virtual method:
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
(WebKit::WebIDBFactoryBackend::createTransactionBackend):
* WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remote Layer Tree: Clean up transaction logging
https://bugs.webkit.org/show_bug.cgi?id=123116

Reviewed by Anders Carlsson.

* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::RemoteLayerTreeTextStream):
(WebKit::RemoteLayerTreeTextStream::increaseIndent):
(WebKit::RemoteLayerTreeTextStream::decreaseIndent):
(WebKit::RemoteLayerTreeTextStream::writeIndent):
(WebKit::RemoteLayerTreeTextStream::operator<<):
Add some stream operator overrides for various types we need to dump.
Add a notion of current indent to our TextStream subclass to make it
easy to keep track of where we are.

(WebKit::dumpProperty):
Added, hand any arbitrary type to RemoteLayerTreeTransaction.

(WebKit::dumpChangedLayers):
(WebKit::RemoteLayerTreeTransaction::dump):
Make use of TextStream.

* WebCore.exp.in:
Export some TextStream functions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStreamTrack now tracks its own state
https://bugs.webkit.org/show_bug.cgi?id=123025

Patch by Thiago de Barros Lacerda <thiago.lacerda@openbossa.org> on 2013-10-21
Reviewed by Jer Noble.

The spec says that a MediaStreamSource can be shared by different tracks,
so a track must have its own state tracking, synchronizing with its MediaStreamSource when
the underlying MediaStreamSource changes the readyState.
In the old implementation if a user invoked the stop method, its readyState method was still
returning the MediaStreamSource state, which was wrong.
This also adds a setEnabled method, which can be used to set the state of a track when a
remote peer ends it, for instance.

No new tests needed.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::readyState):
(WebCore::MediaStreamTrack::setState):
(WebCore::MediaStreamTrack::stopProducingData):
(WebCore::MediaStreamTrack::ended):
(WebCore::MediaStreamTrack::sourceStateChanged):
(WebCore::MediaStreamTrack::trackDidEnd):
* Modules/mediastream/MediaStreamTrack.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Maybe a Lion build fix after r157731.

* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator<<):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Limit use of display sleep assertion when <video> element is off-screen.
https://bugs.webkit.org/show_bug.cgi?id=123041

Reviewed by Darin Adler.

Use page visibility changes to suspend and resume the use of sleep assertions in
HTMLMediaElement.

Page will propogate the page visibility change notifications to its Documents, which
will further propogate those notifications to registered elements.  Upon receiving
these notifications, HTMLMediaElement will release or take a DisplaySleepDisabler
token if necessary.

Also, rename HTMLMediaElement's updateDisableSleep() to updateSleepDisabling() and wrap
the implementation in a PLATFORM(MAC) guard rather than at each call site.

* dom/Document.cpp:
(WebCore::Document::registerForVisibilityStateCallbacks): Added registration method.
(WebCore::Document::unregisterForVisibilityStateCallbacks): Added unregistration method.
(WebCore::Document::visibilityStateChanged): Call all registered clients.
* dom/Document.h:
* dom/Element.h:
(WebCore::Element::visibilityStateChanged): Added default virtual method to be overridden
    by subclasses.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): Register for the notification, and check the
    current status of Document::hidden().
(WebCore::HTMLMediaElement::~HTMLMediaElement): Unregister for the notification.
(WebCore::HTMLMediaElement::visibilityStateChanged): Set m_displaySleepDisablingSuspended
    and call updateSleepDisabling().
(WebCore::HTMLMediaElement::shouldDisableSleep): Add a check for m_displaySleepDisablingSuspended.
* html/HTMLMediaElement.h:
* page/Page.cpp:
(WebCore::Page::setVisibilityState): Pass to every child document.

Rename updateDisableSleep() -> updateSleepDisabling():
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::~HTMLMediaElement):
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::mediaPlayerRateChanged):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::stop):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use pink layer borders for compositing layers with a contents layer
https://bugs.webkit.org/show_bug.cgi?id=123118

Reviewed by Dean Jackson.

With the existing layer border colors, it's not possible to distinguish an empty
layer from one with solid color, image or video contents. So use a pink color
for those. This makes it easier to diagnose bugs like 122784.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::getDebugBorderInfo):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WIN] Unreviewed build correction.

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Handle new JIT files as C++ implementation
  sources, not header files.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Grammar markers are not updated when switching between 1x and 2x
https://bugs.webkit.org/show_bug.cgi?id=122146

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-10-21
Reviewed by Dean Jackson.

Source/WebCore:

When running editing/spelling/grammar-markers-hidpi.html, the 2x
grammar/spelling dot resources are cached. If you then run
editing/spelling/grammar-markers.html without tearing down WebKit,
it re-uses the 2x dots. The difference between the two tests is a call
to testRunner.setBackingScaleFactor().

We create a NSColor from an NSImage, and remember it in a static
variable. However, NSColor inspects the current graphics context to
determine which resolution to use, and then remembers that decision.
Therefore, we want to recreate the NSColor whenever the device pixel
ratio changes. This patch adds a new static function to GraphicsContext
which recreates this NSColor every time the ratio changes.

Tests: editing/spelling/grammar-markers.html
       editing/spelling/inline_spelling_markers.html

* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::makePattern):
(WebCore::GraphicsContext::drawLineForDocumentMarker):

LayoutTests:

* platform/mac/editing/spelling/grammar-markers-expected.png:
* platform/mac/editing/spelling/inline_spelling_markers-expected.png:

* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::makePattern):
(WebCore::GraphicsContext::drawLineForDocumentMarker):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid JSC debugger overhead unless needed.
https://bugs.webkit.org/show_bug.cgi?id=123084.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

- If no breakpoints are set, we now avoid calling the debug hook callbacks.
- If no break on exception is set, we also avoid exception event debug callbacks.
- When we return from the ScriptDebugServer to the JSC::Debugger, we may no
  longer call the debug hook callbacks if not needed. Hence, the m_currentCallFrame
  pointer in the ScriptDebugServer may become stale. To avoid this issue, before
  returning, the ScriptDebugServer will clear its m_currentCallFrame if
  needsOpDebugCallbacks() is false.

* debugger/Debugger.cpp:
(JSC::Debugger::Debugger):
(JSC::Debugger::setNeedsExceptionCallbacks):
(JSC::Debugger::setShouldPause):
(JSC::Debugger::updateNumberOfBreakpoints):
(JSC::Debugger::updateNeedForOpDebugCallbacks):
* debugger/Debugger.h:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::unwind):
(JSC::Interpreter::debug):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_debug):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_debug):
* llint/LLIntOffsetsExtractor.cpp:
* llint/LowLevelInterpreter.asm:

Source/WebCore: 

No new tests.

- If no breakpoints are set, we now avoid calling the debug hook callbacks.
- If no break on exception is set, we also avoid exception event debug callbacks.
- When we return from the ScriptDebugServer to the JSC::Debugger, we may no
  longer call the debug hook callbacks if not needed. Hence, the m_currentCallFrame
  pointer in the ScriptDebugServer may become stale. To avoid this issue, before
  returning, the ScriptDebugServer will clear its m_currentCallFrame if
  needsOpDebugCallbacks() is false.

* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::setBreakpoint):
(WebCore::ScriptDebugServer::removeBreakpoint):
(WebCore::ScriptDebugServer::clearBreakpoints):
(WebCore::ScriptDebugServer::setPauseOnExceptionsState):
(WebCore::ScriptDebugServer::setPauseOnNextStatement):
(WebCore::ScriptDebugServer::breakProgram):
(WebCore::ScriptDebugServer::stepIntoStatement):
(WebCore::ScriptDebugServer::dispatchDidContinue):
(WebCore::ScriptDebugServer::exception):
(WebCore::ScriptDebugServer::didReachBreakpoint):
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::reset):

Source/WebKit/mac: 

* WebView/WebScriptDebugger.mm:
(WebScriptDebugger::WebScriptDebugger):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Style checker should allow a space after the @property keyword
https://bugs.webkit.org/show_bug.cgi?id=123117

Reviewed by Anders Carlsson.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing_for_function_call): Allow a space between @property and the following (
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_spacing_for_fncall): Added a test case.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Back/forward list UI process API
https://bugs.webkit.org/show_bug.cgi?id=123109

Reviewed by Darin Adler.

* CMakeLists.txt: Updated for renames.
* GNUmakefile.list.am: Ditto.

* Shared/Cocoa: Added.
* Shared/Cocoa/WKNSArray.h: Added. WKNSArray is an internal NSArray subclass backed by
a WebKit::ImmutableArray.
* Shared/Cocoa/WKNSArray.mm: Added.
(+[WKNSArray web_arrayWithImmutableArray:]): Added.
(-[WKNSArray web_initWithImmutableArray:]): Added.
(-[WKNSArray count]): Added.
(-[WKNSArray objectAtIndex:]): Added.
(-[WKNSArray copyWithZone:]): Added.

* Shared/Cocoa/WKNSObjectExtras.h: Added. Declares a category on NSObject that allows us to
vend WebKit API objects as Objective-C objects.
* Shared/Cocoa/WKNSObjectExtras.mm: Added.
(-[WKObject initWithAPIObject:]): WKObject is the generic Cocoa wrapper for API objects.
(-[WKObject isEqual:]): Check for equality of the underlying object.
(-[WKObject hash]): Return a pointer to the underlying object.
(-[WKObject description]): Added.
(+[NSObject _web_objectWithAPIObject:]): Added. Returns an appropriate Objective-C object
for the given API object. Currently returns a WKBackForwardListItem for a back/forward list
item and a generic WKObject for all other types.

* UIProcess/API/C/WKBackForwardList.cpp: Renamed.
* UIProcess/API/C/WKBackForwardList.h: Renamed.
* UIProcess/API/C/WKBackForwardListItem.cpp: Renamed.
* UIProcess/API/C/WKBackForwardListItem.h: Renamed.
* UIProcess/API/C/WKBackForwardListItemRef.cpp: Copied from Source/WebKit2/UIProcess/API/C/WKBackForwardListItem.cpp.
* UIProcess/API/C/WKBackForwardListItemRef.h: Copied from Source/WebKit2/UIProcess/API/C/WKBackForwardListItem.h.
* UIProcess/API/C/WKBackForwardListRef.cpp: Copied from Source/WebKit2/UIProcess/API/C/WKBackForwardList.cpp.
* UIProcess/API/C/WKBackForwardListRef.h: Copied from Source/WebKit2/UIProcess/API/C/WKBackForwardList.h.

* UIProcess/API/C/WebKit2_C.h: Updated for header renames.

* UIProcess/API/efl/ewk_back_forward_list.cpp: Updated for rename.
* UIProcess/API/efl/ewk_back_forward_list_item.cpp: Ditto.

* UIProcess/API/mac/WKBrowsingContextController.h: Declared backForwardList property.
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController backForwardList]): Added this accessor.

* UIProcess/Cocoa: Added.
* UIProcess/Cocoa/WKBackForwardList.h: Added.
* UIProcess/Cocoa/WKBackForwardList.mm: Added.
(toWKBackForwardListItem): Added this helper.
(-[WKBackForwardList currentItem]): Added.
(-[WKBackForwardList backItem]): Added.
(-[WKBackForwardList forwardItem]): Added.
(-[WKBackForwardList itemAtIndex:]): Added.
(-[WKBackForwardList backListCount]): Added.
(-[WKBackForwardList forwardListCount]): Added.
(-[WKBackForwardList backListWithLimit:]): Added.
(-[WKBackForwardList forwardListWithLimit:]): Added.
(-[WKBackForwardList _initWithList:]): Added.
* UIProcess/Cocoa/WKBackForwardListInternal.h: Added.

* UIProcess/Cocoa/WKBackForwardListItem.h: Added.
* UIProcess/Cocoa/WKBackForwardListItem.mm: Added.
(-[WKBackForwardListItem URL]): Added.
(-[WKBackForwardListItem title]): Added.
(-[WKBackForwardListItem originalURL]): Added.
(-[WKBackForwardListItem isEqual:]): Check for equality of the underlying object.
(-[WKBackForwardListItem hash]): Return a pointer to the underlying object
(-[WKBackForwardListItem _initWithItem:]): Added.
* UIProcess/Cocoa/WKBackForwardListItemInternal.h: Added.

* WebKit2.xcodeproj/project.pbxproj: Updated for renames and additions.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix; unprotect the declaration of updateSleepDisabling();

* html/HTMLMediaElement.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Maybe a Lion build fix after r157731, part 2.

* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator<<):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
New flakiness dashboard show test time, modifiers, and flaky tests
https://bugs.webkit.org/show_bug.cgi?id=123119

Reviewed by Tim Horton.

* api/failing-tests.php: Manually serialize each row in the results to avoid hitting the memory limit.
* include/db.php:
(Database::query): Added.
(Database::fetch_next_row): Added.
* include/init-database.sql: Added modifiers and time columns to results table.
* include/test-results.php:
(store_test_results): Update start_time and end_time to the union of the new interval and the existing interval.
(recursively_add_test_results): Handle empty $full_name to eliminate the loop over tests in store_test_results.
Also verify that each test name, expected and actual results conform to the specific format to prevent XSS.
Also use insert_row instead of select_or_insert_row to avoid issuing an unnecessary SQL query.
(format_result): Extracted from format_result_rows. Used in failing-tests.php.
* index.html:
(TestResultsView): Added _currentBuilderFailureType and _currentBuilderDays.
(TestResultsView._createResultCell): Show the test time and the expected result.
(TestResultsView._createTestResultRow): Compute the slowest run and also round time to tenth of second for time
less than 10s or second if it's more than 10s so that the test time will always be shown in two digits.
Also show the bug number and the latest expected result on the left columns after linkifying the bug numbers.
(TestResultsView._matchesFailureType): Added. Determines whether results is of a particular failure type.
(TestResultsView._populateBuilderPane):
(TestResultsView.fetchFailingTestsForBuilder): Store the failure type such as flaky, wrongtestexpectations.
(TestResultsView.updateLocationHash):
(TestResultsView.loadTestsFromLocationHash):
(fetchManifest):
* js/dom.js:
(element): appendChild if an item is a Node. Otherwise, e.g. integer, create a text node out of toString() call.
* main.css: Updated styles.


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