Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLBaseElement.cpp

Issue 2384273007: reflow comments in core/html/*.{cpp,h},core/html/imports (Closed)
Patch Set: comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2008, 2009, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2008, 2009, 2010 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 if (insertionPoint->isConnected()) 59 if (insertionPoint->isConnected())
60 document().processBaseElement(); 60 document().processBaseElement();
61 } 61 }
62 62
63 bool HTMLBaseElement::isURLAttribute(const Attribute& attribute) const { 63 bool HTMLBaseElement::isURLAttribute(const Attribute& attribute) const {
64 return attribute.name().localName() == hrefAttr || 64 return attribute.name().localName() == hrefAttr ||
65 HTMLElement::isURLAttribute(attribute); 65 HTMLElement::isURLAttribute(attribute);
66 } 66 }
67 67
68 KURL HTMLBaseElement::href() const { 68 KURL HTMLBaseElement::href() const {
69 // This does not use the getURLAttribute function because that will resolve re lative to the document's base URL; 69 // This does not use the getURLAttribute function because that will resolve
70 // base elements like this one can be used to set that base URL. Thus we need to resolve relative to the document's 70 // relative to the document's base URL; base elements like this one can be
71 // URL and ignore the base URL. 71 // used to set that base URL. Thus we need to resolve relative to the
72 // document's URL and ignore the base URL.
72 73
73 const AtomicString& attributeValue = fastGetAttribute(hrefAttr); 74 const AtomicString& attributeValue = fastGetAttribute(hrefAttr);
74 if (attributeValue.isNull()) 75 if (attributeValue.isNull())
75 return document().url(); 76 return document().url();
76 77
77 KURL url = document().encoding().isValid() 78 KURL url = document().encoding().isValid()
78 ? KURL(document().url(), 79 ? KURL(document().url(),
79 stripLeadingAndTrailingHTMLSpaces(attributeValue)) 80 stripLeadingAndTrailingHTMLSpaces(attributeValue))
80 : KURL(document().url(), 81 : KURL(document().url(),
81 stripLeadingAndTrailingHTMLSpaces(attributeValue), 82 stripLeadingAndTrailingHTMLSpaces(attributeValue),
82 document().encoding()); 83 document().encoding());
83 84
84 if (!url.isValid()) 85 if (!url.isValid())
85 return KURL(); 86 return KURL();
86 87
87 return url; 88 return url;
88 } 89 }
89 90
90 void HTMLBaseElement::setHref(const AtomicString& value) { 91 void HTMLBaseElement::setHref(const AtomicString& value) {
91 setAttribute(hrefAttr, value); 92 setAttribute(hrefAttr, value);
92 } 93 }
93 94
94 } // namespace blink 95 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLBRElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698