Devirtualize RenderView::viewRect().
<https://webkit.org/b/122730>

Reviewed by Antti Koivisto.

There's no need for viewRect() to be a virtual RenderObject function.
The single call site that didn't already access it through RenderView
can just go via view().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Text::renderer() should return RenderText
https://bugs.webkit.org/show_bug.cgi?id=122729

Reviewed by Andreas Kling.
        
Tighten typing.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change callOnMainThread to take an std::function
https://bugs.webkit.org/show_bug.cgi?id=122698

Reviewed by Darin Adler.

This will let us pass anything that can be converted to an std::function (including lambdas and
WTF::Function objects) to callOnMainThread.

* wtf/MainThread.cpp:
(WTF::callOnMainThread):
* wtf/MainThread.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make element predicates and type casts work more consistently on more types
https://bugs.webkit.org/show_bug.cgi?id=122718

Reviewed by Antti Koivisto.

* dom/ContainerNodeAlgorithms.cpp:
(WebCore::assertConnectedSubrameCountIsConsistent):
* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildFrameDisconnector::collectFrameOwners):
Updated for name change.

* dom/Document.cpp:
(WebCore::Document::adoptNode): Use a reference instead of a pointer.
(WebCore::Document::dispatchFullScreenChangeOrErrorEvent): Updated for
typecast name change and also to cast a reference, since we don't overload
for pointers.
(WebCore::Document::updateHoverActiveState): Ditto.

* dom/Element.h: Made the isElementOfType functions take references instead
of pointers. Also use const in the type template argument. These changes go
hand in hand with the changes in the generated code and all the classes.
Also use a bit of nullptr.

* dom/ElementIterator.h:
(WebCore::findElementAncestorOfType): Got rid of the ElementTypeWithConst
naming since this works with or without const. Added const to the call site
for isElementOfType, because it works that way now.

* dom/ElementTraversal.h:
(WebCore::Traversal::firstChildTemplate): Add const to the type when calling
isElementOfType. Along with the corresponding changes, this makes these
templates work for const types.
(WebCore::Traversal::lastChildTemplate): Ditto.
(WebCore::Traversal::firstWithinTemplate): Ditto.
(WebCore::Traversal::lastWithinTemplate): Ditto.
(WebCore::Traversal::nextTemplate): Ditto.
(WebCore::Traversal::previousTemplate): Ditto.
(WebCore::Traversal::nextSiblingTemplate): Ditto.
(WebCore::Traversal::previousSiblingTemplate): Ditto.
(WebCore::Traversal::nextSkippingChildrenTemplate): Ditto.

* dom/Node.cpp:
(WebCore::Node::handleLocalEvents): Check isElementNode and then call the
isDisabledFormControl member function, since we no longer have a helper that
takes a node.
(WebCore::Node::willRespondToMouseMoveEvents): Ditto.
(WebCore::Node::willRespondToMouseClickEvents): Ditto.
(WebCore::Node::willRespondToTouchEvents): Ditto.

* dom/PseudoElement.h: Use some nullptr. Added an isPseudoElement function
that the ELEMENT_TYPE_CASTS macro can use, and also used that macro to make
the toPseudoElement functions instead of a hand-written local variant.

* dom/make_names.pl:
(printTypeHelpers): Added unimplemented versions of the element predicate
functions that return void to catch unnecessary runtime checks of types
that are already known at compile time. Added assertions to the pointer
overloads of the predicates. Maybe later we can delete them. Added const
to the isElementOf template arguments to make these work with both const
and non-const. Put overloads in a consistent order, most specific class
first, then less specific. Changed isElementOfType to take references
rather than pointers.

* editing/Editor.cpp:
(WebCore::Editor::selectionForCommand): Updated to pass a reference.
(WebCore::Editor::setBaseWritingDirection): Ditto.
(WebCore::findFirstMarkable): Ditto.

* html/FormAssociatedElement.h: Tweaked a comment.

* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::insertedInto): Updated for name change and to
pass a reference.

