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

Side by Side Diff: Source/core/html/HTMLLinkElement.cpp

Issue 400763002: Adding relList attr to link and anchor element Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: modified as per review comment Created 6 years, 5 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, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 document().styleEngine()->removeStyleSheetCandidateNode(this); 157 document().styleEngine()->removeStyleSheetCandidateNode(this);
158 #endif 158 #endif
159 159
160 linkLoadEventSender().cancelEvent(this); 160 linkLoadEventSender().cancelEvent(this);
161 } 161 }
162 162
163 void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value) 163 void HTMLLinkElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value)
164 { 164 {
165 if (name == relAttr) { 165 if (name == relAttr) {
166 m_relAttribute = LinkRelAttribute(value); 166 m_relAttribute = LinkRelAttribute(value);
167 if (m_relList)
168 m_relList->setValue(value);
167 process(); 169 process();
168 } else if (name == hrefAttr) { 170 } else if (name == hrefAttr) {
169 process(); 171 process();
170 } else if (name == typeAttr) { 172 } else if (name == typeAttr) {
171 m_type = value; 173 m_type = value;
172 process(); 174 process();
173 } else if (name == sizesAttr) { 175 } else if (name == sizesAttr) {
174 m_sizes->setValue(value); 176 m_sizes->setValue(value);
175 parseSizesAttribute(value, m_iconSizes); 177 parseSizesAttribute(value, m_iconSizes);
176 process(); 178 process();
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 KURL HTMLLinkElement::href() const 416 KURL HTMLLinkElement::href() const
415 { 417 {
416 return document().completeURL(getAttribute(hrefAttr)); 418 return document().completeURL(getAttribute(hrefAttr));
417 } 419 }
418 420
419 const AtomicString& HTMLLinkElement::rel() const 421 const AtomicString& HTMLLinkElement::rel() const
420 { 422 {
421 return getAttribute(relAttr); 423 return getAttribute(relAttr);
422 } 424 }
423 425
426 DOMTokenList& HTMLLinkElement::relList()
427 {
428 if (!m_relList)
429 m_relList = RelList::create(this);
430 return *m_relList;
431 }
432
424 const AtomicString& HTMLLinkElement::type() const 433 const AtomicString& HTMLLinkElement::type() const
425 { 434 {
426 return getAttribute(typeAttr); 435 return getAttribute(typeAttr);
427 } 436 }
428 437
429 bool HTMLLinkElement::async() const 438 bool HTMLLinkElement::async() const
430 { 439 {
431 return fastHasAttribute(HTMLNames::asyncAttr); 440 return fastHasAttribute(HTMLNames::asyncAttr);
432 } 441 }
433 442
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 removePendingSheet(); 750 removePendingSheet();
742 } 751 }
743 752
744 void LinkStyle::trace(Visitor* visitor) 753 void LinkStyle::trace(Visitor* visitor)
745 { 754 {
746 visitor->trace(m_sheet); 755 visitor->trace(m_sheet);
747 LinkResource::trace(visitor); 756 LinkResource::trace(visitor);
748 } 757 }
749 758
750 } // namespace WebCore 759 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698