Skip to content
Permalink
Browse files
Make attribute quoting in DOM view more consistent with source view
        Two changes which make the DOM view more consistent with source view:
         1) We now quote all attribute values, including URLs
         2) The quotes around the values are now purple, matching the left and
            right angle brackets that surround the tag

        One bug fixed by these changes:
         1) The entire URL is selected for editing when you double-click a URL
            that is an attribute value. Previously, the first and last
            characters were not included in the selection.

        Reviewed by Darin.

        * page/inspector/DocumentPanel.js:
        (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't need
        to account for the quotes around attribute values anymore because the
        quotes are now outside the webkit-html-attribute-value span.
        * page/inspector/utilities.js:
        (nodeTitleInfo): Quote all attribute values, including URLs, and place
        the quotes outside the webkit-html-attribute-value span.


Canonical link: https://commits.webkit.org/24650@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30966 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
aroben committed Mar 11, 2008
1 parent 9b8d63f commit c72004c4207480abe474d5f47377144f23e2925f
Showing with 28 additions and 9 deletions.
  1. +24 −0 WebCore/ChangeLog
  2. +1 −6 WebCore/page/inspector/DocumentPanel.js
  3. +3 −3 WebCore/page/inspector/utilities.js
@@ -1,3 +1,27 @@
2008-03-11 Adam Roben <aroben@apple.com>

Make attribute quoting in DOM view more consistent with source view

Two changes which make the DOM view more consistent with source view:
1) We now quote all attribute values, including URLs
2) The quotes around the values are now purple, matching the left and
right angle brackets that surround the tag

One bug fixed by these changes:
1) The entire URL is selected for editing when you double-click a URL
that is an attribute value. Previously, the first and last
characters were not included in the selection.

Reviewed by Darin.

* page/inspector/DocumentPanel.js:
(WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't need
to account for the quotes around attribute values anymore because the
quotes are now outside the webkit-html-attribute-value span.
* page/inspector/utilities.js:
(nodeTitleInfo): Quote all attribute values, including URLs, and place
the quotes outside the webkit-html-attribute-value span.

2008-03-11 Adam Roben <aroben@apple.com>

Stop including pthread.h in WebCore on Windows
@@ -885,12 +885,7 @@ WebInspector.DOMNodeTreeElement.prototype = {
this._editing = true;

WebInspector.startEditing(attribute, this._attributeEditingCommitted.bind(this), this._editingCancelled.bind(this), attributeName);
if (event.target.hasStyleClass("webkit-html-attribute-value")) {
// Select just inside the quotes.
var textChild = event.target.firstChild;
window.getSelection().setBaseAndExtent(textChild, 1, textChild, textChild.length - 1);
} else
window.getSelection().setBaseAndExtent(event.target, 0, event.target, 1);
window.getSelection().setBaseAndExtent(event.target, 0, event.target, 1);

return true;
},
@@ -603,13 +603,13 @@ function nodeTitleInfo(hasChildren, linkify)
var value = attr.value.escapeHTML();
value = value.replace(/([\/;:\)\]\}])/g, "$1&#8203;");

info.title += " <span class=\"webkit-html-attribute\"><span class=\"webkit-html-attribute-name\">" + attr.name.escapeHTML() + "</span>=&#8203;";
info.title += " <span class=\"webkit-html-attribute\"><span class=\"webkit-html-attribute-name\">" + attr.name.escapeHTML() + "</span>=&#8203;\"";

if (linkify && (attr.name === "src" || attr.name === "href"))
info.title += linkify(attr.value, value, "webkit-html-attribute-value", this.nodeName.toLowerCase() == "a");
else
info.title += "<span class=\"webkit-html-attribute-value\">\"" + value + "\"</span>";
info.title += "</span>";
info.title += "<span class=\"webkit-html-attribute-value\">" + value + "</span>";
info.title += "\"</span>";
}
}
info.title += "&gt;</span>&#8203;";

0 comments on commit c72004c

Please sign in to comment.