Remove failing or flaky test expectations from tests that have been passing on Mac.

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Refactoring] Replace Node's Document pointer with a TreeScope pointer
https://bugs.webkit.org/show_bug.cgi?id=59816

Patch by Elliott Sprehn <esprehn@gmail.com> on 2013-01-03
Reviewed by Ryosuke Niwa.

Instead of giving every node in a shadow a rare data, which can be quite
large, we replace the Document pointer in Node with a TreeScope pointer
and we give TreeScope a pointer to it's document scope.

This introduces no branches in document() because in the common
case document() becomes equivalent to m_treeScope->m_documentScope where
the documentScope is actually m_treeScope so this shouldn't introduce a
perf regression.

Note also that TreeScope can never be null after r136328, and the document
pointer is only null for DocumentType nodes so we can use a special
no-document TreeScope for this case that always returns null from
documentScope().

My original patch in r137524 for this did not correctly handle the case
where the Document is being destroyed and we would then call guardDeref on
ourself in the middle of the Document destructor causing asserts. To fix
this we need to go back to the original model where Document passes
null to it's super constructor for the Document pointer and assigns
it's tree scope later, and we also need to clear the tree scope pointer
in Document's destructor.

No new tests, no change in behavior.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::suggestedMIMEType):
* dom/Document.h:
(WebCore::Node::isDocumentNode):
(WebCore::Node::Node):
* dom/Element.cpp:
(WebCore::Element::createRareData):
* dom/ElementRareData.h:
(ElementRareData):
(WebCore::ElementRareData::ElementRareData):
* dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::Node::createRareData):
(WebCore::Node::attach):
(WebCore::Node::reportMemoryUsage):
* dom/Node.h:
(WebCore::NodeRareDataBase::NodeRareDataBase):
(NodeRareDataBase):
(WebCore::Node::treeScope):
(WebCore::Node::inDocument):
(WebCore::Node::documentInternal):
(WebCore::Node::setTreeScope):
(Node):
* dom/NodeRareData.cpp:
(SameSizeAsNodeRareData):
(WebCore::NodeRareData::reportMemoryUsage):
* dom/NodeRareData.h:
(WebCore::NodeRareData::NodeRareData):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
* dom/TreeScope.cpp:
(SameSizeAsTreeScope):
(WebCore::TreeScope::TreeScope):
(WebCore::TreeScope::clearDocumentScope):
    Needed to clear the document scope during Document destruction
    so the Node destructor does not guardDeref the document that is
    already being destroyed.
(WebCore::TreeScope::setParentTreeScope):
* dom/TreeScope.h:
(TreeScope):
(WebCore::TreeScope::documentScope):
(WebCore::TreeScope::noDocumentInstance):
    Special shared tree scope that has a document scope that is always
    null. This is needed for DocType nodes, and also for Documents
    during construction.
(WebCore::TreeScope::setDocumentScope):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix overflow in LayoutUnit::ceil and floor for SATURATED_LAYOUT_ARITHMETIC
https://bugs.webkit.org/show_bug.cgi?id=105961

Source/WebCore:

Reviewed by Levi Weintraub.

The LayoutUnit::ceil and floor methods overflows if given the
intMaxForLayoutUnit and intMinForLayoutUnit values respectively.
Check for the max/min value to avoid this.

Test: TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp

* platform/LayoutUnit.h:
(WebCore::LayoutUnit::ceil):
(WebCore::LayoutUnit::floor):
Check for the max/min value and return early to avoid overflow.
Use the UNLIKELY macro to avoid the cost of branch misprediction
for the common case.

Tools:

Reviewed by Levi Weintraub.

Add tests for LayoutUnit::ceil and floor.

* TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp:
(TestWebKitAPI::TEST):
(TestWebKitAPI):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CallLinkStatus should be aware of closure calls, and the DFG bytecode parser should use that as its sole internal notion of how to optimize calls
https://bugs.webkit.org/show_bug.cgi?id=106027

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg.
        
Previously, the DFG bytecode parser had its own internal notion of exactly what CallLinkStatus was
meant to do, in the form of a CallType, expectedFunction, intrinsic, etc. This change makes CallLinkStatus
smart enough to do all of that, and also gives it the ability to understand closure calls.

* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::CallLinkStatus):
(JSC):
(JSC::CallLinkStatus::function):
(JSC::CallLinkStatus::internalFunction):
(JSC::CallLinkStatus::intrinsicFor):
(JSC::CallLinkStatus::setIsProved):
(JSC::CallLinkStatus::computeFromLLInt):
(JSC::CallLinkStatus::computeFor):
(JSC::CallLinkStatus::dump):
* bytecode/CallLinkStatus.h:
(JSC):
(JSC::CallLinkStatus::CallLinkStatus):
(CallLinkStatus):
(JSC::CallLinkStatus::takesSlowPath):
(JSC::CallLinkStatus::isSet):
(JSC::CallLinkStatus::isClosureCall):
(JSC::CallLinkStatus::callTarget):
(JSC::CallLinkStatus::executable):
(JSC::CallLinkStatus::structure):
(JSC::CallLinkStatus::isProved):
(JSC::CallLinkStatus::canOptimize):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleCall):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::valueOfFunctionConstant):

Source/WTF: 

Reviewed by Mark Hahnenberg.
        
I got tired of the various idioms for printing a list of things with comma in between, so I wrote a helper.

* WTF.xcodeproj/project.pbxproj:
* wtf/CommaPrinter.h: Added.
(WTF):
(CommaPrinter):
(WTF::CommaPrinter::CommaPrinter):
(WTF::CommaPrinter::dump):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138737 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: Add a missing state to RTCPeerConnection
https://bugs.webkit.org/show_bug.cgi?id=106017

Reviewed by Adam Barth.

Adding the missing ReadyStateHaveRemoteOffer which will show up in the spec soon.

Source/Platform:

* chromium/public/WebRTCPeerConnectionHandlerClient.h:

Source/WebCore:

Not testable, just another state.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::readyState):
* platform/mediastream/RTCPeerConnectionHandlerClient.h:

Source/WebKit/chromium:

* src/AssertMatchingEnums.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Add Windows specific result for passing test.

* platform/win/loader: Added.
* platform/win/loader/image-loader-adoptNode-assert-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138740 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix build for DFG JIT disabled.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpValueProfiling):
(JSC::CodeBlock::dumpArrayProfiling):
* runtime/Executable.cpp:
(JSC):
(JSC::ExecutableBase::intrinsic):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove all references to sharedWorkerRepository()
https://bugs.webkit.org/show_bug.cgi?id=104704

Reviewed by Adam Barth.

Now that Chromium calls setSharedWorkerRepository upon
initializing WebKit (
https://codereview.chromium.org/10990121/ and
https://codereview.chromium.org/11576028/ ) and no longer
tries to override sharedWorkerRepository, it is safe to remove
all references to this function.

* public/platform/WebKitPlatformSupport.h:
(WebKit):
(WebKit::WebKitPlatformSupport::idbFactory):
* src/SharedWorkerRepository.cpp:
(WebKit::sharedWorkerRepository):
(WebCore::SharedWorkerRepository::isAvailable):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add crash test expectations for tests regressed by r138729
The failure is tracked by the bug 106042.

* platform/mac-wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkit fails IETC column-width-negative-001.htm
https://bugs.webkit.org/show_bug.cgi?id=84778

Patch by Uday Kiran <udaykiran@motorola.com> on 2013-01-03
Reviewed by Tony Chang.

Source/WebCore:

CSS3 multicolumn 'column-width' property value must be greater than zero.
http://dev.w3.org/csswg/css3-multicol/#column-width

Test: fast/multicol/column-width-zero.html
Negative value test covered by ietestcenter/css3/multicolumn/column-width-negative-001.htm

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue): Check for value greater than zero while parsing.

LayoutTests:

New test for multicolumn 'column-width' property with zero value.
Enable IETC column-width-negative test.

* fast/multicol/column-width-zero-expected.txt: Added.
* fast/multicol/column-width-zero.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
No way to obtain a DOMNode given a JS wrapper for a Node
https://bugs.webkit.org/show_bug.cgi?id=106033

