freeV8NPObject: Skip trying to remove object from per context data's ObjectMap if the object does not exist in the map.
https://bugs.webkit.org/show_bug.cgi?id=103356

Patch by Istiaque Ahmed <lazyboy@chromium.org> on 2012-11-27
Reviewed by Adam Barth.

Before introducing per context data, it used to be the case that we would ignore removing v8 object
from context data's map if we couldn't find it. With perContextData change, this turned into an ASSERT
instead and we had crash reports.
Related crbug.com/154462.

Source/WebCore:

Test: platform/chromium/plugins/release-frame-content-window.html

* bindings/v8/NPV8Object.cpp:
(WebCore::freeV8NPObject):

LayoutTests:

* platform/chromium/plugins/release-frame-content-window-expected.txt: Added.
* platform/chromium/plugins/release-frame-content-window.html: Added.
* platform/chromium/plugins/resources/empty.html: Added.
* platform/chromium/plugins/resources/empty2.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Remove from TestExpectations tests that are passing.

* platform/efl/TestExpectations:



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

Remove leftover file that was replaced by PlatformScreenQt.cpp 4 years ago.

* platform/qt/ScreenQt.cpp: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed build fix on Linux clang.

../../third_party/WebKit/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:1055:63: error:
C++98 requires an accessible copy constructor for class 'WebKit::WebCachedURLRequest' when binding
a reference to a temporary; was private [-Werror,-Wbind-to-temporary-copy]

* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::dispatchWillRequestResource):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [WK2] WebPageProxy::relatedPages() cannot assume that this page is known to process
        https://bugs.webkit.org/show_bug.cgi?id=103433
        <rdar://problem/12543513>

        Reviewed by Jessie Berlin.

        * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::relatedPages): Removed an incorrect
        assertion, and modified code to not rely on its condition being true.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening, fixing lint errors in TestExpectations.

* platform/gtk/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Plumbing showPaintRects out of InspectorPageAgent to use a different drawing implementation if available.
https://bugs.webkit.org/show_bug.cgi?id=102452

Patch by Eberhard Graether <egraether@google.com> on 2012-11-27
Reviewed by Pavel Feldman.

This change makes the showPaintRects setting in the Web Inspector's settings notify InspectorClient
when changed. And the default paint rects drawing is not used if an alternative is available.
This allows Chromium to draw the paint rects in the compositor's HUDLayer.

Source/Platform:

* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):
(WebKit::WebLayerTreeView::setShowPaintRects):

Source/WebCore:

No new tests.

* inspector/InspectorClient.h:
(WebCore::InspectorClient::overridesShowPaintRects):
(WebCore::InspectorClient::setShowPaintRects):
(InspectorClient):
* inspector/InspectorPageAgent.cpp:
(PageAgentState):
(WebCore::InspectorPageAgent::restore):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::setShowPaintRects):
(WebCore::InspectorPageAgent::didPaint):

Source/WebKit/chromium:

