[Chromium] Unreviewed gardening.

WebViewTest.SetCompositionFromExistingText failing after r141479.

* tests/WebViewTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WorkQueue should be a ref-counted class
https://bugs.webkit.org/show_bug.cgi?id=108544

Reviewed by Sam Weinig.

Make WorkQueue a ref-counted class that's implicitly ref()'d when dispatching a function to it, and then
implicitly deref()'d when the function is done executing. This matches the behavior of dispatch queues,
and ensures that the WorkQueue object won't go away while dispatched functions are running.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::Connection):
(CoreIPC::Connection::~Connection):
(CoreIPC::Connection::addQueueClient):
(CoreIPC::Connection::removeQueueClient):
(CoreIPC::Connection::invalidate):
(CoreIPC::Connection::sendMessage):
(CoreIPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
(CoreIPC::Connection::connectionDidClose):
* Platform/CoreIPC/Connection.h:
(Connection):
* Platform/CoreIPC/mac/ConnectionMac.cpp:
(CoreIPC::createDataAvailableSource):
(CoreIPC::Connection::open):
(CoreIPC::Connection::initializeDeadNameSource):
* Platform/WorkQueue.cpp:
(WorkQueue::create):
(WorkQueue::WorkQueue):
(WorkQueue::~WorkQueue):
* Platform/WorkQueue.h:
(WorkQueue):
* Platform/mac/WorkQueueMac.cpp:
(WorkQueue::dispatch):
(WorkQueue::dispatchAfterDelay):
* Shared/ChildProcess.cpp:
(WebKit::didCloseOnConnectionWorkQueue):
* UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::processLauncherWorkQueue):
(WebKit::ProcessLauncher::ProcessLauncher):
* UIProcess/WebProcessProxy.cpp:
(WebKit::pluginWorkQueue):
(WebKit::WebProcessProxy::getPlugins):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Gtk] drag and drop has black background without composition
https://bugs.webkit.org/show_bug.cgi?id=108376

Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-01-31
Reviewed by Martin Robinson.

Use gtk_drag_set_icon_surface (or gtk_drag_set_icon_pixbuf) when the
screen is not composited. That way, drag window will be decomposited
and rendered transparent with Xshape.

To determine which parts of the window must be transparent, gtk checks
if a pixel is more than 50% opaque. With dissolveDragImageToFraction,
all pixels are made 25% transparent. With antialiasing, opacity goes
below the threshold for some pixels, which makes the resulting image
messy. So, we need to skip dissolveDragImageToFraction when we use
gtk_drag_set_icon_surface.

* platform/gtk/DragIcon.cpp:
(WebCore::DragIcon::DragIcon):
(WebCore::DragIcon::~DragIcon):
(WebCore::DragIcon::setImage):
(WebCore::DragIcon::useForDrag):
* platform/gtk/DragIcon.h:
(DragIcon):
* platform/gtk/DragImageGtk.cpp:
(WebCore::dissolveDragImageToFraction):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Abstraction for hiding enum class.
https://bugs.webkit.org/show_bug.cgi?id=108533

Reviewed by Anders Carlsson.

../WebCore: 

No new tests.

* Modules/webdatabase/DatabaseError.h:
(WebCore::ENUM_CLASS_BEGIN):

../WTF: 

* wtf/Compiler.h:
* wtf/EnumClass.h: Copied from Source/WTF/wtf/TypeSafeEnum.h.
(WTF::EnumClass::EnumClass):
(WTF::EnumClass::operator==):
(WTF::EnumClass::operator!=):
(WTF::EnumClass::operator<):
(WTF::EnumClass::operator<=):
(WTF::EnumClass::operator>):
(WTF::EnumClass::operator>=):
* wtf/TypeSafeEnum.h: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Quadratic and bezier curves with coincident endpoints rendered incorrectly
https://bugs.webkit.org/show_bug.cgi?id=105650

Patch by Youenn Fablet <youennf@gmail.com> on 2013-01-31
Reviewed by Kenneth Russell.

Tests: fast/canvas/canvas-bezier-same-endpoint.html
       fast/canvas/canvas-quadratic-same-endpoint.html

* html/canvas/CanvasPathMethods.cpp:
(WebCore::CanvasPathMethods::quadraticCurveTo):
(WebCore::CanvasPathMethods::bezierCurveTo):

