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

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

Issue 143463011: [import] support document.stylesheets in imported documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Landing Created 6 years, 11 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/dom/StyleSheetCollection.h ('k') | Source/core/html/HTMLLinkElement.h » ('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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 StyleSheetCollectionBase::~StyleSheetCollectionBase() 46 StyleSheetCollectionBase::~StyleSheetCollectionBase()
47 { 47 {
48 } 48 }
49 49
50 void StyleSheetCollectionBase::swap(StyleSheetCollectionBase& other) 50 void StyleSheetCollectionBase::swap(StyleSheetCollectionBase& other)
51 { 51 {
52 m_styleSheetsForStyleSheetList.swap(other.m_styleSheetsForStyleSheetList); 52 m_styleSheetsForStyleSheetList.swap(other.m_styleSheetsForStyleSheetList);
53 m_activeAuthorStyleSheets.swap(other.m_activeAuthorStyleSheets); 53 m_activeAuthorStyleSheets.swap(other.m_activeAuthorStyleSheets);
54 } 54 }
55 55
56 void StyleSheetCollectionBase::swapSheetsForSheetList(Vector<RefPtr<StyleSheet> >& sheets)
57 {
58 // Only called for collection of HTML Imports that never has active sheets.
59 ASSERT(m_activeAuthorStyleSheets.isEmpty());
60 m_styleSheetsForStyleSheetList.swap(sheets);
61 }
62
56 void StyleSheetCollectionBase::appendActiveStyleSheets(const Vector<RefPtr<CSSSt yleSheet> >& sheets) 63 void StyleSheetCollectionBase::appendActiveStyleSheets(const Vector<RefPtr<CSSSt yleSheet> >& sheets)
57 { 64 {
58 m_activeAuthorStyleSheets.append(sheets); 65 m_activeAuthorStyleSheets.append(sheets);
59 } 66 }
60 67
61 void StyleSheetCollectionBase::appendActiveStyleSheet(CSSStyleSheet* sheet) 68 void StyleSheetCollectionBase::appendActiveStyleSheet(CSSStyleSheet* sheet)
62 { 69 {
63 m_activeAuthorStyleSheets.append(sheet); 70 m_activeAuthorStyleSheets.append(sheet);
64 } 71 }
65 72
66 void StyleSheetCollectionBase::appendSheetForList(StyleSheet* sheet) 73 void StyleSheetCollectionBase::appendSheetForList(StyleSheet* sheet)
67 { 74 {
68 m_styleSheetsForStyleSheetList.append(sheet); 75 m_styleSheetsForStyleSheetList.append(sheet);
69 } 76 }
70 77
71
72 StyleSheetCollection::StyleSheetCollection(TreeScope& treeScope) 78 StyleSheetCollection::StyleSheetCollection(TreeScope& treeScope)
73 : m_treeScope(treeScope) 79 : m_treeScope(treeScope)
74 , m_hadActiveLoadingStylesheet(false) 80 , m_hadActiveLoadingStylesheet(false)
75 , m_usesRemUnits(false) 81 , m_usesRemUnits(false)
76 { 82 {
77 } 83 }
78 84
79 void StyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool createdBy Parser) 85 void StyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool createdBy Parser)
80 { 86 {
81 if (!node->inDocument()) 87 if (!node->inDocument())
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 } 262 }
257 return false; 263 return false;
258 } 264 }
259 265
260 void StyleSheetCollection::updateUsesRemUnits() 266 void StyleSheetCollection::updateUsesRemUnits()
261 { 267 {
262 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); 268 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets);
263 } 269 }
264 270
265 } 271 }
OLDNEW
« no previous file with comments | « Source/core/dom/StyleSheetCollection.h ('k') | Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698