* html/HTMLElement.cpp:
(WebCore::HTMLElement::translate): Removed FIXME and const_cast since the
problem is fixed.
(WebCore::HTMLElement::directionality): Use a reference.

* html/HTMLElement.h: Use const in the type of the isElementOfType functions.
Use references for all the arguments, not pointers.

* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::refreshElementsIfNeeded): Use documentVersion
instead of docVersion for local variable name. Use elementDescendants instead
of elementTraversal.
(WebCore::HTMLFieldSetElement::length): Use length instead of len for name.

* html/HTMLFormControlElement.h: Put predicates into the standard format and
did them on single lines. Added ELEMENT_TYPE_CASTS so we get standard casts.
* html/HTMLFrameElementBase.h: Ditto.
* html/HTMLFrameOwnerElement.h: Ditto, but changed the name to match the class,
so it's now isHTMLFrameOwnerElement and toHTMLFrameOwnerElement.

* html/HTMLLabelElement.cpp:
(WebCore::nodeAsSupportedLabelableElement): Updated to use references.

* html/HTMLMediaElement.h: Put predicates into the standard format and did
them on single lines. Added ELEMENT_TYPE_CASTS so we get standard casts.
* html/HTMLPlugInElement.h: Ditto. Also marked isPluginElement FINAL.
* html/HTMLPlugInImageElement.h: Ditto.
* html/HTMLTableCellElement.cpp: Removed old hand-written cast functions.
* html/HTMLTableCellElement.h: Did same predicate and ELEMENT_TYPE_CASTS
changes. Also fixed up the ordering of functions in the class.

* html/HTMLTextFormControlElement.cpp:
(WebCore::enclosingTextFormControl): Updated to use references and nullptr.

* html/HTMLTextFormControlElement.h: Did same predicate and ELEMENT_TYPE_CASTS.

* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::removedFrom): Call isHTMLMediaElement by its new name.

* html/LabelableElement.h: Did same predicate and ELEMENT_TYPE_CASTS.

* html/track/WebVTTElement.h: Made isWebVTTElement private. Changed the argument
type of setLanguage to const AtomicString& to avoid excess reference count churn.
Did the predicate and type casts thing.

* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create): Update for name changes and use references.

* mathml/MathMLElement.h: Did same predicate and ELEMENT_TYPE_CASTS.

* page/FocusController.cpp:
(WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
(WebCore::FocusController::advanceFocusInDocumentOrder):
* page/PageSerializer.cpp:
(WebCore::SerializerMarkupAccumulator::appendCustomAttributes):
Update for name change.

* platform/Pasteboard.h: Removed unneeded forward declaration.

* rendering/RenderWidget.h: Updated for name change.

* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives): Use element iterator
and nullptr.

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler): Update for name changes.

* svg/SVGAnimateElement.cpp:
(WebCore::isSVGAnimateElement): Moved here since we don't want to inline such
a long list of tag names.

* svg/SVGAnimateElement.h: Marked a lot more virtual functions OVERRIDE.
Did predicate and ELEMENT_TYPE_CASTS changes, but did not make the predicate
be inlined.

* svg/SVGElement.h: Did predicate and ELEMENT_TYPE_CASTS changes.
* svg/SVGFilterPrimitiveStandardAttributes.h: Ditto.

* svg/SVGGradientElement.cpp:
(WebCore::isSVGGradientElement): Moved here since we don't want to inline
the two tag names.

* svg/SVGGradientElement.h: Did predicate and ELEMENT_TYPE_CASTS changes.
* svg/SVGGraphicsElement.h: Ditto.

* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::SVGImageElement): Took out assertion, since it
was asserting the class of the obejct we just created.

* svg/SVGPolyElement.cpp:
(WebCore::isSVGPolyElement): Moved here since we don't want to inline the
two tag names.

* svg/SVGPolyElement.h: Did predicate and ELEMENT_TYPE_CASTS changes.
* svg/SVGTextContentElement.h: Ditto.

* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::connectConditions): Update for name changes,
to use references and nullptr, and to get rid of a non-helpful local.

