[ATK] [WK2] platform/gtk/accessibility/roles-exposed.html is failing
https://bugs.webkit.org/show_bug.cgi?id=125854

Reviewed by Chris Fleizach.

Tools:

Ensure we don't ever create instances of AccessibilityUIElement
wrapping invalid platform-specific accessibility objects in DRT,
both for consistency with what WKTR does (so we avoid situations
where some tests fail in WK2 and not in WK1) and also to avoid
overlooking tests that might not be checking the right thing.

* DumpRenderTree/AccessibilityUIElement.cpp:
(AccessibilityUIElement::makeJSAccessibilityUIElement): Return a
nullPtr if the platformUIElement() is not a valid one.
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement::platformUIElement): Added const modifier.

LayoutTests:

Updated tests and expectations to keep them passing after the
change done in DRT, without changing their actual purpose.

* platform/gtk/accessibility/roles-exposed.html: Make sure we
print "AXRole: (no element)" when accessibilityElementByID() does
not return a valid object, not to confuse it with cases where the
returned string for the role is an empty string.
* platform/gtk/accessibility/roles-exposed-expected.txt: Update
test expectations to reflect the "AXRole: (no element)" string
that is now being exposed. Also, replace the (wrongly added) PASS
expectations with FAIL for rowgroups, which are currently not
being exposed for ATK either.

* accessibility/deleting-iframe-destroys-axcache.html: Just
consider the first and third sons of the accessibility object for
the body (instead of the grandsons), so the test can run both in
Mac, where sons and grandsons are exposed, and ATK, where only
sons are exposed (no StaticText objects exposed there).

* accessibility/non-data-table-cell-title-ui-element.html: Use
accessibilityElementById() to get the accessibility object for the
"skip" table header instead of navigating with childAtIndex(),
since the hierarchy is not the same for Mac and ATK based ports.

* platform/mac/accessibility/search-predicate.html: Do not rely on
shouldBe() together with the string "AXRole: " when asking for the
role of objects that should no longer be in the accessibility
tree, and use shouldBeUndefined() instead.
* platform/mac/accessibility/search-when-element-starts-in-table.html: Ditto.

* platform/mac/accessibility/search-predicate-expected.txt: Update
expectations according to the usage of shouldBeUndefined().
* platform/mac/accessibility/search-when-element-starts-in-table-expected.txt: Ditto.

* platform/mac/TestExpectations: Add loading-iframe-updates-axtree.html
here, since it seems not to be returning the expected values for
either the scrollarea and the webarea in the iframe (see bug 126066).

* platform/mac-wk2/TestExpectations: Add search-when-element-starts-in-table.html
here, since it does not return an undefined object in WebKit2 when
the search query should return no results (see bug 125996).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Create render tree lazily
https://bugs.webkit.org/show_bug.cgi?id=120685

Source/WebCore: 

Reviewed by Andreas Kling.

We currently recompute style and construct renderer for each DOM node immediately after they are added to 
the tree. This is often inefficient as the style may change immediately afterwards and the work needs to be
redone. 
        
With this patch we always compute style and construct render tree lazily, either on style recalc timer or
synchronously when they are needed. It also removes the 'attached' bit. If document has render tree then
all nodes are conceptually "attached" even if this happens lazily.
        
The patch slightly changes behavior of implicit CSS transitions. A synchronous style change during parsing
may not trigger the animation anymore as laziness means we don't see anything changing. This matches Firefox
and Chrome in our test cases.
        
* WebCore.exp.in:
* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNode::insertBefore):
(WebCore::JSNode::replaceChild):
(WebCore::JSNode::appendChild):
        
    All attaching is now lazy, remove AttachLazily.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
        
    SVG renderers with !isValid() have empty display property value for some reason. Keep the behavior.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::parserInsertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::appendChild):
(WebCore::ContainerNode::parserAppendChild):
(WebCore::ContainerNode::updateTreeAfterInsertion):
* dom/ContainerNode.h:
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::createRenderTree):
(WebCore::Document::destroyRenderTree):
        
    Remove attach bit maintenance.

(WebCore::Document::webkitDidExitFullScreenForElement):
        
    Do lazy render tree reconstruction after returning from full screen. That is the only reliable way
    to get the render tree back to decent shape.

* dom/Element.cpp:
(WebCore::Element::isFocusable):
        
    Remove pointless !renderer()->needsLayout() assert.

(WebCore::Element::addShadowRoot):
(WebCore::Element::childShouldCreateRenderer):
(WebCore::Element::resetComputedStyle):
        
    Take care to reset computed style in all descendants. attachRenderTree no longer does this.

* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::insertBefore):
(WebCore::Node::replaceChild):
(WebCore::Node::appendChild):
(WebCore::Node::setNeedsStyleRecalc):
        
    Propagate ReconstructRenderTree.

(WebCore::Node::attached):
        
    Emulate the behavior of old attached bit for now so existing code calling this mostly stays working.

* dom/Node.h:
        
    Add new ReconstructRenderTree value for StyleChangeType.

* dom/Range.cpp:
(WebCore::Range::isPointInRange):
(WebCore::Range::comparePoint):
(WebCore::Range::compareNode):
(WebCore::Range::intersectsNode):
* editing/AppendNodeCommand.cpp:
(WebCore::AppendNodeCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::canRebalance):
* editing/InsertNodeBeforeCommand.cpp:
(WebCore::InsertNodeBeforeCommand::doApply):
* html/HTMLDetailsElement.cpp:
(WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::activeElement):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::setInnerText):
        
    TextControlInnerTextElement always preserves newline even if it doesn't have style yet.

