MediaStream API: Adding an async RTCPeerConnection::addIceCandidate
https://bugs.webkit.org/show_bug.cgi?id=121403

Source/WebCore: 

Merged from https://chromium.googlesource.com/chromium/blink/+/5bd81fda88d48dd2780832246e7d1ab973ee7a1d

Reviewed by Darin Adler.

No new tests, updated RTCPeerConnection-ice.html.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addIceCandidate): Add success and error callbacks.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:

* platform/mediastream/RTCPeerConnectionHandler.h: Changed addIceCandidate signature.

* platform/mediastream/RTCVoidRequest.h: Removed ExtraData, it is unnecessary.

LayoutTests: 

Reviewed by Darin Adler.

* fast/mediastream/RTCPeerConnection-ice-expected.txt:
* fast/mediastream/RTCPeerConnection-ice.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dodge more work during render tree teardown.
<https://webkit.org/b/121487>

Reviewed by Antti Koivisto.

Add a Document::hasLivingRenderTree() method that returns true if
there's a render tree attached to the document and it's not in the
process of being torn down.

Deploy this check in a number of places that were only checking
for the presence of a RenderView.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155955 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Buildfix for !(ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)) platforms
https://bugs.webkit.org/show_bug.cgi?id=121491

Reviewed by Darin Adler.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderBR should not be RenderText
https://bugs.webkit.org/show_bug.cgi?id=121221

Reviewed by Darin Adler.

Source/WebCore: 

Stop inheriting RenderBR from RenderText and make it be a RenderBoxModelObject instead. RenderBR was one
of the few cases where Element renderer was a RenderText. This will enable future cleanups.
        
RenderBR used little of RenderText mechanisms and was already heavily specialized everywhere. Layout code
didn't care about its text content at all. The new RenderText is also significatly more lightweight
than the old. As a line box it uses plain InlineBox instead of InlineTextBox.
        
The patch tries to avoid changing test results though there are a few changed render tree dumps without
visual effect. There are also two rendering progressions.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement):
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getUpperLeftCorner):
* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
* dom/Position.cpp:
(WebCore::hasInlineBoxWrapper):
(WebCore::nextRenderedEditable):
(WebCore::previousRenderedEditable):
(WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
(WebCore::Position::getInlineBoxAndOffset):
* dom/Range.cpp:
(WebCore::Range::textRects):
(WebCore::Range::textQuads):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
* editing/Editor.cpp:
(WebCore::findFirstMarkable):
* editing/TextIterator.cpp:
(WebCore::ignoresContainerClip):
* editing/VisibleUnits.cpp:
(WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox):
(WebCore::CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox):
(WebCore::logicallyPreviousBox):
(WebCore::logicallyNextBox):
(WebCore::wordBreakIteratorForMinOffsetBoundary):
(WebCore::wordBreakIteratorForMaxOffsetBoundary):
* rendering/InlineBox.cpp:
(WebCore::InlineBox::logicalHeight):
(WebCore::InlineBox::baselinePosition):
(WebCore::InlineBox::lineHeight):
(WebCore::InlineBox::deleteLine):
(WebCore::InlineBox::extractLine):
(WebCore::InlineBox::attachLine):
(WebCore::InlineBox::paint):
* rendering/InlineBox.h:
(WebCore::InlineBox::isLineBreak):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::computeOverflow):
* rendering/InlineIterator.h:
(WebCore::isIteratorTarget):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::lineHeight):
(WebCore::InlineTextBox::isLineBreak):
* rendering/RenderBR.cpp:
(WebCore::RenderBR::RenderBR):
(WebCore::RenderBR::~RenderBR):
(WebCore::RenderBR::createAnonymous):
(WebCore::RenderBR::lineHeight):
(WebCore::RenderBR::baselinePosition):
(WebCore::RenderBR::createInlineBox):
(WebCore::RenderBR::setInlineBoxWrapper):
(WebCore::RenderBR::replaceInlineBoxWrapper):
(WebCore::RenderBR::deleteInlineBoxWrapper):
(WebCore::RenderBR::dirtyLineBoxes):
(WebCore::RenderBR::caretMinOffset):
(WebCore::RenderBR::caretMaxOffset):
(WebCore::RenderBR::canBeSelectionLeaf):
(WebCore::RenderBR::setSelectionState):
(WebCore::RenderBR::localCaretRect):
(WebCore::RenderBR::linesBoundingBox):
(WebCore::RenderBR::absoluteRects):
(WebCore::RenderBR::absoluteQuads):
(WebCore::RenderBR::updateFromStyle):
(WebCore::RenderBR::borderBoundingBox):
* rendering/RenderBR.h:
(WebCore::toRenderBR):
* rendering/RenderBlock.cpp:
(WebCore::InlineMinMaxIterator::next):
(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::createInlineBoxForRenderer):
(WebCore::dirtyLineBoxesForRenderer):
(WebCore::reachedEndOfTextRenderer):
(WebCore::RenderBlock::computeBlockDirectionPositionsForLine):
(WebCore::RenderBlockFlow::layoutInlineChildren):
(WebCore::requiresLineBox):
(WebCore::shouldSkipWhitespaceAfterStartObject):
(WebCore::canBreakAtThisPosition):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::generateCulledLineBoxRects):
(WebCore::RenderInline::culledInlineFirstLineBox):
(WebCore::RenderInline::culledInlineLastLineBox):
(WebCore::RenderInline::dirtyLineBoxes):
* rendering/RenderLineBoxList.cpp:
(WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::RenderMenuList):
(WebCore::RenderMenuList::styleDidChange):
(WebCore::RenderMenuList::setText):
(WebCore::RenderMenuList::text):
* rendering/RenderMenuList.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::isBeforeContent):
(WebCore::RenderObject::isAfterContent):
* rendering/RenderObjectChildList.cpp:
(WebCore::RenderObjectChildList::removeChildNode):
* rendering/RenderText.cpp:
(WebCore::RenderText::removeAndDestroyTextBoxes):
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::setTextInternal):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::ascentAndDescentForBox):
(WebCore::RootInlineBox::verticalPositionForBox):