LayoutTests: Quadratic and bezier curves with coincident endpoints rendered incorrectly
https://bugs.webkit.org/show_bug.cgi?id=105650
Modified TestExpectations for Mac, efl and Qt platforms as quadratic curves
may not be rendered correctly
(see https://bugs.webkit.org/show_bug.cgi?id=107118)

Patch by Youenn Fablet <youennf@gmail.com> on 2013-01-31
Reviewed by Kenneth Russell.

* fast/canvas/canvas-bezier-same-endpoint-expected.txt: Added.
* fast/canvas/canvas-bezier-same-endpoint.html: Added.
* fast/canvas/canvas-quadratic-same-endpoint-expected.txt: Added.
* fast/canvas/canvas-quadratic-same-endpoint.html: Added.
* platform/efl/TestExpectations: Skipped quad test
* platform/mac/TestExpectations: Skipped quad test
* platform/qt/TestExpectations: Skipped quad test

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141500 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rebaseline after r141459.

* fast/multicol/shrink-to-column-height-for-pagination-expected.png: Renamed from LayoutTests/platform/efl/fast/multicol/shrink-to-column-height-for-pagination-expected.png.
* fast/multicol/shrink-to-column-height-for-pagination-expected.txt: Renamed from LayoutTests/platform/chromium/fast/multicol/shrink-to-column-height-for-pagination-expected.txt.
* platform/efl/fast/multicol/shrink-to-column-height-for-pagination-expected.txt:
* platform/gtk/fast/multicol/shrink-to-column-height-for-pagination-expected.png: Removed.
* platform/gtk/fast/multicol/shrink-to-column-height-for-pagination-expected.txt:
* platform/qt/fast/multicol/shrink-to-column-height-for-pagination-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141501 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Simplify CodeGeneratorV8.pm by using InheritsExtendedAttribute("EventTarget")
https://bugs.webkit.org/show_bug.cgi?id=108441

Reviewed by Adam Barth.

A complicated condition in GetInternalFields() can be simplified
by using InheritsExtendedAttribute("EventTarget").

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorV8.pm:
(GetInternalFields):
* dom/EventTarget.idl: Added [EventTarget] which should have been added.
* svg/SVGElementInstance.idl: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] fast/css/relative-positioned-block-crash.html is intermittently crashing
https://bugs.webkit.org/show_bug.cgi?id=108200

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2013-01-31
Reviewed by Martin Robinson.

Source/WebCore:

Getting the Position of a PseudoElement now triggers an assertion.
This can occur when clicking on empty space in a render block.
Looking to the unignored parent's node (and passing that accessible
object on in a signal to Assistive Technologies) seems like the most
reasonable thing to do here.

No new tests; instead skipping two tests that were crashing as a result.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(objectFocusedAndCaretOffsetUnignored):

LayoutTests:

Unskip two crashing tests having fixed the underlying bug.

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rolling out r141407 because it is causing crashes under
WTF::TCMalloc_Central_FreeList::FetchFromSpans() in Release builds.

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):

Source/WTF:

* wtf/Deque.h:
(WTF::::expandCapacity):
* wtf/FastMalloc.cpp:
* wtf/FastMalloc.h:
(WTF):
* wtf/Vector.h:
(WTF::VectorBufferBase::allocateBuffer):
(WTF::VectorBufferBase::tryAllocateBuffer):
(WTF::VectorBufferBase::reallocateBuffer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Support implicit rows and columns
https://bugs.webkit.org/show_bug.cgi?id=103573

Reviewed by Ojan Vafai.

Source/WebCore:

Tests: fast/css-grid-layout/implicit-columns-auto-resolution.html
       fast/css-grid-layout/implicit-rows-auto-resolution.html

This change makes us properly initialize our GridTrack vectors's size
so that we can safely query any items during layout.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridTrackSize):
Added this helper function to return the track size from the grid
element's columns' / rows' definitions or the default value.

(WebCore::RenderGrid::maximumIndexInDirection):
Added this helper function to get the maximum index in a direction
taking grid item's implicit indexes into account.

(WebCore::RenderGrid::computedUsedBreadthOfGridTracks):
Changed the funtion to not append the new tracks as we are properly
sized now.

(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
Updated these functions to use the new helper functions.

(WebCore::RenderGrid::layoutGridItems):
Changed this function to size both vectors when initializing them.
Also removed an unneeded bounds check as it shouldn't be needed anymore.

* rendering/RenderGrid.h:
Added the new helper functions.

* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::GridTrackSize):
Added a constructor taking a LengthType.

