Merge JSGlobalObject::reset() into ::init()
https://bugs.webkit.org/show_bug.cgi?id=136800

Reviewed by Oliver Hunt.

Moved the contents of reset() into init().
Note that the diff shows more changes.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): Moved body of reset() into init.
(JSC::JSGlobalObject::put):
(JSC::JSGlobalObject::defineOwnProperty):
(JSC::JSGlobalObject::addGlobalVar):
(JSC::JSGlobalObject::addFunction):
(JSC::lastInPrototypeChain):
(JSC::JSGlobalObject::reset): Deleted.
* runtime/JSGlobalObject.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Un-inline Element constructor
https://bugs.webkit.org/show_bug.cgi?id=136786

Reviewed by Benjamin Poulain.

Un-inline Element constructor as it is non-trivial and it does not seem
to impact performance based on my testing:
http://dromaeo.com/?id=226865,226869

This reduces the stripped binary size by 8 Kb.

No new tests, no behavior change.

* dom/Element.cpp:
(WebCore::Element::Element):
* dom/Element.h:
(WebCore::Element::Element): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename Node::childNodeCount() to countChildNodes() and avoid inefficient uses
https://bugs.webkit.org/show_bug.cgi?id=136789

Reviewed by Darin Adler.

Source/WebCore:

Rename Node::childNodeCount() to countChildNodes() to make it clearer
that the method actually computes the result rather than returning a
cached value.

This patch also introduces a new Node::hasOneChild() method that is
used to check if a Node has a single child. This is much more efficient
than calling countChildNodes() == 1.

The patch also leverages Node::hasChildNodes() in a lot of places
instead of calling countChildNodes().

Finally, in a couple of places, we now use childrenOfType() to iterate
over children more efficient than using countChildNodes() and
childNode(index).

No new tests, no behavior change.

* WebCore.exp.in:
* WebCore.order:
Update the name of the exposed symbol for countChildNodes().

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::countChildNodes):
(WebCore::ContainerNode::childNodeCount): Deleted.
Rename childNodeCount() to countChildNodes() to make it obvious it is
computing the result rather than returning a cached value.

* dom/ContainerNode.h:
(WebCore::ContainerNode::hasOneChild):
Introduce an efficient way to check in a ContainerNode has a single
child as "countChildNodes() == 1" calls were frequent and inefficient.

(WebCore::Node::countChildNodes):
(WebCore::Node::childNodeCount): Deleted.
* dom/Node.h:
Rename childNodeCount() to countChildNodes().

* dom/Position.cpp:
(WebCore::Position::parentAnchoredEquivalent):
* dom/Position.h:
(WebCore::lastOffsetInNode):
* dom/Range.cpp:
Mechanical renaming.

(WebCore::lengthOfContentsInNode):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
(WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
(WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
(WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
(WebCore::ApplyStyleCommand::applyInlineStyleChange):
Call hasChildNodes() rather than countChildNodes() as it is a lot more
efficient.

* editing/Editor.cpp:
(WebCore::Editor::setTextAsChildOfElement):
(WebCore::Editor::rangeOfString):
(WebCore::Editor::countMatchesForText):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::elementRangeContainingCaretSelection):
Mechanical renaming.

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::insertAsListItems):
Call hasOneChild() instead of countChildNodes() == 1. Also remove
redundant listElement->hasChildNodes() check as hasOneChild() takes
care of this already.

* editing/TextIterator.cpp:
(WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
* editing/VisibleUnits.cpp:
(WebCore::endOfDocument):
* editing/htmlediting.cpp:
(WebCore::lastOffsetForEditing):
Mechanical renaming.

(WebCore::visiblePositionBeforeNode):
(WebCore::visiblePositionAfterNode):
Call hasChildNodes() instead of converting countChildNodes() to a
boolean.

* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
Call !hasChildNodes() instead of !countChildNodes().

(WebCore::isPlainTextMarkup):
- Drop !node->isElementNode() check as !node->hasTagName(divTag) takes
  care of discarding non-Element Nodes already.
- Cast the Node to an HTMLDivElement as soon as possible to avoid
  calling calling the slower Node APIs in several cases.
- Call hasOneChild() instead of countChildNodes() == 1.

* html/HTMLDivElement.h:
* html/HTMLTagNames.in:
Generate casting helpers as I use them in WebCore::isPlainTextMarkup().

* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::setText):
* html/HTMLTitleElement.cpp:
(WebCore::HTMLTitleElement::setText):
Call hasOneChild() / hasChildNodes() instead of countChildNodes().

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineContainerElement::setTimeDisplaysHidden):
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
Use childrenOfType<Element>() to iterate of child Elements instead of
slower childNodeCount() + childNode(index) + isElementNode(). Also,
childNodeCount() was not even cached before the loop.

* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::displayLastTextTrackCueBox):
Use childrenOfType<Element>() to iterate of child Elements, thus
avoiding calling childNodeCount() + childNode(index).

* page/DOMSelection.cpp:
(WebCore::DOMSelection::extend):
(WebCore::DOMSelection::selectAllChildren):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::caretMaxOffset):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::isSelected):
* rendering/RenderView.cpp:
(WebCore::RenderView::splitSelectionBetweenSubtrees):
Mechanical renaming.

Source/WebKit/mac:

Rename childNodeCount() to countChildNodes().

* WebView/WebHTMLView.mm:
(-[WebHTMLView attributedString]):

Source/WebKit2:

Avoid calling slow Node::countChildNodes().

* WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
(WebKit::WebPage::findZoomableAreaForPoint):
Replace call to "node->parentNode()->childNodeCount() != 1" by
"!node->parentNode()->hasOneChild()" which is equivalent but more
efficient.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Drop NodeTraversal::nextSkippingChildren() overload taking a ContainerNode
https://bugs.webkit.org/show_bug.cgi?id=136764

Reviewed by Darin Adler.

Drop NodeTraversal::nextSkippingChildren() overload taking a
ContainerNode argument. This one does not bring any performance
improvement because nextSibling() is defined on Node and
nextAncestorSibling() takes a Node in argument.

Also remove the overload in ElementTraversal as it no longer makes
sense after this change.

No new tests, no behavior change.

* dom/ElementTraversal.h:
(WebCore::Traversal<ElementType>::nextSkippingChildren):
(WebCore::Traversal<ElementType>::nextSkippingChildrenTemplate): Deleted.
* dom/NodeTraversal.h:
(WebCore::NodeTraversal::nextSkippingChildren):
(WebCore::NodeTraversal::next):
(WebCore::NodeTraversal::traverseNextSkippingChildrenTemplate): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Attempt to fix the iOS build after <http://trac.webkit.org/changeset/173606>
(https://bugs.webkit.org/show_bug.cgi?id=136789)

Substitute Node::countChildNodes() for Node::childNodeCount() in more places.

Source/WebCore:

Although I updated a comment in WebCore::lastOffsetForEditing() (defined in file
editing/htmlediting.cpp) to refer to Node::countChildNodes(), I'm unclear what the
comment is trying to explain that isn't otherwise explained by the code or the
comments that precede this function. Specifically, I don't understand the use of
the word "preempt" in the comment. We should look to improve the readability of
this comment.

* editing/htmlediting.cpp:
(WebCore::lastOffsetForEditing):
* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame focusedNodeHasContent]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unnecessary overloads taking a ContainerNode in Element Traversal
https://bugs.webkit.org/show_bug.cgi?id=136767

Reviewed by Darin Adler.

Remove unnecessary overloads taking a ContainerNode in Element Traversal.
Several of those don't bring any performance improvements as the needed
methods are defined on Node (not ContainerNode).

No new tests, no behavior change.

* dom/ElementTraversal.h:
(WebCore::Traversal<Element>::previous):
NodeTraversal::previous() takes a const Node* in argument so the
ContainerNode overload is not needed.

(WebCore::Traversal<ElementType>::previous):
Unnecessary now that Traversal<Element>::previous() takes a const Node*
in argument.

(WebCore::Traversal<ElementType>::nextSibling):
nextSibling() is defined on Node, not ContainerNode, so the overload
is not needed.

(WebCore::Traversal<ElementType>::previousSibling):
previousSibling() is defined on Node, not ContainerNode, so the overload
is not needed.

(WebCore::Traversal<Element>::previousTemplate): Deleted.
(WebCore::Traversal<ElementType>::previousTemplate): Deleted.
(WebCore::Traversal<ElementType>::nextSiblingTemplate): Deleted.
(WebCore::Traversal<ElementType>::previousSiblingTemplate): Deleted.
No need to have those functions templated anymore.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Generate toFooElementData() using ELEMENT_DATA_TYPE_CASTS
https://bugs.webkit.org/show_bug.cgi?id=136775

Reviewed by Darin Adler.

As a step to use toFoo, this patch introduces ELEMENT_DATA_TYPE_CASTS for toFooElementData().
This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.

No new tests, no behavior changes.

