<!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>[203104] trunk</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/203104">203104</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-07-11 21:28:16 -0700 (Mon, 11 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add support for @href attribute in MathML
https://bugs.webkit.org/show_bug.cgi?id=85733

Patch by Frederic Wang &lt;fwang@igalia.com&gt; on 2016-07-11
Reviewed by Brent Fulgham.

Source/WebCore:

We add support for the href attribute from MathML 3 but ignore the deprecated XLink version.
We also use the code from HTMLAnchorElement SVGAElement to make MathMLElement with a href
attribute behave as a link.
Finally, we adjust mathml.css based on rules from the html and svg user agent stylesheets.

Tests: mathml/mathml-in-html5/href-click-1.html
       mathml/mathml-in-html5/href-click-2.html
       mathml/presentation/href-enter.html
       mathml/presentation/href-style.html
       mathml/presentation/maction-toggle-href.html
       mathml/presentation/semantics-href.html

* css/mathml.css:
(:any-link): Set color and mouse cursor of links.
(:any-link:active): Set color of active links.
(:focus): Set outline of focused links.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::parseAttribute): Parse the href attribute.
(WebCore::MathMLElement::willRespondToMouseClickEvents): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::defaultEventHandler): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::canStartSelection): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::isFocusable): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::isKeyboardFocusable): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::isMouseFocusable): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::isURLAttribute): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::supportsFocus): Based on HTMLAnchorElement/SVGAElement.
(WebCore::MathMLElement::tabIndex): Based on HTMLAnchorElement/SVGAElement.
* mathml/MathMLElement.h: Define new members.
* mathml/MathMLSelectElement.cpp:
(WebCore::MathMLSelectElement::willRespondToMouseClickEvents): We also verify whether
the parent class will respond.
* mathml/mathattrs.in: Add href attribute.

LayoutTests:

We import some tests from the MathML in HTML5 test suite to
test clicks on href attributes and write similar tests.
We also test tab/enter keys and user agent style with links.