* public/WebView.h:
(WebView):
* src/InspectorClientImpl.cpp:
(WebKit::InspectorClientImpl::overridesShowPaintRects):
(WebKit):
(WebKit::InspectorClientImpl::setShowPaintRects):
* src/InspectorClientImpl.h:
(InspectorClientImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setShowPaintRects):
(WebKit):
* src/WebViewImpl.h:
(WebViewImpl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
objc/objc-runtime.h does not exist on all PLATFORM(MAC)
https://bugs.webkit.org/show_bug.cgi?id=101780

Reviewed by Brent Fulgham.

Clean up header includes so we don't include objc/objc-runtime.h.

Source/WebCore:

No new tests because no functional changes.

* bridge/objc/objc_header.h:
* page/mac/EventHandlerMac.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
* platform/graphics/mac/WebLayer.mm:
* platform/mac/WebCoreObjCExtras.mm:
* platform/mac/WebVideoFullscreenController.mm:

Source/WebKit/mac:

* Carbon/HIWebView.mm:
(UpdateCommandStatus): Use wtfObjcMsgSend template instead of objc_msgSend.
* Plugins/WebNetscapePluginView.mm:
* Plugins/WebPluginContainerCheck.mm:
(-[WebPluginContainerCheck _continueWithPolicy:]): Use wtfObjcMsgSend template instead of objc_msgSend.
* Plugins/WebPluginController.mm:
* WebCoreSupport/WebCachedFramePlatformData.h:
* WebCoreSupport/WebDeviceOrientationClient.mm:
* WebView/WebDelegateImplementationCaching.mm:
* WebView/WebHTMLView.mm:
* WebView/WebPDFDocumentExtras.mm:
* WebView/WebPolicyDelegate.mm:
(-[WebPolicyDecisionListener _usePolicy:]): Use wtfObjcMsgSend template instead of objc_msgSend.
* WebView/WebView.mm:

Source/WebKit2:

* PluginProcess/mac/PluginProcessShim.mm:
* UIProcess/API/mac/PDFViewController.mm:

Source/WTF:

* wtf/Functional.h:
* wtf/ObjcRuntimeExtras.h: Include objc/message.h here so we don't rely on proper ordering
of includes in files that include this header.

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
* DumpRenderTree/mac/ObjCPlugin.m:
* TestWebKitAPI/mac/InstanceMethodSwizzler.h:
* WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] EventLoop should end when WebKit thread is exiting
https://bugs.webkit.org/show_bug.cgi?id=103301

Reviewed by Rob Buis.
RIM PR# 194379.
Internally reviewed by Joe Mason.

Break the nested event loop when WebKit thread has been asked to quit.

* platform/blackberry/EventLoopBlackBerry.cpp:
(WebCore::EventLoop::cycle):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r125578): word-wrapping in absolute position with nbsp, word-spacing and custom font
https://bugs.webkit.org/show_bug.cgi?id=101443

Reviewed by David Hyatt.

Source/WebCore:

Leading non-breaking space in a text run should always get word-spacing applied. When RenderText
calculates the preferred with of a run of text it breaks it up into word segments that contain
no breaking spaces and calculates the width of each. So when calculating the width of '&nbsp;b'
it needs to add word-spacing to the leading non-breaking space as it does not get collapsed away.

Test: fast/text/word-space-nbsp.html

* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal):

LayoutTests:

* fast/text/word-space-nbsp-expected.html: Added.
* fast/text/word-space-nbsp.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135884 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout Test transitions/transition-shorthand-delay.html should usePauseAPI
https://bugs.webkit.org/show_bug.cgi?id=103402

Patch by Jussi Kukkonen <jussi.kukkonen@intel.com> on 2012-11-27
Reviewed by Simon Fraser.

PauseAPI works when pausing during delay in transitions now, using it
should fix the flakiness.

* platform/efl/TestExpectations:
* transitions/transition-shorthand-delay.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
No need for ExceptionCode in HTMLMediaElement::load
https://bugs.webkit.org/show_bug.cgi?id=103438

Reviewed by Eric Carlson.

After https://bugs.webkit.org/show_bug.cgi?id=103318, there is no
need for the ExceptionCode parameter in load(). The HTML5 spec says
that all errors in loading are communicated via state.
http://dev.w3.org/html5/spec/media-elements.html#dom-media-load

Of the 29 tests exercising load(), none of them were exercising
exceptions (obviously).

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::load):
(WebCore::HTMLMediaElement::resume):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. fast/loader/submit-form-while-parsing-2.html is still flaky
so put it back in TestExpectations.

* platform/efl/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Canvas does not draw any text if the font is not fully loaded yet
https://bugs.webkit.org/show_bug.cgi?id=103392

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-27
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Update CanvasRenderingContext2D::drawTextInternal() so that the
text is being drawn, even if custom fonts are still being loaded.
Without this, WebKit was not drawing any text on the canvas if
the needed font is custom and is not fully loaded yet. This seems
broken.