* dom/Element.cpp:
(WebCore::Element::cloneAttributesFromElement):
(WebCore::Element::createUniqueElementData):
* dom/ElementData.cpp:
(WebCore::ElementData::destroy):
* dom/ElementData.h:
(WebCore::ElementData::length):
(WebCore::ElementData::attributeBase):
(WebCore::ElementData::presentationAttributeStyle):
(WebCore::ElementData::attributesIterator):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::setupInitialView): Remove static_cast<SVGSVGElement*>


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Generate toCSSStyleSheet using STYLE_SHEET_TYPE_CASTS
https://bugs.webkit.org/show_bug.cgi?id=136774

Reviewed by Darin Adler.

As a step to use toFoo, this patch introduces STYLE_SHEET_TYPE_CASTS for toCSSStyleSheet().
This will help to detect wrong type cast. Additonally this patch helps to remove argument type of RefPtr.

No new tests, no behavior changes.

* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* css/CSSStyleSheet.h:
* css/StyleSheet.h:
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::filterEnabledNonemptyCSSStyleSheets):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::parseStyleSheet):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getAllStyleSheets):
(WebCore::InspectorCSSAgent::collectStyleSheets):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce FONT_DATA_TYPE_CASTS, and use it
https://bugs.webkit.org/show_bug.cgi?id=136766

Reviewed by Darin Adler.

As a step to use toFoo, this patch introduces FONT_DATA_TYPE_CASTS macro for toFooFontData().
This will help to detect wrong type cast.

* platform/graphics/FontData.h:
* platform/graphics/FontGlyphs.cpp:
(WebCore::FontGlyphs::releaseFontData):
(WebCore::FontGlyphs::determinePitch):
* platform/graphics/GlyphPageTreeNode.cpp:
(WebCore::GlyphPageTreeNode::initializePage):
* platform/graphics/SegmentedFontData.h:
* platform/graphics/SimpleFontData.h:
* platform/graphics/mac/SimpleFontDataMac.mm:
(WebCore::SimpleFontData::getCompositeFontReferenceFontData):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix post-mortem nits for r173528 & r173549
https://bugs.webkit.org/show_bug.cgi?id=136808

Reviewed by Darin Adler.

Fix post-mortem nits for r173528 & r173549.

No new tests, no behavior change.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alternativeTextForWebArea):
- Use auto* instead of more specific types.
- Use fastGetAttribute() instead of getAttribute() as this is
  supported for the "title" attribute.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionFromNone):
Use auto* instead of more specific types.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GStreamer] don't send transferMode HTTP header
https://bugs.webkit.org/show_bug.cgi?id=136781

Reviewed by Philippe Normand.

No header at all is better than having the wrong header as DLNA
mandates that a missing header has to be tolerated while a wrong
header is an error.

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart):
* platform/network/HTTPHeaderNames.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Crash at CSSParser::parseGridTemplateRowsAndAreas
https://bugs.webkit.org/show_bug.cgi?id=136778

Reviewed by Darin Adler.

Source/WebCore:

An empty list of grid line names (represented by "()") does not
add anything to the list of parsed values. That's why trying to
concatenate an adjacent list of grid line names was failing,
because we were trying to concatenate a list with the last parsed
CSSValue which was not the expected grid line names list.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateRowsAndAreas):
(WebCore::CSSParser::parseGridLineNames):
* css/CSSParser.h:

LayoutTests:

Added some new test cases to verify that we properly handle empty
lists of grid line names.

* fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt:
* fast/css-grid-layout/grid-template-shorthand-get-set.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Make it easier to enable/disable GStreamer.
https://bugs.webkit.org/show_bug.cgi?id=135766

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-09-15
Reviewed by Brent Fulgham.

Make it possible to enable/disable GStreamer by editing the new user macro ENABLE_GSTREAMER_WINCAIRO.

Source/WebCore:

* WebCore.vcxproj/WebCoreDebugWinCairo.props: Import GStreamer property file.
* WebCore.vcxproj/WebCoreReleaseWinCairo.props: Ditto.

Source/WebKit:

* WebKit.vcxproj/WebKit/WebKitDebugWinCairo.props: Import GStreamer property file.
* WebKit.vcxproj/WebKit/WebKitReleaseWinCairo.props: Ditto.

Source/WTF:

* WTF.vcxproj/WTFDebugWinCairo.props: Import GStreamer property file.
* WTF.vcxproj/WTFReleaseWinCairo.props: Ditto.
* wtf/Platform.h: Enable GStreamer if ENABLE(GSTREAMER_WINCAIRO) is true, otherwise use Media Foundation.

Tools:

* WinLauncher/WinMain.cpp: Compile fix when GStreamer is enabled.

WebKitLibraries:

