<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[165699] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/165699">165699</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-03-16 09:38:58 -0700 (Sun, 16 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Optimize hasTagName when called on an HTMLElement
https://bugs.webkit.org/show_bug.cgi?id=130090

Reviewed by Antti Koivisto.

Source/WebCore:

Added new hasTagName functions that have the efficiency of hasLocalName.
but are safe.

Now we can always use hasTagName, and we'll get a compile time error if
we try to use an SVG tag name with an HTML element. All call sites that
use the more specific tag name types are more efficient, and call sites
that have a specific pointer type will get even more efficient checking
that is exactly what we used to get by calling hasLocalName.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::hasTagName): Cast explicitly to Element
since Node::hasTagName no longer works on a general QualifiedName.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isDescendantOfElementType): Use
more specific type, RenderElement, so we can call hasTagName on Element
instead of Node; eliminates an unnecessary branch.

* accessibility/AccessibilityTableColumn.cpp: Added now-needed include.
* accessibility/atk/AccessibilityObjectAtk.cpp: Ditto.

* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets): Use
new for loop and full words for variable names. Also use nullptr instead
of 0. Call toHTMLElement and toSVGElement in code that checks hasTagName
since it's already checking isHTMLElement and isSVGElement.

* dom/Element.cpp:
(WebCore::attrNodeListMap): Use NeverDestroyed and put the vectors into
the map rather than putting pointers to a vector into the map.
(WebCore::attrNodeListForElement): Take a reference rather than a pointer,
and update for the change above.
(WebCore::ensureAttrNodeListForElement): Ditto.
(WebCore::removeAttrNodeListForElement): Ditto.
(WebCore::findAttrNodeInList): Ditto.
(WebCore::Element::isFocusable): Use lineageOfType&lt;HTMLCanvasElement&gt;
to fine the canvas rather than a hand-written loop.
(WebCore::Element::attrNodeList): Update for above changes.
(WebCore::Element::setAttributeNode): Ditto.
(WebCore::Element::attrIfExists): Ditto.
(WebCore::Element::ensureAttr): Ditto.
(WebCore::Element::detachAttrNodeFromElementWithValue): Ditto.
(WebCore::Element::detachAllAttrNodesFromElement): Ditto.

* dom/Element.h: Removed the overload of hasLocalName that takes a
QualifiedName and ignores the non-local-name parts of it. Callers should
use hasTagName instead, now that it's optimized appropriately. Added
overloads of hasTagName for all the specific qualified name types. It's
more efficient to use the Node versions of these functions rather than
using QualifiedName::matches to do the check. Removed the hasTagName and
hasLocalName functions from the Node class; the only convenience functions
needed in Node are the specific checks for tags from HTML, MathML, and SVG,
not the general purpose ones.

* dom/Node.h: Removed hasLocalName and replaced the single hasTagName
that takes a QualifiedName with three faster ones that take HTML, MathML,
and SVG qualified names instead. Also updated to use nullptr instead of 0.

* dom/PositionIterator.cpp: Added now-needed include.
* dom/Text.cpp: Ditto.

* dom/make_names.pl:
(printHeaderHead): Renamed an argument for clarity and added a definitions
argument, which is where we insert the classes derived from QualifiedName.
(printCppHead): Renamed an argument for clarity.
(printTypeHelpers): Use hasTagName rather than hasLocalName, since the
former is now optimized to be the same as what the latter was.
(printNamesHeaderFile): Define a class derived from QualifiedName that can
be used at compile time to avoid having to check the namespace.
(printNamesCppFile): Use the new more-specific type as needed.

* editing/ApplyStyleCommand.cpp:
(WebCore::isLegacyAppleStyleSpan): Use hasTagName instead of hasLocalName,
and references instead of pointers.
(WebCore::ApplyStyleCommand::ApplyStyleCommand): Removed uneeded explicit
construction of a smart pointer.
(WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun): Updated to use
the enclosingElementWithTag function by its new name.

* editing/Editor.cpp:
(WebCore::Editor::selectionUnorderedListState): Updated to use the
enclosingElementWithTag function by its new name.
(WebCore::Editor::selectionOrderedListState): Ditto.

* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply): Use a more-specific type for the list tag.
(WebCore::InsertListCommand::doApplyForSingleParagraph): Ditto.
* editing/InsertListCommand.h: Ditto.

* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces): Added an explicit
cast to Element in the loop that is already guarded by an isElementNode check.
Also use a modern C++ for loop.

* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
Updated to use the enclosingElementWithTag function by its new name.
(WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds): Ditto.
(WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent): Ditto.

* editing/TypingCommand.cpp: Added now-needed includes.
* editing/VisibleUnits.cpp: Ditto.

* editing/htmlediting.cpp:
(WebCore::enclosingElementWithTag): Changed to return an Element instead of a Node,
since nodes other than elements do not have tags.
* editing/htmlediting.h: Ditto.

* editing/mac/EditorMac.mm:
(WebCore::Editor::adjustedSelectionRange): Updated to use the enclosingElementWithTag
function by its new name.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendText): Ditto.
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Ditto.
(WebCore::highestAncestorToWrapMarkup): Ditto.
(WebCore::createMarkupInternal): Ditto.
(WebCore::createContextualFragment): Ditto. Use hasTagName instead of hasLocalName,
since the former is now optimized to be the same as the latter was before.

* html/HTMLCollection.cpp:
(WebCore::isMatchingElement): Use hasTagName instead of hasLocalName,
since the former is now optimized to be the same as the latter was before.
(WebCore::nameShouldBeVisibleInDocumentAll): Ditto.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::ieForbidsInsertHTML): Ditto.
(WebCore::unicodeBidiAttributeForDirAuto): Ditto.
(WebCore::HTMLElement::parseBorderWidthAttribute): Ditto.
(WebCore::HTMLElement::setInnerHTML): Ditto.
(WebCore::shouldProhibitSetInnerOuterText): Ditto. Added this to share code between
setInnerText and setOuterText.
(WebCore::HTMLElement::setInnerText): Ditto.
(WebCore::HTMLElement::setOuterText): Ditto.
(WebCore::HTMLElement::rendererIsNeeded): Ditto.
(WebCore::HTMLElement::createElementRenderer): Ditto.

* html/HTMLElement.h: Added hasTagName, which hides the one inherited from Element
and takes the more-specific HTMLQualifiedName type. This means we don't need to check
the namespace at runtime because it's known at compile time. Also put the
implementation of Node::hasTagName for HTMLQualifiedName into this header.

* html/HTMLObjectElement.cpp:
(WebCore::isRecognizedTagName): Updated for change in return type of
HTMLNames::getHTMLTags.

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add): Use hasTagName inastead of hasLocalName.
(WebCore::HTMLSelectElement::value): Use isHTMLOptionElement instead of hasTagName.
Also use a new style for loop and emptyString() instead of &quot;&quot;.
(WebCore::HTMLSelectElement::setValue): Ditto.
(WebCore::HTMLSelectElement::setLength): Ditto.
(WebCore::HTMLSelectElement::searchOptionsForValue): Ditto.
(WebCore::HTMLSelectElement::restoreFormControlState): Ditto.

* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::additionalPresentationAttributeStyle): Use hasTagName
instead of hasLocalName.

* html/HTMLTableRowsCollection.cpp:
(WebCore::isInSection): Updated to use hasTagName and take a reference.
(WebCore::HTMLTableRowsCollection::rowAfter): Pass a reference.

* html/parser/HTMLConstructionSite.cpp: Added now-needed include.

* html/parser/HTMLTreeBuilder.cpp:
(WebCore::createCaseMap): Updated to return a map rather than filling one in, and to
be flxible about the type of the table being used.
(WebCore::adjustSVGTagNameCase): Updated to use NeverDestroyed.
(WebCore::adjustAttributes): Added new helper so we can share more code. Updated
template argument names for clarity.
(WebCore::adjustSVGAttributes): Marked this inline, since it just turns around and
calls a single non-inline function.
(WebCore::adjustMathMLAttributes): Ditto.
(WebCore::addNamesWithPrefix): Changed to take argument by reference instead of pointer.
(WebCore::createForeignAttributesMap): Added. Factors out the map creation from the
function below.
(WebCore::adjustForeignAttributes): Updated for above changes.
(WebCore::HTMLTreeBuilder::processStartTagForInBody): Updated to pass reference.
(WebCore::HTMLTreeBuilder::processTokenInForeignContent): Ditto.

* inspector/InspectorStyleSheet.cpp: Added now-needed include.

* mathml/MathMLElement.h: Added hasTagName, which hides the one inherited from Element
and takes the more-specific MathMLQualifiedName type. This means we don't need to check
the namespace at runtime because it's known at compile time. Also put the
implementation of Node::hasTagName for MathMLQualifiedName into this header.

* mathml/MathMLInlineContainerElement.cpp:
(WebCore::MathMLInlineContainerElement::createElementRenderer): Use hasTagName.

* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::attributeChanged): Use hasTagName.
(WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Ditto.
(WebCore::MathMLSelectElement::getSelectedActionChild): Ditto.
(WebCore::MathMLSelectElement::getSelectedSemanticsChild): Ditto.
(WebCore::MathMLSelectElement::updateSelectedChild): Ditto.
* mathml/MathMLTextElement.cpp:
(WebCore::MathMLTextElement::createElementRenderer): Ditto.
(WebCore::MathMLTextElement::childShouldCreateRenderer): Ditto.

* platform/gtk/PasteboardGtk.cpp: Added now-needed include.
* platform/mac/HTMLConverter.mm: Ditto.
* rendering/RenderBlockFlow.cpp: Ditto.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended): Use hasTagName.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::rendererForRootBackground): Ditto.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer): Ditto.

* rendering/RenderReplaced.cpp: Added now-needed include.

* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::RenderMathMLScripts): Use hasTagName.
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver): Ditto.

* svg/SVGElement.h: Added hasTagName, which hides the one inherited from Element
and takes the more-specific SVGQualifiedName type. This means we don't need to check
the namespace at runtime because it's known at compile time. Also put the
implementation of Node::hasTagName for SVGQualifiedName into this header.

* svg/SVGFontFaceSrcElement.cpp:
(WebCore::SVGFontFaceSrcElement::childrenChanged): Use isSVGFontFaceElement instead
of calling hasTagName.

* svg/SVGUseElement.cpp:
(WebCore::isDirectReference): Changed to take a reference and a more specific type.
(WebCore::SVGUseElement::toClipPath): Added a type cast.
(WebCore::SVGUseElement::rendererClipChild): Use more specific types so we don't
need a type cast.

* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::parseDocumentFragment): Added explicit calls to this
unusual call site that has a good reason to use hasLocalName instead of hasTagName.

