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

Side by Side Diff: Source/core/dom/DocumentStyleSheetCollection.cpp

Issue 17496004: Do not consider title from non-css stylesheet for preferred set. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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
« no previous file with comments | « LayoutTests/fast/css/style-preferred-stylesheet-02-expected.html ('k') | no next file » | 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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 sheet = static_cast<SVGStyleElement*>(n)->sheet(); 312 sheet = static_cast<SVGStyleElement*>(n)->sheet();
313 else if (e->hasLocalName(linkTag)) 313 else if (e->hasLocalName(linkTag))
314 sheet = static_cast<HTMLLinkElement*>(n)->sheet(); 314 sheet = static_cast<HTMLLinkElement*>(n)->sheet();
315 else 315 else
316 // <STYLE> element 316 // <STYLE> element
317 sheet = static_cast<HTMLStyleElement*>(n)->sheet(); 317 sheet = static_cast<HTMLStyleElement*>(n)->sheet();
318 // Check to see if this sheet belongs to a styleset 318 // Check to see if this sheet belongs to a styleset
319 // (thus making it PREFERRED or ALTERNATE rather than 319 // (thus making it PREFERRED or ALTERNATE rather than
320 // PERSISTENT). 320 // PERSISTENT).
321 AtomicString rel = e->getAttribute(relAttr); 321 AtomicString rel = e->getAttribute(relAttr);
322 if (!enabledViaScript && !title.isEmpty()) { 322 if (!enabledViaScript && sheet && !title.isEmpty()) {
323 // Yes, we have a title. 323 // Yes, we have a title.
324 if (m_preferredStylesheetSetName.isEmpty()) { 324 if (m_preferredStylesheetSetName.isEmpty()) {
325 // No preferred set has been established. If 325 // No preferred set has been established. If
326 // we are NOT an alternate sheet, then establish 326 // we are NOT an alternate sheet, then establish
327 // us as the preferred set. Otherwise, just ignore 327 // us as the preferred set. Otherwise, just ignore
328 // this sheet. 328 // this sheet.
329 if (e->hasLocalName(styleTag) || !rel.contains("alternate")) 329 if (e->hasLocalName(styleTag) || !rel.contains("alternate"))
330 m_preferredStylesheetSetName = m_selectedStylesheetSetNa me = title; 330 m_preferredStylesheetSetName = m_selectedStylesheetSetNa me = title;
331 } 331 }
332 if (title != m_preferredStylesheetSetName) 332 if (title != m_preferredStylesheetSetName)
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 info.addMember(m_authorStyleSheets, "authorStyleSheets"); 490 info.addMember(m_authorStyleSheets, "authorStyleSheets");
491 info.addMember(m_activeAuthorStyleSheets, "activeAuthorStyleSheets"); 491 info.addMember(m_activeAuthorStyleSheets, "activeAuthorStyleSheets");
492 info.addMember(m_styleSheetsForStyleSheetList, "styleSheetsForStyleSheetList "); 492 info.addMember(m_styleSheetsForStyleSheetList, "styleSheetsForStyleSheetList ");
493 info.addMember(m_styleSheetCandidateNodes, "styleSheetCandidateNodes"); 493 info.addMember(m_styleSheetCandidateNodes, "styleSheetCandidateNodes");
494 info.addMember(m_preferredStylesheetSetName, "preferredStylesheetSetName"); 494 info.addMember(m_preferredStylesheetSetName, "preferredStylesheetSetName");
495 info.addMember(m_selectedStylesheetSetName, "selectedStylesheetSetName"); 495 info.addMember(m_selectedStylesheetSetName, "selectedStylesheetSetName");
496 info.addMember(m_document, "document"); 496 info.addMember(m_document, "document");
497 } 497 }
498 498
499 } 499 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/style-preferred-stylesheet-02-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698