* win/tools/vsprops/GStreamerCommon.props: Add user macro ENABLE_GSTREAMER_WINCAIRO.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r170243): [EFL][WK2] Dirty image is shown when new page is loading on fixed layout
https://bugs.webkit.org/show_bug.cgi?id=136568

Reviewed by Csaba Osztrogonác.

r170243 landed wrong didCommitNewPage() since it always returns false. It cause that
PageViewportControllerClientEfl::didChangeVisibleContents() continues to draw dirty image on 0,0 coordinate.
This patch fixes the problem.

* UIProcess/API/efl/EwkView.h:
(EwkView::waitingForNewPage):
(EwkView::didCommitNewPage):
* UIProcess/efl/PageViewportControllerClientEfl.cpp:
(WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMake] Remove FIND_PACKAGE_HANDLE_STANDARD_ARGS call for WAYLAND_EGL in FindWayland.cmake
https://bugs.webkit.org/show_bug.cgi?id=136814

Reviewed by Philippe Normand.

* Source/cmake/FindWayland.cmake: This line was committed by mistake.
We bundle the wayland-egl dependency with wayland-client and wayland-server
and store the resulting variables with the WAYLAND_ prefix. Because of this
this line wasn't exporting anything useful.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][CMake] Build WebCore with Wayland-specific include directories, libraries
https://bugs.webkit.org/show_bug.cgi?id=136815

Reviewed by Philippe Normand.

* PlatformGTK.cmake: Add the platform/graphics/wayland/ directory to the list of
WebCore's include directories. Add include directories of the Wayland dependency
to the list of WebCore's include directories. Same for the Wayland libraries.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Sort items by span when resolving content-based track sizing functions
https://bugs.webkit.org/show_bug.cgi?id=135701

Reviewed by Darin Adler.

Source/WebCore:

Section 10.4 of the specs mentions that we should first treat non
spanning items and then incrementally proceed with items with
greater spans when resolving the track breaths in the Track Sizing
Algorithm.

As a nice side effect we're removing the multiple processing of
spanning grid items caused by GridIterator (it returns the same
item as many times as the number of cells it spans). This adds a
~4% performance penalty in auto-grid-lots-of-data.html mainly due
to the use of a hash to remove duplicates.

Test: fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridItemSpan):
(WebCore::gridItemWithSpanSorter):
(WebCore::uniquePointerInPair):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
* rendering/RenderGrid.h:

LayoutTests:

Tests that check that items are sorted by span to resolve content
based track sizing functions instead of directly using DOM order.

* fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution-expected.txt: Added.
* fast/css-grid-layout/grid-item-order-in-content-sized-columns-resolution.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Ecore and Eina are initialized twice in TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=136822

Reviewed by Gyuyoung Kim.

In TestWebKitAPI/efl/main.cpp, ecore and eina modules are unnecessarily
initialized as we already does it in PlatformWebView::PlatformWebView
calling ewk_init(). The reason for that was to ensure testing for example,
WTF where creating the view is not mandatory.

Call ewk_init() and ewk_shutdown() in TestWebKitAPI/efl/main.cpp
in order to properly initalize and release EWebKit.

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/efl/PlatformWebView.cpp:
(TestWebKitAPI::PlatformWebView::PlatformWebView):
(TestWebKitAPI::PlatformWebView::~PlatformWebView):
* TestWebKitAPI/efl/main.cpp:
(main):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid redundant isElementNode() checks in Traversal<HTML*Element> / Traversal<SVG*Element>
https://bugs.webkit.org/show_bug.cgi?id=136719

Reviewed by Darin Adler.

Avoid redundant isElementNode() checks in Traversal<HTML*Element> /
Traversal<SVG*Element>.  We used to iterate through Elements, and then
call isElementOfType<HTML*Element>()  on each Element. This made sense
because hasTagName() used to be defined on Element. However, after
http://trac.webkit.org/changeset/165699, hasTagName() is now defined on
Node for HTMLQualifiedName / SVGQualifiedName arguments.

Node::hasTagName(HTMLQualifiedName) basically does the following check
"isHTMLElement() &&  toHTMLElement(*this).hasTagName(tagName)". As a
consequence, doing an isElementNode() check is now redundant as
isHTMLElement() is defined on Node.

This patch adds a template parameter to isElementOfType() so that it can
take any type in argument (particulaly Node, Element, HTMLElement,
SVGElement, MathMLElement), not just an Element. I had to add an
ElementTypeCastTraits struct to support partial specialization as C++
does not support partial specialization of template functions.
This patch also updates Traversal<ElementType> so that the methods use
NodeTraversal internally instead of Traversal<ElementType>. As a result,
we now iterate over Nodes (not Elements) and call the new
isElementOfType<ElementType>(Node) helpers (which are efficient after
r165699).

