diff options
author | Ben Murdoch <benm@google.com> | 2011-05-05 14:36:32 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-10 15:38:30 +0100 |
commit | f05b935882198ccf7d81675736e3aeb089c5113a (patch) | |
tree | 4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebCore/inspector/front-end/Section.js | |
parent | 60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff) | |
download | external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2 |
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebCore/inspector/front-end/Section.js')
-rw-r--r-- | WebCore/inspector/front-end/Section.js | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/WebCore/inspector/front-end/Section.js b/WebCore/inspector/front-end/Section.js index a186d43..5caa78b 100644 --- a/WebCore/inspector/front-end/Section.js +++ b/WebCore/inspector/front-end/Section.js @@ -31,7 +31,7 @@ WebInspector.Section = function(title, subtitle) { this.element = document.createElement("div"); this.element.className = "section"; - this.element.sectionForTest = this; + this.element._section = this; this.headerElement = document.createElement("div"); this.headerElement.className = "header"; @@ -85,15 +85,15 @@ WebInspector.Section.prototype = { this.subtitleElement.textContent = x; }, - get subtitleAsTextForTest()
- {
- var result = this.subtitleElement.textContent;
- var child = this.subtitleElement.querySelector("[data-uncopyable]");
- if (child) {
- var linkData = child.getAttribute("data-uncopyable");
- if (linkData)
- result += linkData;
- }
+ get subtitleAsTextForTest() + { + var result = this.subtitleElement.textContent; + var child = this.subtitleElement.querySelector("[data-uncopyable]"); + if (child) { + var linkData = child.getAttribute("data-uncopyable"); + if (linkData) + result += linkData; + } return result; }, @@ -124,6 +124,26 @@ WebInspector.Section.prototype = { } }, + get nextSibling() + { + var curElement = this.element; + do { + curElement = curElement.nextSibling; + } while (curElement && !curElement._section); + + return curElement ? curElement._section : null; + }, + + get previousSibling() + { + var curElement = this.element; + do { + curElement = curElement.previousSibling; + } while (curElement && !curElement._section); + + return curElement ? curElement._section : null; + }, + expand: function() { if (this._expanded) |