[Chromium] Fix cases where find-in-page doesn't send a final update
https://bugs.webkit.org/show_bug.cgi?id=96402

Fix some issues in the WebKit implementation that prevented to send a final
reportFindInPageMatchCount message.

Reviewed by Adam Barth.

* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::scopeStringMatches):
(WebKit):
(WebKit::WebFrameImpl::finishCurrentScopingEffort):
(WebKit::WebFrameImpl::cancelPendingScopingEffort):
(WebKit::WebFrameImpl::WebFrameImpl):
(WebKit::WebFrameImpl::shouldScopeMatches):
* src/WebFrameImpl.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add gpu_test trace events tracking the creation of a DrawingBuffer
and Canvas2DLayerBridge. They will be used by browser tests to verify the
existence of WebGL and accelerated canvas.
https://bugs.webkit.org/show_bug.cgi?id=96871

Reviewed by James Robinson.

* platform/graphics/chromium/Canvas2DLayerBridge.cpp:
(WebCore::Canvas2DLayerBridge::Canvas2DLayerBridge):
* platform/graphics/chromium/DrawingBufferChromium.cpp:
(WebCore::DrawingBuffer::DrawingBuffer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] Enable shape-inside for percentage lengths based on logical height
https://bugs.webkit.org/show_bug.cgi?id=93547

Patch by Bear Travis <betravis@adobe.com> on 2012-09-17
Reviewed by Levi Weintraub.

Source/WebCore:

Shape-inside needs to be passed the logical size to use when computing percentage
based coordinates. The CSS Regions-specific method computeInitialRegionRangeForBlock
has been generalized to updateRegionsAndExclusionsLogicalSize. This method takes
the pre-child-layout logical width and height, and uses them to compute the logical
width and height that regions and exclusions should use for layout. Regions use a
block's maximum possible logical height to compute a region's maximum extent.
Exclusions use a block's fixed logical width and height, or 0 if one does not exist,
to resolve percentage-based shape lengths. The default logical size used for resolving
percentage based coordinates is tested in shape-inside-percentage-auto.html.

Test: fast/exclusions/shape-inside/shape-inside-percentage.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateRegionsAndExclusionsLogicalSize): Calculates the logical
height regions and exclusions should use, and updates their layout sizes through
computeExclusionShapeSize and computeRegionRangeForBlock.
(WebCore):
(WebCore::RenderBlock::computeExclusionShapeSize): Pass the appropriate logical size
to exclusion shapes so they can resolve percentage based coordinates.
(WebCore::RenderBlock::layoutBlock): Call the new updateRegionsAndExclusionsLogicalSize
method.
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderBox.cpp:
(WebCore::percentageLogicalHeightIsResolvable): Determine if percentage lengths
based on logical height can be resolved.
(WebCore):
(WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Added declaration.
* rendering/RenderBox.h:
(RenderBox):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock): Calling
updateRegionsAndExclusionsLogicalSize rather than computeInitialRegionRangeForBlock.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock): Ditto.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock): Ditto.

LayoutTests:

Test that shape percentage-based measurements resolve correctly. Some testing is
already covered by shape-inside-percentage-auto.html.

* fast/exclusions/shape-inside/shape-inside-percentage-expected.html: Added.
* fast/exclusions/shape-inside/shape-inside-percentage.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=96936
Opt into layers for fixed positioned elements for TiledDrawingArea

Reviewed by Tim Horton.

This code already exists in DrawingAreaImpl, and we need it for 
TiledCoreAnimationDrawingArea as well.
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updatePreferences):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
We should make collecting metrics easier by adding an IDL attribute
https://bugs.webkit.org/show_bug.cgi?id=96837

Reviewed by Kentaro Hara.

Currently it is too hard to set up a good measurement experiment to see
whether we can safely remove a feature (including vendor-prefixed
features). This patch introduces the [V8MeasureAs] IDL attribute to make
that process easier.

When you add the [V8MeasureAs] IDL property to an API, we'll count what
fraction of Page objects used that API.

* Modules/notifications/DOMWindowNotifications.idl:
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateFeatureObservation):
(GenerateNormalAttrGetter):
(GenerateReplaceableAttrSetter):
(GenerateNormalAttrSetter):
(GenerateOverloadedFunctionCallback):
(GenerateFunctionCallback):
(GenerateConstructorCallback):
(GenerateNamedConstructorCallback):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::testObjAttrAttrGetter):
(WebCore::TestObjV8Internal::testObjAttrAttrSetter):
(WebCore::TestObjV8Internal::objMethodCallback):
(WebCore):
* page/Page.h:
(WebCore::Page::featureObserver):
(Page):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Use ScriptValue instead of SerializedScriptValue for get/openCursor
https://bugs.webkit.org/show_bug.cgi?id=95409

