<!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>[45443] 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/45443">45443</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2009-07-01 11:41:25 -0700 (Wed, 01 Jul 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

2009-07-01  David Hyatt  &lt;hyatt@apple.com&gt;

        Reviewed by Simon Fraser.

        Make sure setting attributes on dcol elements properly updates the corresponding DataGridColumn object.

        Added new test in fast/dom/HTMLDataGridElement.

        * html/HTMLDataGridColElement.cpp:
        (WebCore::HTMLDataGridColElement::parseMappedAttribute):
        * html/HTMLDataGridColElement.h:

LayoutTests:

2009-07-01  David Hyatt  &lt;hyatt@apple.com&gt;

        Reviewed by Simon Fraser.

        Add layout test for being able to set attributes on dcol elements.
        
        * fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes-expected.txt: Added.
        * fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorehtmlHTMLDataGridColElementcpp">trunk/WebCore/html/HTMLDataGridColElement.cpp</a></li>
<li><a href="#trunkWebCorehtmlHTMLDataGridColElementh">trunk/WebCore/html/HTMLDataGridColElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomHTMLDataGridElementDataGridColumnsdomattributesexpectedtxt">trunk/LayoutTests/fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomHTMLDataGridElementDataGridColumnsdomattributeshtml">trunk/LayoutTests/fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (45442 => 45443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2009-07-01 18:19:01 UTC (rev 45442)
+++ trunk/LayoutTests/ChangeLog        2009-07-01 18:41:25 UTC (rev 45443)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2009-07-01  David Hyatt  &lt;hyatt@apple.com&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add layout test for being able to set attributes on dcol elements.
+        
+        * fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes-expected.txt: Added.
+        * fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes.html: Added.
+
</ins><span class="cx"> 2009-07-01  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Dimitri Glazkov.
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLDataGridElementDataGridColumnsdomattributesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes-expected.txt (0 => 45443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes-expected.txt        2009-07-01 18:41:25 UTC (rev 45443)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+PASS: Initial value of datagrid.columns is defined.
+PASS: Initial length of datagrid.columns is 2.
+PASS: The column's ID is from as expected.
+PASS: The column's label is From as expected.
+PASS: The column's type is text as expected.
+PASS: The column's primary property is true as expected.
+PASS: The column's sortable property is 2 as expected.
+PASS: The first column is the primary column.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomHTMLDataGridElementDataGridColumnsdomattributeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes.html (0 => 45443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes.html                                (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLDataGridElement/DataGridColumns-dom-attributes.html        2009-07-01 18:41:25 UTC (rev 45443)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+&lt;html&gt;
+&lt;body&gt;
+    &lt;pre id=&quot;console&quot;&gt;&lt;/pre&gt;
+    &lt;datagrid id=&quot;test&quot;&gt;&lt;dcol id=&quot;fromwrong&quot; label=&quot;Fromwrong&quot; type=&quot;progress&quot;&gt;&lt;dcol id=&quot;subject&quot; label=&quot;Subject&quot; type=&quot;text&quot;&gt;&lt;/datagrid&gt;
+    &lt;script&gt;
+        if (window.layoutTestController) {
+            layoutTestController.dumpAsText();
+            layoutTestController.waitUntilDone();
+        }
+
+        function log(msg)
+        {
+            document.getElementById('console').appendChild(document.createTextNode(msg + &quot;\n&quot;));
+        }
+
+        var datagrid = document.getElementById('test');
+
+        // Test initial value.
+        if (datagrid.columns != null) {
+            log(&quot;PASS: Initial value of datagrid.columns is defined.&quot;);
+        } else {
+            log(&quot;FAIL: Initial value of datagrid.columns was null.&quot;);
+        }
+
+        // Test initial length.
+        if (datagrid.columns.length == 2) {
+            log(&quot;PASS: Initial length of datagrid.columns is 2.&quot;);
+        } else {
+            log(&quot;FAIL: Initial length of datagrid.columns was &quot; + datagrid.columns.length + &quot;.&quot;);
+        }
+        
+        // Examine the first column's properties to make sure they are what we expected after
+        // we change the attributes using setAttribute calls.
+        datagrid.firstChild.setAttribute(&quot;id&quot;, &quot;from&quot;);
+        datagrid.firstChild.setAttribute(&quot;label&quot;, &quot;From&quot;);
+        datagrid.firstChild.setAttribute(&quot;type&quot;, &quot;text&quot;);
+        datagrid.firstChild.setAttribute(&quot;primary&quot;, &quot;true&quot;);
+
+        var column = datagrid.columns[0];
+        if (column.id == &quot;from&quot;) {
+            log(&quot;PASS: The column's ID is from as expected.&quot;);
+        } else {
+            log(&quot;FAIL: The column's ID should be from but is &quot; + column.id + &quot; instead.&quot;);
+        }
+        
+        if (column.label == &quot;From&quot;) {
+            log(&quot;PASS: The column's label is From as expected.&quot;);
+        } else {
+            log(&quot;FAIL: The column's label should be From but is &quot; + column.label + &quot; instead.&quot;);
+        }
+
+        if (column.type == &quot;text&quot;) {
+            log(&quot;PASS: The column's type is text as expected.&quot;);
+        } else {
+            log(&quot;FAIL: The column's type should be text but is &quot; + column.type + &quot; instead.&quot;);
+        }
+    
+        if (column.primary) {
+            log(&quot;PASS: The column's primary property is true as expected.&quot;);
+        } else {
+            log(&quot;FAIL: The column's primary property should be true but isn't.&quot;);
+        }
+
+        if (column.sortable == 2) {
+            log(&quot;PASS: The column's sortable property is 2 as expected.&quot;);
+        } else {
+            log(&quot;FAIL: The column's sortable property should be 2 but is &quot; + column.sortable + &quot; instead.&quot;);
+        }
+
+        // Make sure the from column is the primary column.
+        if (datagrid.columns.primaryColumn == column) {
+            log(&quot;PASS: The first column is the primary column.&quot;);
+        } else {
+            log(&quot;FAIL: The first column is not the primary column as expected.&quot;);
+        }
+
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    &lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (45442 => 45443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-07-01 18:19:01 UTC (rev 45442)
+++ trunk/WebCore/ChangeLog        2009-07-01 18:41:25 UTC (rev 45443)
</span><span class="lines">@@ -1,5 +1,17 @@
</span><span class="cx"> 2009-07-01  David Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Reviewed by Simon Fraser.
+
+        Make sure setting attributes on dcol elements properly updates the corresponding DataGridColumn object.
+
+        Added new test in fast/dom/HTMLDataGridElement.
+
+        * html/HTMLDataGridColElement.cpp:
+        (WebCore::HTMLDataGridColElement::parseMappedAttribute):
+        * html/HTMLDataGridColElement.h:
+
+2009-07-01  David Hyatt  &lt;hyatt@apple.com&gt;
+
</ins><span class="cx">         Reviewed by Tim Hatcher.
</span><span class="cx"> 
</span><span class="cx">         &lt;rdar://problem/6998524&gt; REGRESSION (r44474): Form text field has focus ring, looks focused,
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLDataGridColElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLDataGridColElement.cpp (45442 => 45443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLDataGridColElement.cpp        2009-07-01 18:19:01 UTC (rev 45442)
+++ trunk/WebCore/html/HTMLDataGridColElement.cpp        2009-07-01 18:41:25 UTC (rev 45443)
</span><span class="lines">@@ -30,8 +30,8 @@
</span><span class="cx"> #include &quot;DataGridColumn.h&quot;
</span><span class="cx"> #include &quot;HTMLDataGridElement.h&quot;
</span><span class="cx"> #include &quot;HTMLDataGridColElement.h&quot;
</span><del>-
</del><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><ins>+#include &quot;MappedAttribute.h&quot;
</ins><span class="cx"> #include &quot;Text.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -145,6 +145,27 @@
</span><span class="cx">     setAttribute(primaryAttr, primary ? &quot;&quot; : 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void HTMLDataGridColElement::parseMappedAttribute(MappedAttribute* attr) 
+{
+    HTMLElement::parseMappedAttribute(attr);
+     
+    if (!column())
+        return;
+
+    if (attr-&gt;name() == labelAttr)
+        column()-&gt;setLabel(label());
+    else if (attr-&gt;name() == typeAttr)
+        column()-&gt;setType(type());
+    else if (attr-&gt;name() == primaryAttr)
+        column()-&gt;setPrimary(primary());
+    else if (attr-&gt;name() == sortableAttr)
+        column()-&gt;setSortable(sortable());
+    else if (attr-&gt;name() == sortdirectionAttr)
+        column()-&gt;setSortDirection(sortDirection());
+    else if (attr-&gt;name() == idAttr)
+        column()-&gt;setId(getAttribute(idAttr));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLDataGridColElementh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLDataGridColElement.h (45442 => 45443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLDataGridColElement.h        2009-07-01 18:19:01 UTC (rev 45442)
+++ trunk/WebCore/html/HTMLDataGridColElement.h        2009-07-01 18:41:25 UTC (rev 45443)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">     virtual int tagPriority() const { return 0; }
</span><span class="cx">     virtual void insertedIntoTree(bool /*deep*/);
</span><span class="cx">     virtual void removedFromTree(bool /*deep*/);
</span><ins>+    virtual void parseMappedAttribute(MappedAttribute*);
</ins><span class="cx"> 
</span><span class="cx">     String label() const;
</span><span class="cx">     void setLabel(const String&amp;);
</span></span></pre>
</div>
</div>

</body>
</html>