(WebCore::HTMLElement::supportsFocus):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::parseAttribute):
* html/HTMLFormControlElement.cpp:
(WebCore::shouldAutofocus):
        
    Don't autofocus until we have renderer.

* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateType):
        
    Lazy render tree construction.

(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::defaultEventHandler):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parseAttribute):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::executeTask):
        
    Don't attach renderer after construction.

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::invalidateDistribution):
* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::willAttachRenderers):
(WebCore::InsertionPoint::willDetachRenderers):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::createTextTrackDisplay):
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::createControls):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::getDisplayTree):
* loader/PlaceholderDocument.cpp:
(WebCore::PlaceholderDocument::createRenderTree):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::preload):
* style/StyleResolveTree.cpp:
(WebCore::Style::attachTextRenderer):
(WebCore::Style::detachTextRenderer):
        
    Remove attached bit maintenance.

(WebCore::Style::attachChildren):
(WebCore::Style::attachShadowRoot):
(WebCore::Style::attachRenderTree):
(WebCore::Style::detachShadowRoot):
(WebCore::Style::detachRenderTree):
(WebCore::Style::resolveLocal):
* svg/SVGTests.cpp:
(WebCore::SVGTests::handleAttributeChange):
        
    Make lazy.

* testing/Internals.cpp:
(WebCore::Internals::attached):
(WebCore::Internals::elementRenderTreeAsText):
(WebCore::Internals::markerAt):
(WebCore::Internals::nodesFromRect):

LayoutTests: 

Reviewed by Andreas Kling.
        
Most of these are non-visible render tree dump changes (they become simpler).

* editing/selection/click-on-head-margin-expected.txt:
* fast/css-generated-content/before-content-continuation-chain-expected.txt:
* fast/css/transition-color-unspecified.html:
* fast/dom/adopt-node-crash-2-expected.txt:
* fast/dom/modify-node-and-while-in-the-callback-too-crash-expected.txt:
* fast/forms/radio/radio_checked_dynamic-expected.txt:
* fast/frames/lots-of-iframes-expected.txt:
* fast/frames/sandboxed-iframe-autofocus-denied-expected.txt:
* fast/table/table-row-style-not-updated-with-after-content-expected.txt:
* fullscreen/full-screen-render-inline-expected.txt:
* fullscreen/parent-flow-inline-with-block-child-expected.txt:
* platform/mac/editing/inserting/break-blockquote-after-delete-expected.txt:
* platform/mac/fast/css-generated-content/table-row-group-to-inline-expected.txt:
* platform/mac/fast/dynamic/011-expected.txt:
* platform/mac/fast/forms/formmove3-expected.txt:
* platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt:
* platform/mac/fast/invalid/001-expected.txt:
* platform/mac/fast/invalid/003-expected.txt:
* platform/mac/fast/invalid/004-expected.txt:
* platform/mac/fast/invalid/007-expected.txt:
* platform/mac/fast/invalid/019-expected.txt:
* platform/mac/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt:
* platform/mac/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt:
* platform/mac/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt:
* platform/mac/fast/ruby/ruby-base-merge-block-children-crash-expected.txt:
* platform/mac/tables/mozilla/bugs/bug113235-1-expected.txt:
* platform/mac/tables/mozilla/bugs/bug647-expected.txt:
* platform/mac/tables/mozilla/other/wa_table_tr_align-expected.txt:
* plugins/plugin-remove-readystatechange-expected.txt:
* svg/custom/system-language-crash-expected.txt:
* transitions/equivalent-background-image-no-transition.html:
* transitions/repeated-firing-background-color.html:
* transitions/transition-duration-cleared-in-transitionend-crash.html:

    Adopt a few transition test cases to new behavior.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] The fullscreen API should be enabled by default
https://bugs.webkit.org/show_bug.cgi?id=125993

Patch by Enrique Ocaña González <eocanha@igalia.com> on 2013-12-20
Reviewed by Gustavo Noronha Silva.

Set the WebSettings property to TRUE

Source/WebKit/gtk:

* webkit/webkitwebsettings.cpp:
(webkit_web_settings_class_init):

Source/WebKit2:

* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK build fix after r160909.
Remove remaining uses of AttachLazily in code specific to the GTK port.

* html/shadow/MediaControlsGtk.cpp:
(WebCore::MediaControlsGtk::initializeControls):
(WebCore::MediaControlsGtk::createTextTrackDisplay):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[arm] Add missing implementation in MacroAssembler to fix CPU(ARM_TRADITIONAL) build.
https://bugs.webkit.org/show_bug.cgi?id=126064

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-12-20
Reviewed by Mark Hahnenberg.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::branchTest8):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[sh4] Add missing implementation in MacroAssembler to fix build.
https://bugs.webkit.org/show_bug.cgi?id=126063

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-12-20
Reviewed by Mark Hahnenberg.

* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::branchTest8):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MIPS] Missing MacroAssemblerMIPS::branchTest8(ResultCondition, BaseIndex, TrustedImm32)
https://bugs.webkit.org/show_bug.cgi?id=126062

Patch by Balazs Kilvady <kilvadyb@homejinni.com> on 2013-12-20
Reviewed by Mark Hahnenberg.

* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::branchTest8):

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