LayoutTests:

* fast/css-grid-layout/implicit-columns-auto-resolution-expected.txt: Added.
* fast/css-grid-layout/implicit-columns-auto-resolution.html: Added.
* fast/css-grid-layout/implicit-rows-auto-resolution-expected.txt: Added.
* fast/css-grid-layout/implicit-rows-auto-resolution.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Land failing baselines for Lion after r141333. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=108523

* platform/mac-lion/fast/canvas/canvas-composite-alpha-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141506 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r141136): Apple's internal PLT test suite doesn't finish
https://bugs.webkit.org/show_bug.cgi?id=108380

Mark another test whose results depend on main resource caching being enabled as failing until
main resource caching can be re-enabled on mac.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Clean up Dictionary::get() by removing redundant FindInstanceInPrototypeChain()
https://bugs.webkit.org/show_bug.cgi?id=108443

Reviewed by Adam Barth.

In Dictionary::get(), wrapper->FindInstanceInPrototypeChain(V8XXX::GetTemplate())
is unnecessary for DOM wrappers other than DOMWindow. For wrappers other than
DOMWindow, we can simply use V8XXX::HasInstance(wrapper).

Tests: fast/events/constructors/*

* bindings/v8/Dictionary.cpp:
(WebCore::Dictionary::get):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StorageManager should be ref-counted
https://bugs.webkit.org/show_bug.cgi?id=108553

Reviewed by Beth Dakin.

It's likely we'd want to have the storage manager outlive its context at times, so make it
reference counted.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::create):
(WebKit):
* UIProcess/Storage/StorageManager.h:
(StorageManager):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
* UIProcess/WebContext.h:
(WebContext):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Pass an Isolate to GetTemplate() in CodeGeneratorV8.pm
https://bugs.webkit.org/show_bug.cgi?id=108445

Reviewed by Adam Barth.

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateDomainSafeFunctionGetter):
(GenerateDomainSafeFunctionSetter):
(GenerateNormalAttrGetter):
(GenerateNamedConstructorCallback):
(GenerateImplementation):
* bindings/scripts/test/V8/V8Float64Array.cpp:
(WebCore::ConfigureV8Float64ArrayTemplate):
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore::TestActiveDOMObjectV8Internal::postMessageAttrGetter):
(WebCore::TestActiveDOMObjectV8Internal::TestActiveDOMObjectDomainSafeFunctionSetter):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore::V8TestNamedConstructorConstructor::GetTemplate):
* bindings/scripts/test/V8/V8TestNode.cpp:
(WebCore::ConfigureV8TestNodeTemplate):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Notify the WebWidget when the WebViewHost is about to tear down compositing support
https://bugs.webkit.org/show_bug.cgi?id=108518

Patch by James Robinson <jamesr@chromium.org> on 2013-01-31
Reviewed by Adrienne Walker.

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::shutdown):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac: Editor::baseWritingDirectionForSelectionStart should return WritingDirection instead of NSWritingDirection.
https://bugs.webkit.org/show_bug.cgi?id=108519.

Reviewed by Sam Weinig.

Source/WebCore: 

No new tests, no change in behavior.

There is no need to use AppKit types here.
baseWritingDirectionForSelectionStart now returns WritingDirection and
WebHTMLView toggleWritingDirection has been modified accordingly.
        
* editing/Editor.h:
* editing/mac/EditorMac.mm:
(WebCore::Editor::baseWritingDirectionForSelectionStart):

Source/WebKit/mac: 

There is no need to use AppKit types here.
baseWritingDirectionForSelectionStart now returns WritingDirection and
WebHTMLView toggleWritingDirection has been modified accordingly.

* WebView/WebHTMLView.mm:
(-[WebHTMLView toggleBaseWritingDirection:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix rubber-band effect on non-scrollable pages
https://bugs.webkit.org/show_bug.cgi?id=107611

Source/WebCore:

Patch by Christopher Cameron <ccameron@chromium.org> on 2013-01-31
Reviewed by Antonio Gomes.

Handle a FrameView's wheel event even if it is not scrollable
because Chrome relies on handling these wheel events for the
over-scroll rubber-band effect.

This had been removed in r138378
[EFL][WK2] Never create WebCore scrollbars for EFL/WK2
by kenneth@chromium.org

Tests: platform/chromium/rubberbanding/wheelevent-overhang-e.html
       platform/chromium/rubberbanding/wheelevent-overhang-n.html
       platform/chromium/rubberbanding/wheelevent-overhang-s.html
       platform/chromium/rubberbanding/wheelevent-overhang-w.html

* page/FrameView.cpp:
(WebCore::FrameView::wheelEvent):

Tools:

Add mouseWheelBegin function to EventSender to allow
event-based rubber-banding tests.

Patch by Christopher Cameron <ccameron@chromium.org> on 2013-01-31
Reviewed by Antonio Gomes.

* DumpRenderTree/chromium/TestRunner/src/EventSender.cpp:
(WebTestRunner):
(WebTestRunner::EventSender::EventSender):
(WebTestRunner::EventSender::mouseDragBegin):
* DumpRenderTree/chromium/TestRunner/src/EventSender.h:
(EventSender):

LayoutTests:

Patch by Christopher Cameron <ccameron@chromium.org> on 2013-01-31
Reviewed by Antonio Gomes.

* platform/chromium/rubberbanding/event-overhang-e-expected.png: Added.
* platform/chromium/rubberbanding/event-overhang-e-expected.txt: Added.
* platform/chromium/rubberbanding/event-overhang-e.html: Added.
* platform/chromium/rubberbanding/event-overhang-n-expected.png: Added.
* platform/chromium/rubberbanding/event-overhang-n-expected.txt: Added.
* platform/chromium/rubberbanding/event-overhang-n.html: Added.
* platform/chromium/rubberbanding/event-overhang-s-expected.png: Added.
* platform/chromium/rubberbanding/event-overhang-s-expected.txt: Added.
* platform/chromium/rubberbanding/event-overhang-s.html: Added.
* platform/chromium/rubberbanding/event-overhang-w-expected.png: Added.
* platform/chromium/rubberbanding/event-overhang-w-expected.txt: Added.
* platform/chromium/rubberbanding/event-overhang-w.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Provide a sensible default architecture when building on iOS SDKs
https://bugs.webkit.org/show_bug.cgi?id=108395

Patch by David Farler <dfarler@apple.com> on 2013-01-31
Reviewed by Joseph Pecoraro.

* Scripts/webkitdirs.pm:
(determineArchitecture):
Check for iphoneos and iphonesimulator SDKs for a default arch.
(determineXcodeSDK): Added.
(xcodeSDK): Added.
(XcodeOptions): Add ARCHS= if defined.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use ASSERT_WITH_SECURITY_IMPLICATION to catch bad casts in DOM
https://bugs.webkit.org/show_bug.cgi?id=108490

Reviewed by Eric Seidel.

* dom/ContainerNode.h:
(WebCore::toContainerNode):
* dom/Element.h:
(WebCore::toElement):
* dom/ShadowRoot.h:
(WebCore::toShadowRoot):
* dom/Text.h:
(WebCore::toText):
* html/HTMLElement.h:
(HTMLElement):
(WebCore::toHTMLElement):
* html/HTMLFrameOwnerElement.h:
(WebCore::toFrameOwnerElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::hasMediaControls):
* html/HTMLTemplateElement.cpp:
(WebCore::toHTMLTemplateElement):
* html/HTMLUnknownElement.h:
(WebCore::toHTMLUnknownElement):
* html/shadow/InsertionPoint.h:
(WebCore::toInsertionPoint):
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::mediaControlElementType):
* html/shadow/MediaControls.h:
(WebCore::toMediaControls):
* html/shadow/SliderThumbElement.h:
(WebCore::toSliderThumbElement):
* html/shadow/TextControlInnerElements.h:
(WebCore::toInputFieldSpeechButtonElement):
* html/shadow/TextFieldDecorationElement.h:
(WebCore::toTextFieldDecorationElement):
* html/track/WebVTTElement.h:
(WebCore::toWebVTTElement):
* mathml/MathMLElement.h:
(WebCore::toMathMLElement):
* page/scrolling/ScrollingStateFixedNode.h:
(WebCore::toScrollingStateFixedNode):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::toScrollingStateScrollingNode):
* page/scrolling/ScrollingStateStickyNode.h:
(WebCore::toScrollingStateStickyNode):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
* rendering/svg/SVGResources.cpp:
(WebCore::registerPendingResource):
(WebCore::SVGResources::buildCachedResources):
* svg/SVGElement.h:
(WebCore::toSVGElement):
* svg/SVGStyledElement.h:
(WebCore::toSVGStyledElement):


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