LayoutTests: 

* editing/selection/move-by-word-visually-mac-expected.txt:
        
    This is a progression. A previously failing subtest passes.

* platform/mac/css3/selectors3/html/css3-modsel-179a-expected.txt:
* platform/mac/css3/selectors3/xhtml/css3-modsel-179a-expected.txt:
* platform/mac/css3/selectors3/xml/css3-modsel-179a-expected.txt:
        
    Changes in render tree dump that don't affect rendering.

* platform/mac/fast/css/pseudo-first-line-border-width-expected.txt:
        
    This is a progression. The new rendering matches Firefox.

* platform/mac/fast/css/word-space-extra-expected.txt:
* platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt:
        
    Changes in render tree dump that don't affect rendering.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix Windows CE build on ARM.
https://bugs.webkit.org/show_bug.cgi?id=121490

Patch by Sergio Martins <sergio.martins@kdab.com> on 2013-09-17
Reviewed by Darin Adler.

* wtf/dtoa/utils.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Set MessageEvent.source to the newly created port for shared workers' connect events
https://bugs.webkit.org/show_bug.cgi?id=121390

Reviewed by Darin Adler.

Source/WebCore:

Set MessageEvent.source to the newly created port for shared workers' connect events
instead of previously null, as per the latest specification:
http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#dom-messageevent-source
http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#dom-sharedworker

This behavior is consisent with Blink.

Test: fast/workers/shared-worker-messageevent-source.html

* dom/EventTarget.cpp:
(WebCore::EventTarget::isMessagePort):
* dom/EventTarget.h:
* dom/MessageEvent.cpp:
(WebCore::isValidSource):
(WebCore::MessageEvent::MessageEvent):
* dom/MessageEvent.h:
Use null String instead of an empty String as default value for origin and lastEventId.
This is more efficient and has no impact on the behavior on the JavaScript since a
null String is exposed as an empty one on JS side.
This change is covered by fast/events/constructors/message-event-constructor.html
* dom/MessageEvent.idl:
* dom/MessagePort.h:
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::event):
* workers/SharedWorkerGlobalScope.cpp:
(WebCore::createConnectEvent):

LayoutTests:

Add layout test to check that MessageEvent.source is set to the newly created port
for shared workers' connect events.