The new behavior is according to specification:
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html

The specification says: "If a font is used before it is fully
loaded, or if the font style source object does not have that
font in scope at the time the font is to be used, then it must be
treated as if it was an unknown font, falling back to another as
described by the relevant CSS specifications."

Test: http/tests/canvas/canvas-slow-font-loading.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* platform/graphics/Font.cpp:
(WebCore::Font::drawText): Add argument to specify the behavior
when custom fonts are not ready. By default, it will not draw
anything (same behavior as before). However, the Canvas code
can now request that a fallback font is used if the custom
font is not fully loaded yet.
* platform/graphics/Font.h: #undef Complex if defined to avoid
conflicting with Complex value in CodePath enum. X11/X.h is
defining Complex to 0.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawBidiText):
* platform/graphics/GraphicsContext.h:
(WebCore):
(GraphicsContext):

LayoutTests:

Add canvas test to check that text is drawn using a fallback font
if the primary font is not fully loaded yet.

* http/tests/canvas/canvas-slow-font-loading-expected.html: Added.
* http/tests/canvas/canvas-slow-font-loading.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Gardening of failing tests
https://bugs.webkit.org/show_bug.cgi?id=103434

Unreviewed gardening.

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-11-27

* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:
* platform/efl/fast/js/global-constructors-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Windows specific implementation of usesTileCacheLayer needed after r133056.
https://bugs.webkit.org/show_bug.cgi?id=103321

Reviewed by Simon Fraser.

After r133056 it no longer suffices to use the existing usesTileCacheLayer method on Windows.
The change resulted in 3 crashing tests:
compositing/rotated-tiled-clamped
compositing/rotated-tiled-preserve3d-clamped
fast/events/tabindex-focus-blur-all

* platform/win/TestExpectations: 
Remove the tests below from the Windows skip list. 

* platform/win/compositing/tiling/rotated-tiled-clamped-expected.txt: Added.
* platform/win/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt: Added.
Add Windows specific results for tests added in r133056.

* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::usesTileCacheLayer):
(PlatformCALayer): 
Adding in platform specific method for Windows that returns false for this method.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135890 268f45cc-cd09-0410-ab3c-d52691b4dbfc
max-height property not respected in case of tables
https://bugs.webkit.org/show_bug.cgi?id=98633

Patch by Pravin D <pravind.2k4@gmail.com> on 2012-11-27
Reviewed by Julien Chaffraix.

Source/WebCore:

The max-height property determines the maximum computed height an element can have. In case of tables
the computed height was not being limited by the max-height property. The current patch fixes the same.

Test: fast/table/css-table-max-height.html

* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
  Helper function to compute height from the given style height.
  This function handles style height of type fixed, percent and viewport percent.
  As height of type 'calculated' gets internally resolved to either fixed or percent
  there is no special handling required for the same.

(WebCore):
(WebCore::RenderTable::layout):
  Logic to compute the logical height of an element such that it does not exceed the max-height value given that
  min-width < Content height < max-height, when min-height < max-height.
  However max-height value is not respected if either min-height > max-height or Content height > max-height.

* rendering/RenderTable.h:
(RenderTable):
  Function definition for the newly add function convertStyleLogicalHeightToComputedHeight().

LayoutTests:

* fast/table/css-table-max-height-expected.txt: Added.
* fast/table/css-table-max-height.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Skip some flaky video tests on Windows.
https://bugs.webkit.org/show_bug.cgi?id=103442

* platform/win/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HTMLCollection on Document should be stored on NodeListsNodeData like other HTMLCollections and LiveNodeLists
https://bugs.webkit.org/show_bug.cgi?id=103364

Reviewed by Anders Carlsson.

Replaced the HTMLCollection storage in Document by NodeListsNodeData used by other HTMLCollection's
and LiveNodeList's. Now NodeListsNodeData is the only storage for HTMLCollection and LiveNodeList.