Source/WebCore: 

Reviewed by Sam Weinig.

Test: TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm.

* bindings/objc/DOM.mm:
(+[DOMNode _nodeFromJSWrapper:]): Added. If the given JSObjectRef is a wrapper for a Node,
returns the Objective-C wrapper for that node. Note that Objective-C wrappers are always
for the main world, regardless of which world the given JS wrapper comes from.
* bindings/objc/DOMPrivate.h: Added declaration of the above.

Tools: 

Added a test for +[DOMNode _nodeFromJSWrapper:].

Reviewed by Sam Weinig.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/mac/DOMNodeFromJSObject.mm: Added.
(TestWebKitAPI):
(TestWebKitAPI::TEST):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
css3/filters/effect-invert.html is flaky/has incorrect image output on Win

Unreviewed gardening. Marked this as [ Failure Pass ] for Win7 and
as [ Failure ] for XP.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed debug buildfix after r138723.

* WebProcess/qt/QtBuiltinBundle.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Setting webaudio/automatic-pull-node.html to
[ Timeout Pass ] for XP.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] Unreviewed gardening, skip a new crashing test to paint the bots green.

* platform/qt-5.0-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138751 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Ensure autorelease pool exists when calling WKNSProcessInfoProcessAssertionWithTypes on Mac
https://bugs.webkit.org/show_bug.cgi?id=105674

Patch by Kiran Muppala <cmuppala@apple.com> on 2013-01-03
Reviewed by Sam Weinig.

The function WKNSProcessInfoProcessAssertionWithTypes returns a autoreleased object and since,
it is called during process initialization prior to the runloop being started in PluginProcess
and SharedWorkerProcess, an autorelease pool must be explictly created.

* PluginProcess/mac/PluginProcessMainMac.mm:
(WebKit::PluginProcessMain): Enclose process initialization code in an @autoreleasepool block.
* SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm:
(WebKit::SharedWorkerProcessMain): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138752 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable an intermittently failing unit test for now.
The failure is tracked by the bug 106051.

* TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm:
(TestWebKitAPI::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138753 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mutation Observers] prevent delivery while recipient context is suspended
https://bugs.webkit.org/show_bug.cgi?id=105810

Reviewed by Adam Barth.

Source/WebCore:

Test: inspector/debugger/mutation-observer-suspend-while-paused.html

* dom/MutationObserver.cpp:
(WebCore::suspendedMutationObservers):
(WebCore):
(WebCore::MutationObserver::canDeliver):
(WebCore::MutationObserver::deliver):
(WebCore::MutationObserver::deliverAllMutations):
* dom/MutationObserver.h:

LayoutTests:

* inspector/debugger/mutation-observer-suspend-while-paused-expected.txt: Added.
* inspector/debugger/mutation-observer-suspend-while-paused.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138754 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] Don't apply region flow to fullscreen video playing
https://bugs.webkit.org/show_bug.cgi?id=102388

Reviewed by David Hyatt.

In case of full screen video playing we want to watch the video full screen without applying the region flow.

Source/WebCore: 

Test: fast/regions/full-screen-video-from-region.html

* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::moveToFlowThreadIfNeeded): Don't move full screen video playing to FlowThread.

LayoutTests: 

* fast/regions/full-screen-video-from-region-expected.txt: Added.
* fast/regions/full-screen-video-from-region.html: Added.
* platform/chromium-mac/fast/regions/full-screen-video-from-region-expected.png: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[HTMLTemplateElement] When adopting a template element, also adopt its content into the appropriate document
https://bugs.webkit.org/show_bug.cgi?id=106039

Reviewed by Eric Seidel.

Source/WebCore:

Implements the approach discussed in the spec bug:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20129

Test: fast/dom/HTMLTemplateElement/ownerDocument-adoptNode.html

* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::didMoveToNewDocument):
* html/HTMLTemplateElement.h:
(HTMLTemplateElement):

LayoutTests:

* fast/dom/HTMLTemplateElement/ownerDocument-adoptNode-expected.txt: Added.
* fast/dom/HTMLTemplateElement/ownerDocument-adoptNode.html: Added.


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