Changeset 51134 in webkit


Ignore:
Timestamp:
Nov 18, 2009 2:05:46 PM (14 years ago)
Author:
Joseph Pecoraro
Message:

2009-11-18 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by Pavel Feldman.

Web Inspector: Directly Access <head> Instead of Searching for It
https://bugs.webkit.org/show_bug.cgi?id=31641

Changed old access of the head element (document.getElementsByTagName)
to just use the document.head accessor.

  • inspector/front-end/FontView.js: (WebInspector.FontView):
  • inspector/front-end/InjectedScript.js: (InjectedScript.addStyleSelector):
  • inspector/front-end/SourceFrame.js: (WebInspector.SourceFrame.prototype._loaded):
  • inspector/front-end/inspector.js: (windowLoaded):
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51133 r51134  
     12009-11-18  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Directly Access <head> Instead of Searching for It
     6        https://bugs.webkit.org/show_bug.cgi?id=31641
     7       
     8        Changed old access of the head element (document.getElementsByTagName)
     9        to just use the document.head accessor.
     10
     11        * inspector/front-end/FontView.js:
     12        (WebInspector.FontView):
     13        * inspector/front-end/InjectedScript.js:
     14        (InjectedScript.addStyleSelector):
     15        * inspector/front-end/SourceFrame.js:
     16        (WebInspector.SourceFrame.prototype._loaded):
     17        * inspector/front-end/inspector.js:
     18        (windowLoaded):
     19
    1202009-11-18  Sam Weinig  <sam@webkit.org>
    221
  • trunk/WebCore/inspector/front-end/FontView.js

    r37289 r51134  
    3737    this.fontStyleElement = document.createElement("style");
    3838    this.fontStyleElement.textContent = "@font-face { font-family: \"" + uniqueFontName + "\"; src: url(" + this.resource.url + "); }";
    39     document.getElementsByTagName("head").item(0).appendChild(this.fontStyleElement);
     39    document.head.appendChild(this.fontStyleElement);
    4040
    4141    this.fontPreviewElement = document.createElement("div");
  • trunk/WebCore/inspector/front-end/InjectedScript.js

    r50639 r51134  
    239239    var stylesheet = ownerDocument.__stylesheet;
    240240    if (!stylesheet) {
    241         var head = ownerDocument.getElementsByTagName("head")[0];
     241        var head = ownerDocument.head;
    242242        var styleElement = ownerDocument.createElement("style");
    243243        styleElement.type = "text/css";
  • trunk/WebCore/inspector/front-end/SourceFrame.js

    r50755 r51134  
    213213        this._shortcuts[shortcut] = this._evalSelectionInCallFrame.bind(this);
    214214
    215         var headElement = this.element.contentDocument.getElementsByTagName("head")[0];
     215        var headElement = this.element.contentDocument.head;
    216216        if (!headElement) {
    217217            headElement = this.element.contentDocument.createElement("head");
  • trunk/WebCore/inspector/front-end/inspector.js

    r51119 r51134  
    501501        localizedStringsScriptElement.type = "text/javascript";
    502502        localizedStringsScriptElement.src = localizedStringsURL;
    503         document.getElementsByTagName("head").item(0).appendChild(localizedStringsScriptElement);
     503        document.head.appendChild(localizedStringsScriptElement);
    504504    } else
    505505        WebInspector.loaded();
Note: See TracChangeset for help on using the changeset viewer.