* dom/Document.cpp:
(WebCore::Document::Document): Removed code for m_collection since it has been removed.
(WebCore::Document::~Document): Ditto.
(WebCore::Document::registerNodeList): Renamed. 
(WebCore::Document::unregisterNodeList): Ditto.
(WebCore::Document::ensureCachedCollection): Renamed from cachedCollection to match the convetion
used elsewhere. Also use NodeListNodeData::addCacheWithAtomicName now that m_collection is gone.
(WebCore::Document::images):
(WebCore::Document::applets):
(WebCore::Document::embeds):
(WebCore::Document::plugins):
(WebCore::Document::scripts):
(WebCore::Document::links):
(WebCore::Document::forms):
(WebCore::Document::anchors):
(WebCore::Document::all):
(WebCore::Document::windowNamedItems): Use addCacheWithAtomicName.
(WebCore::Document::documentNamedItems): Ditto.
(WebCore::Document::reportMemoryUsage): Removed code for m_collection since it has been removed.
* dom/Document.h:
(WebCore::Document): Removed m_collections, m_documentNamedItemCollections, and
m_windowNamedItemCollections.
* dom/Element.cpp:
(WebCore::Element::ensureCachedHTMLCollection): Merged ElementRareData::ensureCachedHTMLCollection.
(WebCore::Element::cachedHTMLCollection): Merged ElementRareData::cachedHTMLCollection.
* Source/WebCore/dom/ElementRareData.h: Removed ensureCachedHTMLCollection, cachedHTMLCollection,
and removeCachedHTMLCollection since they're no longer used.
* dom/LiveNodeList.h:
(WebCore::LiveNodeListBase::LiveNodeListBase): Call registerNodeList now that LiveNodeList
and HTMLCollection share the same storage in all nodes.
(WebCore::LiveNodeListBase::~LiveNodeListBase): Ditto about unregisterNodeList.
(WebCore::LiveNodeList): Removed the calls to registerNodeList and unregisterNodeList since they
are now called in the base class.
* dom/NameNodeList.h:
(WebCore::NameNodeList::create):
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::addCacheWithAtomicName): Pass in CollectionType as the second argument
to T::create. This is used in HTMLNameCollection::create. Sevearl LiveNodeList constructors and
create functions have been modified to support this.
(WebCore::NodeListsNodeData::adoptTreeScope):
(WebCore::NodeListsNodeData::namedNodeListKey): CollectionType is no longer restricted in its range.
* dom/TagNodeList.h:
(WebCore::TagNodeList::create):
(WebCore::HTMLTagNodeList::create):
* html/CollectionType.h: Deleted a bunch of unused inline functions and constants, and cleanup enum.
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection): Removed the call to registerNodeListCache since it's called
in LiveNodeListBase now.
(WebCore::HTMLCollection::~HTMLCollection): Ditto. Also replaced calls to removeCachedHTMLCollection
of Element and Document by a call to NodeListsNodeData::removeCacheWithAtomicName.
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
(WebCore::HTMLFormControlsCollection::create):
* html/HTMLFormControlsCollection.h:
(HTMLFormControlsCollection):
* html/HTMLNameCollection.cpp:
(WebCore::HTMLNameCollection::HTMLNameCollection):
(WebCore::HTMLNameCollection::~HTMLNameCollection):
* html/HTMLNameCollection.h:
(WebCore::HTMLNameCollection::create):
(HTMLNameCollection):
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
(WebCore::HTMLOptionsCollection::create):
* html/HTMLOptionsCollection.h:
(HTMLOptionsCollection):
* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
(WebCore::HTMLTableRowsCollection::create):
* html/HTMLTableRowsCollection.h:
(HTMLTableRowsCollection):
* html/LabelsNodeList.h:
(WebCore::LabelsNodeList::create):
* html/RadioNodeList.h:
(WebCore::RadioNodeList::create):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix after r135890. #else, not #elif.

* platform/graphics/ca/PlatformCALayer.h:
(PlatformCALayer):


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