Source/WebKit:

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
Updated exports for QualifiedName -&gt; HTMLQualifiedName change.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityListcpp">trunk/Source/WebCore/accessibility/AccessibilityList.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableCellcpp">trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityTableColumncpp">trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkAccessibilityObjectAtkcpp">trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentStyleSheetCollectioncpp">trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomElementh">trunk/Source/WebCore/dom/Element.h</a></li>
<li><a href="#trunkSourceWebCoredomNodeh">trunk/Source/WebCore/dom/Node.h</a></li>
<li><a href="#trunkSourceWebCoredomPositionIteratorcpp">trunk/Source/WebCore/dom/PositionIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoredomStyledElementcpp">trunk/Source/WebCore/dom/StyledElement.cpp</a></li>
<li><a href="#trunkSourceWebCoredomTextcpp">trunk/Source/WebCore/dom/Text.cpp</a></li>
<li><a href="#trunkSourceWebCoredommake_namespl">trunk/Source/WebCore/dom/make_names.pl</a></li>
<li><a href="#trunkSourceWebCoreeditingApplyStyleCommandcpp">trunk/Source/WebCore/editing/ApplyStyleCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertListCommandcpp">trunk/Source/WebCore/editing/InsertListCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingInsertListCommandh">trunk/Source/WebCore/editing/InsertListCommand.h</a></li>
<li><a href="#trunkSourceWebCoreeditingMarkupAccumulatorcpp">trunk/Source/WebCore/editing/MarkupAccumulator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingReplaceSelectionCommandcpp">trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingTypingCommandcpp">trunk/Source/WebCore/editing/TypingCommand.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingVisibleUnitscpp">trunk/Source/WebCore/editing/VisibleUnits.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditinghtmleditingcpp">trunk/Source/WebCore/editing/htmlediting.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditinghtmleditingh">trunk/Source/WebCore/editing/htmlediting.h</a></li>
<li><a href="#trunkSourceWebCoreeditingmacEditorMacmm">trunk/Source/WebCore/editing/mac/EditorMac.mm</a></li>
<li><a href="#trunkSourceWebCoreeditingmarkupcpp">trunk/Source/WebCore/editing/markup.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLCollectioncpp">trunk/Source/WebCore/html/HTMLCollection.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementcpp">trunk/Source/WebCore/html/HTMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLElementh">trunk/Source/WebCore/html/HTMLElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLSelectElementcpp">trunk/Source/WebCore/html/HTMLSelectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTableColElementcpp">trunk/Source/WebCore/html/HTMLTableColElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLTableRowsCollectioncpp">trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLConstructionSitecpp">trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLTreeBuildercpp">trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorStyleSheetcpp">trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementh">trunk/Source/WebCore/mathml/MathMLElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLInlineContainerElementcpp">trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLSelectElementcpp">trunk/Source/WebCore/mathml/MathMLSelectElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLTextElementcpp">trunk/Source/WebCore/mathml/MathMLTextElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkPasteboardGtkcpp">trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacHTMLConvertermm">trunk/Source/WebCore/platform/mac/HTMLConverter.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowcpp">trunk/Source/WebCore/rendering/RenderBlockFlow.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxModelObjectcpp">trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerBackingcpp">trunk/Source/WebCore/rendering/RenderLayerBacking.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderReplacedcpp">trunk/Source/WebCore/rendering/RenderReplaced.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLScriptscpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingmathmlRenderMathMLUnderOvercpp">trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGElementh">trunk/Source/WebCore/svg/SVGElement.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontFaceSrcElementcpp">trunk/Source/WebCore/svg/SVGFontFaceSrcElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGUseElementcpp">trunk/Source/WebCore/svg/SVGUseElement.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParsercpp">trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitExportGeneratorWebKitExportsdefin">trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/ChangeLog        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -1,3 +1,245 @@
</span><ins>+2014-03-16  Darin Adler  &lt;darin@apple.com&gt;
+
+        Optimize hasTagName when called on an HTMLElement
+        https://bugs.webkit.org/show_bug.cgi?id=130090
+
+        Reviewed by Antti Koivisto.
+
+        Added new hasTagName functions that have the efficiency of hasLocalName.
+        but are safe.
+
+        Now we can always use hasTagName, and we'll get a compile time error if
+        we try to use an SVG tag name with an HTML element. All call sites that
+        use the more specific tag name types are more efficient, and call sites
+        that have a specific pointer type will get even more efficient checking
+        that is exactly what we used to get by calling hasLocalName.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::hasTagName): Cast explicitly to Element
+        since Node::hasTagName no longer works on a general QualifiedName.
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::isDescendantOfElementType): Use
+        more specific type, RenderElement, so we can call hasTagName on Element
+        instead of Node; eliminates an unnecessary branch.
+
+        * accessibility/AccessibilityTableColumn.cpp: Added now-needed include.
+        * accessibility/atk/AccessibilityObjectAtk.cpp: Ditto.
+
+        * dom/DocumentStyleSheetCollection.cpp:
+        (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets): Use
+        new for loop and full words for variable names. Also use nullptr instead
+        of 0. Call toHTMLElement and toSVGElement in code that checks hasTagName
+        since it's already checking isHTMLElement and isSVGElement.
+
+        * dom/Element.cpp:
+        (WebCore::attrNodeListMap): Use NeverDestroyed and put the vectors into
+        the map rather than putting pointers to a vector into the map.
+        (WebCore::attrNodeListForElement): Take a reference rather than a pointer,
+        and update for the change above.
+        (WebCore::ensureAttrNodeListForElement): Ditto.
+        (WebCore::removeAttrNodeListForElement): Ditto.
+        (WebCore::findAttrNodeInList): Ditto.
+        (WebCore::Element::isFocusable): Use lineageOfType&lt;HTMLCanvasElement&gt;
+        to fine the canvas rather than a hand-written loop.
+        (WebCore::Element::attrNodeList): Update for above changes.
+        (WebCore::Element::setAttributeNode): Ditto.
+        (WebCore::Element::attrIfExists): Ditto.
+        (WebCore::Element::ensureAttr): Ditto.
+        (WebCore::Element::detachAttrNodeFromElementWithValue): Ditto.
+        (WebCore::Element::detachAllAttrNodesFromElement): Ditto.
+
+        * dom/Element.h: Removed the overload of hasLocalName that takes a
+        QualifiedName and ignores the non-local-name parts of it. Callers should
+        use hasTagName instead, now that it's optimized appropriately. Added
+        overloads of hasTagName for all the specific qualified name types. It's
+        more efficient to use the Node versions of these functions rather than
+        using QualifiedName::matches to do the check. Removed the hasTagName and
+        hasLocalName functions from the Node class; the only convenience functions
+        needed in Node are the specific checks for tags from HTML, MathML, and SVG,
+        not the general purpose ones.
+
+        * dom/Node.h: Removed hasLocalName and replaced the single hasTagName
+        that takes a QualifiedName with three faster ones that take HTML, MathML,
+        and SVG qualified names instead. Also updated to use nullptr instead of 0.
+
+        * dom/PositionIterator.cpp: Added now-needed include.
+        * dom/Text.cpp: Ditto.
+
+        * dom/make_names.pl:
+        (printHeaderHead): Renamed an argument for clarity and added a definitions
+        argument, which is where we insert the classes derived from QualifiedName.
+        (printCppHead): Renamed an argument for clarity.
+        (printTypeHelpers): Use hasTagName rather than hasLocalName, since the
+        former is now optimized to be the same as what the latter was.
+        (printNamesHeaderFile): Define a class derived from QualifiedName that can
+        be used at compile time to avoid having to check the namespace.
+        (printNamesCppFile): Use the new more-specific type as needed.
+
+        * editing/ApplyStyleCommand.cpp:
+        (WebCore::isLegacyAppleStyleSpan): Use hasTagName instead of hasLocalName,
+        and references instead of pointers.
+        (WebCore::ApplyStyleCommand::ApplyStyleCommand): Removed uneeded explicit
+        construction of a smart pointer.
+        (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun): Updated to use
+        the enclosingElementWithTag function by its new name.
+
+        * editing/Editor.cpp:
+        (WebCore::Editor::selectionUnorderedListState): Updated to use the
+        enclosingElementWithTag function by its new name.
+        (WebCore::Editor::selectionOrderedListState): Ditto.
+
+        * editing/InsertListCommand.cpp:
+        (WebCore::InsertListCommand::doApply): Use a more-specific type for the list tag.
+        (WebCore::InsertListCommand::doApplyForSingleParagraph): Ditto.
+        * editing/InsertListCommand.h: Ditto.
+
+        * editing/MarkupAccumulator.cpp:
+        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces): Added an explicit
+        cast to Element in the loop that is already guarded by an isElementNode check.
+        Also use a modern C++ for loop.
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
+        Updated to use the enclosingElementWithTag function by its new name.
+        (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds): Ditto.
+        (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent): Ditto.
+
+        * editing/TypingCommand.cpp: Added now-needed includes.
+        * editing/VisibleUnits.cpp: Ditto.
+
+        * editing/htmlediting.cpp:
+        (WebCore::enclosingElementWithTag): Changed to return an Element instead of a Node,
+        since nodes other than elements do not have tags.
+        * editing/htmlediting.h: Ditto.
+
+        * editing/mac/EditorMac.mm:
+        (WebCore::Editor::adjustedSelectionRange): Updated to use the enclosingElementWithTag
+        function by its new name.
+        * editing/markup.cpp:
+        (WebCore::StyledMarkupAccumulator::appendText): Ditto.
+        (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Ditto.
+        (WebCore::highestAncestorToWrapMarkup): Ditto.
+        (WebCore::createMarkupInternal): Ditto.
+        (WebCore::createContextualFragment): Ditto. Use hasTagName instead of hasLocalName,
+        since the former is now optimized to be the same as the latter was before.
+
+        * html/HTMLCollection.cpp:
+        (WebCore::isMatchingElement): Use hasTagName instead of hasLocalName,
+        since the former is now optimized to be the same as the latter was before.
+        (WebCore::nameShouldBeVisibleInDocumentAll): Ditto.
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::ieForbidsInsertHTML): Ditto.
+        (WebCore::unicodeBidiAttributeForDirAuto): Ditto.
+        (WebCore::HTMLElement::parseBorderWidthAttribute): Ditto.
+        (WebCore::HTMLElement::setInnerHTML): Ditto.
+        (WebCore::shouldProhibitSetInnerOuterText): Ditto. Added this to share code between
+        setInnerText and setOuterText.
+        (WebCore::HTMLElement::setInnerText): Ditto.
+        (WebCore::HTMLElement::setOuterText): Ditto.
+        (WebCore::HTMLElement::rendererIsNeeded): Ditto.
+        (WebCore::HTMLElement::createElementRenderer): Ditto.
+
+        * html/HTMLElement.h: Added hasTagName, which hides the one inherited from Element
+        and takes the more-specific HTMLQualifiedName type. This means we don't need to check
+        the namespace at runtime because it's known at compile time. Also put the
+        implementation of Node::hasTagName for HTMLQualifiedName into this header.
+
+        * html/HTMLObjectElement.cpp:
+        (WebCore::isRecognizedTagName): Updated for change in return type of
+        HTMLNames::getHTMLTags.
+
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::add): Use hasTagName inastead of hasLocalName.
+        (WebCore::HTMLSelectElement::value): Use isHTMLOptionElement instead of hasTagName.
+        Also use a new style for loop and emptyString() instead of &quot;&quot;.
+        (WebCore::HTMLSelectElement::setValue): Ditto.
+        (WebCore::HTMLSelectElement::setLength): Ditto.
+        (WebCore::HTMLSelectElement::searchOptionsForValue): Ditto.
+        (WebCore::HTMLSelectElement::restoreFormControlState): Ditto.
+
+        * html/HTMLTableColElement.cpp:
+        (WebCore::HTMLTableColElement::additionalPresentationAttributeStyle): Use hasTagName
+        instead of hasLocalName.
+
+        * html/HTMLTableRowsCollection.cpp:
+        (WebCore::isInSection): Updated to use hasTagName and take a reference.
+        (WebCore::HTMLTableRowsCollection::rowAfter): Pass a reference.
+
+        * html/parser/HTMLConstructionSite.cpp: Added now-needed include.
+
+        * html/parser/HTMLTreeBuilder.cpp:
+        (WebCore::createCaseMap): Updated to return a map rather than filling one in, and to
+        be flxible about the type of the table being used.
+        (WebCore::adjustSVGTagNameCase): Updated to use NeverDestroyed.
+        (WebCore::adjustAttributes): Added new helper so we can share more code. Updated
+        template argument names for clarity.
+        (WebCore::adjustSVGAttributes): Marked this inline, since it just turns around and
+        calls a single non-inline function.
+        (WebCore::adjustMathMLAttributes): Ditto.
+        (WebCore::addNamesWithPrefix): Changed to take argument by reference instead of pointer.
+        (WebCore::createForeignAttributesMap): Added. Factors out the map creation from the
+        function below.
+        (WebCore::adjustForeignAttributes): Updated for above changes.
+        (WebCore::HTMLTreeBuilder::processStartTagForInBody): Updated to pass reference.
+        (WebCore::HTMLTreeBuilder::processTokenInForeignContent): Ditto.
+
+        * inspector/InspectorStyleSheet.cpp: Added now-needed include.
+
+        * mathml/MathMLElement.h: Added hasTagName, which hides the one inherited from Element
+        and takes the more-specific MathMLQualifiedName type. This means we don't need to check
+        the namespace at runtime because it's known at compile time. Also put the
+        implementation of Node::hasTagName for MathMLQualifiedName into this header.
+
+        * mathml/MathMLInlineContainerElement.cpp:
+        (WebCore::MathMLInlineContainerElement::createElementRenderer): Use hasTagName.
+
+        * mathml/MathMLSelectElement.cpp:
+        (WebCore::MathMLSelectElement::attributeChanged): Use hasTagName.
+        (WebCore::MathMLSelectElement::getSelectedActionChildAndIndex): Ditto.
+        (WebCore::MathMLSelectElement::getSelectedActionChild): Ditto.
+        (WebCore::MathMLSelectElement::getSelectedSemanticsChild): Ditto.
+        (WebCore::MathMLSelectElement::updateSelectedChild): Ditto.
+        * mathml/MathMLTextElement.cpp:
+        (WebCore::MathMLTextElement::createElementRenderer): Ditto.
+        (WebCore::MathMLTextElement::childShouldCreateRenderer): Ditto.
+
+        * platform/gtk/PasteboardGtk.cpp: Added now-needed include.
+        * platform/mac/HTMLConverter.mm: Ditto.
+        * rendering/RenderBlockFlow.cpp: Ditto.
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintFillLayerExtended): Use hasTagName.
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::rendererForRootBackground): Ditto.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer): Ditto.
+
+        * rendering/RenderReplaced.cpp: Added now-needed include.
+
+        * rendering/mathml/RenderMathMLScripts.cpp:
+        (WebCore::RenderMathMLScripts::RenderMathMLScripts): Use hasTagName.
+        * rendering/mathml/RenderMathMLUnderOver.cpp:
+        (WebCore::RenderMathMLUnderOver::RenderMathMLUnderOver): Ditto.
+
+        * svg/SVGElement.h: Added hasTagName, which hides the one inherited from Element
+        and takes the more-specific SVGQualifiedName type. This means we don't need to check
+        the namespace at runtime because it's known at compile time. Also put the
+        implementation of Node::hasTagName for SVGQualifiedName into this header.
+
+        * svg/SVGFontFaceSrcElement.cpp:
+        (WebCore::SVGFontFaceSrcElement::childrenChanged): Use isSVGFontFaceElement instead
+        of calling hasTagName.
+
+        * svg/SVGUseElement.cpp:
+        (WebCore::isDirectReference): Changed to take a reference and a more specific type.
+        (WebCore::SVGUseElement::toClipPath): Added a type cast.
+        (WebCore::SVGUseElement::rendererClipChild): Use more specific types so we don't
+        need a type cast.
+
+        * xml/parser/XMLDocumentParser.cpp:
+        (WebCore::XMLDocumentParser::parseDocumentFragment): Added explicit calls to this
+        unusual call site that has a good reason to use hasLocalName instead of hasTagName.
+
</ins><span class="cx"> 2014-03-16  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Stop pulling in JSDOMBinding.h via JSEventListener.h
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityList.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityList.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/accessibility/AccessibilityList.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;AccessibilityList.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;RenderListItem.h&quot;
</span><span class="cx"> #include &quot;RenderObject.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -1555,9 +1555,8 @@
</span><span class="cx">  
</span><span class="cx"> bool AccessibilityObject::hasTagName(const QualifiedName&amp; tagName) const
</span><span class="cx"> {
</span><del>-    if (Node* node = this-&gt;node())
-        return node-&gt;hasTagName(tagName);
-    return false;
</del><ins>+    Node* node = this-&gt;node();
+    return node &amp;&amp; node-&gt;isElementNode() &amp;&amp; toElement(*node).hasTagName(tagName);
</ins><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> bool AccessibilityObject::hasAttribute(const QualifiedName&amp; attribute) const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -2415,8 +2415,8 @@
</span><span class="cx"> 
</span><span class="cx"> bool AccessibilityRenderObject::isDescendantOfElementType(const QualifiedName&amp; tagName) const
</span><span class="cx"> {
</span><del>-    for (RenderObject* parent = m_renderer-&gt;parent(); parent; parent = parent-&gt;parent()) {
-        if (parent-&gt;node() &amp;&amp; parent-&gt;node()-&gt;hasTagName(tagName))
</del><ins>+    for (auto&amp; ancestor : ancestorsOfType&lt;RenderElement&gt;(*m_renderer)) {
+        if (ancestor.element() &amp;&amp; ancestor.element()-&gt;hasTagName(tagName))
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableCellcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;AccessibilityTable.h&quot;
</span><span class="cx"> #include &quot;AccessibilityTableRow.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;RenderObject.h&quot;
</span><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityTableColumncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/accessibility/AccessibilityTableColumn.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;AccessibilityTableCell.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;RenderTable.h&quot;
</span><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkAccessibilityObjectAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -21,8 +21,8 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;AccessibilityObject.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><del>-#include &quot;RenderObject.h&quot;
</del><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> #include &lt;glib-object.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentStyleSheetCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -262,15 +262,12 @@
</span><span class="cx">     if (m_document.settings() &amp;&amp; !m_document.settings()-&gt;authorAndUserStylesEnabled())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    StyleSheetCandidateListHashSet::iterator begin = m_styleSheetCandidateNodes.begin();
-    StyleSheetCandidateListHashSet::iterator end = m_styleSheetCandidateNodes.end();
-    for (StyleSheetCandidateListHashSet::iterator it = begin; it != end; ++it) {
-        Node* n = *it;
-        StyleSheet* sheet = 0;
-        if (n-&gt;nodeType() == Node::PROCESSING_INSTRUCTION_NODE) {
</del><ins>+    for (auto&amp; node : m_styleSheetCandidateNodes) {
+        StyleSheet* sheet = nullptr;
+        if (node-&gt;nodeType() == Node::PROCESSING_INSTRUCTION_NODE) {
</ins><span class="cx">             // Processing instruction (XML documents only).
</span><span class="cx">             // We don't support linking to embedded CSS stylesheets, see &lt;https://bugs.webkit.org/show_bug.cgi?id=49281&gt; for discussion.
</span><del>-            ProcessingInstruction* pi = toProcessingInstruction(n);
</del><ins>+            ProcessingInstruction* pi = toProcessingInstruction(node);
</ins><span class="cx">             sheet = pi-&gt;sheet();
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx">             // Don't apply XSL transforms to already transformed documents -- &lt;rdar://problem/4132806&gt;
</span><span class="lines">@@ -281,47 +278,41 @@
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><span class="cx"> #endif
</span><del>-        } else if ((n-&gt;isHTMLElement() &amp;&amp; (n-&gt;hasTagName(linkTag) || n-&gt;hasTagName(styleTag)))
-            || (n-&gt;isSVGElement() &amp;&amp; n-&gt;hasTagName(SVGNames::styleTag))) {
-            Element* e = toElement(n);
-            AtomicString title = e-&gt;getAttribute(titleAttr);
</del><ins>+        } else if ((node-&gt;isHTMLElement() &amp;&amp; (toHTMLElement(*node).hasTagName(linkTag) || toHTMLElement(*node).hasTagName(styleTag))) || (node-&gt;isSVGElement() &amp;&amp; toSVGElement(*node).hasTagName(SVGNames::styleTag))) {
+            Element&amp; element = toElement(*node);
+            AtomicString title = element.getAttribute(titleAttr);
</ins><span class="cx">             bool enabledViaScript = false;
</span><del>-            if (e-&gt;hasTagName(linkTag)) {
</del><ins>+            if (isHTMLLinkElement(element)) {
</ins><span class="cx">                 // &lt;LINK&gt; element
</span><del>-                HTMLLinkElement* linkElement = toHTMLLinkElement(n);
-                if (linkElement-&gt;isDisabled())
</del><ins>+                HTMLLinkElement&amp; linkElement = toHTMLLinkElement(element);
+                if (linkElement.isDisabled())
</ins><span class="cx">                     continue;
</span><del>-                enabledViaScript = linkElement-&gt;isEnabledViaScript();
-                if (linkElement-&gt;styleSheetIsLoading()) {
</del><ins>+                enabledViaScript = linkElement.isEnabledViaScript();
+                if (linkElement.styleSheetIsLoading()) {
</ins><span class="cx">                     // it is loading but we should still decide which style sheet set to use
</span><span class="cx">                     if (!enabledViaScript &amp;&amp; !title.isEmpty() &amp;&amp; m_preferredStylesheetSetName.isEmpty()) {
</span><del>-                        const AtomicString&amp; rel = e-&gt;getAttribute(relAttr);
-                        if (!rel.contains(&quot;alternate&quot;)) {
</del><ins>+                        if (!linkElement.fastGetAttribute(relAttr).contains(&quot;alternate&quot;)) {
</ins><span class="cx">                             m_preferredStylesheetSetName = title;
</span><span class="cx">                             m_selectedStylesheetSetName = title;
</span><span class="cx">                         }
</span><span class="cx">                     }
</span><span class="cx">                     continue;
</span><span class="cx">                 }
</span><del>-                if (!linkElement-&gt;sheet())
</del><ins>+                if (!linkElement.sheet())
</ins><span class="cx">                     title = nullAtom;
</span><span class="cx">             }
</span><span class="cx">             // Get the current preferred styleset. This is the
</span><span class="cx">             // set of sheets that will be enabled.
</span><del>-            if (isSVGStyleElement(e))
-                sheet = toSVGStyleElement(e)-&gt;sheet();
-            else {
-                if (isHTMLLinkElement(e))
-                    sheet = toHTMLLinkElement(n)-&gt;sheet();
-                else {
-                    // &lt;STYLE&gt; element
-                    sheet = toHTMLStyleElement(e)-&gt;sheet();
-                }
-            }
</del><ins>+            if (isSVGStyleElement(element))
+                sheet = toSVGStyleElement(element).sheet();
+            else if (isHTMLLinkElement(element))
+                sheet = toHTMLLinkElement(element).sheet();
+            else
+                sheet = toHTMLStyleElement(element).sheet();
</ins><span class="cx">             // Check to see if this sheet belongs to a styleset
</span><span class="cx">             // (thus making it PREFERRED or ALTERNATE rather than
</span><span class="cx">             // PERSISTENT).
</span><del>-            AtomicString rel = e-&gt;getAttribute(relAttr);
</del><ins>+            auto&amp; rel = element.fastGetAttribute(relAttr);
</ins><span class="cx">             if (!enabledViaScript &amp;&amp; !title.isEmpty()) {
</span><span class="cx">                 // Yes, we have a title.
</span><span class="cx">                 if (m_preferredStylesheetSetName.isEmpty()) {
</span><span class="lines">@@ -329,15 +320,15 @@
</span><span class="cx">                     // we are NOT an alternate sheet, then establish
</span><span class="cx">                     // us as the preferred set. Otherwise, just ignore
</span><span class="cx">                     // this sheet.
</span><del>-                    if (e-&gt;hasTagName(styleTag) || !rel.contains(&quot;alternate&quot;))
</del><ins>+                    if (isHTMLStyleElement(element) || !rel.contains(&quot;alternate&quot;))
</ins><span class="cx">                         m_preferredStylesheetSetName = m_selectedStylesheetSetName = title;
</span><span class="cx">                 }
</span><span class="cx">                 if (title != m_preferredStylesheetSetName)
</span><del>-                    sheet = 0;
</del><ins>+                    sheet = nullptr;
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             if (rel.contains(&quot;alternate&quot;) &amp;&amp; title.isEmpty())
</span><del>-                sheet = 0;
</del><ins>+                sheet = nullptr;
</ins><span class="cx">         }
</span><span class="cx">         if (sheet)
</span><span class="cx">             sheets.append(sheet);
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/dom/Element.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -44,9 +44,9 @@
</span><span class="cx"> #include &quot;FocusEvent.h&quot;
</span><span class="cx"> #include &quot;FrameSelection.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><ins>+#include &quot;HTMLCanvasElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLCollection.h&quot;
</span><span class="cx"> #include &quot;HTMLDocument.h&quot;
</span><del>-#include &quot;HTMLElement.h&quot;
</del><span class="cx"> #include &quot;HTMLFormControlsCollection.h&quot;
</span><span class="cx"> #include &quot;HTMLLabelElement.h&quot;
</span><span class="cx"> #include &quot;HTMLNameCollection.h&quot;
</span><span class="lines">@@ -93,50 +93,46 @@
</span><span class="cx">     return element.isHTMLElement() &amp;&amp; element.document().isHTMLDocument();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-typedef Vector&lt;RefPtr&lt;Attr&gt;&gt; AttrNodeList;
-typedef HashMap&lt;Element*, OwnPtr&lt;AttrNodeList&gt;&gt; AttrNodeListMap;
-
-static AttrNodeListMap&amp; attrNodeListMap()
</del><ins>+static HashMap&lt;Element*, Vector&lt;RefPtr&lt;Attr&gt;&gt;&gt;&amp; attrNodeListMap()
</ins><span class="cx"> {
</span><del>-    DEPRECATED_DEFINE_STATIC_LOCAL(AttrNodeListMap, map, ());
</del><ins>+    static NeverDestroyed&lt;HashMap&lt;Element*, Vector&lt;RefPtr&lt;Attr&gt;&gt;&gt;&gt; map;
</ins><span class="cx">     return map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static AttrNodeList* attrNodeListForElement(Element* element)
</del><ins>+static Vector&lt;RefPtr&lt;Attr&gt;&gt;* attrNodeListForElement(Element&amp; element)
</ins><span class="cx"> {
</span><del>-    if (!element-&gt;hasSyntheticAttrChildNodes())
-        return 0;
-    ASSERT(attrNodeListMap().contains(element));
-    return attrNodeListMap().get(element);
</del><ins>+    if (!element.hasSyntheticAttrChildNodes())
+        return nullptr;
+    ASSERT(attrNodeListMap().contains(&amp;element));
+    return &amp;attrNodeListMap().find(&amp;element)-&gt;value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static AttrNodeList&amp; ensureAttrNodeListForElement(Element* element)
</del><ins>+static Vector&lt;RefPtr&lt;Attr&gt;&gt;&amp; ensureAttrNodeListForElement(Element&amp; element)
</ins><span class="cx"> {
</span><del>-    if (element-&gt;hasSyntheticAttrChildNodes()) {
-        ASSERT(attrNodeListMap().contains(element));
-        return *attrNodeListMap().get(element);
</del><ins>+    if (element.hasSyntheticAttrChildNodes()) {
+        ASSERT(attrNodeListMap().contains(&amp;element));
+        return attrNodeListMap().find(&amp;element)-&gt;value;
</ins><span class="cx">     }
</span><del>-    ASSERT(!attrNodeListMap().contains(element));
-    element-&gt;setHasSyntheticAttrChildNodes(true);
-    AttrNodeListMap::AddResult result = attrNodeListMap().add(element, adoptPtr(new AttrNodeList));
-    return *result.iterator-&gt;value;
</del><ins>+    ASSERT(!attrNodeListMap().contains(&amp;element));
+    element.setHasSyntheticAttrChildNodes(true);
+    return attrNodeListMap().add(&amp;element, Vector&lt;RefPtr&lt;Attr&gt;&gt;()).iterator-&gt;value;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void removeAttrNodeListForElement(Element* element)
</del><ins>+static void removeAttrNodeListForElement(Element&amp; element)
</ins><span class="cx"> {
</span><del>-    ASSERT(element-&gt;hasSyntheticAttrChildNodes());
-    ASSERT(attrNodeListMap().contains(element));
-    attrNodeListMap().remove(element);
-    element-&gt;setHasSyntheticAttrChildNodes(false);
</del><ins>+    ASSERT(element.hasSyntheticAttrChildNodes());
+    ASSERT(attrNodeListMap().contains(&amp;element));
+    attrNodeListMap().remove(&amp;element);
+    element.setHasSyntheticAttrChildNodes(false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Attr* findAttrNodeInList(AttrNodeList&amp; attrNodeList, const QualifiedName&amp; name)
</del><ins>+static Attr* findAttrNodeInList(Vector&lt;RefPtr&lt;Attr&gt;&gt;&amp; attrNodeList, const QualifiedName&amp; name)
</ins><span class="cx"> {
</span><del>-    for (unsigned i = 0; i &lt; attrNodeList.size(); ++i) {
-        if (attrNodeList.at(i)-&gt;qualifiedName() == name)
-            return attrNodeList.at(i).get();
</del><ins>+    for (auto&amp; node : attrNodeList) {
+        if (node-&gt;qualifiedName() == name)
+            return node.get();
</ins><span class="cx">     }
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Element&gt; Element::create(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="lines">@@ -434,11 +430,9 @@
</span><span class="cx">     // Elements in canvas fallback content are not rendered, but they are allowed to be
</span><span class="cx">     // focusable as long as their canvas is displayed and visible.
</span><span class="cx">     if (isInCanvasSubtree()) {
</span><del>-        const Element* e = this;
-        while (e &amp;&amp; !e-&gt;hasLocalName(canvasTag))
-            e = e-&gt;parentElement();
-        ASSERT(e);
-        return e-&gt;renderer() &amp;&amp; e-&gt;renderer()-&gt;style().visibility() == VISIBLE;
</del><ins>+        ASSERT(lineageOfType&lt;HTMLCanvasElement&gt;(*this).first());
+        auto&amp; canvas = *lineageOfType&lt;HTMLCanvasElement&gt;(*this).first();
+        return canvas.renderer() &amp;&amp; canvas.renderer()-&gt;style().visibility() == VISIBLE;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!renderer()) {
</span><span class="lines">@@ -1638,7 +1632,7 @@
</span><span class="cx"> const Vector&lt;RefPtr&lt;Attr&gt;&gt;&amp; Element::attrNodeList()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(hasSyntheticAttrChildNodes());
</span><del>-    return *attrNodeListForElement(this);
</del><ins>+    return *attrNodeListForElement(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Attr&gt; Element::setAttributeNode(Attr* attrNode, ExceptionCode&amp; ec)
</span><span class="lines">@@ -1674,7 +1668,7 @@
</span><span class="cx"> 
</span><span class="cx">     attrNode-&gt;attachToElement(this);
</span><span class="cx">     treeScope().adoptIfNeeded(attrNode);
</span><del>-    ensureAttrNodeListForElement(this).append(attrNode);
</del><ins>+    ensureAttrNodeListForElement(*this).append(attrNode);
</ins><span class="cx"> 
</span><span class="cx">     return oldAttrNode.release();
</span><span class="cx"> }
</span><span class="lines">@@ -2769,14 +2763,14 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Attr&gt; Element::attrIfExists(const QualifiedName&amp; name)
</span><span class="cx"> {
</span><del>-    if (AttrNodeList* attrNodeList = attrNodeListForElement(this))
</del><ins>+    if (auto* attrNodeList = attrNodeListForElement(*this))
</ins><span class="cx">         return findAttrNodeInList(*attrNodeList, name);
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;Attr&gt; Element::ensureAttr(const QualifiedName&amp; name)
</span><span class="cx"> {
</span><del>-    AttrNodeList&amp; attrNodeList = ensureAttrNodeListForElement(this);
</del><ins>+    auto&amp; attrNodeList = ensureAttrNodeListForElement(*this);
</ins><span class="cx">     RefPtr&lt;Attr&gt; attrNode = findAttrNodeInList(attrNodeList, name);
</span><span class="cx">     if (!attrNode) {
</span><span class="cx">         attrNode = Attr::create(this, name);
</span><span class="lines">@@ -2791,12 +2785,12 @@
</span><span class="cx">     ASSERT(hasSyntheticAttrChildNodes());
</span><span class="cx">     attrNode-&gt;detachFromElementWithValue(value);
</span><span class="cx"> 
</span><del>-    AttrNodeList* attrNodeList = attrNodeListForElement(this);
</del><ins>+    auto* attrNodeList = attrNodeListForElement(*this);
</ins><span class="cx">     for (unsigned i = 0; i &lt; attrNodeList-&gt;size(); ++i) {
</span><span class="cx">         if (attrNodeList-&gt;at(i)-&gt;qualifiedName() == attrNode-&gt;qualifiedName()) {
</span><span class="cx">             attrNodeList-&gt;remove(i);
</span><span class="cx">             if (attrNodeList-&gt;isEmpty())
</span><del>-                removeAttrNodeListForElement(this);
</del><ins>+                removeAttrNodeListForElement(*this);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2805,7 +2799,7 @@
</span><span class="cx"> 
</span><span class="cx"> void Element::detachAllAttrNodesFromElement()
</span><span class="cx"> {
</span><del>-    AttrNodeList* attrNodeList = attrNodeListForElement(this);
</del><ins>+    auto* attrNodeList = attrNodeListForElement(*this);
</ins><span class="cx">     ASSERT(attrNodeList);
</span><span class="cx"> 
</span><span class="cx">     for (const Attribute&amp; attribute : attributesIterator()) {
</span><span class="lines">@@ -2813,7 +2807,7 @@
</span><span class="cx">             attrNode-&gt;detachFromElementWithValue(attribute.value());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    removeAttrNodeListForElement(this);
</del><ins>+    removeAttrNodeListForElement(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Element::resetComputedStyle()
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.h (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.h        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/dom/Element.h        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -260,10 +260,12 @@
</span><span class="cx"> #endif // ENABLE(CSS_SELECTOR_JIT)
</span><span class="cx">     String tagName() const { return nodeName(); }
</span><span class="cx">     bool hasTagName(const QualifiedName&amp; tagName) const { return m_tagName.matches(tagName); }
</span><del>-    
</del><ins>+    bool hasTagName(const HTMLQualifiedName&amp; tagName) const { return ContainerNode::hasTagName(tagName); }
+    bool hasTagName(const MathMLQualifiedName&amp; tagName) const { return ContainerNode::hasTagName(tagName); }
+    bool hasTagName(const SVGQualifiedName&amp; tagName) const { return ContainerNode::hasTagName(tagName); }
+
</ins><span class="cx">     // A fast function for checking the local name against another atomic string.
</span><span class="cx">     bool hasLocalName(const AtomicString&amp; other) const { return m_tagName.localName() == other; }
</span><del>-    bool hasLocalName(const QualifiedName&amp; other) const { return m_tagName.localName() == other.localName(); }
</del><span class="cx"> 
</span><span class="cx">     virtual const AtomicString&amp; localName() const override final { return m_tagName.localName(); }
</span><span class="cx">     virtual const AtomicString&amp; prefix() const override final { return m_tagName.prefix(); }
</span><span class="lines">@@ -686,16 +688,6 @@
</span><span class="cx"> template &lt;typename Type&gt; inline bool isElementOfType(const Node&amp; node) { return node.isElementNode() &amp;&amp; isElementOfType&lt;const Type&gt;(toElement(node)); }
</span><span class="cx"> template &lt;&gt; inline bool isElementOfType&lt;const Element&gt;(const Element&amp;) { return true; }
</span><span class="cx"> 
</span><del>-inline bool Node::hasTagName(const QualifiedName&amp; name) const
-{
-    return isElementNode() &amp;&amp; toElement(this)-&gt;hasTagName(name);
-}
-    
-inline bool Node::hasLocalName(const AtomicString&amp; name) const
-{
-    return isElementNode() &amp;&amp; toElement(this)-&gt;hasLocalName(name);
-}
-
</del><span class="cx"> inline bool Node::hasAttributes() const
</span><span class="cx"> {
</span><span class="cx">     return isElementNode() &amp;&amp; toElement(this)-&gt;hasAttributes();
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.h (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.h        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/dom/Node.h        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -60,8 +60,10 @@
</span><span class="cx"> class FloatPoint;
</span><span class="cx"> class Frame;
</span><span class="cx"> class HTMLInputElement;
</span><ins>+class HTMLQualifiedName;
</ins><span class="cx"> class IntRect;
</span><span class="cx"> class KeyboardEvent;
</span><ins>+class MathMLQualifiedName;
</ins><span class="cx"> class NSResolver;
</span><span class="cx"> class NamedNodeMap;
</span><span class="cx"> class NameNodeList;
</span><span class="lines">@@ -75,6 +77,7 @@
</span><span class="cx"> class RenderBoxModelObject;
</span><span class="cx"> class RenderObject;
</span><span class="cx"> class RenderStyle;
</span><ins>+class SVGQualifiedName;
</ins><span class="cx"> class ShadowRoot;
</span><span class="cx"> class TagNodeList;
</span><span class="cx"> 
</span><span class="lines">@@ -157,8 +160,9 @@
</span><span class="cx"> 
</span><span class="cx">     // DOM methods &amp; attributes for Node
</span><span class="cx"> 
</span><del>-    bool hasTagName(const QualifiedName&amp;) const;
-    bool hasLocalName(const AtomicString&amp;) const;
</del><ins>+    bool hasTagName(const HTMLQualifiedName&amp;) const;
+    bool hasTagName(const MathMLQualifiedName&amp;) const;
+    bool hasTagName(const SVGQualifiedName&amp;) const;
</ins><span class="cx">     virtual String nodeName() const = 0;
</span><span class="cx">     virtual String nodeValue() const;
</span><span class="cx">     virtual void setNodeValue(const String&amp;, ExceptionCode&amp;);
</span><span class="lines">@@ -259,7 +263,7 @@
</span><span class="cx">     bool hasSyntheticAttrChildNodes() const { return getFlag(HasSyntheticAttrChildNodesFlag); }
</span><span class="cx">     void setHasSyntheticAttrChildNodes(bool flag) { setFlag(flag, HasSyntheticAttrChildNodesFlag); }
</span><span class="cx"> 
</span><del>-    // If this node is in a shadow tree, returns its shadow host. Otherwise, returns 0.
</del><ins>+    // If this node is in a shadow tree, returns its shadow host. Otherwise, returns null.
</ins><span class="cx">     Element* shadowHost() const;
</span><span class="cx">     // If this node is in a shadow tree, returns its shadow host. Otherwise, returns this.
</span><span class="cx">     // Deprecated. Should use shadowHost() and check the return value.
</span><span class="lines">@@ -267,7 +271,7 @@
</span><span class="cx">     ShadowRoot* containingShadowRoot() const;
</span><span class="cx">     ShadowRoot* shadowRoot() const;
</span><span class="cx"> 
</span><del>-    // Returns 0, a child of ShadowRoot, or a legacy shadow root.
</del><ins>+    // Returns null, a child of ShadowRoot, or a legacy shadow root.
</ins><span class="cx">     Node* nonBoundaryShadowTreeRootNode();
</span><span class="cx"> 
</span><span class="cx">     // Node's parent or shadow tree host.
</span><span class="lines">@@ -276,9 +280,9 @@
</span><span class="cx">     void setParentNode(ContainerNode*);
</span><span class="cx">     Node* highestAncestor() const;
</span><span class="cx"> 
</span><del>-    // Use when it's guaranteed to that shadowHost is 0.
</del><ins>+    // Use when it's guaranteed to that shadowHost is null.
</ins><span class="cx">     ContainerNode* parentNodeGuaranteedHostFree() const;
</span><del>-    // Returns the parent node, but 0 if the parent node is a ShadowRoot.
</del><ins>+    // Returns the parent node, but null if the parent node is a ShadowRoot.
</ins><span class="cx">     ContainerNode* nonShadowBoundaryParentNode() const;
</span><span class="cx"> 
</span><span class="cx">     bool selfOrAncestorHasDirAutoAttribute() const { return getFlag(SelfOrAncestorHasDirAutoFlag); }
</span><span class="lines">@@ -377,11 +381,11 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned nodeIndex() const;
</span><span class="cx"> 
</span><del>-    // Returns the DOM ownerDocument attribute. This method never returns 0, except in the case
</del><ins>+    // Returns the DOM ownerDocument attribute. This method never returns null, except in the case
</ins><span class="cx">     // of a Document node.
</span><span class="cx">     Document* ownerDocument() const;
</span><span class="cx"> 
</span><del>-    // Returns the document associated with this node. This method never returns 0.
</del><ins>+    // Returns the document associated with this node.
</ins><span class="cx">     // A Document node returns itself.
</span><span class="cx">     Document&amp; document() const
</span><span class="cx">     {
</span><span class="lines">@@ -491,11 +495,11 @@
</span><span class="cx">     void showNode(const char* prefix = &quot;&quot;) const;
</span><span class="cx">     void showTreeForThis() const;
</span><span class="cx">     void showNodePathForThis() const;
</span><del>-    void showTreeAndMark(const Node* markedNode1, const char* markedLabel1, const Node* markedNode2 = 0, const char* markedLabel2 = 0) const;
</del><ins>+    void showTreeAndMark(const Node* markedNode1, const char* markedLabel1, const Node* markedNode2 = nullptr, const char* markedLabel2 = nullptr) const;
</ins><span class="cx">     void showTreeForThisAcrossFrame() const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void invalidateNodeListAndCollectionCachesInAncestors(const QualifiedName* attrName = 0, Element* attributeOwnerElement = 0);
</del><ins>+    void invalidateNodeListAndCollectionCachesInAncestors(const QualifiedName* attrName = nullptr, Element* attributeOwnerElement = nullptr);
</ins><span class="cx">     NodeListsNodeData* nodeLists();
</span><span class="cx">     void clearNodeLists();
</span><span class="cx"> 
</span><span class="lines">@@ -670,7 +674,7 @@
</span><span class="cx">     virtual void refEventTarget() override;
</span><span class="cx">     virtual void derefEventTarget() override;
</span><span class="cx"> 
</span><del>-    virtual RenderStyle* nonRendererStyle() const { return 0; }
</del><ins>+    virtual RenderStyle* nonRendererStyle() const { return nullptr; }
</ins><span class="cx"> 
</span><span class="cx">     Element* ancestorElement() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomPositionIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PositionIterator.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PositionIterator.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/dom/PositionIterator.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;PositionIterator.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoredomStyledElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/StyledElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/StyledElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/dom/StyledElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include &quot;CSSValuePool.h&quot;
</span><span class="cx"> #include &quot;ContentSecurityPolicy.h&quot;
</span><span class="cx"> #include &quot;DOMTokenList.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLParserIdioms.h&quot;
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><span class="cx"> #include &quot;PropertySetCSSStyleDeclaration.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoredomTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Text.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Text.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/dom/Text.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -25,13 +25,13 @@
</span><span class="cx"> #include &quot;RenderCombineText.h&quot;
</span><span class="cx"> #include &quot;RenderSVGInlineText.h&quot;
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><ins>+#include &quot;SVGElement.h&quot;
+#include &quot;SVGNames.h&quot;
</ins><span class="cx"> #include &quot;ScopedEventQueue.h&quot;
</span><span class="cx"> #include &quot;ShadowRoot.h&quot;
</span><del>-#include &quot;SVGNames.h&quot;
-#include &quot;TextNodeTraversal.h&quot;
-
</del><span class="cx"> #include &quot;StyleInheritedData.h&quot;
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><ins>+#include &quot;TextNodeTraversal.h&quot;
</ins><span class="cx"> #include &lt;wtf/CheckedArithmetic.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoredommake_namespl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/make_names.pl (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/make_names.pl        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/dom/make_names.pl        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> #!/usr/bin/perl -w
</span><span class="cx"> 
</span><del>-# Copyright (C) 2005, 2006, 2007, 2009, 2013 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2005-2007, 2009, 2013-2014 Apple Inc. All rights reserved.
</ins><span class="cx"> # Copyright (C) 2009, Julien Chaffraix &lt;jchaffraix@webkit.org&gt;
</span><span class="cx"> # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx"> # Copyright (C) 2011 Ericsson AB. All rights reserved.
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">     open F, &quot;&gt;$header&quot; or die &quot;Unable to open $header for writing.&quot;;
</span><span class="cx"> 
</span><span class="cx">     printLicenseHeader($F);
</span><del>-    printHeaderHead($F, &quot;CSS&quot;, $familyNamesFileBase, &quot;#include &lt;wtf/text/AtomicString.h&gt;&quot;);
</del><ins>+    printHeaderHead($F, &quot;CSS&quot;, $familyNamesFileBase, &quot;#include &lt;wtf/text/AtomicString.h&gt;&quot;, &quot;&quot;);
</ins><span class="cx"> 
</span><span class="cx">     printMacros($F, &quot;extern const WTF::AtomicString&quot;, &quot;&quot;, \%parameters);
</span><span class="cx">     print F &quot;#endif\n\n&quot;;
</span><span class="lines">@@ -525,34 +525,41 @@
</span><span class="cx"> 
</span><span class="cx"> sub printHeaderHead
</span><span class="cx"> {
</span><del>-    my ($F, $prefix, $nsName, $includes) = @_;
</del><ins>+    my ($F, $prefix, $namespace, $includes, $definitions) = @_;
</ins><span class="cx"> 
</span><del>-    print F &quot;#ifndef ${prefix}_${nsName}Names_h\n&quot;;
-    print F &quot;#define ${prefix}_${nsName}Names_h\n\n&quot;;
-    print F &quot;$includes\n\n&quot;;
</del><ins>+    print F&lt;&lt;END
+#ifndef ${prefix}_${namespace}Names_h
</ins><span class="cx"> 
</span><del>-    print F &quot;namespace WebCore {\n\n&quot;;
-    print F &quot;namespace ${nsName}Names {\n\n&quot;;
</del><ins>+#define ${prefix}_${namespace}Names_h
</ins><span class="cx"> 
</span><del>-    print F &quot;#ifndef ${prefix}_${nsName}NAMES_HIDE_GLOBALS\n&quot;;
</del><ins>+$includes
+
+namespace WebCore {
+
+${definitions}namespace ${namespace}Names {
+
+#ifndef ${prefix}_${namespace}_NAMES_HIDE_GLOBALS
+
+END
+    ;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub printCppHead
</span><span class="cx"> {
</span><del>-    my ($F, $prefix, $nsName, $usedNamespace) = @_;
</del><ins>+    my ($F, $prefix, $namespace, $usedNamespace) = @_;
</ins><span class="cx"> 
</span><span class="cx">     print F &quot;#include \&quot;config.h\&quot;\n\n&quot;;
</span><span class="cx">     print F &quot;#ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC\n&quot;;
</span><del>-    print F &quot;#define ${prefix}_${nsName}NAMES_HIDE_GLOBALS 1\n&quot;;
</del><ins>+    print F &quot;#define ${prefix}_${namespace}_NAMES_HIDE_GLOBALS 1\n&quot;;
</ins><span class="cx">     print F &quot;#else\n&quot;;
</span><span class="cx">     print F &quot;#define QNAME_DEFAULT_CONSTRUCTOR 1\n&quot;;
</span><span class="cx">     print F &quot;#endif\n\n&quot;;
</span><span class="cx"> 
</span><del>-    print F &quot;#include \&quot;${nsName}Names.h\&quot;\n\n&quot;;
</del><ins>+    print F &quot;#include \&quot;${namespace}Names.h\&quot;\n\n&quot;;
</ins><span class="cx">     print F &quot;#include &lt;wtf/StaticConstructors.h&gt;\n&quot;;
</span><span class="cx"> 
</span><span class="cx">     print F &quot;namespace WebCore {\n\n&quot;;
</span><del>-    print F &quot;namespace ${nsName}Names {\n\n&quot;;
</del><ins>+    print F &quot;namespace ${namespace}Names {\n\n&quot;;
</ins><span class="cx">     print F &quot;using namespace $usedNamespace;\n\n&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -639,13 +646,13 @@
</span><span class="cx">             if ($parsedTags{$name}{wrapperOnlyIfMediaIsAvailable}) {
</span><span class="cx">                 # We need to check for HTMLUnknownElement if it might have been created by the factory.
</span><span class="cx">                 print F &lt;&lt;END
</span><del>-inline bool $checkHelper(const HTMLElement&amp; element) { return !element.isHTMLUnknownElement() &amp;&amp; element.hasLocalName($parameters{namespace}Names::${name}Tag); }
</del><ins>+inline bool $checkHelper(const HTMLElement&amp; element) { return !element.isHTMLUnknownElement() &amp;&amp; element.hasTagName($parameters{namespace}Names::${name}Tag); }
</ins><span class="cx"> inline bool $checkHelper(const HTMLElement* element) { ASSERT(element); return $checkHelper(*element); }
</span><span class="cx"> END
</span><span class="cx">                 ;
</span><span class="cx">             } else {
</span><span class="cx">                 print F &lt;&lt;END
</span><del>-inline bool $checkHelper(const HTMLElement&amp; element) { return element.hasLocalName(HTMLNames::${name}Tag); }
</del><ins>+inline bool $checkHelper(const HTMLElement&amp; element) { return element.hasTagName(HTMLNames::${name}Tag); }
</ins><span class="cx"> inline bool $checkHelper(const HTMLElement* element) { ASSERT(element); return $checkHelper(*element); }
</span><span class="cx"> END
</span><span class="cx">                 ;
</span><span class="lines">@@ -701,15 +708,16 @@
</span><span class="cx">     open F, &quot;&gt;$headerPath&quot;;
</span><span class="cx"> 
</span><span class="cx">     printLicenseHeader($F);
</span><del>-    printHeaderHead($F, &quot;DOM&quot;, $parameters{namespace}, &quot;#include \&quot;QualifiedName.h\&quot;&quot;);
</del><ins>+    printHeaderHead($F, &quot;DOM&quot;, $parameters{namespace}, '#include &quot;QualifiedName.h&quot;', &quot;class $parameters{namespace}QualifiedName : public QualifiedName { };\n\n&quot;);
</ins><span class="cx"> 
</span><del>-    my $lowerNamespace = lc($parameters{namespacePrefix});
</del><ins>+    my $lowercaseNamespacePrefix = lc($parameters{namespacePrefix});
+
</ins><span class="cx">     print F &quot;// Namespace\n&quot;;
</span><del>-    print F &quot;extern const WTF::AtomicString ${lowerNamespace}NamespaceURI;\n\n&quot;;
</del><ins>+    print F &quot;extern const WTF::AtomicString ${lowercaseNamespacePrefix}NamespaceURI;\n\n&quot;;
</ins><span class="cx"> 
</span><span class="cx">     if (keys %allTags) {
</span><span class="cx">         print F &quot;// Tags\n&quot;;
</span><del>-        printMacros($F, &quot;extern const WebCore::QualifiedName&quot;, &quot;Tag&quot;, \%allTags);
</del><ins>+        printMacros($F, &quot;extern const WebCore::$parameters{namespace}QualifiedName&quot;, &quot;Tag&quot;, \%allTags);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (keys %allAttrs) {
</span><span class="lines">@@ -720,12 +728,12 @@
</span><span class="cx"> 
</span><span class="cx">     if (keys %allTags) {
</span><span class="cx">         print F &quot;const unsigned $parameters{namespace}TagsCount = &quot;, scalar(keys %allTags), &quot;;\n&quot;;
</span><del>-        print F &quot;const WebCore::QualifiedName* const * get$parameters{namespace}Tags();\n&quot;;
</del><ins>+        print F &quot;const WebCore::$parameters{namespace}QualifiedName* const* get$parameters{namespace}Tags();\n&quot;;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (keys %allAttrs) {
</span><span class="cx">         print F &quot;const unsigned $parameters{namespace}AttrsCount = &quot;, scalar(keys %allAttrs), &quot;;\n&quot;;
</span><del>-        print F &quot;const WebCore::QualifiedName* const * get$parameters{namespace}Attrs();\n&quot;;
</del><ins>+        print F &quot;const WebCore::QualifiedName* const* get$parameters{namespace}Attrs();\n&quot;;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     printInit($F, 1);
</span><span class="lines">@@ -741,22 +749,22 @@
</span><span class="cx">     printLicenseHeader($F);
</span><span class="cx">     printCppHead($F, &quot;DOM&quot;, $parameters{namespace}, &quot;WebCore&quot;);
</span><span class="cx">     
</span><del>-    my $lowerNamespace = lc($parameters{namespacePrefix});
</del><ins>+    my $lowercaseNamespacePrefix = lc($parameters{namespacePrefix});
</ins><span class="cx"> 
</span><del>-    print F &quot;DEFINE_GLOBAL(AtomicString, ${lowerNamespace}NamespaceURI)\n\n&quot;;
</del><ins>+    print F &quot;DEFINE_GLOBAL(AtomicString, ${lowercaseNamespacePrefix}NamespaceURI)\n\n&quot;;
</ins><span class="cx"> 
</span><span class="cx">     print F StaticString::GenerateStrings(\%allStrings);
</span><span class="cx"> 
</span><span class="cx">     if (keys %allTags) {
</span><span class="cx">         print F &quot;// Tags\n&quot;;
</span><span class="cx">         for my $name (sort keys %allTags) {
</span><del>-            print F &quot;DEFINE_GLOBAL(QualifiedName, &quot;, $name, &quot;Tag)\n&quot;;
</del><ins>+            print F &quot;DEFINE_GLOBAL($parameters{namespace}QualifiedName, &quot;, $name, &quot;Tag)\n&quot;;
</ins><span class="cx">         }
</span><span class="cx">         
</span><del>-        print F &quot;\n\nconst WebCore::QualifiedName* const * get$parameters{namespace}Tags()\n&quot;;
-        print F &quot;{\n    static const WebCore::QualifiedName* const $parameters{namespace}Tags[] = {\n&quot;;
</del><ins>+        print F &quot;\n\nconst WebCore::$parameters{namespace}QualifiedName* const* get$parameters{namespace}Tags()\n&quot;;
+        print F &quot;{\n    static const WebCore::$parameters{namespace}QualifiedName* const $parameters{namespace}Tags[] = {\n&quot;;
</ins><span class="cx">         for my $name (sort keys %allTags) {
</span><del>-            print F &quot;        reinterpret_cast&lt;const WebCore::QualifiedName*&gt;(&amp;${name}Tag),\n&quot;;
</del><ins>+            print F &quot;        reinterpret_cast&lt;const WebCore::$parameters{namespace}QualifiedName*&gt;(&amp;${name}Tag),\n&quot;;
</ins><span class="cx">         }
</span><span class="cx">         print F &quot;    };\n&quot;;
</span><span class="cx">         print F &quot;    return $parameters{namespace}Tags;\n&quot;;
</span><span class="lines">@@ -768,7 +776,7 @@
</span><span class="cx">         for my $name (sort keys %allAttrs) {
</span><span class="cx">             print F &quot;DEFINE_GLOBAL(QualifiedName, &quot;, $name, &quot;Attr)\n&quot;;
</span><span class="cx">         }
</span><del>-        print F &quot;\n\nconst WebCore::QualifiedName* const * get$parameters{namespace}Attrs()\n&quot;;
</del><ins>+        print F &quot;\n\nconst WebCore::QualifiedName* const* get$parameters{namespace}Attrs()\n&quot;;
</ins><span class="cx">         print F &quot;{\n    static const WebCore::QualifiedName* const $parameters{namespace}Attrs[] = {\n&quot;;
</span><span class="cx">         for my $name (sort keys %allAttrs) {
</span><span class="cx">             print F &quot;        reinterpret_cast&lt;const WebCore::QualifiedName*&gt;(&amp;${name}Attr),\n&quot;;
</span><span class="lines">@@ -780,19 +788,19 @@
</span><span class="cx"> 
</span><span class="cx">     printInit($F, 0);
</span><span class="cx"> 
</span><del>-    print(F &quot;    AtomicString ${lowerNamespace}NS(\&quot;$parameters{namespaceURI}\&quot;, AtomicString::ConstructFromLiteral);\n\n&quot;);
</del><ins>+    print(F &quot;    AtomicString ${lowercaseNamespacePrefix}NS(\&quot;$parameters{namespaceURI}\&quot;, AtomicString::ConstructFromLiteral);\n\n&quot;);
</ins><span class="cx"> 
</span><span class="cx">     print(F &quot;    // Namespace\n&quot;);
</span><del>-    print(F &quot;    new (NotNull, (void*)&amp;${lowerNamespace}NamespaceURI) AtomicString(${lowerNamespace}NS);\n&quot;);
</del><ins>+    print(F &quot;    new (NotNull, (void*)&amp;${lowercaseNamespacePrefix}NamespaceURI) AtomicString(${lowercaseNamespacePrefix}NS);\n&quot;);
</ins><span class="cx">     print(F &quot;\n&quot;);
</span><span class="cx">     print F StaticString::GenerateStringAsserts(\%allStrings);
</span><span class="cx"> 
</span><span class="cx">     if (keys %allTags) {
</span><del>-        my $tagsNamespace = $parameters{tagsNullNamespace} ? &quot;nullAtom&quot; : &quot;${lowerNamespace}NS&quot;;
</del><ins>+        my $tagsNamespace = $parameters{tagsNullNamespace} ? &quot;nullAtom&quot; : &quot;${lowercaseNamespacePrefix}NS&quot;;
</ins><span class="cx">         printDefinitions($F, \%allTags, &quot;tags&quot;, $tagsNamespace);
</span><span class="cx">     }
</span><span class="cx">     if (keys %allAttrs) {
</span><del>-        my $attrsNamespace = $parameters{attrsNullNamespace} ? &quot;nullAtom&quot; : &quot;${lowerNamespace}NS&quot;;
</del><ins>+        my $attrsNamespace = $parameters{attrsNullNamespace} ? &quot;nullAtom&quot; : &quot;${lowercaseNamespacePrefix}NS&quot;;
</ins><span class="cx">         printDefinitions($F, \%allAttrs, &quot;attributes&quot;, $attrsNamespace);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingApplyStyleCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ApplyStyleCommand.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/ApplyStyleCommand.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -65,13 +65,13 @@
</span><span class="cx">     return styleSpanClassString;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool isLegacyAppleStyleSpan(const Node *node)
</del><ins>+bool isLegacyAppleStyleSpan(const Node* node)
</ins><span class="cx"> {
</span><span class="cx">     if (!node || !node-&gt;isHTMLElement())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    const HTMLElement* elem = toHTMLElement(node);
-    return elem-&gt;hasLocalName(spanAttr) &amp;&amp; elem-&gt;getAttribute(classAttr) == styleSpanClassString();
</del><ins>+    const HTMLElement&amp; element = toHTMLElement(*node);
+    return element.hasTagName(spanTag) &amp;&amp; element.fastGetAttribute(classAttr) == styleSpanClassString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool hasNoAttributeOrOnlyStyleAttribute(const StyledElement* element, ShouldStyleAttributeBeEmpty shouldStyleAttributeBeEmpty)
</span><span class="lines">@@ -130,7 +130,6 @@
</span><span class="cx">     , m_start(endingSelection().start().downstream())
</span><span class="cx">     , m_end(endingSelection().end().upstream())
</span><span class="cx">     , m_useEndingSelection(true)
</span><del>-    , m_styledInlineElement(0)
</del><span class="cx">     , m_removeOnly(false)
</span><span class="cx">     , m_isInlineElementToRemoveFunction(0)
</span><span class="cx"> {
</span><span class="lines">@@ -144,7 +143,6 @@
</span><span class="cx">     , m_start(start)
</span><span class="cx">     , m_end(end)
</span><span class="cx">     , m_useEndingSelection(false)
</span><del>-    , m_styledInlineElement(0)
</del><span class="cx">     , m_removeOnly(false)
</span><span class="cx">     , m_isInlineElementToRemoveFunction(0)
</span><span class="cx"> {
</span><span class="lines">@@ -172,7 +170,6 @@
</span><span class="cx">     , m_start(endingSelection().start().downstream())
</span><span class="cx">     , m_end(endingSelection().end().upstream())
</span><span class="cx">     , m_useEndingSelection(true)
</span><del>-    , m_styledInlineElement(0)
</del><span class="cx">     , m_removeOnly(true)
</span><span class="cx">     , m_isInlineElementToRemoveFunction(isInlineElementToRemoveFunction)
</span><span class="cx"> {
</span><span class="lines">@@ -850,7 +847,7 @@
</span><span class="cx">         // We don't consider m_isInlineElementToRemoveFunction here because we never apply style when m_isInlineElementToRemoveFunction is specified
</span><span class="cx">         if (!style-&gt;styleIsPresentInComputedStyleOfNode(node))
</span><span class="cx">             return true;
</span><del>-        if (m_styledInlineElement &amp;&amp; !enclosingNodeWithTag(positionBeforeNode(node), m_styledInlineElement-&gt;tagQName()))
</del><ins>+        if (m_styledInlineElement &amp;&amp; !enclosingElementWithTag(positionBeforeNode(node), m_styledInlineElement-&gt;tagQName()))
</ins><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/Editor.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -797,11 +797,11 @@
</span><span class="cx"> TriState Editor::selectionUnorderedListState() const
</span><span class="cx"> {
</span><span class="cx">     if (m_frame.selection().isCaret()) {
</span><del>-        if (enclosingNodeWithTag(m_frame.selection().selection().start(), ulTag))
</del><ins>+        if (enclosingElementWithTag(m_frame.selection().selection().start(), ulTag))
</ins><span class="cx">             return TrueTriState;
</span><span class="cx">     } else if (m_frame.selection().isRange()) {
</span><del>-        Node* startNode = enclosingNodeWithTag(m_frame.selection().selection().start(), ulTag);
-        Node* endNode = enclosingNodeWithTag(m_frame.selection().selection().end(), ulTag);
</del><ins>+        auto* startNode = enclosingElementWithTag(m_frame.selection().selection().start(), ulTag);
+        auto* endNode = enclosingElementWithTag(m_frame.selection().selection().end(), ulTag);
</ins><span class="cx">         if (startNode &amp;&amp; endNode &amp;&amp; startNode == endNode)
</span><span class="cx">             return TrueTriState;
</span><span class="cx">     }
</span><span class="lines">@@ -812,11 +812,11 @@
</span><span class="cx"> TriState Editor::selectionOrderedListState() const
</span><span class="cx"> {
</span><span class="cx">     if (m_frame.selection().isCaret()) {
</span><del>-        if (enclosingNodeWithTag(m_frame.selection().selection().start(), olTag))
</del><ins>+        if (enclosingElementWithTag(m_frame.selection().selection().start(), olTag))
</ins><span class="cx">             return TrueTriState;
</span><span class="cx">     } else if (m_frame.selection().isRange()) {
</span><del>-        Node* startNode = enclosingNodeWithTag(m_frame.selection().selection().start(), olTag);
-        Node* endNode = enclosingNodeWithTag(m_frame.selection().selection().end(), olTag);
</del><ins>+        auto* startNode = enclosingElementWithTag(m_frame.selection().selection().start(), olTag);
+        auto* endNode = enclosingElementWithTag(m_frame.selection().selection().end(), olTag);
</ins><span class="cx">         if (startNode &amp;&amp; endNode &amp;&amp; startNode == endNode)
</span><span class="cx">             return TrueTriState;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertListCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertListCommand.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertListCommand.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/InsertListCommand.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">     if (visibleEnd != visibleStart &amp;&amp; isStartOfParagraph(visibleEnd, CanSkipOverEditingBoundary))
</span><span class="cx">         setEndingSelection(VisibleSelection(visibleStart, visibleEnd.previous(CannotCrossEditingBoundary), endingSelection().isDirectional()));
</span><span class="cx"> 
</span><del>-    const QualifiedName&amp; listTag = (m_type == OrderedList) ? olTag : ulTag;
</del><ins>+    auto&amp; listTag = (m_type == OrderedList) ? olTag : ulTag;
</ins><span class="cx">     if (endingSelection().isRange()) {
</span><span class="cx">         VisibleSelection selection = selectionForParagraphIteration(endingSelection());
</span><span class="cx">         ASSERT(selection.isRange());
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">     doApplyForSingleParagraph(false, listTag, endingSelection().firstRange().get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InsertListCommand::doApplyForSingleParagraph(bool forceCreateList, const QualifiedName&amp; listTag, Range* currentSelection)
</del><ins>+void InsertListCommand::doApplyForSingleParagraph(bool forceCreateList, const HTMLQualifiedName&amp; listTag, Range* currentSelection)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: This will produce unexpected results for a selection that starts just before a
</span><span class="cx">     // table and ends inside the first cell, selectionForParagraphIteration should probably
</span><span class="lines">@@ -207,9 +207,10 @@
</span><span class="cx">             listNode = fixOrphanedListChild(listChildNode);
</span><span class="cx">             listNode = mergeWithNeighboringLists(listNode);
</span><span class="cx">         }
</span><del>-        if (!listNode-&gt;hasTagName(listTag))
</del><ins>+        if (!listNode-&gt;hasTagName(listTag)) {
</ins><span class="cx">             // listChildNode will be removed from the list and a list of type m_type will be created.
</span><span class="cx">             switchListType = true;
</span><ins>+        }
</ins><span class="cx"> 
</span><span class="cx">         // If the list is of the desired type, and we are not removing the list, then exit early.
</span><span class="cx">         if (!switchListType &amp;&amp; forceCreateList)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingInsertListCommandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/InsertListCommand.h (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/InsertListCommand.h        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/InsertListCommand.h        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class HTMLElement;
</span><ins>+class HTMLQualifiedName;
</ins><span class="cx"> 
</span><span class="cx"> class InsertListCommand : public CompositeEditCommand {
</span><span class="cx"> public:
</span><span class="lines">@@ -54,7 +55,7 @@
</span><span class="cx">     HTMLElement* fixOrphanedListChild(Node*);
</span><span class="cx">     bool selectionHasListOfType(const VisibleSelection&amp; selection, const QualifiedName&amp;);
</span><span class="cx">     PassRefPtr&lt;HTMLElement&gt; mergeWithNeighboringLists(PassRefPtr&lt;HTMLElement&gt;);
</span><del>-    void doApplyForSingleParagraph(bool forceCreateList, const QualifiedName&amp;, Range* currentSelection);
</del><ins>+    void doApplyForSingleParagraph(bool forceCreateList, const HTMLQualifiedName&amp;, Range* currentSelection);
</ins><span class="cx">     void unlistifyParagraph(const VisiblePosition&amp; originalStart, HTMLElement* listNode, Node* listChildNode);
</span><span class="cx">     PassRefPtr&lt;HTMLElement&gt; listifyParagraph(const VisiblePosition&amp; originalStart, const QualifiedName&amp; listTag);
</span><span class="cx">     RefPtr&lt;HTMLElement&gt; m_listElement;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingMarkupAccumulatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/MarkupAccumulator.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/MarkupAccumulator.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/MarkupAccumulator.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -140,8 +140,8 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (tagNamesToSkip &amp;&amp; targetNode.isElementNode()) {
</span><del>-        for (size_t i = 0; i &lt; tagNamesToSkip-&gt;size(); ++i) {
-            if (targetNode.hasTagName(tagNamesToSkip-&gt;at(i)))
</del><ins>+        for (auto&amp; name : *tagNamesToSkip) {
+            if (toElement(targetNode).hasTagName(name))
</ins><span class="cx">                 return;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingReplaceSelectionCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -628,12 +628,12 @@
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         if (isProhibitedParagraphChild(toHTMLElement(node.get())-&gt;localName())) {
</span><del>-            if (HTMLElement* paragraphElement = toHTMLElement(enclosingNodeWithTag(positionInParentBeforeNode(node.get()), pTag)))
</del><ins>+            if (auto* paragraphElement = enclosingElementWithTag(positionInParentBeforeNode(node.get()), pTag))
</ins><span class="cx">                 moveNodeOutOfAncestor(node, paragraphElement);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (isHeaderElement(node.get())) {
</span><del>-            if (HTMLElement* headerElement = toHTMLElement(highestEnclosingNodeOfType(positionInParentBeforeNode(node.get()), isHeaderElement)))
</del><ins>+            if (auto* headerElement = highestEnclosingNodeOfType(positionInParentBeforeNode(node.get()), isHeaderElement))
</ins><span class="cx">                 moveNodeOutOfAncestor(node, headerElement);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -672,8 +672,8 @@
</span><span class="cx"> 
</span><span class="cx">     Node* lastLeafInserted = insertedNodes.lastLeafInserted();
</span><span class="cx">     if (lastLeafInserted &amp;&amp; lastLeafInserted-&gt;isTextNode() &amp;&amp; !hasRenderedText(toText(*lastLeafInserted))
</span><del>-        &amp;&amp; !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag)
-        &amp;&amp; !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted), scriptTag)) {
</del><ins>+        &amp;&amp; !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag)
+        &amp;&amp; !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), scriptTag)) {
</ins><span class="cx">         insertedNodes.willRemoveNode(lastLeafInserted);
</span><span class="cx">         removeNode(lastLeafInserted);
</span><span class="cx">     }
</span><span class="lines">@@ -690,7 +690,7 @@
</span><span class="cx"> VisiblePosition ReplaceSelectionCommand::positionAtEndOfInsertedContent() const
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Why is this hack here?  What's special about &lt;select&gt; tags?
</span><del>-    Node* enclosingSelect = enclosingNodeWithTag(m_endOfInsertedContent, selectTag);
</del><ins>+    auto* enclosingSelect = enclosingElementWithTag(m_endOfInsertedContent, selectTag);
</ins><span class="cx">     return enclosingSelect ? lastPositionInOrAfterNode(enclosingSelect) : m_endOfInsertedContent;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -807,12 +807,12 @@
</span><span class="cx"> 
</span><span class="cx"> static bool hasHeaderTag(HTMLElement&amp; element)
</span><span class="cx"> {
</span><del>-    return element.hasLocalName(h1Tag)
-        || element.hasLocalName(h2Tag)
-        || element.hasLocalName(h3Tag)
-        || element.hasLocalName(h4Tag)
-        || element.hasLocalName(h5Tag)
-        || element.hasLocalName(h6Tag);
</del><ins>+    return element.hasTagName(h1Tag)
+        || element.hasTagName(h2Tag)
+        || element.hasTagName(h3Tag)
+        || element.hasTagName(h4Tag)
+        || element.hasTagName(h5Tag)
+        || element.hasTagName(h6Tag);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool shouldEmitNewlinesBeforeAndAfterNode(Node&amp; node)
</span><span class="lines">@@ -825,19 +825,19 @@
</span><span class="cx">             return false;
</span><span class="cx">         auto&amp; element = toHTMLElement(node);
</span><span class="cx">         return hasHeaderTag(element)
</span><del>-            || element.hasLocalName(blockquoteTag)
-            || element.hasLocalName(ddTag)
-            || element.hasLocalName(divTag)
-            || element.hasLocalName(dlTag)
-            || element.hasLocalName(dtTag)
-            || element.hasLocalName(hrTag)
-            || element.hasLocalName(liTag)
-            || element.hasLocalName(listingTag)
-            || element.hasLocalName(olTag)
-            || element.hasLocalName(pTag)
-            || element.hasLocalName(preTag)
-            || element.hasLocalName(trTag)
-            || element.hasLocalName(ulTag);
</del><ins>+            || element.hasTagName(blockquoteTag)
+            || element.hasTagName(ddTag)
+            || element.hasTagName(divTag)
+            || element.hasTagName(dlTag)
+            || element.hasTagName(dtTag)
+            || element.hasTagName(hrTag)
+            || element.hasTagName(liTag)
+            || element.hasTagName(listingTag)
+            || element.hasTagName(olTag)
+            || element.hasTagName(pTag)
+            || element.hasTagName(preTag)
+            || element.hasTagName(trTag)
+            || element.hasTagName(ulTag);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     // Need to make an exception for table cells, because they are blocks, but we
</span><span class="lines">@@ -894,7 +894,7 @@
</span><span class="cx">     // NOTE: We only do this for a select set of nodes, and WinIE appears not to do this at all.
</span><span class="cx">     if (!node.isHTMLElement())
</span><span class="cx">         return false;
</span><del>-    if (!(hasHeaderTag(toHTMLElement(node)) || toHTMLElement(node).hasLocalName(pTag)))
</del><ins>+    if (!(hasHeaderTag(toHTMLElement(node)) || toHTMLElement(node).hasTagName(pTag)))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     int bottomMargin = toRenderBox(renderer)-&gt;collapsedMarginAfter();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTypingCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TypingCommand.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TypingCommand.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/TypingCommand.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -32,10 +32,12 @@
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;Element.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;InsertLineBreakCommand.h&quot;
</span><span class="cx"> #include &quot;InsertParagraphSeparatorCommand.h&quot;
</span><span class="cx"> #include &quot;InsertTextCommand.h&quot;
</span><ins>+#include &quot;MathMLElement.h&quot;
</ins><span class="cx"> #include &quot;RenderElement.h&quot;
</span><span class="cx"> #include &quot;TextIterator.h&quot;
</span><span class="cx"> #include &quot;VisibleUnits.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingVisibleUnitscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/VisibleUnits.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/VisibleUnits.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/VisibleUnits.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> #include &quot;VisibleUnits.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;Element.h&quot;
</del><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;InlineTextBox.h&quot;
</span><span class="cx"> #include &quot;NodeTraversal.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditinghtmleditingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/htmlediting.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/htmlediting.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/htmlediting.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -542,22 +542,24 @@
</span><span class="cx">     return n &amp;&amp; (isListElement(n-&gt;parentNode()) || (n-&gt;renderer() &amp;&amp; n-&gt;renderer()-&gt;isListItem()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Node* enclosingNodeWithTag(const Position&amp; p, const QualifiedName&amp; tagName)
</del><ins>+Element* enclosingElementWithTag(const Position&amp; position, const QualifiedName&amp; tagName)
</ins><span class="cx"> {
</span><del>-    if (p.isNull())
-        return 0;
-        
-    Node* root = highestEditableRoot(p);
-    for (Node* n = p.deprecatedNode(); n; n = n-&gt;parentNode()) {
-        if (root &amp;&amp; !n-&gt;hasEditableStyle())
</del><ins>+    if (position.isNull())
+        return nullptr;
+
+    Node* root = highestEditableRoot(position);
+    for (Node* node = position.deprecatedNode(); node; node = node-&gt;parentNode()) {
+        if (root &amp;&amp; !node-&gt;hasEditableStyle())
</ins><span class="cx">             continue;
</span><del>-        if (n-&gt;hasTagName(tagName))
-            return n;
-        if (n == root)
-            return 0;
</del><ins>+        if (!node-&gt;isElementNode())
+            continue;
+        if (toElement(*node).hasTagName(tagName))
+            return toElement(node);
+        if (node == root)
+            return nullptr;
</ins><span class="cx">     }
</span><del>-    
-    return 0;
</del><ins>+
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Node* enclosingNodeOfType(const Position&amp; p, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule rule)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditinghtmleditingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/htmlediting.h (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/htmlediting.h        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/htmlediting.h        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> Node* enclosingTableCell(const Position&amp;);
</span><span class="cx"> Node* enclosingEmptyListItem(const VisiblePosition&amp;);
</span><span class="cx"> Element* enclosingAnchorElement(const Position&amp;);
</span><del>-Node* enclosingNodeWithTag(const Position&amp;, const QualifiedName&amp;);
</del><ins>+Element* enclosingElementWithTag(const Position&amp;, const QualifiedName&amp;);
</ins><span class="cx"> Node* enclosingNodeOfType(const Position&amp;, bool (*nodeIsOfType)(const Node*), EditingBoundaryCrossingRule = CannotCrossEditingBoundary);
</span><span class="cx"> 
</span><span class="cx"> Node* tabSpanNode(const Node*);
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacEditorMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/EditorMac.mm (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/EditorMac.mm        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/mac/EditorMac.mm        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -298,7 +298,7 @@
</span><span class="cx">     RefPtr&lt;Range&gt; range = selectedRange();
</span><span class="cx">     Node* commonAncestor = range-&gt;commonAncestorContainer(IGNORE_EXCEPTION);
</span><span class="cx">     ASSERT(commonAncestor);
</span><del>-    Node* enclosingAnchor = enclosingNodeWithTag(firstPositionInNode(commonAncestor), HTMLNames::aTag);
</del><ins>+    auto* enclosingAnchor = enclosingElementWithTag(firstPositionInNode(commonAncestor), HTMLNames::aTag);
</ins><span class="cx">     if (enclosingAnchor &amp;&amp; comparePositions(firstPositionInOrBeforeNode(range-&gt;startPosition().anchorNode()), range-&gt;startPosition()) &gt;= 0)
</span><span class="cx">         range-&gt;setStart(enclosingAnchor, 0, IGNORE_EXCEPTION);
</span><span class="cx">     return range;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmarkupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/markup.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/markup.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/editing/markup.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx">     if (!shouldAnnotate() || parentIsTextarea)
</span><span class="cx">         MarkupAccumulator::appendText(out, text);
</span><span class="cx">     else {
</span><del>-        const bool useRenderedText = !enclosingNodeWithTag(firstPositionInNode(const_cast&lt;Text*&gt;(&amp;text)), selectTag);
</del><ins>+        const bool useRenderedText = !enclosingElementWithTag(firstPositionInNode(const_cast&lt;Text*&gt;(&amp;text)), selectTag);
</ins><span class="cx">         String content = useRenderedText ? renderedText(text, m_range) : stringValueForRange(text, m_range);
</span><span class="cx">         StringBuilder buffer;
</span><span class="cx">         appendCharactersReplacingEntities(buffer, content, 0, content.length(), EntityMaskInPCDATA);
</span><span class="lines">@@ -387,7 +387,7 @@
</span><span class="cx">             // Don't write out empty block containers that aren't fully selected.
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (!n-&gt;renderer() &amp;&amp; !enclosingNodeWithTag(firstPositionInOrBeforeNode(n), selectTag)) {
</del><ins>+        if (!n-&gt;renderer() &amp;&amp; !enclosingElementWithTag(firstPositionInOrBeforeNode(n), selectTag)) {
</ins><span class="cx">             next = NodeTraversal::nextSkippingChildren(n);
</span><span class="cx">             // Don't skip over pastEnd.
</span><span class="cx">             if (pastEnd &amp;&amp; pastEnd-&gt;isDescendantOf(n))
</span><span class="lines">@@ -547,7 +547,7 @@
</span><span class="cx">     if (!specialCommonAncestor &amp;&amp; isTabSpanNode(commonAncestor))
</span><span class="cx">         specialCommonAncestor = commonAncestor;
</span><span class="cx"> 
</span><del>-    if (Node *enclosingAnchor = enclosingNodeWithTag(firstPositionInNode(specialCommonAncestor ? specialCommonAncestor : commonAncestor), aTag))
</del><ins>+    if (auto* enclosingAnchor = enclosingElementWithTag(firstPositionInNode(specialCommonAncestor ? specialCommonAncestor : commonAncestor), aTag))
</ins><span class="cx">         specialCommonAncestor = enclosingAnchor;
</span><span class="cx"> 
</span><span class="cx">     return specialCommonAncestor;
</span><span class="lines">@@ -569,7 +569,7 @@
</span><span class="cx"> 
</span><span class="cx">     document.updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><del>-    Node* body = enclosingNodeWithTag(firstPositionInNode(commonAncestor), bodyTag);
</del><ins>+    auto* body = enclosingElementWithTag(firstPositionInNode(commonAncestor), bodyTag);
</ins><span class="cx">     Node* fullySelectedRoot = 0;
</span><span class="cx">     // FIXME: Do this for all fully selected blocks, not just the body.
</span><span class="cx">     if (body &amp;&amp; VisiblePosition(firstPositionInNode(body)) == VisiblePosition(range.startPosition())
</span><span class="lines">@@ -948,8 +948,8 @@
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (element-&gt;hasLocalName(colTag) || element-&gt;hasLocalName(colgroupTag) || element-&gt;hasLocalName(framesetTag)
-        || element-&gt;hasLocalName(headTag) || element-&gt;hasLocalName(styleTag) || element-&gt;hasLocalName(titleTag)) {
</del><ins>+    if (element-&gt;hasTagName(colTag) || element-&gt;hasTagName(colgroupTag) || element-&gt;hasTagName(framesetTag)
+        || element-&gt;hasTagName(headTag) || element-&gt;hasTagName(styleTag) || element-&gt;hasTagName(titleTag)) {
</ins><span class="cx">         ec = NOT_SUPPORTED_ERR;
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLCollection.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLCollection.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/HTMLCollection.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -176,38 +176,38 @@
</span><span class="cx"> 
</span><span class="cx">     switch (type) {
</span><span class="cx">     case DocImages:
</span><del>-        return element.hasLocalName(imgTag);
</del><ins>+        return element.hasTagName(imgTag);
</ins><span class="cx">     case DocScripts:
</span><del>-        return element.hasLocalName(scriptTag);
</del><ins>+        return element.hasTagName(scriptTag);
</ins><span class="cx">     case DocForms:
</span><del>-        return element.hasLocalName(formTag);
</del><ins>+        return element.hasTagName(formTag);
</ins><span class="cx">     case TableTBodies:
</span><del>-        return element.hasLocalName(tbodyTag);
</del><ins>+        return element.hasTagName(tbodyTag);
</ins><span class="cx">     case TRCells:
</span><del>-        return element.hasLocalName(tdTag) || element.hasLocalName(thTag);
</del><ins>+        return element.hasTagName(tdTag) || element.hasTagName(thTag);
</ins><span class="cx">     case TSectionRows:
</span><del>-        return element.hasLocalName(trTag);
</del><ins>+        return element.hasTagName(trTag);
</ins><span class="cx">     case SelectOptions:
</span><del>-        return element.hasLocalName(optionTag);
</del><ins>+        return element.hasTagName(optionTag);
</ins><span class="cx">     case SelectedOptions:
</span><del>-        return element.hasLocalName(optionTag) &amp;&amp; toHTMLOptionElement(element).selected();
</del><ins>+        return element.hasTagName(optionTag) &amp;&amp; toHTMLOptionElement(element).selected();
</ins><span class="cx">     case DataListOptions:
</span><del>-        if (element.hasLocalName(optionTag)) {
</del><ins>+        if (element.hasTagName(optionTag)) {
</ins><span class="cx">             HTMLOptionElement&amp; option = toHTMLOptionElement(element);
</span><span class="cx">             if (!option.isDisabledFormControl() &amp;&amp; !option.value().isEmpty())
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="cx">         return false;
</span><span class="cx">     case MapAreas:
</span><del>-        return element.hasLocalName(areaTag);
</del><ins>+        return element.hasTagName(areaTag);
</ins><span class="cx">     case DocApplets:
</span><del>-        return element.hasLocalName(appletTag) || (element.hasLocalName(objectTag) &amp;&amp; toHTMLObjectElement(element).containsJavaApplet());
</del><ins>+        return element.hasTagName(appletTag) || (element.hasTagName(objectTag) &amp;&amp; toHTMLObjectElement(element).containsJavaApplet());
</ins><span class="cx">     case DocEmbeds:
</span><del>-        return element.hasLocalName(embedTag);
</del><ins>+        return element.hasTagName(embedTag);
</ins><span class="cx">     case DocLinks:
</span><del>-        return (element.hasLocalName(aTag) || element.hasLocalName(areaTag)) &amp;&amp; element.fastHasAttribute(hrefAttr);
</del><ins>+        return (element.hasTagName(aTag) || element.hasTagName(areaTag)) &amp;&amp; element.fastHasAttribute(hrefAttr);
</ins><span class="cx">     case DocAnchors:
</span><del>-        return element.hasLocalName(aTag) &amp;&amp; element.fastHasAttribute(nameAttr);
</del><ins>+        return element.hasTagName(aTag) &amp;&amp; element.fastHasAttribute(nameAttr);
</ins><span class="cx">     case DocAll:
</span><span class="cx">     case NodeChildren:
</span><span class="cx">         return true;
</span><span class="lines">@@ -269,13 +269,13 @@
</span><span class="cx"> {
</span><span class="cx">     // The document.all collection returns only certain types of elements by name,
</span><span class="cx">     // although it returns any type of element by id.
</span><del>-    return element.hasLocalName(appletTag)
-        || element.hasLocalName(embedTag)
-        || element.hasLocalName(formTag)
-        || element.hasLocalName(imgTag)
-        || element.hasLocalName(inputTag)
-        || element.hasLocalName(objectTag)
-        || element.hasLocalName(selectTag);
</del><ins>+    return element.hasTagName(appletTag)
+        || element.hasTagName(embedTag)
+        || element.hasTagName(formTag)
+        || element.hasTagName(imgTag)
+        || element.hasTagName(inputTag)
+        || element.hasTagName(objectTag)
+        || element.hasTagName(selectTag);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline Element* firstMatchingChildElement(const HTMLCollection&amp; nodeList, ContainerNode&amp; root)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/HTMLElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -91,28 +91,28 @@
</span><span class="cx">     // This is also called from editing and assumed to be the list of tags
</span><span class="cx">     // for which no end tag should be serialized. It's unclear if the list for
</span><span class="cx">     // IE compat and the list for serialization sanity are the same.
</span><del>-    if (hasLocalName(areaTag)
-        || hasLocalName(baseTag)
-        || hasLocalName(basefontTag)
-        || hasLocalName(brTag)
-        || hasLocalName(colTag)
-        || hasLocalName(embedTag)
-        || hasLocalName(frameTag)
-        || hasLocalName(hrTag)
-        || hasLocalName(imageTag)
-        || hasLocalName(imgTag)
-        || hasLocalName(inputTag)
-        || hasLocalName(isindexTag)
-        || hasLocalName(linkTag)
-        || hasLocalName(metaTag)
-        || hasLocalName(paramTag)
-        || hasLocalName(sourceTag)
-        || hasLocalName(wbrTag))
</del><ins>+    if (hasTagName(areaTag)
+        || hasTagName(baseTag)
+        || hasTagName(basefontTag)
+        || hasTagName(brTag)
+        || hasTagName(colTag)
+        || hasTagName(embedTag)
+        || hasTagName(frameTag)
+        || hasTagName(hrTag)
+        || hasTagName(imageTag)
+        || hasTagName(imgTag)
+        || hasTagName(inputTag)
+        || hasTagName(isindexTag)
+        || hasTagName(linkTag)
+        || hasTagName(metaTag)
+        || hasTagName(paramTag)
+        || hasTagName(sourceTag)
+        || hasTagName(wbrTag))
</ins><span class="cx">         return true;
</span><span class="cx">     // FIXME: I'm not sure why dashboard mode would want to change the
</span><span class="cx">     // serialization of &lt;canvas&gt;, that seems like a bad idea.
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><del>-    if (hasLocalName(canvasTag)) {
</del><ins>+    if (hasTagName(canvasTag)) {
</ins><span class="cx">         Settings* settings = document().settings();
</span><span class="cx">         if (settings &amp;&amp; settings-&gt;usesDashboardBackwardCompatibilityMode())
</span><span class="cx">             return true;
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx"> 
</span><span class="cx"> static inline CSSValueID unicodeBidiAttributeForDirAuto(HTMLElement&amp; element)
</span><span class="cx"> {
</span><del>-    if (element.hasLocalName(preTag) || element.hasLocalName(textareaTag))
</del><ins>+    if (element.hasTagName(preTag) || element.hasTagName(textareaTag))
</ins><span class="cx">         return CSSValueWebkitPlaintext;
</span><span class="cx">     // FIXME: For bdo element, dir=&quot;auto&quot; should result in &quot;bidi-override isolate&quot; but we don't support having multiple values in unicode-bidi yet.
</span><span class="cx">     // See https://bugs.webkit.org/show_bug.cgi?id=73164.
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> {
</span><span class="cx">     unsigned borderWidth = 0;
</span><span class="cx">     if (value.isEmpty() || !parseHTMLNonNegativeInteger(value, borderWidth))
</span><del>-        return hasLocalName(tableTag) ? 1 : borderWidth;
</del><ins>+        return hasTagName(tableTag) ? 1 : borderWidth;
</ins><span class="cx">     return borderWidth;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -378,7 +378,7 @@
</span><span class="cx">     if (RefPtr&lt;DocumentFragment&gt; fragment = createFragmentForInnerOuterHTML(html, this, AllowScriptingContent, ec)) {
</span><span class="cx">         ContainerNode* container = this;
</span><span class="cx"> #if ENABLE(TEMPLATE_ELEMENT)
</span><del>-        if (hasLocalName(templateTag))
</del><ins>+        if (hasTagName(templateTag))
</ins><span class="cx">             container = toHTMLTemplateElement(this)-&gt;content();
</span><span class="cx"> #endif
</span><span class="cx">         replaceChildrenWithFragment(*container, fragment.release(), ec);
</span><span class="lines">@@ -455,16 +455,27 @@
</span><span class="cx">     return fragment;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline bool shouldProhibitSetInnerOuterText(const HTMLElement&amp; element)
+{
+    return element.hasTagName(colTag)
+        || element.hasTagName(colgroupTag)
+        || element.hasTagName(framesetTag)
+        || element.hasTagName(headTag)
+        || element.hasTagName(htmlTag)
+        || element.hasTagName(tableTag)
+        || element.hasTagName(tbodyTag)
+        || element.hasTagName(tfootTag)
+        || element.hasTagName(theadTag)
+        || element.hasTagName(trTag);
+}
+
</ins><span class="cx"> void HTMLElement::setInnerText(const String&amp; text, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     if (ieForbidsInsertHTML()) {
</span><span class="cx">         ec = NO_MODIFICATION_ALLOWED_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag) ||
-        hasLocalName(headTag) || hasLocalName(htmlTag) || hasLocalName(tableTag) || 
-        hasLocalName(tbodyTag) || hasLocalName(tfootTag) || hasLocalName(theadTag) ||
-        hasLocalName(trTag)) {
</del><ins>+    if (shouldProhibitSetInnerOuterText(*this)) {
</ins><span class="cx">         ec = NO_MODIFICATION_ALLOWED_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -509,10 +520,7 @@
</span><span class="cx">         ec = NO_MODIFICATION_ALLOWED_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    if (hasLocalName(colTag) || hasLocalName(colgroupTag) || hasLocalName(framesetTag) ||
-        hasLocalName(headTag) || hasLocalName(htmlTag) || hasLocalName(tableTag) || 
-        hasLocalName(tbodyTag) || hasLocalName(tfootTag) || hasLocalName(theadTag) ||
-        hasLocalName(trTag)) {
</del><ins>+    if (shouldProhibitSetInnerOuterText(*this)) {
</ins><span class="cx">         ec = NO_MODIFICATION_ALLOWED_ERR;
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -791,11 +799,11 @@
</span><span class="cx"> 
</span><span class="cx"> bool HTMLElement::rendererIsNeeded(const RenderStyle&amp; style)
</span><span class="cx"> {
</span><del>-    if (hasLocalName(noscriptTag)) {
</del><ins>+    if (hasTagName(noscriptTag)) {
</ins><span class="cx">         Frame* frame = document().frame();
</span><span class="cx">         if (frame &amp;&amp; frame-&gt;script().canExecuteScripts(NotAboutToExecuteScript))
</span><span class="cx">             return false;
</span><del>-    } else if (hasLocalName(noembedTag)) {
</del><ins>+    } else if (hasTagName(noembedTag)) {
</ins><span class="cx">         Frame* frame = document().frame();
</span><span class="cx">         if (frame &amp;&amp; frame-&gt;loader().subframeLoader().allowPlugins(NotAboutToInstantiatePlugin))
</span><span class="cx">             return false;
</span><span class="lines">@@ -805,7 +813,7 @@
</span><span class="cx"> 
</span><span class="cx"> RenderPtr&lt;RenderElement&gt; HTMLElement::createElementRenderer(PassRef&lt;RenderStyle&gt; style)
</span><span class="cx"> {
</span><del>-    if (hasLocalName(wbrTag))
</del><ins>+    if (hasTagName(wbrTag))
</ins><span class="cx">         return createRenderer&lt;RenderLineBreak&gt;(*this, std::move(style));
</span><span class="cx">     return RenderElement::createFor(*this, std::move(style));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLElement.h (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLElement.h        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/HTMLElement.h        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -99,6 +99,8 @@
</span><span class="cx">     virtual bool isLabelable() const { return false; }
</span><span class="cx">     virtual FormNamedItem* asFormNamedItem() { return 0; }
</span><span class="cx"> 
</span><ins>+    bool hasTagName(const HTMLQualifiedName&amp; name) const { return hasLocalName(name.localName()); }
+
</ins><span class="cx"> protected:
</span><span class="cx">     HTMLElement(const QualifiedName&amp; tagName, Document&amp;, ConstructionType);
</span><span class="cx"> 
</span><span class="lines">@@ -151,6 +153,11 @@
</span><span class="cx"> 
</span><span class="cx"> NODE_TYPE_CASTS(HTMLElement)
</span><span class="cx"> 
</span><ins>+inline bool Node::hasTagName(const HTMLQualifiedName&amp; name) const
+{
+    return isHTMLElement() &amp;&amp; toHTMLElement(*this).hasTagName(name);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #include &quot;HTMLElementTypeHelpers.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -397,7 +397,7 @@
</span><span class="cx"> {
</span><span class="cx">     DEPRECATED_DEFINE_STATIC_LOCAL(HashSet&lt;AtomicStringImpl*&gt;, tagList, ());
</span><span class="cx">     if (tagList.isEmpty()) {
</span><del>-        const QualifiedName* const * tags = HTMLNames::getHTMLTags();
</del><ins>+        auto* tags = HTMLNames::getHTMLTags();
</ins><span class="cx">         for (size_t i = 0; i &lt; HTMLNames::HTMLTagsCount; i++) {
</span><span class="cx">             if (*tags[i] == bgsoundTag
</span><span class="cx">                 || *tags[i] == commandTag
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLSelectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLSelectElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLSelectElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/HTMLSelectElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLSelectElement::add(HTMLElement* element, HTMLElement* before, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><del>-    if (!element || !(element-&gt;hasLocalName(optionTag) || element-&gt;hasLocalName(hrTag)))
</del><ins>+    if (!element || !(isHTMLOptionElement(*element) || element-&gt;hasTagName(hrTag)))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Make sure the element is ref'd and deref'd so we don't leak it.
</span><span class="lines">@@ -249,15 +249,14 @@
</span><span class="cx"> 
</span><span class="cx"> String HTMLSelectElement::value() const
</span><span class="cx"> {
</span><del>-    const Vector&lt;HTMLElement*&gt;&amp; items = listItems();
-    for (unsigned i = 0; i &lt; items.size(); i++) {
-        if (items[i]-&gt;hasLocalName(optionTag)) {
-            HTMLOptionElement* option = toHTMLOptionElement(items[i]);
-            if (option-&gt;selected())
-                return option-&gt;value();
</del><ins>+    for (auto* item : listItems()) {
+        if (isHTMLOptionElement(*item)) {
+            HTMLOptionElement&amp; option = toHTMLOptionElement(*item);
+            if (option.selected())
+                return option.value();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><del>-    return &quot;&quot;;
</del><ins>+    return emptyString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLSelectElement::setValue(const String &amp;value)
</span><span class="lines">@@ -269,15 +268,14 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Find the option with value() matching the given parameter and make it the current selection.
</span><del>-    const Vector&lt;HTMLElement*&gt;&amp; items = listItems();
</del><span class="cx">     unsigned optionIndex = 0;
</span><del>-    for (unsigned i = 0; i &lt; items.size(); i++) {
-        if (items[i]-&gt;hasLocalName(optionTag)) {
-            if (toHTMLOptionElement(items[i])-&gt;value() == value) {
</del><ins>+    for (auto* item : listItems()) {
+        if (isHTMLOptionElement(*item)) {
+            if (toHTMLOptionElement(*item).value() == value) {
</ins><span class="cx">                 setSelectedIndex(optionIndex);
</span><span class="cx">                 return;
</span><span class="cx">             }
</span><del>-            optionIndex++;
</del><ins>+            ++optionIndex;
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -484,18 +482,16 @@
</span><span class="cx">         // of elements that we intend to remove then attempt to remove them one at a time.
</span><span class="cx">         Vector&lt;RefPtr&lt;Element&gt;&gt; itemsToRemove;
</span><span class="cx">         size_t optionIndex = 0;
</span><del>-        for (size_t i = 0; i &lt; items.size(); ++i) {
-            Element* item = items[i];
-            if (item-&gt;hasLocalName(optionTag) &amp;&amp; optionIndex++ &gt;= newLen) {
</del><ins>+        for (auto&amp; item : items) {
+            if (isHTMLOptionElement(*item) &amp;&amp; optionIndex++ &gt;= newLen) {
</ins><span class="cx">                 ASSERT(item-&gt;parentNode());
</span><span class="cx">                 itemsToRemove.append(item);
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        for (size_t i = 0; i &lt; itemsToRemove.size(); ++i) {
-            Element* item = itemsToRemove[i].get();
</del><ins>+        for (auto&amp; item : itemsToRemove) {
</ins><span class="cx">             if (item-&gt;parentNode())
</span><del>-                item-&gt;parentNode()-&gt;removeChild(item, ec);
</del><ins>+                item-&gt;parentNode()-&gt;removeChild(item.get(), ec);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     setNeedsValidityCheck();
</span><span class="lines">@@ -997,7 +993,7 @@
</span><span class="cx">     const Vector&lt;HTMLElement*&gt;&amp; items = listItems();
</span><span class="cx">     size_t loopEndIndex = std::min(items.size(), listIndexEnd);
</span><span class="cx">     for (size_t i = listIndexStart; i &lt; loopEndIndex; ++i) {
</span><del>-        if (!items[i]-&gt;hasLocalName(optionTag))
</del><ins>+        if (!isHTMLOptionElement(items[i]))
</ins><span class="cx">             continue;
</span><span class="cx">         if (toHTMLOptionElement(items[i])-&gt;value() == value)
</span><span class="cx">             return i;
</span><span class="lines">@@ -1015,7 +1011,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; itemsSize; ++i) {
</span><del>-        if (!items[i]-&gt;hasLocalName(optionTag))
</del><ins>+        if (!isHTMLOptionElement(items[i]))
</ins><span class="cx">             continue;
</span><span class="cx">         toHTMLOptionElement(items[i])-&gt;setSelectedState(false);
</span><span class="cx">     }
</span><span class="lines">@@ -1495,9 +1491,9 @@
</span><span class="cx">         } else if (m_multiple &amp;&amp; keyCode == ' ' &amp;&amp; m_allowsNonContiguousSelection) {
</span><span class="cx">             // Use space to toggle selection change.
</span><span class="cx">             m_activeSelectionState = !m_activeSelectionState;
</span><del>-            ASSERT(m_activeSelectionEndIndex &gt;= 0
-                &amp;&amp; m_activeSelectionEndIndex &lt; static_cast&lt;int&gt;(listItems.size())
-                &amp;&amp; listItems[m_activeSelectionEndIndex]-&gt;hasTagName(optionTag));
</del><ins>+            ASSERT(m_activeSelectionEndIndex &gt;= 0);
+            ASSERT(m_activeSelectionEndIndex &lt; static_cast&lt;int&gt;(listItems.size()));
+            ASSERT(isHTMLOptionElement(*listItems[m_activeSelectionEndIndex]));
</ins><span class="cx">             updateSelectedState(m_activeSelectionEndIndex, true /*multi*/, false /*shift*/);
</span><span class="cx">             listBoxOnChange();
</span><span class="cx">             event-&gt;setDefaultHandled();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTableColElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTableColElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTableColElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/HTMLTableColElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -84,11 +84,11 @@
</span><span class="cx"> 
</span><span class="cx"> const StyleProperties* HTMLTableColElement::additionalPresentationAttributeStyle()
</span><span class="cx"> {
</span><del>-    if (!hasLocalName(colgroupTag))
-        return 0;
</del><ins>+    if (!hasTagName(colgroupTag))
+        return nullptr;
</ins><span class="cx">     if (HTMLTableElement* table = findParentTable())
</span><span class="cx">         return table-&gt;additionalGroupStyle(false);
</span><del>-    return 0;
</del><ins>+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLTableColElement::setSpan(int n)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLTableRowsCollectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/HTMLTableRowsCollection.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -54,12 +54,11 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool isInSection(HTMLTableRowElement* row, const QualifiedName&amp; sectionTag)
</del><ins>+static inline bool isInSection(HTMLTableRowElement&amp; row, const HTMLQualifiedName&amp; sectionTag)
</ins><span class="cx"> {
</span><del>-    // Because we know that the parent is a table or a section, all of which are in the HTML
-    // namespace, it's OK to do the faster hasLocalName here instead of the more typical hasTagName,
-    // since we don't need the check for the HTML namespace.
-    return toElement(row-&gt;parentNode())-&gt;hasLocalName(sectionTag);
</del><ins>+    // Because we know that the parent is a table or a section, it's safe to cast it to an HTMLElement
+    // giving us access to the faster hasTagName overload from that class.
+    return toHTMLElement(row.parentNode())-&gt;hasTagName(sectionTag);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> HTMLTableRowElement* HTMLTableRowsCollection::rowAfter(HTMLTableElement* table, HTMLTableRowElement* previous)
</span><span class="lines">@@ -81,7 +80,7 @@
</span><span class="cx">     // If still looking at head sections, find the first row in the next head section.
</span><span class="cx">     if (!previous)
</span><span class="cx">         child = ElementTraversal::firstChild(table);
</span><del>-    else if (isInSection(previous, theadTag))
</del><ins>+    else if (isInSection(*previous, theadTag))
</ins><span class="cx">         child = ElementTraversal::nextSibling(previous-&gt;parentNode());
</span><span class="cx">     for (; child; child = ElementTraversal::nextSibling(child)) {
</span><span class="cx">         if (child-&gt;hasTagName(theadTag)) {
</span><span class="lines">@@ -91,11 +90,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If still looking at top level and bodies, find the next row in top level or the first in the next body section.
</span><del>-    if (!previous || isInSection(previous, theadTag))
</del><ins>+    if (!previous || isInSection(*previous, theadTag))
</ins><span class="cx">         child = ElementTraversal::firstChild(table);
</span><span class="cx">     else if (previous-&gt;parentNode() == table)
</span><span class="cx">         child = ElementTraversal::nextSibling(previous);
</span><del>-    else if (isInSection(previous, tbodyTag))
</del><ins>+    else if (isInSection(*previous, tbodyTag))
</ins><span class="cx">         child = ElementTraversal::nextSibling(previous-&gt;parentNode());
</span><span class="cx">     for (; child; child = ElementTraversal::nextSibling(child)) {
</span><span class="cx">         if (isHTMLTableRowElement(child))
</span><span class="lines">@@ -107,7 +106,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Find the first row in the next foot section.
</span><del>-    if (!previous || !isInSection(previous, tfootTag))
</del><ins>+    if (!previous || !isInSection(*previous, tfootTag))
</ins><span class="cx">         child = ElementTraversal::firstChild(table);
</span><span class="cx">     else
</span><span class="cx">         child = ElementTraversal::nextSibling(previous-&gt;parentNode());
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLConstructionSitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;HTMLScriptElement.h&quot;
</span><span class="cx"> #include &quot;HTMLTemplateElement.h&quot;
</span><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><ins>+#include &quot;SVGElement.h&quot;
</ins><span class="cx"> #include &quot;Text.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLTreeBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;XMLNSNames.h&quot;
</span><span class="cx"> #include &quot;XMLNames.h&quot;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> #include &lt;wtf/unicode/CharacterNames.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TELEPHONE_NUMBER_DETECTION)
</span><span class="lines">@@ -522,91 +523,81 @@
</span><span class="cx">     m_tree.insertHTMLElement(token);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-typedef HashMap&lt;AtomicString, QualifiedName&gt; PrefixedNameToQualifiedNameMap;
-
-static void mapLoweredLocalNameToName(PrefixedNameToQualifiedNameMap* map, const QualifiedName* const names[], size_t length)
</del><ins>+template &lt;typename TableQualifiedName&gt;
+static HashMap&lt;AtomicString, QualifiedName&gt; createCaseMap(const TableQualifiedName* const names[], unsigned length)
</ins><span class="cx"> {
</span><del>-    for (size_t i = 0; i &lt; length; ++i) {
</del><ins>+    HashMap&lt;AtomicString, QualifiedName&gt; map;
+    for (unsigned i = 0; i &lt; length; ++i) {
</ins><span class="cx">         const QualifiedName&amp; name = *names[i];
</span><span class="cx">         const AtomicString&amp; localName = name.localName();
</span><span class="cx">         AtomicString loweredLocalName = localName.lower();
</span><span class="cx">         if (loweredLocalName != localName)
</span><del>-            map-&gt;add(loweredLocalName, name);
</del><ins>+            map.add(loweredLocalName, name);
</ins><span class="cx">     }
</span><ins>+    return map;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void adjustSVGTagNameCase(AtomicHTMLToken* token)
</del><ins>+static void adjustSVGTagNameCase(AtomicHTMLToken&amp; token)
</ins><span class="cx"> {
</span><del>-    static PrefixedNameToQualifiedNameMap* caseMap = 0;
-    if (!caseMap) {
-        caseMap = new PrefixedNameToQualifiedNameMap;
-        mapLoweredLocalNameToName(caseMap, SVGNames::getSVGTags(), SVGNames::SVGTagsCount);
-    }
-
-    const QualifiedName&amp; casedName = caseMap-&gt;get(token-&gt;name());
</del><ins>+    static NeverDestroyed&lt;HashMap&lt;AtomicString, QualifiedName&gt;&gt; map = createCaseMap(SVGNames::getSVGTags(), SVGNames::SVGTagsCount);
+    const QualifiedName&amp; casedName = map.get().get(token.name());
</ins><span class="cx">     if (casedName.localName().isNull())
</span><span class="cx">         return;
</span><del>-    token-&gt;setName(casedName.localName());
</del><ins>+    token.setName(casedName.localName());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;const QualifiedName* const * getAttrs(), unsigned length&gt;
-static void adjustAttributes(AtomicHTMLToken* token)
</del><ins>+static inline void adjustAttributes(HashMap&lt;AtomicString, QualifiedName&gt;&amp; map, AtomicHTMLToken&amp; token)
</ins><span class="cx"> {
</span><del>-    static PrefixedNameToQualifiedNameMap* caseMap = 0;
-    if (!caseMap) {
-        caseMap = new PrefixedNameToQualifiedNameMap;
-        mapLoweredLocalNameToName(caseMap, getAttrs(), length);
-    }
-
-    for (unsigned i = 0; i &lt; token-&gt;attributes().size(); ++i) {
-        Attribute&amp; tokenAttribute = token-&gt;attributes().at(i);
-        const QualifiedName&amp; casedName = caseMap-&gt;get(tokenAttribute.localName());
</del><ins>+    for (auto&amp; attribute : token.attributes()) {
+        const QualifiedName&amp; casedName = map.get(attribute.localName());
</ins><span class="cx">         if (!casedName.localName().isNull())
</span><del>-            tokenAttribute.parserSetName(casedName);
</del><ins>+            attribute.parserSetName(casedName);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void adjustSVGAttributes(AtomicHTMLToken* token)
</del><ins>+template&lt;const QualifiedName* const* attributesTable(), unsigned attributesTableLength&gt;
+static void adjustAttributes(AtomicHTMLToken&amp; token)
</ins><span class="cx"> {
</span><ins>+    static NeverDestroyed&lt;HashMap&lt;AtomicString, QualifiedName&gt;&gt; map = createCaseMap(attributesTable(), attributesTableLength);
+    adjustAttributes(map, token);
+}
+
+static inline void adjustSVGAttributes(AtomicHTMLToken&amp; token)
+{
</ins><span class="cx">     adjustAttributes&lt;SVGNames::getSVGAttrs, SVGNames::SVGAttrsCount&gt;(token);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void adjustMathMLAttributes(AtomicHTMLToken* token)
</del><ins>+static inline void adjustMathMLAttributes(AtomicHTMLToken&amp; token)
</ins><span class="cx"> {
</span><span class="cx">     adjustAttributes&lt;MathMLNames::getMathMLAttrs, MathMLNames::MathMLAttrsCount&gt;(token);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void addNamesWithPrefix(PrefixedNameToQualifiedNameMap* map, const AtomicString&amp; prefix, const QualifiedName* const names[], size_t length)
</del><ins>+static void addNamesWithPrefix(HashMap&lt;AtomicString, QualifiedName&gt;&amp; map, const AtomicString&amp; prefix, const QualifiedName* const names[], unsigned length)
</ins><span class="cx"> {
</span><del>-    for (size_t i = 0; i &lt; length; ++i) {
</del><ins>+    for (unsigned i = 0; i &lt; length; ++i) {
</ins><span class="cx">         const QualifiedName&amp; name = *names[i];
</span><span class="cx">         const AtomicString&amp; localName = name.localName();
</span><del>-        AtomicString prefixColonLocalName = prefix + ':' + localName;
-        QualifiedName nameWithPrefix(prefix, localName, name.namespaceURI());
-        map-&gt;add(prefixColonLocalName, nameWithPrefix);
</del><ins>+        map.add(prefix + ':' + localName, QualifiedName(prefix, localName, name.namespaceURI()));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void adjustForeignAttributes(AtomicHTMLToken* token)
</del><ins>+static HashMap&lt;AtomicString, QualifiedName&gt; createForeignAttributesMap()
</ins><span class="cx"> {
</span><del>-    static PrefixedNameToQualifiedNameMap* map = 0;
-    if (!map) {
-        map = new PrefixedNameToQualifiedNameMap;
</del><ins>+    HashMap&lt;AtomicString, QualifiedName&gt; map;
</ins><span class="cx"> 
</span><del>-        addNamesWithPrefix(map, xlinkAtom, XLinkNames::getXLinkAttrs(), XLinkNames::XLinkAttrsCount);
</del><ins>+    addNamesWithPrefix(map, xlinkAtom, XLinkNames::getXLinkAttrs(), XLinkNames::XLinkAttrsCount);
+    addNamesWithPrefix(map, xmlAtom, XMLNames::getXMLAttrs(), XMLNames::XMLAttrsCount);
</ins><span class="cx"> 
</span><del>-        addNamesWithPrefix(map, xmlAtom, XMLNames::getXMLAttrs(), XMLNames::XMLAttrsCount);
</del><ins>+    map.add(WTF::xmlnsAtom, XMLNSNames::xmlnsAttr);
+    map.add(&quot;xmlns:xlink&quot;, QualifiedName(xmlnsAtom, xlinkAtom, XMLNSNames::xmlnsNamespaceURI));
</ins><span class="cx"> 
</span><del>-        map-&gt;add(WTF::xmlnsAtom, XMLNSNames::xmlnsAttr);
-        map-&gt;add(&quot;xmlns:xlink&quot;, QualifiedName(xmlnsAtom, xlinkAtom, XMLNSNames::xmlnsNamespaceURI));
-    }
</del><ins>+    return map;
+}
</ins><span class="cx"> 
</span><del>-    for (unsigned i = 0; i &lt; token-&gt;attributes().size(); ++i) {
-        Attribute&amp; tokenAttribute = token-&gt;attributes().at(i);
-        const QualifiedName&amp; name = map-&gt;get(tokenAttribute.localName());
-        if (!name.localName().isNull())
-            tokenAttribute.parserSetName(name);
-    }
</del><ins>+static void adjustForeignAttributes(AtomicHTMLToken&amp; token)
+{
+    static NeverDestroyed&lt;HashMap&lt;AtomicString, QualifiedName&gt;&gt; map = createForeignAttributesMap();
+    adjustAttributes(map, token);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLTreeBuilder::processStartTagForInBody(AtomicHTMLToken* token)
</span><span class="lines">@@ -896,15 +887,15 @@
</span><span class="cx">     }
</span><span class="cx">     if (token-&gt;name() == MathMLNames::mathTag.localName()) {
</span><span class="cx">         m_tree.reconstructTheActiveFormattingElements();
</span><del>-        adjustMathMLAttributes(token);
-        adjustForeignAttributes(token);
</del><ins>+        adjustMathMLAttributes(*token);
+        adjustForeignAttributes(*token);
</ins><span class="cx">         m_tree.insertForeignElement(token, MathMLNames::mathmlNamespaceURI);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (token-&gt;name() == SVGNames::svgTag.localName()) {
</span><span class="cx">         m_tree.reconstructTheActiveFormattingElements();
</span><del>-        adjustSVGAttributes(token);
-        adjustForeignAttributes(token);
</del><ins>+        adjustSVGAttributes(*token);
+        adjustForeignAttributes(*token);
</ins><span class="cx">         m_tree.insertForeignElement(token, SVGNames::svgNamespaceURI);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -2926,18 +2917,18 @@
</span><span class="cx">         }
</span><span class="cx">         const AtomicString&amp; currentNamespace = m_tree.currentStackItem()-&gt;namespaceURI();
</span><span class="cx">         if (currentNamespace == MathMLNames::mathmlNamespaceURI)
</span><del>-            adjustMathMLAttributes(token);
</del><ins>+            adjustMathMLAttributes(*token);
</ins><span class="cx">         if (currentNamespace == SVGNames::svgNamespaceURI) {
</span><del>-            adjustSVGTagNameCase(token);
-            adjustSVGAttributes(token);
</del><ins>+            adjustSVGTagNameCase(*token);
+            adjustSVGAttributes(*token);
</ins><span class="cx">         }
</span><del>-        adjustForeignAttributes(token);
</del><ins>+        adjustForeignAttributes(*token);
</ins><span class="cx">         m_tree.insertForeignElement(token, currentNamespace);
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx">     case HTMLToken::EndTag: {
</span><span class="cx">         if (m_tree.currentStackItem()-&gt;namespaceURI() == SVGNames::svgNamespaceURI)
</span><del>-            adjustSVGTagNameCase(token);
</del><ins>+            adjustSVGTagNameCase(*token);
</ins><span class="cx"> 
</span><span class="cx">         if (token-&gt;name() == SVGNames::scriptTag &amp;&amp; m_tree.currentStackItem()-&gt;hasTagName(SVGNames::scriptTag)) {
</span><span class="cx">             if (scriptingContentIsAllowed(m_tree.parserContentPolicy()))
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #include &quot;InspectorCSSAgent.h&quot;
</span><span class="cx"> #include &quot;InspectorPageAgent.h&quot;
</span><span class="cx"> #include &quot;Node.h&quot;
</span><ins>+#include &quot;SVGElement.h&quot;
</ins><span class="cx"> #include &quot;SVGNames.h&quot;
</span><span class="cx"> #include &quot;StyleProperties.h&quot;
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.h (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.h        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/mathml/MathMLElement.h        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -54,6 +54,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool isPresentationMathML() const;
</span><span class="cx"> 
</span><ins>+    bool hasTagName(const MathMLQualifiedName&amp; name) const { return hasLocalName(name.localName()); }
+
</ins><span class="cx"> protected:
</span><span class="cx">     MathMLElement(const QualifiedName&amp; tagName, Document&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -63,17 +65,22 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool isPresentationAttribute(const QualifiedName&amp;) const override;
</span><span class="cx">     virtual void collectStyleForPresentationAttribute(const QualifiedName&amp;, const AtomicString&amp;, MutableStyleProperties&amp;) override;
</span><del>-private:    
</del><span class="cx"> 
</span><del>-    virtual void updateSelectedChild() { };
</del><ins>+private:
+    virtual void updateSelectedChild() { }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> void isMathMLElement(const MathMLElement&amp;); // Catch unnecessary runtime check of type known at compile time.
</span><span class="cx"> inline bool isMathMLElement(const Node&amp; node) { return node.isMathMLElement(); }
</span><span class="cx"> NODE_TYPE_CASTS(MathMLElement)
</span><span class="cx"> 
</span><ins>+inline bool Node::hasTagName(const MathMLQualifiedName&amp; name) const
+{
+    return isMathMLElement() &amp;&amp; toMathMLElement(*this).hasTagName(name);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif // ENABLE(MATHML)
</span><span class="cx"> 
</span><span class="cx"> #endif // MathMLElement_h
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLInlineContainerElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/mathml/MathMLInlineContainerElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     if (renderer()) {
</span><span class="cx">         if (renderer()-&gt;isRenderMathMLRow())
</span><span class="cx">             toRenderMathMLRow(renderer())-&gt;updateOperatorProperties();
</span><del>-        else if (hasLocalName(mathTag) || hasLocalName(msqrtTag)) {
</del><ins>+        else if (hasTagName(mathTag) || hasTagName(msqrtTag)) {
</ins><span class="cx">             auto childRenderer = renderer()-&gt;firstChild();
</span><span class="cx">             if (childRenderer &amp;&amp; childRenderer-&gt;isRenderMathMLRow())
</span><span class="cx">                 toRenderMathMLRow(childRenderer)-&gt;updateOperatorProperties();
</span><span class="lines">@@ -71,33 +71,33 @@
</span><span class="cx"> 
</span><span class="cx"> RenderPtr&lt;RenderElement&gt; MathMLInlineContainerElement::createElementRenderer(PassRef&lt;RenderStyle&gt; style)
</span><span class="cx"> {
</span><del>-    if (hasLocalName(annotation_xmlTag))
</del><ins>+    if (hasTagName(annotation_xmlTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLRow&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(merrorTag) || hasLocalName(mphantomTag) || hasLocalName(mrowTag) || hasLocalName(mstyleTag))
</del><ins>+    if (hasTagName(merrorTag) || hasTagName(mphantomTag) || hasTagName(mrowTag) || hasTagName(mstyleTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLRow&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(msubTag))
</del><ins>+    if (hasTagName(msubTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLScripts&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(msupTag))
</del><ins>+    if (hasTagName(msupTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLScripts&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(msubsupTag))
</del><ins>+    if (hasTagName(msubsupTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLScripts&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(mmultiscriptsTag))
</del><ins>+    if (hasTagName(mmultiscriptsTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLScripts&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(moverTag))
</del><ins>+    if (hasTagName(moverTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLUnderOver&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(munderTag))
</del><ins>+    if (hasTagName(munderTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLUnderOver&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(munderoverTag))
</del><ins>+    if (hasTagName(munderoverTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLUnderOver&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(mfracTag))
</del><ins>+    if (hasTagName(mfracTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLFraction&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(msqrtTag))
</del><ins>+    if (hasTagName(msqrtTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLSquareRoot&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(mrootTag))
</del><ins>+    if (hasTagName(mrootTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLRoot&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(mfencedTag))
</del><ins>+    if (hasTagName(mfencedTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLFenced&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(mtableTag))
</del><ins>+    if (hasTagName(mtableTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLTable&gt;(*this, std::move(style));
</span><span class="cx"> 
</span><span class="cx">     return createRenderer&lt;RenderMathMLBlock&gt;(*this, std::move(style));
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLSelectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLSelectElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLSelectElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MathMLSelectElement::attributeChanged(const QualifiedName&amp; name, const AtomicString&amp; oldValue, const AtomicString&amp; newValue, AttributeModificationReason reason)
</span><span class="cx"> {
</span><del>-    if (hasLocalName(mactionTag) &amp;&amp; (name == MathMLNames::actiontypeAttr || name == MathMLNames::selectionAttr))
</del><ins>+    if (hasTagName(mactionTag) &amp;&amp; (name == MathMLNames::actiontypeAttr || name == MathMLNames::selectionAttr))
</ins><span class="cx">         updateSelectedChild();
</span><span class="cx"> 
</span><span class="cx">     MathMLInlineContainerElement::attributeChanged(name, oldValue, newValue, reason);
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx"> int MathMLSelectElement::getSelectedActionChildAndIndex(Element*&amp; selectedChild)
</span><span class="cx"> {
</span><del>-    ASSERT(hasLocalName(mactionTag));
</del><ins>+    ASSERT(hasTagName(mactionTag));
</ins><span class="cx"> 
</span><span class="cx">     // We &quot;round up or down to the closest allowable value&quot; of the selection attribute, as suggested by the MathML specification.
</span><span class="cx">     selectedChild = firstElementChild();
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx"> 
</span><span class="cx"> Element* MathMLSelectElement::getSelectedActionChild()
</span><span class="cx"> {
</span><del>-    ASSERT(hasLocalName(mactionTag));
</del><ins>+    ASSERT(hasTagName(mactionTag));
</ins><span class="cx"> 
</span><span class="cx">     Element* child = firstElementChild();
</span><span class="cx">     if (!child)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> 
</span><span class="cx"> Element* MathMLSelectElement::getSelectedSemanticsChild()
</span><span class="cx"> {
</span><del>-    ASSERT(hasLocalName(semanticsTag));
</del><ins>+    ASSERT(hasTagName(semanticsTag));
</ins><span class="cx"> 
</span><span class="cx">     Element* child = firstElementChild();
</span><span class="cx">     if (!child)
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx">         if (!child-&gt;isMathMLElement())
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        if (child-&gt;hasLocalName(MathMLNames::annotationTag)) {
</del><ins>+        if (child-&gt;hasTagName(MathMLNames::annotationTag)) {
</ins><span class="cx">             // If the &lt;annotation&gt; element has an src attribute then it is a reference to arbitrary binary data and it is not clear whether we can display it. Hence we just ignore the annotation.
</span><span class="cx">             if (child-&gt;hasAttribute(MathMLNames::srcAttr))
</span><span class="cx">                 continue;
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx">             return child;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (child-&gt;hasLocalName(MathMLNames::annotation_xmlTag)) {
</del><ins>+        if (child-&gt;hasTagName(MathMLNames::annotation_xmlTag)) {
</ins><span class="cx">             // If the &lt;annotation-xml&gt; element has an src attribute then it is a reference to arbitrary binary data and it is not clear whether we can display it. Hence we just ignore the annotation.
</span><span class="cx">             if (child-&gt;hasAttribute(MathMLNames::srcAttr))
</span><span class="cx">                 continue;
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> 
</span><span class="cx"> void MathMLSelectElement::updateSelectedChild()
</span><span class="cx"> {
</span><del>-    Element* newSelectedChild = hasLocalName(mactionTag) ? getSelectedActionChild() : getSelectedSemanticsChild();
</del><ins>+    Element* newSelectedChild = hasTagName(mactionTag) ? getSelectedActionChild() : getSelectedSemanticsChild();
</ins><span class="cx"> 
</span><span class="cx">     if (m_selectedChild == newSelectedChild)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLTextElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLTextElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/mathml/MathMLTextElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -66,11 +66,11 @@
</span><span class="cx"> 
</span><span class="cx"> RenderPtr&lt;RenderElement&gt; MathMLTextElement::createElementRenderer(PassRef&lt;RenderStyle&gt; style)
</span><span class="cx"> {
</span><del>-    if (hasLocalName(MathMLNames::moTag))
</del><ins>+    if (hasTagName(MathMLNames::moTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLOperator&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(MathMLNames::miTag))
</del><ins>+    if (hasTagName(MathMLNames::miTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLToken&gt;(*this, std::move(style));
</span><del>-    if (hasLocalName(MathMLNames::mspaceTag))
</del><ins>+    if (hasTagName(MathMLNames::mspaceTag))
</ins><span class="cx">         return createRenderer&lt;RenderMathMLSpace&gt;(*this, std::move(style));
</span><span class="cx"> 
</span><span class="cx">     return MathMLElement::createElementRenderer(std::move(style));
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MathMLTextElement::childShouldCreateRenderer(const Node&amp; child) const
</span><span class="cx"> {
</span><del>-    return !hasLocalName(mspaceTag) &amp;&amp; child.isTextNode();
</del><ins>+    return !hasTagName(mspaceTag) &amp;&amp; child.isTextNode();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkPasteboardGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &quot;PasteboardHelper.h&quot;
</span><span class="cx"> #include &quot;RenderImage.h&quot;
</span><ins>+#include &quot;SVGElement.h&quot;
</ins><span class="cx"> #include &quot;SVGNames.h&quot;
</span><span class="cx"> #include &quot;XLinkNames.h&quot;
</span><span class="cx"> #include &quot;markup.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacHTMLConvertermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/HTMLConverter.mm (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/HTMLConverter.mm        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/platform/mac/HTMLConverter.mm        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #import &quot;Font.h&quot;
</span><span class="cx"> #import &quot;Frame.h&quot;
</span><span class="cx"> #import &quot;FrameLoader.h&quot;
</span><ins>+#import &quot;HTMLElement.h&quot;
</ins><span class="cx"> #import &quot;HTMLNames.h&quot;
</span><span class="cx"> #import &quot;HTMLParserIdioms.h&quot;
</span><span class="cx"> #import &quot;LoaderNSURLExtras.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;FloatingObjects.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;HitTestLocation.h&quot;
</span><span class="cx"> #include &quot;InlineTextBox.h&quot;
</span><span class="cx"> #include &quot;LayoutRepainter.h&quot;
</span><span class="lines">@@ -46,10 +47,6 @@
</span><span class="cx"> #include &quot;ShapeInsideInfo.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(IOS_TEXT_AUTOSIZING)
-#include &quot;HTMLElement.h&quot;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> bool RenderBlock::s_canPropagateFloatIntoSibling = false;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxModelObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -756,7 +756,7 @@
</span><span class="cx">                     HTMLElement* body = document().body();
</span><span class="cx">                     if (body) {
</span><span class="cx">                         // Can't scroll a frameset document anyway.
</span><del>-                        isOpaqueRoot = body-&gt;hasLocalName(framesetTag);
</del><ins>+                        isOpaqueRoot = body-&gt;hasTagName(framesetTag);
</ins><span class="cx">                     } else {
</span><span class="cx">                         // SVG documents and XML documents with SVG root nodes are transparent.
</span><span class="cx">                         isOpaqueRoot = !document().hasSVGRootNode();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -1084,7 +1084,7 @@
</span><span class="cx">         // anonymous blocks created by inline &lt;body&gt; tags etc. We can locate the &lt;body&gt;
</span><span class="cx">         // render object very easily via the DOM.
</span><span class="cx">         if (auto body = document().body()) {
</span><del>-            if (body-&gt;hasLocalName(HTMLNames::bodyTag)) {
</del><ins>+            if (body-&gt;hasTagName(HTMLNames::bodyTag)) {
</ins><span class="cx">                 if (auto renderer = body-&gt;renderer())
</span><span class="cx">                     return *renderer;
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerBackingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -1743,7 +1743,7 @@
</span><span class="cx">         
</span><span class="cx">         // Now look at the body's renderer.
</span><span class="cx">         HTMLElement* body = renderer().document().body();
</span><del>-        RenderObject* bodyObject = (body &amp;&amp; body-&gt;hasLocalName(bodyTag)) ? body-&gt;renderer() : 0;
</del><ins>+        RenderObject* bodyObject = (body &amp;&amp; body-&gt;hasTagName(bodyTag)) ? body-&gt;renderer() : 0;
</ins><span class="cx">         if (!bodyObject)
</span><span class="cx">             return false;
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderReplacedcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderReplaced.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;FloatRoundedRect.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><ins>+#include &quot;HTMLElement.h&quot;
</ins><span class="cx"> #include &quot;InlineElementBox.h&quot;
</span><span class="cx"> #include &quot;LayoutRepainter.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLScriptscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;RenderMathMLScripts.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;MathMLNames.h&quot;
</del><ins>+#include &quot;MathMLElement.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><span class="lines">@@ -61,14 +61,14 @@
</span><span class="cx">     , m_baseWrapper(0)
</span><span class="cx"> {
</span><span class="cx">     // Determine what kind of sub/sup expression we have by element name
</span><del>-    if (element.hasLocalName(MathMLNames::msubTag))
</del><ins>+    if (element.hasTagName(MathMLNames::msubTag))
</ins><span class="cx">         m_kind = Sub;
</span><del>-    else if (element.hasLocalName(MathMLNames::msupTag))
</del><ins>+    else if (element.hasTagName(MathMLNames::msupTag))
</ins><span class="cx">         m_kind = Super;
</span><del>-    else if (element.hasLocalName(MathMLNames::msubsupTag))
</del><ins>+    else if (element.hasTagName(MathMLNames::msubsupTag))
</ins><span class="cx">         m_kind = SubSup;
</span><span class="cx">     else {
</span><del>-        ASSERT(element.hasLocalName(MathMLNames::mmultiscriptsTag));
</del><ins>+        ASSERT(element.hasTagName(MathMLNames::mmultiscriptsTag));
</ins><span class="cx">         m_kind = Multiscripts;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingmathmlRenderMathMLUnderOvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/rendering/mathml/RenderMathMLUnderOver.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;RenderMathMLUnderOver.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;MathMLNames.h&quot;
</del><ins>+#include &quot;MathMLElement.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -39,12 +39,12 @@
</span><span class="cx">     : RenderMathMLBlock(element, std::move(style))
</span><span class="cx"> {
</span><span class="cx">     // Determine what kind of under/over expression we have by element name
</span><del>-    if (element.hasLocalName(MathMLNames::munderTag))
</del><ins>+    if (element.hasTagName(MathMLNames::munderTag))
</ins><span class="cx">         m_kind = Under;
</span><del>-    else if (element.hasLocalName(MathMLNames::moverTag))
</del><ins>+    else if (element.hasTagName(MathMLNames::moverTag))
</ins><span class="cx">         m_kind = Over;
</span><span class="cx">     else {
</span><del>-        ASSERT(element.hasLocalName(MathMLNames::munderoverTag));
</del><ins>+        ASSERT(element.hasTagName(MathMLNames::munderoverTag));
</ins><span class="cx">         m_kind = UnderOver;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGElement.h (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGElement.h        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/svg/SVGElement.h        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -140,6 +140,8 @@
</span><span class="cx">     virtual bool shouldMoveToFlowThread(const RenderStyle&amp;) const override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    bool hasTagName(const SVGQualifiedName&amp; name) const { return hasLocalName(name.localName()); }
+
</ins><span class="cx"> protected:
</span><span class="cx">     SVGElement(const QualifiedName&amp;, Document&amp;);
</span><span class="cx">     virtual ~SVGElement();
</span><span class="lines">@@ -213,6 +215,11 @@
</span><span class="cx"> 
</span><span class="cx"> NODE_TYPE_CASTS(SVGElement)
</span><span class="cx"> 
</span><ins>+inline bool Node::hasTagName(const SVGQualifiedName&amp; name) const
+{
+    return isSVGElement() &amp;&amp; toSVGElement(*this).hasTagName(name);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontFaceSrcElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontFaceSrcElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontFaceSrcElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/svg/SVGFontFaceSrcElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> void SVGFontFaceSrcElement::childrenChanged(const ChildChange&amp; change)
</span><span class="cx"> {
</span><span class="cx">     SVGElement::childrenChanged(change);
</span><del>-    if (parentNode() &amp;&amp; parentNode()-&gt;hasTagName(font_faceTag))
</del><ins>+    if (parentNode() &amp;&amp; isSVGFontFaceElement(parentNode()))
</ins><span class="cx">         toSVGFontFaceElement(parentNode())-&gt;rebuildFontFace();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGUseElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGUseElement.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -522,15 +522,15 @@
</span><span class="cx">     return createRenderer&lt;RenderSVGTransformableContainer&gt;(*this, std::move(style));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool isDirectReference(const Node* node)
</del><ins>+static bool isDirectReference(const SVGElement&amp; element)
</ins><span class="cx"> {
</span><del>-    return node-&gt;hasTagName(SVGNames::pathTag)
-           || node-&gt;hasTagName(SVGNames::rectTag)
-           || node-&gt;hasTagName(SVGNames::circleTag)
-           || node-&gt;hasTagName(SVGNames::ellipseTag)
-           || node-&gt;hasTagName(SVGNames::polygonTag)
-           || node-&gt;hasTagName(SVGNames::polylineTag)
-           || node-&gt;hasTagName(SVGNames::textTag);
</del><ins>+    return element.hasTagName(SVGNames::pathTag)
+        || element.hasTagName(SVGNames::rectTag)
+        || element.hasTagName(SVGNames::circleTag)
+        || element.hasTagName(SVGNames::ellipseTag)
+        || element.hasTagName(SVGNames::polygonTag)
+        || element.hasTagName(SVGNames::polylineTag)
+        || element.hasTagName(SVGNames::textTag);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SVGUseElement::toClipPath(Path&amp; path)
</span><span class="lines">@@ -541,12 +541,12 @@
</span><span class="cx">     if (!n)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (n-&gt;isSVGElement() &amp;&amp; toSVGElement(n)-&gt;isSVGGraphicsElement()) {
-        if (!isDirectReference(n))
</del><ins>+    if (n-&gt;isSVGElement() &amp;&amp; toSVGElement(*n).isSVGGraphicsElement()) {
+        if (!isDirectReference(toSVGElement(*n))) {
</ins><span class="cx">             // Spec: Indirect references are an error (14.3.5)
</span><span class="cx">             document().accessSVGExtensions()-&gt;reportError(&quot;Not allowed to use indirect reference in &lt;clip-path&gt;&quot;);
</span><del>-        else {
-            toSVGGraphicsElement(n)-&gt;toClipPath(path);
</del><ins>+        } else {
+            toSVGGraphicsElement(*n).toClipPath(path);
</ins><span class="cx">             // FIXME: Avoid manual resolution of x/y here. Its potentially harmful.
</span><span class="cx">             SVGLengthContext lengthContext(this);
</span><span class="cx">             path.translate(FloatSize(x().value(lengthContext), y().value(lengthContext)));
</span><span class="lines">@@ -557,14 +557,17 @@
</span><span class="cx"> 
</span><span class="cx"> RenderElement* SVGUseElement::rendererClipChild() const
</span><span class="cx"> {
</span><del>-    Node* n = m_targetElementInstance ? m_targetElementInstance-&gt;shadowTreeElement() : 0;
-    if (!n)
-        return 0;
</del><ins>+    if (!m_targetElementInstance)
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    if (n-&gt;isSVGElement() &amp;&amp; isDirectReference(n))
-        return toSVGElement(n)-&gt;renderer();
</del><ins>+    auto* element = m_targetElementInstance-&gt;shadowTreeElement();
+    if (!element)
+        return nullptr;
</ins><span class="cx"> 
</span><del>-    return 0;
</del><ins>+    if (!isDirectReference(*element))
+        return nullptr;
+
+    return element-&gt;renderer();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SVGUseElement::buildInstanceTree(SVGElement* target, SVGElementInstance* targetInstance, bool&amp; foundProblem, bool foundUse)
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -275,17 +275,16 @@
</span><span class="cx">     // FIXME: We need to implement the HTML5 XML Fragment parsing algorithm:
</span><span class="cx">     // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#xml-fragment-parsing-algorithm
</span><span class="cx">     // For now we have a hack for script/style innerHTML support:
</span><del>-    if (contextElement &amp;&amp; (contextElement-&gt;hasLocalName(HTMLNames::scriptTag) || contextElement-&gt;hasLocalName(HTMLNames::styleTag))) {
</del><ins>+    if (contextElement &amp;&amp; (contextElement-&gt;hasLocalName(HTMLNames::scriptTag.localName()) || contextElement-&gt;hasLocalName(HTMLNames::styleTag.localName()))) {
</ins><span class="cx">         fragment.parserAppendChild(fragment.document().createTextNode(chunk));
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;XMLDocumentParser&gt; parser = XMLDocumentParser::create(fragment, contextElement, parserContentPolicy);
</span><span class="cx">     bool wellFormed = parser-&gt;appendFragmentSource(chunk);
</span><del>-    // Do not call finish().  Current finish() and doEnd() implementations touch the main Document/loader
-    // and can cause crashes in the fragment case.
</del><ins>+    // Do not call finish(). The finish() and doEnd() implementations touch the main document and loader and can cause crashes in the fragment case.
</ins><span class="cx">     parser-&gt;detach(); // Allows ~DocumentParser to assert it was detached before destruction.
</span><del>-    return wellFormed; // appendFragmentSource()'s wellFormed is more permissive than wellFormed().
</del><ins>+    return wellFormed; // appendFragmentSource()'s wellFormed is more permissive than Document::wellFormed().
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebKit/ChangeLog        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-03-16  Darin Adler  &lt;darin@apple.com&gt;
+
+        Optimize hasTagName when called on an HTMLElement
+        https://bugs.webkit.org/show_bug.cgi?id=130090
+
+        Reviewed by Antti Koivisto.
+
+        * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
+        Updated exports for QualifiedName -&gt; HTMLQualifiedName change.
+
</ins><span class="cx"> 2014-03-14  Maciej Stachowiak  &lt;mjs@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Replace &quot;Apple Computer, Inc.&quot; with &quot;Apple Inc.&quot; in copyright headers
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitExportGeneratorWebKitExportsdefin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (165698 => 165699)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in        2014-03-16 15:15:57 UTC (rev 165698)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in        2014-03-16 16:38:58 UTC (rev 165699)
</span><span class="lines">@@ -207,10 +207,10 @@
</span><span class="cx">         symbolWithPointer(?getElementById@TreeScope@WebCore@@QBEPAVElement@2@ABVString@WTF@@@Z, ?getElementById@TreeScope@WebCore@@QEBAPEAVElement@2@AEBVString@WTF@@@Z)
</span><span class="cx">         symbolWithPointer(?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPAVNode@2@PBVRange@2@AAI2@Z, ?getLocationAndLengthFromRange@TextIterator@WebCore@@SA_NPEAVNode@2@PEBVRange@2@AEA_K2@Z)
</span><span class="cx">         symbolWithPointer(?hitTest@RenderView@WebCore@@QAE_NABVHitTestRequest@2@AAVHitTestResult@2@@Z, ?hitTest@RenderView@WebCore@@QEAA_NAEBVHitTestRequest@2@AEAVHitTestResult@2@@Z)
</span><del>-        ?inputTag@HTMLNames@WebCore@@3VQualifiedName@2@B
</del><ins>+        ?inputTag@HTMLNames@WebCore@@3VHTMLQualifiedName@2@B
</ins><span class="cx">         symbolWithPointer(?intersects@IntRect@WebCore@@QBE_NABV12@@Z, ?intersects@IntRect@WebCore@@QEBA_NAEBV12@@Z)
</span><span class="cx">         symbolWithPointer(?item@StaticNodeList@WebCore@@UBEPAVNode@2@I@Z, ?item@StaticNodeList@WebCore@@UEBAPEAVNode@2@I@Z)
</span><del>-        ?selectTag@HTMLNames@WebCore@@3VQualifiedName@2@B
</del><ins>+        ?selectTag@HTMLNames@WebCore@@3VHTMLQualifiedName@2@B
</ins><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">         symbolWithPointer(?buildObjectForHighlightedNode@InspectorController@WebCore@@QBE?AV?$PassRefPtr@VInspectorObject@Inspector@@@WTF@@XZ, ?buildObjectForHighlightedNode@InspectorController@WebCore@@QEBA?AV?$PassRefPtr@VInspectorObject@Inspector@@@WTF@@XZ)
</span><span class="cx">         symbolWithPointer(?getHighlight@InspectorController@WebCore@@QBEXPAUHighlight@2@@Z, ?getHighlight@InspectorController@WebCore@@QEBAXPEAUHighlight@2@@Z)
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx">         symbolWithPointer(?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ, ?suggestedValue@HTMLInputElement@WebCore@@QEBAAEBVString@WTF@@XZ)
</span><span class="cx">         symbolWithPointer(?target@HistoryItem@WebCore@@QBEABVString@WTF@@XZ, ?target@HistoryItem@WebCore@@QEBAAEBVString@WTF@@XZ)
</span><span class="cx">         symbolWithPointer(?text@Range@WebCore@@QBE?AVString@WTF@@XZ, ?text@Range@WebCore@@QEBA?AVString@WTF@@XZ)
</span><del>-        ?textareaTag@HTMLNames@WebCore@@3VQualifiedName@2@B
</del><ins>+        ?textareaTag@HTMLNames@WebCore@@3VHTMLQualifiedName@2@B
</ins><span class="cx">         symbolWithPointer(?textContent@Node@WebCore@@QBE?AVString@WTF@@_N@Z, ?textContent@Node@WebCore@@QEBA?AVString@WTF@@_N@Z)
</span><span class="cx">         symbolWithPointer(?toDocument@WebCore@@YAPAVDocument@1@VJSValue@JSC@@@Z, ?toDocument@WebCore@@YAPEAVDocument@1@VJSValue@JSC@@@Z)
</span><span class="cx">         symbolWithPointer(?toDOMStringList@WebCore@@YA?AV?$PassRefPtr@VDOMStringList@WebCore@@@WTF@@PAVExecState@JSC@@VJSValue@5@@Z, ?toDOMStringList@WebCore@@YA?AV?$PassRefPtr@VDOMStringList@WebCore@@@WTF@@PEAVExecState@JSC@@VJSValue@5@@Z)
</span></span></pre>
</div>
</div>

</body>
</html>