Patch by Alec Flett <alecflett@chromium.org> on 2012-09-17
Reviewed by Kentaro Hara.

Source/WebCore:

This reduces a bunch of serialization/deserialization when writing
to objectstores with indexes.

No new tests, as this covers core functionality of IndexedDB, and
almost every test would fail. Some likely tests that would fail
fundamentally include:

storage/indexeddb/objectstore-basics.html
storage/indexeddb/cursor-basics.html
storage/indexeddb/index-basics.html

* Modules/indexeddb/IDBAny.cpp:
(WebCore::IDBAny::scriptValue):
(WebCore::IDBAny::integer):
(WebCore):
(WebCore::IDBAny::set):
* Modules/indexeddb/IDBAny.h:
(WebCore):
(IDBAny):
(WebCore::IDBAny::create):
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::setValueReady):
* Modules/indexeddb/IDBCursor.h:
(WebCore):
(IDBCursor):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::version):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResultCursor):
(WebCore::IDBRequest::onSuccess):
(WebCore):
(WebCore::IDBRequest::onSuccessInternal):
(WebCore::IDBRequest::dispatchEvent):
* Modules/indexeddb/IDBRequest.h:
(IDBRequest):
* Modules/indexeddb/IDBTransactionCallbacks.h:
* bindings/v8/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValue):
(WebCore::injectIDBKeyIntoScriptValue):
* bindings/v8/IDBBindingUtilities.h:
(WebCore):
* bindings/v8/custom/V8IDBAnyCustom.cpp:
(WebCore::toV8):

Source/WebKit/chromium:

This removes a bunch of tests that have been migrated to
LayoutTests, in https://bugs.webkit.org/show_bug.cgi?id=96818.

* tests/IDBBindingUtilitiesTest.cpp:
(WebCore::checkKeyFromValueAndKeyPathInternal):
(WebCore::checkKeyPathNullValue):
(WebCore::injectKey):
(WebCore::checkInjection):
(WebCore::checkInjectionFails):
(WebCore::checkKeyPathStringValue):
(WebCore::checkKeyPathNumberValue):
(WebCore::TEST):
* tests/IDBKeyPathTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Array profiling has convergence issues
https://bugs.webkit.org/show_bug.cgi?id=96891

Reviewed by Gavin Barraclough.

Source/JavaScriptCore: 

Now each array profiling site merges in the indexing type it observed into
the m_observedArrayModes bitset. The ArrayProfile also uses this to detect
cases where the structure must have gone polymorphic (if the bitset is
polymorphic then the structure must be). This achieves something like the
best of both worlds: on the one hand, we get a probabilistic structure that
we can use to optimize the monomorphic structure case, but on the other hand,
we get an accurate view of the set of types that were encountered.

* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::or32):
(MacroAssemblerARMv7):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::or32):
(MacroAssemblerX86):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::or32):
(MacroAssemblerX86_64):
* assembler/X86Assembler.h:
(X86Assembler):
(JSC::X86Assembler::orl_rm):
* bytecode/ArrayProfile.cpp:
(JSC::ArrayProfile::computeUpdatedPrediction):
* bytecode/ArrayProfile.h:
(JSC::ArrayProfile::addressOfArrayModes):
(JSC::ArrayProfile::structureIsPolymorphic):
* jit/JIT.h:
(JIT):
* jit/JITInlineMethods.h:
(JSC):
(JSC::JIT::emitArrayProfilingSite):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::privateCompilePatchGetArrayLength):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::privateCompilePatchGetArrayLength):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

Source/WTF: 

Added functions for testing if something is a power of 2.

* wtf/MathExtras.h:
(hasZeroOrOneBitsSet):
(hasTwoOrMoreBitsSet):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash if we fail to allocate memory for the argument encoder buffer.
https://bugs.webkit.org/show_bug.cgi?id=88367

Reviewed by Andreas Kling.
<rdar://problem/11488239>

Since there's no way to recover from malloc returning null here, just crash.

* Platform/CoreIPC/ArgumentEncoder.cpp:
(CoreIPC::ArgumentEncoder::grow):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        https://bugs.webkit.org/show_bug.cgi?id=96942
        [Mac] Failing test http/tests/inspector/network/network-xhr-replay.html

        * platform/mac/Skipped: Skipping a test for the newly added feature.



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