* fast/events/constructors/message-event-constructor-expected.txt:
* fast/events/constructors/message-event-constructor.html:
* fast/workers/resources/messageevent-source.js: Added.
(onconnect):
* fast/workers/shared-worker-messageevent-source-expected.txt: Added.
* fast/workers/shared-worker-messageevent-source.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155959 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Skip and rebase tests.

Patch by Gabor Abraham <abrhm@inf.u-szeged.hu> on 2013-09-17

* platform/qt-wk2/TestExpectations:
* platform/qt-wk2/compositing/geometry/negative-text-indent-with-overflow-hidden-layer-expected.txt: Added r155546.
* platform/qt-wk2/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt: Added r155607.
* platform/qt-wk2/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt: Added r155607.
* platform/qt-wk2/fast/repaint/negative-text-indent-with-overflow-hidden-expected.txt: Added r155546.
* platform/qt-wk2/fast/replaced/border-radius-clip-expected.txt: Removed.
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Export some missing symbols for Internals after RenderArena& change.

* WebCore.exp.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add RenderObject bit for isBR().
https://bugs.webkit.org/show_bug.cgi?id=121494

Reviewed by Andreas Kling.

It is no longer piggybacking on isText() flag and is now hot in inline layout.

* rendering/RenderBR.cpp:
(WebCore::RenderBR::RenderBR):
* rendering/RenderBR.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::isBR):
(WebCore::RenderObject::setIsBR):
(WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
HashMap should work with move-only keys
https://bugs.webkit.org/show_bug.cgi?id=121310

Reviewed by Darin Adler.

Source/WebCore:

Update the call sites now that HashMap::take doesn't return a PassOwnPtr.

* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::takeRenderBoxRegionInfo):
* rendering/RenderRegion.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::registerResource):
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::removePendingResource):
(WebCore::SVGDocumentExtensions::removePendingResourceForRemoval):
* svg/SVGDocumentExtensions.h:

Source/WTF:

Add extra overloads for add and set where the key is an rvalue reference, but not a
template parameter rvalue reference. This way we'll coerce the key parameter to have the expected
type instead of the passed in type, causing map.add(StringImpl::create("Hello"), 123) work when the
type of map is HashMap<String, unsigned>.

Also, sprinkle && and std::forward where appropriate.

* wtf/HashMap.h:
* wtf/HashTable.h:

Tools:

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):
Add test.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move the line widow functions out of RenderBlock and into RenderBlockFlow.
https://bugs.webkit.org/show_bug.cgi?id=121456

Reviewed by Dean Jackson.

* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
(WebCore::RenderBlock::RenderBlockRareData::RenderBlockRareData):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlockChild):
(WebCore::calculateMinimumPageHeight):
(WebCore::RenderBlockFlow::adjustLinePositionForPagination):
(WebCore::RenderBlockFlow::setBreakAtLineToAvoidWidow):
(WebCore::RenderBlockFlow::clearShouldBreakAtLineToAvoidWidow):
(WebCore::RenderBlockFlow::relayoutToAvoidWidows):
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::RenderBlockFlowRareData::RenderBlockFlowRareData):
(WebCore::RenderBlockFlow::shouldBreakAtLineToAvoidWidow):
(WebCore::RenderBlockFlow::lineBreakToAvoidWidow):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::layoutRunsAndFloatsInRange):
(WebCore::RenderBlock::linkToEndLineIfNeeded):
(WebCore::RenderBlock::determineStartPosition):
(WebCore::RenderBlock::checkPaginationAndFloatsAtEndLine):
* rendering/RenderObject.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bad ASSERT() in RasterShapeIntervals::firstIncludedIntervalY()
https://bugs.webkit.org/show_bug.cgi?id=121455

Reviewed by Darin Adler.

Source/WebCore:

Corrected a bad ASSERT() introduced in https://bugs.webkit.org/show_bug.cgi?id=120211.

Test: fast/shapes/shape-inside/shape-inside-first-fit-crash.html

* rendering/shapes/RasterShape.cpp:
(WebCore::RasterShapeIntervals::firstIncludedIntervalY):

LayoutTests:

Simple regression test, it crashes in the bad ASSERT().

* fast/shapes/shape-inside/shape-inside-first-fit-crash-expected.txt: Added.
* fast/shapes/shape-inside/shape-inside-first-fit-crash.html: Added.


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