* mathml/mathml-in-html5/href-click-1.html: Added. Verify mouse click on a MathML link.
* mathml/mathml-in-html5/href-click-1-expected.html: Added.
* mathml/mathml-in-html5/href-click-2.html: Added.
Verify mouse click on a descendant of a MathML link.
* mathml/mathml-in-html5/href-click-2-expected.html: Added.
* mathml/presentation/href-enter.html: Added.
Verify tab navigation and activing link with enter.
* mathml/presentation/href-enter-expected.html: Added.
* mathml/presentation/href-style.html: Added.
Verify default style of links and of focused links.
* mathml/presentation/href-style-expected.html: Added.
* mathml/presentation/maction-toggle-href.html: Added.
Verify conflicts between maction toggle and href link.
* mathml/presentation/maction-toggle-href-expected.html: Added.
* mathml/presentation/semantics-href.html: Added. Verify mouse click on a &lt;semantics&gt; link.
* mathml/presentation/semantics-href-expected.html: Added.
* platform/mac/TestExpectations: Disable MathML link tests that rely on keyboard events.
* platform/ios-simulator/TestExpectations: Ditto.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssmathmlcss">trunk/Source/WebCore/css/mathml.css</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementcpp">trunk/Source/WebCore/mathml/MathMLElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLElementh">trunk/Source/WebCore/mathml/MathMLElement.h</a></li>
<li><a href="#trunkSourceWebCoremathmlMathMLSelectElementcpp">trunk/Source/WebCore/mathml/MathMLSelectElement.cpp</a></li>
<li><a href="#trunkSourceWebCoremathmlmathattrsin">trunk/Source/WebCore/mathml/mathattrs.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/</li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5mathmlrelationshtml5treehrefclick1expectedhtml">trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5mathmlrelationshtml5treehrefclick1html">trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1.html</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5mathmlrelationshtml5treehrefclick2expectedhtml">trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2-expected.html</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5mathmlrelationshtml5treehrefclick2html">trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationhrefenterexpectedhtml">trunk/LayoutTests/mathml/presentation/href-enter-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationhrefenterhtml">trunk/LayoutTests/mathml/presentation/href-enter.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationhrefstyleexpectedhtml">trunk/LayoutTests/mathml/presentation/href-style-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationhrefstylehtml">trunk/LayoutTests/mathml/presentation/href-style.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmactiontogglehrefexpectedhtml">trunk/LayoutTests/mathml/presentation/maction-toggle-href-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationmactiontogglehrefhtml">trunk/LayoutTests/mathml/presentation/maction-toggle-href.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationsemanticshrefexpectedhtml">trunk/LayoutTests/mathml/presentation/semantics-href-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationsemanticshrefhtml">trunk/LayoutTests/mathml/presentation/semantics-href.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/LayoutTests/ChangeLog        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -1,5 +1,35 @@
</span><span class="cx"> 2016-07-11  Frederic Wang  &lt;fwang@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        Add support for @href attribute in MathML
+        https://bugs.webkit.org/show_bug.cgi?id=85733
+
+        Reviewed by Brent Fulgham.
+
+        We import some tests from the MathML in HTML5 test suite to
+        test clicks on href attributes and write similar tests.
+        We also test tab/enter keys and user agent style with links.
+
+        * mathml/mathml-in-html5/href-click-1.html: Added. Verify mouse click on a MathML link.
+        * mathml/mathml-in-html5/href-click-1-expected.html: Added.
+        * mathml/mathml-in-html5/href-click-2.html: Added.
+        Verify mouse click on a descendant of a MathML link.
+        * mathml/mathml-in-html5/href-click-2-expected.html: Added.
+        * mathml/presentation/href-enter.html: Added.
+        Verify tab navigation and activing link with enter.
+        * mathml/presentation/href-enter-expected.html: Added.
+        * mathml/presentation/href-style.html: Added.
+        Verify default style of links and of focused links.
+        * mathml/presentation/href-style-expected.html: Added.
+        * mathml/presentation/maction-toggle-href.html: Added.
+        Verify conflicts between maction toggle and href link.
+        * mathml/presentation/maction-toggle-href-expected.html: Added.
+        * mathml/presentation/semantics-href.html: Added. Verify mouse click on a &lt;semantics&gt; link.
+        * mathml/presentation/semantics-href-expected.html: Added.
+        * platform/mac/TestExpectations: Disable MathML link tests that rely on keyboard events.
+        * platform/ios-simulator/TestExpectations: Ditto.
+
+2016-07-11  Frederic Wang  &lt;fwang@igalia.com&gt;
+
</ins><span class="cx">         Replace reftest mathml/presentation/fractions-positions.html with script tests
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=159558
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5mathmlrelationshtml5treehrefclick1expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1-expected.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1-expected.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href click (reference)&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; background: green&quot;&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsimportedmathmlinhtml5mathmlrelationshtml5treehrefclick1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1.html                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href click&lt;/title&gt;
+&lt;link rel=&quot;help&quot; href=&quot;http://www.mathml-association.org/MathMLinHTML5/S2.html#SS2&quot;&gt;
+&lt;link rel=&quot;match&quot; href=&quot;href-click-ref.html&quot;/&gt;
+&lt;meta name=&quot;assert&quot; content=&quot;Verify that a click on a link moves to the target.&quot;&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+  function test()
+  {
+    var event = new MouseEvent('click', {bubbles: true, cancelable: true});
+    document.getElementById('link').dispatchEvent(event);
+  }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;test()&quot;&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; overflow: hidden&quot;&gt;
+    &lt;math style=&quot;padding: 0&quot;&gt;
+      &lt;mrow id=&quot;link&quot; href=&quot;#target&quot;&gt;
+        &lt;mspace id=&quot;space&quot; width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;red&quot;/&gt;
+      &lt;/mrow&gt;
+    &lt;/math&gt;
+    &lt;div style=&quot;height: 500px;&quot;&gt;&lt;/div&gt;
+    &lt;math id=&quot;target&quot; style=&quot;padding: 0&quot;&gt;
+      &lt;mspace width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;green&quot;/&gt;
+    &lt;/math&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-1.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsimportedmathmlinhtml5mathmlrelationshtml5treehrefclick2expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2-expected.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2-expected.html                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2-expected.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href click (reference)&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; background: green&quot;&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsimportedmathmlinhtml5mathmlrelationshtml5treehrefclick2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2.html                                (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href click&lt;/title&gt;
+&lt;link rel=&quot;help&quot; href=&quot;http://www.mathml-association.org/MathMLinHTML5/S2.html#SS2&quot;&gt;
+&lt;link rel=&quot;match&quot; href=&quot;href-click-ref.html&quot;/&gt;
+&lt;meta name=&quot;assert&quot; content=&quot;Test that a click on an element bubbles to an ancestor link.&quot;&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+  function test()
+  {
+    var event = new MouseEvent('click', {bubbles: true, cancelable: true});
+    document.getElementById('space').dispatchEvent(event);
+  }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;test()&quot;&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; overflow: hidden&quot;&gt;
+    &lt;math style=&quot;padding: 0&quot;&gt;
+      &lt;mrow href=&quot;#target&quot;&gt;
+        &lt;mrow&gt;
+          &lt;mrow&gt;
+            &lt;mspace id=&quot;space&quot; width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;red&quot;/&gt;
+          &lt;/mrow&gt;
+        &lt;/mrow&gt;
+      &lt;/mrow&gt;
+    &lt;/math&gt;
+    &lt;div style=&quot;height: 500px;&quot;&gt;&lt;/div&gt;
+    &lt;math id=&quot;target&quot; style=&quot;padding: 0&quot;&gt;
+      &lt;mspace width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;green&quot;/&gt;
+    &lt;/math&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/relations/html5-tree/href-click-2.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationhrefenterexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/href-enter-expected.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/href-enter-expected.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/href-enter-expected.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href enter&lt;/title&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; background: green&quot;&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/href-enter-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationhrefenterhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/href-enter.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/href-enter.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/href-enter.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html class=&quot;reftest-wait&quot;&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href enter&lt;/title&gt;
+&lt;script&gt;
+  function runTest() {
+    if (window.eventSender) {
+      eventSender.keyDown('\t'); // focus the link
+      eventSender.keyDown('\r'); // press enter
+      document.documentElement.removeAttribute(&quot;class&quot;);
+    }
+  }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; overflow: hidden&quot;&gt;
+    &lt;math style=&quot;padding: 0&quot;&gt;
+      &lt;mrow id=&quot;link&quot; href=&quot;#target&quot;&gt;
+        &lt;mspace id=&quot;space&quot; width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;red&quot;/&gt;
+      &lt;/mrow&gt;
+    &lt;/math&gt;
+    &lt;div style=&quot;height: 500px;&quot;&gt;&lt;/div&gt;
+    &lt;math id=&quot;target&quot; style=&quot;padding: 0&quot;&gt;
+      &lt;mspace width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;green&quot;/&gt;
+    &lt;/math&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/href-enter.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationhrefstyleexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/href-style-expected.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/href-style-expected.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/href-style-expected.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;href style&lt;/title&gt;
+    &lt;meta charset=&quot;utf-8&quot;/&gt;
+    &lt;style&gt;
+      #Link {
+        color: -webkit-link;
+      }
+      #FocusedLink {
+        outline: auto 5px -webkit-focus-ring-color;
+        color: -webkit-link;
+      }
+    &lt;/style&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+
+    &lt;math&gt;
+      &lt;mrow&gt;&lt;mtext&gt;Non-Link&lt;/mtext&gt;&lt;/mrow&gt;
+      &lt;mrow id=&quot;Link&quot;&gt;&lt;mtext&gt;Link&lt;/mtext&gt;&lt;/mrow&gt;
+      &lt;mrow id=&quot;FocusedLink&quot;&gt;&lt;mtext&gt;Focused Link&lt;/mtext&gt;&lt;/mrow&gt;
+    &lt;/math&gt;
+
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/href-style-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationhrefstylehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/href-style.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/href-style.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/href-style.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html class=&quot;reftest-wait&quot;&gt;
+  &lt;head&gt;
+    &lt;title&gt;href style&lt;/title&gt;
+    &lt;meta charset=&quot;utf-8&quot;/&gt;
+    &lt;script&gt;
+      function runTest() {
+        if (window.eventSender) {
+          eventSender.keyDown('\t'); // focus #Link
+          eventSender.keyDown('\t'); // focus #FocusedLink
+          document.documentElement.removeAttribute(&quot;class&quot;);
+        }
+      }
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body onload=&quot;runTest()&quot;&gt;
+
+    &lt;math&gt;
+      &lt;mrow&gt;&lt;mtext&gt;Non-Link&lt;/mtext&gt;&lt;/mrow&gt;
+      &lt;mrow href=&quot;#Link&quot;&gt;&lt;mtext&gt;Link&lt;/mtext&gt;&lt;/mrow&gt;
+      &lt;mrow href=&quot;#FocusedLink&quot;&gt;&lt;mtext&gt;Focused Link&lt;/mtext&gt;&lt;/mrow&gt;
+    &lt;/math&gt;
+
+  &lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/href-style.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationmactiontogglehrefexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/maction-toggle-href-expected.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/maction-toggle-href-expected.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/maction-toggle-href-expected.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href on a maction toggle&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; background: green&quot;&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/maction-toggle-href-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationmactiontogglehrefhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/maction-toggle-href.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/maction-toggle-href.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/maction-toggle-href.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href on a maction toggle&lt;/title&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+  function test()
+  {
+    var event = new MouseEvent('click', {bubbles: true, cancelable: true});
+    document.getElementById('link').dispatchEvent(event);
+  }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;test()&quot;&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; overflow: hidden&quot;&gt;
+    &lt;math style=&quot;padding: 0&quot;&gt;
+      &lt;!-- Initially, the maction element displays its second child which is a red mspace.
+           After the click, the selection moves to the third child which is a green mspace.
+           We should not follow the link, whose target is a red space.
+        --&gt;
+      &lt;maction id=&quot;link&quot; href=&quot;#target&quot; actiontype=&quot;toggle&quot; selection=&quot;2&quot;&gt;
+        &lt;mspace width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;mspace width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;mspace width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;green&quot;/&gt;
+      &lt;/semantics&gt;
+    &lt;/math&gt;
+    &lt;div style=&quot;height: 500px;&quot;&gt;&lt;/div&gt;
+    &lt;math id=&quot;target&quot; style=&quot;padding: 0&quot;&gt;
+      &lt;mspace id=&quot;space&quot; width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;red&quot;/&gt;
+    &lt;/math&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/maction-toggle-href.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationsemanticshrefexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/semantics-href-expected.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/semantics-href-expected.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/semantics-href-expected.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href on a semantics element (expected)&lt;/title&gt;
+&lt;/head&gt;
+&lt;body&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; background: green&quot;&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/semantics-href-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationsemanticshrefhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/mathml/presentation/semantics-href.html (0 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/semantics-href.html                                (rev 0)
+++ trunk/LayoutTests/mathml/presentation/semantics-href.html        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;/&gt;
+&lt;title&gt;href on a semantics element&lt;/title&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+  function test()
+  {
+    var event = new MouseEvent('click', {bubbles: true, cancelable: true});
+    document.getElementById('link').dispatchEvent(event);
+  }
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;test()&quot;&gt;
+
+  &lt;p&gt;This test passes if you see a green square.&lt;/p&gt;
+
+  &lt;div style=&quot;width: 150px; height: 150px; overflow: hidden&quot;&gt;
+    &lt;math style=&quot;padding: 0&quot;&gt;
+      &lt;semantics id=&quot;link&quot; href=&quot;#target&quot;&gt;
+        &lt;mspace id=&quot;space&quot; width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;red&quot;/&gt;
+        &lt;annotation&gt;red square&lt;/annotation&gt;
+      &lt;/semantics&gt;
+    &lt;/math&gt;
+    &lt;div style=&quot;height: 500px;&quot;&gt;&lt;/div&gt;
+    &lt;math id=&quot;target&quot; style=&quot;padding: 0&quot;&gt;
+      &lt;mspace width=&quot;150px&quot; height=&quot;150px&quot; mathbackground=&quot;green&quot;/&gt;
+    &lt;/math&gt;
+  &lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/mathml/presentation/semantics-href.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -680,6 +680,10 @@
</span><span class="cx"> # The web font loading &amp; relayout seems to be performed too late.
</span><span class="cx"> imported/mathml-in-html5/mathml/relations/css-styling/mathvariant-transforms-1.html [ Pass ImageOnlyFailure ]
</span><span class="cx"> 
</span><ins>+# These tests use key navigation to test MathML links but do not seem to work on iOS simulator.
+webkit.org/b/159662 mathml/presentation/href-enter.html [ Skip ]
+webkit.org/b/159662 mathml/presentation/href-style.html [ Skip ]
+
</ins><span class="cx"> # &lt;rdar://problem/19215305&gt; ASSERT(m_cgFont.get()) fails in FontPlatformData::ctFont()
</span><span class="cx"> svg/text/svg-fallback-font-crash.html
</span><span class="cx"> svg/css/font-face-variant-crash.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -805,6 +805,10 @@
</span><span class="cx"> mathml/presentation/fractions-linethickness.html [ Skip ]
</span><span class="cx"> mathml/opentype/large-operators-italic-correction.html [ Skip ]
</span><span class="cx"> 
</span><ins>+# These tests use key navigation to test MathML links but do not seem to work on Mac.
+webkit.org/b/159662 mathml/presentation/href-enter.html [ Skip ]
+webkit.org/b/159662 mathml/presentation/href-style.html [ Skip ]
+
</ins><span class="cx"> webkit.org/b/128255 compositing/columns/composited-lr-paginated-repaint.html [ Pass Failure ]
</span><span class="cx"> webkit.org/b/128255 compositing/columns/composited-rl-paginated-repaint.html [ Pass Failure ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/Source/WebCore/ChangeLog        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2016-07-11  Frederic Wang  &lt;fwang@igalia.com&gt;
+
+        Add support for @href attribute in MathML
+        https://bugs.webkit.org/show_bug.cgi?id=85733
+
+        Reviewed by Brent Fulgham.
+
+        We add support for the href attribute from MathML 3 but ignore the deprecated XLink version.
+        We also use the code from HTMLAnchorElement SVGAElement to make MathMLElement with a href
+        attribute behave as a link.
+        Finally, we adjust mathml.css based on rules from the html and svg user agent stylesheets.
+
+        Tests: mathml/mathml-in-html5/href-click-1.html
+               mathml/mathml-in-html5/href-click-2.html
+               mathml/presentation/href-enter.html
+               mathml/presentation/href-style.html
+               mathml/presentation/maction-toggle-href.html
+               mathml/presentation/semantics-href.html
+
+        * css/mathml.css:
+        (:any-link): Set color and mouse cursor of links.
+        (:any-link:active): Set color of active links.
+        (:focus): Set outline of focused links.
+        * mathml/MathMLElement.cpp:
+        (WebCore::MathMLElement::parseAttribute): Parse the href attribute.
+        (WebCore::MathMLElement::willRespondToMouseClickEvents): Based on HTMLAnchorElement/SVGAElement.
+        (WebCore::MathMLElement::defaultEventHandler): Based on HTMLAnchorElement/SVGAElement.
+        (WebCore::MathMLElement::canStartSelection): Based on HTMLAnchorElement/SVGAElement.
+        (WebCore::MathMLElement::isFocusable): Based on HTMLAnchorElement/SVGAElement.
+        (WebCore::MathMLElement::isKeyboardFocusable): Based on HTMLAnchorElement/SVGAElement.
+        (WebCore::MathMLElement::isMouseFocusable): Based on HTMLAnchorElement/SVGAElement.
+        (WebCore::MathMLElement::isURLAttribute): Based on HTMLAnchorElement/SVGAElement.
+        (WebCore::MathMLElement::supportsFocus): Based on HTMLAnchorElement/SVGAElement.
+        (WebCore::MathMLElement::tabIndex): Based on HTMLAnchorElement/SVGAElement.
+        * mathml/MathMLElement.h: Define new members.
+        * mathml/MathMLSelectElement.cpp:
+        (WebCore::MathMLSelectElement::willRespondToMouseClickEvents): We also verify whether
+        the parent class will respond.
+        * mathml/mathattrs.in: Add href attribute.
+
</ins><span class="cx"> 2016-07-11  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Speech Synthesis: getting list of voices no longer works
</span></span></pre></div>
<a id="trunkSourceWebCorecssmathmlcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/mathml.css (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/mathml.css        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/Source/WebCore/css/mathml.css        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -1,5 +1,18 @@
</span><span class="cx"> @namespace &quot;http://www.w3.org/1998/Math/MathML&quot;;
</span><span class="cx"> 
</span><ins>+:any-link {
+    color: -webkit-link;
+    cursor: auto;
+}
+
+:any-link:active {
+    color: -webkit-activelink;
+}
+
+:focus {
+    outline: auto 5px -webkit-focus-ring-color
+}
+
</ins><span class="cx"> math {
</span><span class="cx">     /*
</span><span class="cx">     We use the exact bounding boxes of glyphs to avoid excessive gaps in mathematical formulas.
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.cpp (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.cpp        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/Source/WebCore/mathml/MathMLElement.cpp        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -32,6 +32,9 @@
</span><span class="cx"> #include &quot;MathMLElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ElementIterator.h&quot;
</span><ins>+#include &quot;Event.h&quot;
+#include &quot;EventHandler.h&quot;
+#include &quot;HTMLAnchorElement.h&quot;
</ins><span class="cx"> #include &quot;HTMLElement.h&quot;
</span><span class="cx"> #include &quot;HTMLHtmlElement.h&quot;
</span><span class="cx"> #include &quot;HTMLMapElement.h&quot;
</span><span class="lines">@@ -40,10 +43,12 @@
</span><span class="cx"> #include &quot;MathMLMathElement.h&quot;
</span><span class="cx"> #include &quot;MathMLNames.h&quot;
</span><span class="cx"> #include &quot;MathMLSelectElement.h&quot;
</span><ins>+#include &quot;MouseEvent.h&quot;
</ins><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span><span class="cx"> #include &quot;SVGElement.h&quot;
</span><span class="cx"> #include &quot;SVGNames.h&quot;
</span><span class="cx"> #include &quot;SVGSVGElement.h&quot;
</span><ins>+#include &quot;XLinkNames.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -216,7 +221,12 @@
</span><span class="cx"> 
</span><span class="cx"> void MathMLElement::parseAttribute(const QualifiedName&amp; name, const AtomicString&amp; value)
</span><span class="cx"> {
</span><del>-    if (name == rowspanAttr) {
</del><ins>+    if (name == hrefAttr) {
+        bool wasLink = isLink();
+        setIsLink(!value.isNull() &amp;&amp; !shouldProhibitLinks(this));
+        if (wasLink != isLink())
+            setNeedsStyleRecalc();
+    } else if (name == rowspanAttr) {
</ins><span class="cx">         if (is&lt;RenderTableCell&gt;(renderer()) &amp;&amp; hasTagName(mtdTag))
</span><span class="cx">             downcast&lt;RenderTableCell&gt;(*renderer()).colSpanOrRowSpanChanged();
</span><span class="cx">     } else if (name == columnspanAttr) {
</span><span class="lines">@@ -305,6 +315,88 @@
</span><span class="cx">     StyledElement::attributeChanged(name, oldValue, newValue, reason);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool MathMLElement::willRespondToMouseClickEvents()
+{
+    return isLink() || StyledElement::willRespondToMouseClickEvents();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MathMLElement::defaultEventHandler(Event* event)
+{
+    if (isLink()) {
+        if (focused() &amp;&amp; isEnterKeyKeydownEvent(event)) {
+            event-&gt;setDefaultHandled();
+            dispatchSimulatedClick(event);
+            return;
+        }
+        if (MouseEvent::canTriggerActivationBehavior(*event)) {
+            const AtomicString&amp; href = fastGetAttribute(hrefAttr);
+            String url = stripLeadingAndTrailingHTMLSpaces(href);
+            event-&gt;setDefaultHandled();
+            if (Frame* frame = document().frame())
+                frame-&gt;loader().urlSelected(document().completeURL(url), &quot;_self&quot;, event, LockHistory::No, LockBackForwardList::No, MaybeSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate());
+            return;
+        }
+    }
+
+    StyledElement::defaultEventHandler(event);
+}
+
+bool MathMLElement::canStartSelection() const
+{
+    if (!isLink())
+        return StyledElement::canStartSelection();
+
+    return hasEditableStyle();
+}
+
+bool MathMLElement::isFocusable() const
+{
+    if (renderer() &amp;&amp; renderer()-&gt;absoluteClippedOverflowRect().isEmpty())
+        return false;
+
+    return StyledElement::isFocusable();
+}
+
+bool MathMLElement::isKeyboardFocusable(KeyboardEvent* event) const
+{
+    if (isFocusable() &amp;&amp; StyledElement::supportsFocus())
+        return StyledElement::isKeyboardFocusable(event);
+
+    if (isLink())
+        return document().frame()-&gt;eventHandler().tabsToLinks(event);
+
+    return StyledElement::isKeyboardFocusable(event);
+}
+
+bool MathMLElement::isMouseFocusable() const
+{
+    // Links are focusable by default, but only allow links with tabindex or contenteditable to be mouse focusable.
+    // https://bugs.webkit.org/show_bug.cgi?id=26856
+    if (isLink())
+        return StyledElement::supportsFocus();
+
+    return StyledElement::isMouseFocusable();
+}
+
+bool MathMLElement::isURLAttribute(const Attribute&amp; attribute) const
+{
+    return attribute.name().localName() == hrefAttr || StyledElement::isURLAttribute(attribute);
+}
+
+bool MathMLElement::supportsFocus() const
+{
+    if (hasEditableStyle())
+        return StyledElement::supportsFocus();
+    // If not a link we should still be able to focus the element if it has tabIndex.
+    return isLink() || StyledElement::supportsFocus();
+}
+
+int MathMLElement::tabIndex() const
+{
+    // Skip the supportsFocus check in StyledElement.
+    return Element::tabIndex();
+}
+
+}
+
</ins><span class="cx"> #endif // ENABLE(MATHML)
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLElement.h (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLElement.h        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/Source/WebCore/mathml/MathMLElement.h        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -69,8 +69,19 @@
</span><span class="cx">     bool isPhrasingContent(const Node&amp;) const;
</span><span class="cx">     bool isFlowContent(const Node&amp;) const;
</span><span class="cx"> 
</span><ins>+    bool willRespondToMouseClickEvents() override;
+    void defaultEventHandler(Event*) override;
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual void updateSelectedChild() { }
</span><ins>+
+    bool canStartSelection() const final;
+    bool isFocusable() const final;
+    bool isKeyboardFocusable(KeyboardEvent*) const final;
+    bool isMouseFocusable() const final;
+    bool isURLAttribute(const Attribute&amp;) const final;
+    bool supportsFocus() const final;
+    int tabIndex() const final;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline bool Node::hasTagName(const MathMLQualifiedName&amp; name) const
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlMathMLSelectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/MathMLSelectElement.cpp (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/MathMLSelectElement.cpp        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/Source/WebCore/mathml/MathMLSelectElement.cpp        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -224,7 +224,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool MathMLSelectElement::willRespondToMouseClickEvents()
</span><span class="cx"> {
</span><del>-    return fastGetAttribute(MathMLNames::actiontypeAttr) == &quot;toggle&quot;;
</del><ins>+    return fastGetAttribute(MathMLNames::actiontypeAttr) == &quot;toggle&quot; || MathMLInlineContainerElement::willRespondToMouseClickEvents();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MathMLSelectElement::toggle()
</span></span></pre></div>
<a id="trunkSourceWebCoremathmlmathattrsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/mathml/mathattrs.in (203103 => 203104)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/mathml/mathattrs.in        2016-07-12 04:03:43 UTC (rev 203103)
+++ trunk/Source/WebCore/mathml/mathattrs.in        2016-07-12 04:28:16 UTC (rev 203104)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> fontweight
</span><span class="cx"> form
</span><span class="cx"> height
</span><ins>+href
</ins><span class="cx"> largeop
</span><span class="cx"> linethickness
</span><span class="cx"> lspace
</span></span></pre>
</div>
</div>

</body>
</html>