<!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>[170809] trunk/Source/WebCore</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/170809">170809</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2014-07-04 12:54:43 -0700 (Fri, 04 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>CTTE: ScriptElement always has a HTTPScriptElement or SVGScriptElement.
&lt;https://webkit.org/b/134637&gt;

Have ScriptElement store the pointer to the more specific subclass
element as a reference. Also made the constructor protected since
nobody should instantiate ScriptElement directly.

Reviewed by Antti Koivisto.

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::childrenChanged):
(WebCore::ScriptElement::dispatchErrorEvent):
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::requestScript):
(WebCore::ScriptElement::executeScript):
(WebCore::ScriptElement::notifyFinished):
(WebCore::ScriptElement::ignoresLoadRequest):
(WebCore::ScriptElement::scriptContent):
* dom/ScriptElement.h:
(WebCore::ScriptElement::element):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::queueScriptForExecution):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::HTMLScriptElement):
* svg/SVGScriptElement.cpp:
(WebCore::SVGScriptElement::SVGScriptElement):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomScriptElementcpp">trunk/Source/WebCore/dom/ScriptElement.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptElementh">trunk/Source/WebCore/dom/ScriptElement.h</a></li>
<li><a href="#trunkSourceWebCoredomScriptRunnercpp">trunk/Source/WebCore/dom/ScriptRunner.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLScriptElementcpp">trunk/Source/WebCore/html/HTMLScriptElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGScriptElementcpp">trunk/Source/WebCore/svg/SVGScriptElement.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170808 => 170809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-07-04 19:12:25 UTC (rev 170808)
+++ trunk/Source/WebCore/ChangeLog        2014-07-04 19:54:43 UTC (rev 170809)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2014-07-04  Andreas Kling  &lt;akling@apple.com&gt;
+
+        CTTE: ScriptElement always has a HTTPScriptElement or SVGScriptElement.
+        &lt;https://webkit.org/b/134637&gt;
+
+        Have ScriptElement store the pointer to the more specific subclass
+        element as a reference. Also made the constructor protected since
+        nobody should instantiate ScriptElement directly.
+
+        Reviewed by Antti Koivisto.
+
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::ScriptElement):
+        (WebCore::ScriptElement::childrenChanged):
+        (WebCore::ScriptElement::dispatchErrorEvent):
+        (WebCore::ScriptElement::prepareScript):
+        (WebCore::ScriptElement::requestScript):
+        (WebCore::ScriptElement::executeScript):
+        (WebCore::ScriptElement::notifyFinished):
+        (WebCore::ScriptElement::ignoresLoadRequest):
+        (WebCore::ScriptElement::scriptContent):
+        * dom/ScriptElement.h:
+        (WebCore::ScriptElement::element):
+        * dom/ScriptRunner.cpp:
+        (WebCore::ScriptRunner::queueScriptForExecution):
+        * html/HTMLScriptElement.cpp:
+        (WebCore::HTMLScriptElement::HTMLScriptElement):
+        * svg/SVGScriptElement.cpp:
+        (WebCore::SVGScriptElement::SVGScriptElement):
+
</ins><span class="cx"> 2014-07-04  Julien Quint  &lt;pom@graougraou.com&gt;
</span><span class="cx"> 
</span><span class="cx">         input type=range element should only fire change events after committing a  value
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptElement.cpp (170808 => 170809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptElement.cpp        2014-07-04 19:12:25 UTC (rev 170808)
+++ trunk/Source/WebCore/dom/ScriptElement.cpp        2014-07-04 19:54:43 UTC (rev 170809)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-ScriptElement::ScriptElement(Element* element, bool parserInserted, bool alreadyStarted)
</del><ins>+ScriptElement::ScriptElement(Element&amp; element, bool parserInserted, bool alreadyStarted)
</ins><span class="cx">     : m_element(element)
</span><span class="cx">     , m_cachedScript(0)
</span><span class="cx">     , m_startLineNumber(WTF::OrdinalNumber::beforeFirst())
</span><span class="lines">@@ -70,9 +70,8 @@
</span><span class="cx">     , m_willExecuteInOrder(false)
</span><span class="cx">     , m_requestUsesAccessControl(false)
</span><span class="cx"> {
</span><del>-    ASSERT(m_element);
-    if (parserInserted &amp;&amp; m_element-&gt;document().scriptableDocumentParser() &amp;&amp; !m_element-&gt;document().isInDocumentWrite())
-        m_startLineNumber = m_element-&gt;document().scriptableDocumentParser()-&gt;textPosition().m_line;
</del><ins>+    if (parserInserted &amp;&amp; m_element.document().scriptableDocumentParser() &amp;&amp; !m_element.document().isInDocumentWrite())
+        m_startLineNumber = m_element.document().scriptableDocumentParser()-&gt;textPosition().m_line;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScriptElement::~ScriptElement()
</span><span class="lines">@@ -88,7 +87,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ScriptElement::childrenChanged()
</span><span class="cx"> {
</span><del>-    if (!m_parserInserted &amp;&amp; m_element-&gt;inDocument())
</del><ins>+    if (!m_parserInserted &amp;&amp; m_element.inDocument())
</ins><span class="cx">         prepareScript(); // FIXME: Provide a real starting line number here.
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -138,7 +137,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ScriptElement::dispatchErrorEvent()
</span><span class="cx"> {
</span><del>-    m_element-&gt;dispatchEvent(Event::create(eventNames().errorEvent, false, false));
</del><ins>+    m_element.dispatchEvent(Event::create(eventNames().errorEvent, false, false));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ScriptElement::isScriptTypeSupported(LegacyTypeSupport supportLegacyTypes) const
</span><span class="lines">@@ -177,10 +176,10 @@
</span><span class="cx">         m_forceAsync = true;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: HTML5 spec says we should check that all children are either comments or empty text nodes.
</span><del>-    if (!hasSourceAttribute() &amp;&amp; !m_element-&gt;firstChild())
</del><ins>+    if (!hasSourceAttribute() &amp;&amp; !m_element.firstChild())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!m_element-&gt;inDocument())
</del><ins>+    if (!m_element.inDocument())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!isScriptTypeSupported(supportLegacyTypes))
</span><span class="lines">@@ -194,7 +193,7 @@
</span><span class="cx">     m_alreadyStarted = true;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: If script is parser inserted, verify it's still in the original document.
</span><del>-    Document&amp; document = m_element-&gt;document();
</del><ins>+    Document&amp; document = m_element.document();
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Eventually we'd like to evaluate scripts which are inserted into a
</span><span class="cx">     // viewless document but this'll do for now.
</span><span class="lines">@@ -230,7 +229,7 @@
</span><span class="cx">         document.scriptRunner()-&gt;queueScriptForExecution(this, m_cachedScript, ScriptRunner::IN_ORDER_EXECUTION);
</span><span class="cx">         m_cachedScript-&gt;addClient(this);
</span><span class="cx">     } else if (hasSourceAttribute()) {
</span><del>-        m_element-&gt;document().scriptRunner()-&gt;queueScriptForExecution(this, m_cachedScript, ScriptRunner::ASYNC_EXECUTION);
</del><ins>+        m_element.document().scriptRunner()-&gt;queueScriptForExecution(this, m_cachedScript, ScriptRunner::ASYNC_EXECUTION);
</ins><span class="cx">         m_cachedScript-&gt;addClient(this);
</span><span class="cx">     } else {
</span><span class="cx">         // Reset line numbering for nested writes.
</span><span class="lines">@@ -243,28 +242,28 @@
</span><span class="cx"> 
</span><span class="cx"> bool ScriptElement::requestScript(const String&amp; sourceUrl)
</span><span class="cx"> {
</span><del>-    Ref&lt;Document&gt; originalDocument(m_element-&gt;document());
-    if (!m_element-&gt;dispatchBeforeLoadEvent(sourceUrl))
</del><ins>+    Ref&lt;Document&gt; originalDocument(m_element.document());
+    if (!m_element.dispatchBeforeLoadEvent(sourceUrl))
</ins><span class="cx">         return false;
</span><del>-    if (!m_element-&gt;inDocument() || &amp;m_element-&gt;document() != &amp;originalDocument.get())
</del><ins>+    if (!m_element.inDocument() || &amp;m_element.document() != &amp;originalDocument.get())
</ins><span class="cx">         return false;
</span><del>-    if (!m_element-&gt;document().contentSecurityPolicy()-&gt;allowScriptNonce(m_element-&gt;fastGetAttribute(HTMLNames::nonceAttr), m_element-&gt;document().url(), m_startLineNumber, m_element-&gt;document().completeURL(sourceUrl)))
</del><ins>+    if (!m_element.document().contentSecurityPolicy()-&gt;allowScriptNonce(m_element.fastGetAttribute(HTMLNames::nonceAttr), m_element.document().url(), m_startLineNumber, m_element.document().completeURL(sourceUrl)))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!m_cachedScript);
</span><span class="cx">     if (!stripLeadingAndTrailingHTMLSpaces(sourceUrl).isEmpty()) {
</span><del>-        CachedResourceRequest request(ResourceRequest(m_element-&gt;document().completeURL(sourceUrl)));
</del><ins>+        CachedResourceRequest request(ResourceRequest(m_element.document().completeURL(sourceUrl)));
</ins><span class="cx"> 
</span><del>-        String crossOriginMode = m_element-&gt;fastGetAttribute(HTMLNames::crossoriginAttr);
</del><ins>+        String crossOriginMode = m_element.fastGetAttribute(HTMLNames::crossoriginAttr);
</ins><span class="cx">         if (!crossOriginMode.isNull()) {
</span><span class="cx">             m_requestUsesAccessControl = true;
</span><span class="cx">             StoredCredentials allowCredentials = equalIgnoringCase(crossOriginMode, &quot;use-credentials&quot;) ? AllowStoredCredentials : DoNotAllowStoredCredentials;
</span><del>-            updateRequestForAccessControl(request.mutableResourceRequest(), m_element-&gt;document().securityOrigin(), allowCredentials);
</del><ins>+            updateRequestForAccessControl(request.mutableResourceRequest(), m_element.document().securityOrigin(), allowCredentials);
</ins><span class="cx">         }
</span><span class="cx">         request.setCharset(scriptCharset());
</span><del>-        request.setInitiator(element());
</del><ins>+        request.setInitiator(&amp;element());
</ins><span class="cx"> 
</span><del>-        m_cachedScript = m_element-&gt;document().cachedResourceLoader()-&gt;requestScript(request);
</del><ins>+        m_cachedScript = m_element.document().cachedResourceLoader()-&gt;requestScript(request);
</ins><span class="cx">         m_isExternalScript = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -283,23 +282,23 @@
</span><span class="cx">     if (sourceCode.isEmpty())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!m_element-&gt;document().contentSecurityPolicy()-&gt;allowScriptNonce(m_element-&gt;fastGetAttribute(HTMLNames::nonceAttr), m_element-&gt;document().url(), m_startLineNumber))
</del><ins>+    if (!m_element.document().contentSecurityPolicy()-&gt;allowScriptNonce(m_element.fastGetAttribute(HTMLNames::nonceAttr), m_element.document().url(), m_startLineNumber))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!m_isExternalScript &amp;&amp; !m_element-&gt;document().contentSecurityPolicy()-&gt;allowInlineScript(m_element-&gt;document().url(), m_startLineNumber))
</del><ins>+    if (!m_isExternalScript &amp;&amp; !m_element.document().contentSecurityPolicy()-&gt;allowInlineScript(m_element.document().url(), m_startLineNumber))
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NOSNIFF)
</span><span class="cx">     if (m_isExternalScript &amp;&amp; m_cachedScript &amp;&amp; !m_cachedScript-&gt;mimeTypeAllowedByNosniff()) {
</span><del>-        m_element-&gt;document().addConsoleMessage(MessageSource::Security, MessageLevel::Error, &quot;Refused to execute script from '&quot; + m_cachedScript-&gt;url().stringCenterEllipsizedToLength() + &quot;' because its MIME type ('&quot; + m_cachedScript-&gt;mimeType() + &quot;') is not executable, and strict MIME type checking is enabled.&quot;);
</del><ins>+        m_element.document().addConsoleMessage(MessageSource::Security, MessageLevel::Error, &quot;Refused to execute script from '&quot; + m_cachedScript-&gt;url().stringCenterEllipsizedToLength() + &quot;' because its MIME type ('&quot; + m_cachedScript-&gt;mimeType() + &quot;') is not executable, and strict MIME type checking is enabled.&quot;);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    Ref&lt;Document&gt; document(m_element-&gt;document());
</del><ins>+    Ref&lt;Document&gt; document(m_element.document());
</ins><span class="cx">     if (Frame* frame = document-&gt;frame()) {
</span><span class="cx">         IgnoreDestructiveWriteCountIncrementer ignoreDesctructiveWriteCountIncrementer(m_isExternalScript ? &amp;document.get() : 0);
</span><del>-        CurrentScriptIncrementer currentScriptIncrementer(&amp;document.get(), m_element);
</del><ins>+        CurrentScriptIncrementer currentScriptIncrementer(&amp;document.get(), &amp;m_element);
</ins><span class="cx"> 
</span><span class="cx">         // Create a script from the script element node, using the script
</span><span class="cx">         // block's source and the script block's type.
</span><span class="lines">@@ -343,26 +342,26 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (m_requestUsesAccessControl
</span><del>-        &amp;&amp; !m_element-&gt;document().securityOrigin()-&gt;canRequest(m_cachedScript-&gt;response().url())
-        &amp;&amp; !m_cachedScript-&gt;passesAccessControlCheck(m_element-&gt;document().securityOrigin())) {
</del><ins>+        &amp;&amp; !m_element.document().securityOrigin()-&gt;canRequest(m_cachedScript-&gt;response().url())
+        &amp;&amp; !m_cachedScript-&gt;passesAccessControlCheck(m_element.document().securityOrigin())) {
</ins><span class="cx"> 
</span><span class="cx">         dispatchErrorEvent();
</span><span class="cx">         DEPRECATED_DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral(&quot;Cross-origin script load denied by Cross-Origin Resource Sharing policy.&quot;)));
</span><del>-        m_element-&gt;document().addConsoleMessage(MessageSource::JS, MessageLevel::Error, consoleMessage);
</del><ins>+        m_element.document().addConsoleMessage(MessageSource::JS, MessageLevel::Error, consoleMessage);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (m_willExecuteInOrder)
</span><del>-        m_element-&gt;document().scriptRunner()-&gt;notifyScriptReady(this, ScriptRunner::IN_ORDER_EXECUTION);
</del><ins>+        m_element.document().scriptRunner()-&gt;notifyScriptReady(this, ScriptRunner::IN_ORDER_EXECUTION);
</ins><span class="cx">     else
</span><del>-        m_element-&gt;document().scriptRunner()-&gt;notifyScriptReady(this, ScriptRunner::ASYNC_EXECUTION);
</del><ins>+        m_element.document().scriptRunner()-&gt;notifyScriptReady(this, ScriptRunner::ASYNC_EXECUTION);
</ins><span class="cx"> 
</span><span class="cx">     m_cachedScript = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ScriptElement::ignoresLoadRequest() const
</span><span class="cx"> {
</span><del>-    return m_alreadyStarted || m_isExternalScript || m_parserInserted || !m_element-&gt;inDocument();
</del><ins>+    return m_alreadyStarted || m_isExternalScript || m_parserInserted || !m_element.inDocument();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ScriptElement::isScriptForEventSupported() const
</span><span class="lines">@@ -383,7 +382,7 @@
</span><span class="cx"> 
</span><span class="cx"> String ScriptElement::scriptContent() const
</span><span class="cx"> {
</span><del>-    return TextNodeTraversal::contentsAsString(m_element);
</del><ins>+    return TextNodeTraversal::contentsAsString(&amp;m_element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScriptElement* toScriptElementIfPossible(Element* element)
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptElement.h (170808 => 170809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptElement.h        2014-07-04 19:12:25 UTC (rev 170808)
+++ trunk/Source/WebCore/dom/ScriptElement.h        2014-07-04 19:54:43 UTC (rev 170809)
</span><span class="lines">@@ -36,10 +36,10 @@
</span><span class="cx"> 
</span><span class="cx"> class ScriptElement : private CachedResourceClient {
</span><span class="cx"> public:
</span><del>-    ScriptElement(Element*, bool createdByParser, bool isEvaluated);
</del><span class="cx">     virtual ~ScriptElement();
</span><span class="cx"> 
</span><del>-    Element* element() const { return m_element; }
</del><ins>+    Element&amp; element() { return m_element; }
+    const Element&amp; element() const { return m_element; }
</ins><span class="cx"> 
</span><span class="cx">     enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeInTypeAttribute };
</span><span class="cx">     bool prepareScript(const TextPosition&amp; scriptStartPosition = TextPosition::minimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
</span><span class="lines">@@ -61,6 +61,8 @@
</span><span class="cx">     CachedResourceHandle&lt;CachedScript&gt; cachedScript() { return m_cachedScript; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><ins>+    ScriptElement(Element&amp;, bool createdByParser, bool isEvaluated);
+
</ins><span class="cx">     void setHaveFiredLoadEvent(bool haveFiredLoad) { m_haveFiredLoad = haveFiredLoad; }
</span><span class="cx">     bool isParserInserted() const { return m_parserInserted; }
</span><span class="cx">     bool alreadyStarted() const { return m_alreadyStarted; }
</span><span class="lines">@@ -91,7 +93,7 @@
</span><span class="cx">     virtual bool deferAttributeValue() const = 0;
</span><span class="cx">     virtual bool hasSourceAttribute() const = 0;
</span><span class="cx"> 
</span><del>-    Element* m_element;
</del><ins>+    Element&amp; m_element;
</ins><span class="cx">     CachedResourceHandle&lt;CachedScript&gt; m_cachedScript;
</span><span class="cx">     WTF::OrdinalNumber m_startLineNumber;
</span><span class="cx">     bool m_parserInserted : 1;
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptRunnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptRunner.cpp (170808 => 170809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptRunner.cpp        2014-07-04 19:12:25 UTC (rev 170808)
+++ trunk/Source/WebCore/dom/ScriptRunner.cpp        2014-07-04 19:54:43 UTC (rev 170809)
</span><span class="lines">@@ -54,19 +54,18 @@
</span><span class="cx">     ASSERT(scriptElement);
</span><span class="cx">     ASSERT(cachedScript.get());
</span><span class="cx"> 
</span><del>-    Element* element = scriptElement-&gt;element();
-    ASSERT(element);
-    ASSERT(element-&gt;inDocument());
</del><ins>+    Element&amp; element = scriptElement-&gt;element();
+    ASSERT(element.inDocument());
</ins><span class="cx"> 
</span><span class="cx">     m_document.incrementLoadEventDelayCount();
</span><span class="cx"> 
</span><span class="cx">     switch (executionType) {
</span><span class="cx">     case ASYNC_EXECUTION:
</span><del>-        m_pendingAsyncScripts.add(scriptElement, PendingScript(element, cachedScript.get()));
</del><ins>+        m_pendingAsyncScripts.add(scriptElement, PendingScript(&amp;element, cachedScript.get()));
</ins><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case IN_ORDER_EXECUTION:
</span><del>-        m_scriptsToExecuteInOrder.append(PendingScript(element, cachedScript.get()));
</del><ins>+        m_scriptsToExecuteInOrder.append(PendingScript(&amp;element, cachedScript.get()));
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLScriptElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLScriptElement.cpp (170808 => 170809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLScriptElement.cpp        2014-07-04 19:12:25 UTC (rev 170808)
+++ trunk/Source/WebCore/html/HTMLScriptElement.cpp        2014-07-04 19:54:43 UTC (rev 170809)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline HTMLScriptElement::HTMLScriptElement(const QualifiedName&amp; tagName, Document&amp; document, bool wasInsertedByParser, bool alreadyStarted)
</span><span class="cx">     : HTMLElement(tagName, document)
</span><del>-    , ScriptElement(this, wasInsertedByParser, alreadyStarted)
</del><ins>+    , ScriptElement(*this, wasInsertedByParser, alreadyStarted)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(hasTagName(scriptTag));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGScriptElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGScriptElement.cpp (170808 => 170809)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGScriptElement.cpp        2014-07-04 19:12:25 UTC (rev 170808)
+++ trunk/Source/WebCore/svg/SVGScriptElement.cpp        2014-07-04 19:54:43 UTC (rev 170809)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline SVGScriptElement::SVGScriptElement(const QualifiedName&amp; tagName, Document&amp; document, bool wasInsertedByParser, bool alreadyStarted)
</span><span class="cx">     : SVGElement(tagName, document)
</span><del>-    , ScriptElement(this, wasInsertedByParser, alreadyStarted)
</del><ins>+    , ScriptElement(*this, wasInsertedByParser, alreadyStarted)
</ins><span class="cx">     , m_svgLoadEventTimer(this, &amp;SVGElement::svgLoadEventTimerFired)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(hasTagName(SVGNames::scriptTag));
</span></span></pre>
</div>
</div>

</body>
</html>