Before the patch, the code ended up doing the following checks for
Traversal<HTML*element>:
node.isElementNode() && toElement(node).isHTMLElement()
    && toHTMLElement(node).hasTagName(HTMLNames::fooTag)

After the patch, the code only does:
node.isHTMLElement()
    && toHTMLElement(node).hasTagName(HTMLNames::fooTag)

No new tests, no behavior change.

* dom/Element.h:
(WebCore::Element>):
(WebCore::isElementOfType):
Add template parameter to isElementOfType() function so that it can
handle any argument type, not just Elements. Also introduce an
ElementTypeCastTraits struct that is called by isElementOfType()
function so that we can so partial template specialization.

* dom/ElementTraversal.h:
(WebCore::Traversal<ElementType>::firstWithinTemplate):
(WebCore::Traversal<ElementType>::lastWithinTemplate):
(WebCore::Traversal<ElementType>::nextTemplate):
(WebCore::Traversal<ElementType>::previousTemplate):
Use NodeTraversal API internally instead of Traversal<Element> to avoid
redundant isElementNode() checks.

(WebCore::Traversal<Element>::lastWithinTemplate): Deleted.
The code is now identical to the generic version.

(WebCore::Traversal<Element>::previousTemplate): Deleted.
The code is now identical to the generic version.

* dom/make_names.pl:
(printTypeHelpers):
- Generate template specializations for ElementTypeCastTraits struct
  instead of isElementOfType(). This avoids having to provide overloads
  for specific argument types (e.g. Node, Element, HTMLElement, ...).
- Share more code between HTML code path and the other path (for SVG,
  MTHML).

* html/HTMLElement.h:
(WebCore::HTMLElement>):
Provide HTMLElement template specialization for ElementTypeCastTraits
struct instead of isElementOfType().

* html/HTMLFormControlElement.h:
(WebCore::HTMLFormControlElement>):
Provide HTMLFormControlElement template specialization for
ElementTypeCastTraits struct instead of isElementOfType().

* html/HTMLFrameElementBase.h:
(WebCore::isHTMLFrameElementBase):
- Remove helper taking an Element in argument as it does not bring any
  benefit. Instead, update the overload taking a Node in argument to
  remove the unnecessary isElementNode() check as isHTMLFrameElement(Node)
  is now efficient.
- Add an overload taking an HTMLElement in argument so that we can bypass
  the isHTMLElement() check when we know the input is an HTMLElement.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement>):
Provide HTMLMediaElement template specialization for ElementTypeCastTraits
struct instead of isElementOfType().

* html/HTMLPlugInImageElement.h:
(WebCore::HTMLPlugInImageElement>):
Provide HTMLPlugInImageElement template specialization for
ElementTypeCastTraits struct instead of isElementOfType().

* html/LabelableElement.h:
(WebCore::LabelableElement>):
Provide LabelableElement template specialization for ElementTypeCastTraits
struct instead of isElementOfType().

* mathml/MathMLElement.h:
(WebCore::MathMLElement>):
Provide MathMLElement template specialization for ElementTypeCastTraits
struct for consistency with HTMLElement / SVGElement.

* svg/SVGElement.h:
(WebCore::SVGElement>):
- Provide SVGElement template specialization for ElementTypeCastTraits
  struct instead of isElementOfType().
- include SVGElementTypeHelpers.h at the end of the file (similarly to
  what is already done in HTMLElement.h because
  isElementOfType(const SVGElement&) needs to be defiend because the
  include.

* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes>):
Provide SVGFilterPrimitiveStandardAttributes template specialization for
ElementTypeCastTraits struct instead of isElementOfType().

* svg/animation/SVGSMILElement.h:
(WebCore::SVGSMILElement>):
Provide SVGSMILElement template specialization for ElementTypeCastTraits
struct instead of isElementOfType().


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Should call [BKSProcessAssertion invalidate]
https://bugs.webkit.org/show_bug.cgi?id=136804
<rdar://problem/17897780>

Reviewed by Darin Adler.

We should invalidate the process assertion before releasing it. Fortunately this is really easy,
since there is a simple 1:1 relationship with ProcessAssertion, with their lifetimes matching exactly.

* UIProcess/ProcessAssertion.cpp:
(WebKit::ProcessAssertion::~ProcessAssertion):
    - no-op implementation.
* UIProcess/ProcessAssertion.h:
    - added destructor.
* UIProcess/ios/ProcessAssertionIOS.mm:
(WebKit::ProcessAssertion::~ProcessAssertion):
    - destructor invalidates the BKSProcessAssertion.



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