* svg/animation/SVGSMILElement.h: Added a virtual function to check if a
given SVGElement is an SVGSMILElement so we don't have to check a long list
of tag names instead. Also did the predicate and ELEMENT_TYPE_CASTS changes.

* testing/Internals.cpp:
(WebCore::Internals::visiblePlaceholder): Updated to use references.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157375 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix the Lion build.

* Configurations/JavaScriptCore.xcconfig:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removing  input-file-entries.html from TestExpectation
https://bugs.webkit.org/show_bug.cgi?id=122674

Patch by Santosh Mahto <santosh.ma@samsung.com> on 2013-10-13
Reviewed by Anders Carlsson.

input-file-entries.html has been removed in
changeset 156692. so removing references to this file.

* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderLayerBacking should have RenderLayer& backpointer.
<https://webkit.org/b/122731>

Reviewed by Anders Carlsson.

RenderLayerBacking is always owned by a RenderLayer and so should
store its backpointer in a reference.


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

* platform/gtk-wk2/TestExpectations:
Add bug number to the failing animation tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Roll deps^H^H^H^HChangeLogs.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rewrite Document::body and Document::head in modern style, way clearer and shorter
https://bugs.webkit.org/show_bug.cgi?id=122717

Reviewed by Andreas Kling.

* dom/Document.cpp:
(WebCore::Document::body): Use iterator to make this way easier to read.
(WebCore::Document::head): Ditto.

* html/HTMLTagNames.in: Added generateTypeHelpers for body and head.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL OSR exit should perform zero extension on values smaller than 64-bit
https://bugs.webkit.org/show_bug.cgi?id=122688

Reviewed by Gavin Barraclough.
        
In the DFG we usually make the simplistic assumption that a 32-bit value in a 64-bit
register will have zeros on the high bits.  In the few cases where the high bits are
non-zero, the DFG sort of tells us this explicitly.

But when working with llvm.webkit.stackmap, it doesn't work that way.  Consider we might
emit LLVM IR like:

    %2 = trunc i64 %1 to i32
    stuff %2
    call @llvm.webkit.stackmap(...., %2)

LLVM may never actually emit a truncation instruction of any kind.  And that's great - in
many cases it won't be needed, like if 'stuff %2' is a 32-bit op that ignores the high
bits anyway.  Hence LLVM may tell us that %2 is in the register that still had the value
from before truncation, and that register may have garbage in the high bits.

This means that on our end, if we want a 32-bit value and we want that value to be
zero-extended, we should zero-extend it ourselves.  This is pretty easy and should be
cheap, so we should just do it and not make it a requirement that LLVM does it on its
end.
        
This makes all tests pass with JSC_ftlOSRExitUsesStackmap=true.

* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStubWithOSRExitStackmap):
* ftl/FTLValueFormat.cpp:
(JSC::FTL::reboxAccordingToFormat):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r157381): Make Document::body() crash less when there is no documentElement.

Unreviewed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Uncrashify Document::head() too. (Why am I even awake?)

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge NODE_TYPE_CASTS and ELEMENT_TYPE_CASTS
https://bugs.webkit.org/show_bug.cgi?id=122735

Reviewed by Antti Koivisto.

NODE_TYPE_CASTS and ELEMENT_TYPE_CASTS are identical. Let them become one
with one another.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
build.webkit.org/dashboard incorrectly shows interrupted builds as green
https://bugs.webkit.org/show_bug.cgi?id=122732

Reviewed by Tim Hatcher.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js:
(BuildbotIteration.prototype.update): Removed a special case for status 4 (EXCEPTION).
I don't see it occur any time in recent history, but judging from what happens for
status 5 (RETRY), we can just finish this function normally.
Record overall text description for iteration as BuildbotIteration.text.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTesterQueueView.js:
(BuildbotTesterQueueView.prototype.update.appendBuilderQueueStatus): If an iteration is a failure,
but no tests failed, make it yellow, and use buildbot-provided description for it.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Deprecate or remove deleteAllValues functions; there are only a few call sites left
https://bugs.webkit.org/show_bug.cgi?id=122738

Reviewed by Anders Carlsson.

