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

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

Issue 27509002: Get rid of custom code for HTMLLinkElement.sizes attribute setter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/HTMLLinkElement.h ('k') | Source/core/html/HTMLLinkElement.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 { 89 {
90 if (name == relAttr) { 90 if (name == relAttr) {
91 m_relAttribute = LinkRelAttribute(value); 91 m_relAttribute = LinkRelAttribute(value);
92 process(); 92 process();
93 } else if (name == hrefAttr) { 93 } else if (name == hrefAttr) {
94 process(); 94 process();
95 } else if (name == typeAttr) { 95 } else if (name == typeAttr) {
96 m_type = value; 96 m_type = value;
97 process(); 97 process();
98 } else if (name == sizesAttr) { 98 } else if (name == sizesAttr) {
99 setSizes(value); 99 m_sizes->setValue(value);
100 process(); 100 process();
101 } else if (name == mediaAttr) { 101 } else if (name == mediaAttr) {
102 m_media = value.string().lower(); 102 m_media = value.string().lower();
103 process(); 103 process();
104 } else if (name == disabledAttr) { 104 } else if (name == disabledAttr) {
105 if (LinkStyle* link = linkStyle()) 105 if (LinkStyle* link = linkStyle())
106 link->setDisabledState(!value.isNull()); 106 link->setDisabledState(!value.isNull());
107 } else if (name == onbeforeloadAttr) 107 } else if (name == onbeforeloadAttr)
108 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve ntListener(this, name, value)); 108 setAttributeEventListener(EventTypeNames::beforeload, createAttributeEve ntListener(this, name, value));
109 else { 109 else {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 // Walk the URLs linked by the linked-to stylesheet. 358 // Walk the URLs linked by the linked-to stylesheet.
359 if (CSSStyleSheet* styleSheet = const_cast<HTMLLinkElement*>(this)->sheet()) 359 if (CSSStyleSheet* styleSheet = const_cast<HTMLLinkElement*>(this)->sheet())
360 styleSheet->contents()->addSubresourceStyleURLs(urls); 360 styleSheet->contents()->addSubresourceStyleURLs(urls);
361 } 361 }
362 362
363 DOMSettableTokenList* HTMLLinkElement::sizes() const 363 DOMSettableTokenList* HTMLLinkElement::sizes() const
364 { 364 {
365 return m_sizes.get(); 365 return m_sizes.get();
366 } 366 }
367 367
368 void HTMLLinkElement::setSizes(const String& value)
369 {
370 m_sizes->setValue(value);
371 }
372
373
374 PassRefPtr<LinkStyle> LinkStyle::create(HTMLLinkElement* owner) 368 PassRefPtr<LinkStyle> LinkStyle::create(HTMLLinkElement* owner)
375 { 369 {
376 return adoptRef(new LinkStyle(owner)); 370 return adoptRef(new LinkStyle(owner));
377 } 371 }
378 372
379 LinkStyle::LinkStyle(HTMLLinkElement* owner) 373 LinkStyle::LinkStyle(HTMLLinkElement* owner)
380 : LinkResource(owner) 374 : LinkResource(owner)
381 , m_disabledState(Unset) 375 , m_disabledState(Unset)
382 , m_pendingSheetType(None) 376 , m_pendingSheetType(None)
383 , m_loading(false) 377 , m_loading(false)
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 void LinkStyle::ownerRemoved() 633 void LinkStyle::ownerRemoved()
640 { 634 {
641 if (m_sheet) 635 if (m_sheet)
642 clearSheet(); 636 clearSheet();
643 637
644 if (styleSheetIsLoading()) 638 if (styleSheetIsLoading())
645 removePendingSheet(RemovePendingSheetNotifyLater); 639 removePendingSheet(RemovePendingSheetNotifyLater);
646 } 640 }
647 641
648 } // namespace WebCore 642 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLLinkElement.h ('k') | Source/core/html/HTMLLinkElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698