summaryrefslogtreecommitdiffstats
path: root/WebCore/html/HTMLViewSourceDocument.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-08-13 05:20:16 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-08-13 05:20:16 -0700
commitf4958a7d95cd5fbc1c74905e229b02c95cd5ee78 (patch)
tree14a0f1b07a19948c2ed93d0d8547caa7fe10aa0e /WebCore/html/HTMLViewSourceDocument.cpp
parentd074a7997da8ce379434eb6e208b97cde8a0841c (diff)
parentf964bc1fd59a545a80a0cc2529ad8830be514871 (diff)
downloadexternal_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.zip
external_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.tar.gz
external_webkit-f4958a7d95cd5fbc1c74905e229b02c95cd5ee78.tar.bz2
Merge changes I60a96064,I6929172f,Idefd9bec,I8cf448f2,I8791737a,I992c56b0,Ibb4b089d,I779a8ec0,Ife412e30,I2da1ae98,Ibcf41849
* changes: Merge WebKit at r65072 : Update WebKit revision number. Merge WebKit at r65072 : Update test_expectations. Merge WebKit at r65072 : Complete cherry-pick of WebKit change 43848 to add EmptyDeviceMotionClient Merge WebKit at r65072 : Implement DeviceMotionClientAndroid Merge WebKit at r65072: JSC build fix in InspectorController.h Merge WebKit at r65072: Fix V8 code generator. Merge WebKit at r65072 : Build fix for JSC, update ambiguous usage of JSLock. Merge WebKit at r65072: String class has moved to the WTF namespace. Merge Webkit at r65072 : Fix conflicts. Merge Webkit at r65072 : Fix Makefiles. Merge WebKit at r65072 : Initial merge by git.
Diffstat (limited to 'WebCore/html/HTMLViewSourceDocument.cpp')
-rw-r--r--WebCore/html/HTMLViewSourceDocument.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/WebCore/html/HTMLViewSourceDocument.cpp b/WebCore/html/HTMLViewSourceDocument.cpp
index 6cee27c..e1b959b 100644
--- a/WebCore/html/HTMLViewSourceDocument.cpp
+++ b/WebCore/html/HTMLViewSourceDocument.cpp
@@ -19,7 +19,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
@@ -69,26 +69,26 @@ DocumentParser* HTMLViewSourceDocument::createParser()
void HTMLViewSourceDocument::createContainingTable()
{
RefPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(this);
- legacyParserAddChild(html);
+ parserAddChild(html);
html->attach();
RefPtr<HTMLBodyElement> body = HTMLBodyElement::create(this);
- html->legacyParserAddChild(body);
+ html->parserAddChild(body);
body->attach();
-
+
// Create a line gutter div that can be used to make sure the gutter extends down the height of the whole
// document.
RefPtr<HTMLDivElement> div = HTMLDivElement::create(this);
RefPtr<NamedNodeMap> attrs = NamedNodeMap::create();
attrs->addAttribute(Attribute::createMapped(classAttr, "webkit-line-gutter-backdrop"));
div->setAttributeMap(attrs.release());
- body->legacyParserAddChild(div);
+ body->parserAddChild(div);
div->attach();
RefPtr<HTMLTableElement> table = HTMLTableElement::create(this);
- body->legacyParserAddChild(table);
+ body->parserAddChild(table);
table->attach();
m_tbody = HTMLTableSectionElement::create(tbodyTag, this);
- table->legacyParserAddChild(m_tbody);
+ table->parserAddChild(m_tbody);
m_tbody->attach();
m_current = m_tbody;
}
@@ -137,7 +137,7 @@ void HTMLViewSourceDocument::addViewSourceToken(Token* token)
if (guide->at(i) == 'a' || guide->at(i) == 'x' || guide->at(i) == 'v') {
// Add in the string.
addText(String(static_cast<UChar*>(guide->data()) + begin, i - begin), classNameStr);
-
+
begin = i + 1;
if (guide->at(i) == 'a') {
@@ -149,7 +149,7 @@ void HTMLViewSourceDocument::addViewSourceToken(Token* token)
if (attr) {
if (guide->at(i) == 'a') {
String name = attr->name().toString();
-
+
m_current = addSpanWithClassName("webkit-html-attribute-name");
addText(name, "webkit-html-attribute-name");
if (m_current != m_tbody)
@@ -179,7 +179,7 @@ void HTMLViewSourceDocument::addViewSourceToken(Token* token)
}
}
}
-
+
// Add in any string that might be left.
if (begin < size)
addText(String(static_cast<UChar*>(guide->data()) + begin, size - begin), classNameStr);
@@ -187,7 +187,7 @@ void HTMLViewSourceDocument::addViewSourceToken(Token* token)
// Add in the end tag.
addText(">", classNameStr);
}
-
+
m_current = m_td;
}
}
@@ -214,7 +214,7 @@ PassRefPtr<Element> HTMLViewSourceDocument::addSpanWithClassName(const String& c
RefPtr<NamedNodeMap> attrs = NamedNodeMap::create();
attrs->addAttribute(Attribute::createMapped(classAttr, className));
span->setAttributeMap(attrs.release());
- m_current->legacyParserAddChild(span);
+ m_current->parserAddChild(span);
span->attach();
return span.release();
}
@@ -223,15 +223,15 @@ void HTMLViewSourceDocument::addLine(const String& className)
{
// Create a table row.
RefPtr<HTMLTableRowElement> trow = HTMLTableRowElement::create(this);
- m_tbody->legacyParserAddChild(trow);
+ m_tbody->parserAddChild(trow);
trow->attach();
-
+
// Create a cell that will hold the line number (it is generated in the stylesheet using counters).
RefPtr<HTMLTableCellElement> td = HTMLTableCellElement::create(tdTag, this);
RefPtr<NamedNodeMap> attrs = NamedNodeMap::create();
attrs->addAttribute(Attribute::createMapped(classAttr, "webkit-line-number"));
td->setAttributeMap(attrs.release());
- trow->legacyParserAddChild(td);
+ trow->parserAddChild(td);
td->attach();
// Create a second cell for the line contents
@@ -239,7 +239,7 @@ void HTMLViewSourceDocument::addLine(const String& className)
attrs = NamedNodeMap::create();
attrs->addAttribute(Attribute::createMapped(classAttr, "webkit-line-content"));
td->setAttributeMap(attrs.release());
- trow->legacyParserAddChild(td);
+ trow->parserAddChild(td);
td->attach();
m_current = m_td = td;
@@ -276,12 +276,12 @@ void HTMLViewSourceDocument::addText(const String& text, const String& className
if (m_current == m_tbody)
addLine(className);
RefPtr<Text> t = Text::create(this, substring);
- m_current->legacyParserAddChild(t);
+ m_current->parserAddChild(t);
t->attach();
if (i < size - 1)
m_current = m_tbody;
}
-
+
// Set current to m_tbody if the last character was a newline.
if (text[text.length() - 1] == '\n')
m_current = m_tbody;
@@ -291,7 +291,7 @@ PassRefPtr<Element> HTMLViewSourceDocument::addLink(const String& url, bool isAn
{
if (m_current == m_tbody)
addLine("webkit-html-tag");
-
+
// Now create a link for the attribute value instead of a span.
RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(this);
RefPtr<NamedNodeMap> attrs = NamedNodeMap::create();
@@ -304,7 +304,7 @@ PassRefPtr<Element> HTMLViewSourceDocument::addLink(const String& url, bool isAn
attrs->addAttribute(Attribute::createMapped(targetAttr, "_blank"));
attrs->addAttribute(Attribute::createMapped(hrefAttr, url));
anchor->setAttributeMap(attrs.release());
- m_current->legacyParserAddChild(anchor);
+ m_current->parserAddChild(anchor);
anchor->attach();
return anchor.release();
}