Source/WebCore:

* platform/blackberry/CookieMap.cpp:
(WebCore::CookieMap::deleteAllCookiesAndDomains):
* platform/network/blackberry/rss/RSSParserBase.cpp:
(WebCore::RSSFeed::clear):
* platform/win/WCDataObject.cpp:
(WebCore::WCDataObject::~WCDataObject):
Renamed deleteAllValues to deprecatedDeleteAllValues.

Source/WebKit/blackberry:

* WebKitSupport/InPageSearchManager.cpp:
(BlackBerry::WebKit::InPageSearchManager::cancelPendingScopingEffort):
Renamed deleteAllValues to deprecatedDeleteAllValues.

Source/WebKit2:

* Shared/Plugins/NPRemoteObjectMap.cpp:
(WebKit::NPRemoteObjectMap::pluginDestroyed): Renamed deleteAllValues to
deprecatedDeleteAllValues.

Source/WTF:

* wtf/Deque.h: Deleted deleteAllValues.
* wtf/HashMap.h: Ditto.
* wtf/HashSet.h: Ditto.
* wtf/ListHashSet.h: Ditto.
* wtf/Vector.h: Renamed deleteAllValues to deprecatedDeleteAllValues.

Tools:

* DumpRenderTree/win/DRTDataObject.cpp:
(DRTDataObject::~DRTDataObject):
* DumpRenderTree/win/UIDelegate.cpp:
(DRTUndoStack::~DRTUndoStack):
(DRTUndoStack::clear):
Renamed deleteAllValues to deprecatedDeleteAllValues.

* Scripts/do-webcore-rename: Updated to perform this rename, as is traditional.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use RenderElement instead of RenderObject in more places.
<https://webkit.org/b/122734>

Reviewed by Antti Koivisto.

Convert some sites to use RenderElement (or type inference) instead
of RenderObject for less branchy code.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] 2 span positions are not resolved correctly
https://bugs.webkit.org/show_bug.cgi?id=119717

Reviewed by Andreas Kling.

From Blink r155397 by <jchaffraix@chromium.org>

Source/WebCore:

Test: fast/css-grid-layout/grid-item-bad-resolution-double-span.html

Two opposite 'span' or 'auto' positions should be resolved using
the auto placement algorithm. We were only checking for the 'auto'
case. This also covers the case of other positions that, according
to the spec, should be treated as 'auto'.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::resolveGridPositionsFromStyle):

LayoutTests:

Added a new test case to check bad grid items resolution with two
opposite span positions. Also added a real grid container to check
also the resolution code path in some other tests.

* fast/css-grid-layout/grid-item-area-get-set.html: Added a grid container.
* fast/css-grid-layout/grid-item-bad-resolution-double-span-expected.txt: Added.
* fast/css-grid-layout/grid-item-bad-resolution-double-span.html: Added.
* fast/css-grid-layout/grid-item-end-after-get-set.html: Added a grid container.
* fast/css-grid-layout/grid-item-start-before-get-set.html: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Be more efficient about passing RenderStyle to attachRenderTree().
<https://webkit.org/b/122743>

Reviewed by Antti Koivisto.

Have attachRenderTree() and createRendererTreeIfNeeded() pass the
RenderStyle in a PassRefPtr to avoid churning the ref count.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unexpected word wrapping for wrapped content then raw content.
https://bugs.webkit.org/show_bug.cgi?id=121130

Reviewed by Antti Koivisto.

When deciding whether a line is considered empty, we need to check if the current
object is fully responsible for the currently uncommitted width. It helps differentiating
<span></span><span>abcd</span> from <span>a</span><span>bcd</span>, where in the first
case when we hit the second <span> the line is still considered empty, as opposed to the
second example.

Source/WebCore:

Test: fast/css/unexpected-word-wrapping-with-non-empty-spans.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::LineBreaker::nextSegmentBreak):

LayoutTests:

* fast/css/unexpected-word-wrapping-with-non-empty-spans-expected.html: Added.
* fast/css/unexpected-word-wrapping-with-non-empty-spans.html: Added.


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