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
Attempted build fix after http://trac.webkit.org/changeset/135888.

* WebCore.exp.in:
* WebCore.order:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135896 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gardening: Updated TestExpecations for failure in
http/tests/canvas/canvas-slow-font-loading.html
https://bugs.webkit.org/show_bug.cgi?id=103446

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135897 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Remove unnecessary backing store suspension in InputHandler::ensureFocusTextElementVisible
https://bugs.webkit.org/show_bug.cgi?id=103441

Patch by Andrew Lo <anlo@rim.com> on 2012-11-27
Reviewed by Rob Buis.
Internally reviewed by Mike Fenton.

Remove unnecessary backing store suspension in
InputHandler::ensureFocusTextElementVisible.

Not necessary anymore since both zoom and scroll adjustments
happen in an animation.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::ensureFocusTextElementVisible):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Add bug numbers to flaky tests.

* platform/efl/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] http:// origins can navigate to privileged local:// origins
https://bugs.webkit.org/show_bug.cgi?id=103437

Patch by Jacky Jiang  <zhajiang@rim.com>.
Reviewed by Yong Li.

PR: 251489
When we aren't allowed to display the destination origin, we shouldn't
even create the window for it. In this way we can block the remote
origins(like http://) window.open local origins(like file:// and
local://) and avoid further security issues.
Chrome and Safari will open a blank window and fail to load. Firefox
will fail to open the window and report a load failure error which has
the same behavior as us. I would prefer this way as the window would
be useless and the calls after that would be harmful to us.

* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::createWindow):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening: ImageOnlyFailure in fast/canvas/font-update.html
https://bugs.webkit.org/show_bug.cgi?id=103447

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Log to console when autofocus is blocked by sandbox attribute.
https://bugs.webkit.org/show_bug.cgi?id=103255

Reviewed by Ojan Vafai.

Source/WebCore:

Adding a short log message when autofocus is blocked by a document's
sandbox flags, as it's currently a black box.

Test: fast/forms/autofocus-in-sandbox-without-allow-scripts.html

* html/HTMLFormControlElement.cpp:
(WebCore::shouldAutofocus):

LayoutTests:

* fast/forms/autofocus-in-sandbox-without-allow-scripts-expected.txt: Added.
* fast/forms/autofocus-in-sandbox-without-allow-scripts.html: Added.


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