| OLD | NEW |
| 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 10 matching lines...) Expand all Loading... |
| 21 * You should have received a copy of the GNU Library General Public License | 21 * You should have received a copy of the GNU Library General Public License |
| 22 * along with this library; see the file COPYING.LIB. If not, write to | 22 * along with this library; see the file COPYING.LIB. If not, write to |
| 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 24 * Boston, MA 02110-1301, USA. | 24 * Boston, MA 02110-1301, USA. |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "config.h" | 27 #include "config.h" |
| 28 #include "core/dom/DocumentStyleSheetCollection.h" | 28 #include "core/dom/DocumentStyleSheetCollection.h" |
| 29 | 29 |
| 30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
| 31 #include "RuntimeEnabledFeatures.h" |
| 31 #include "SVGNames.h" | 32 #include "SVGNames.h" |
| 32 #include "core/css/CSSStyleSheet.h" | 33 #include "core/css/CSSStyleSheet.h" |
| 33 #include "core/css/resolver/StyleResolver.h" | 34 #include "core/css/resolver/StyleResolver.h" |
| 34 #include "core/dom/Document.h" | 35 #include "core/dom/Document.h" |
| 35 #include "core/dom/Element.h" | 36 #include "core/dom/Element.h" |
| 36 #include "core/dom/ProcessingInstruction.h" | 37 #include "core/dom/ProcessingInstruction.h" |
| 37 #include "core/dom/StyleEngine.h" | 38 #include "core/dom/StyleEngine.h" |
| 38 #include "core/html/HTMLIFrameElement.h" | 39 #include "core/html/HTMLIFrameElement.h" |
| 39 #include "core/html/HTMLLinkElement.h" | 40 #include "core/html/HTMLLinkElement.h" |
| 40 #include "core/html/HTMLStyleElement.h" | 41 #include "core/html/HTMLStyleElement.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 60 DocumentOrderedList::iterator end = m_styleSheetCandidateNodes.end(); | 61 DocumentOrderedList::iterator end = m_styleSheetCandidateNodes.end(); |
| 61 for (DocumentOrderedList::iterator it = begin; it != end; ++it) { | 62 for (DocumentOrderedList::iterator it = begin; it != end; ++it) { |
| 62 Node* n = *it; | 63 Node* n = *it; |
| 63 StyleSheet* sheet = 0; | 64 StyleSheet* sheet = 0; |
| 64 CSSStyleSheet* activeSheet = 0; | 65 CSSStyleSheet* activeSheet = 0; |
| 65 if (n->nodeType() == Node::PROCESSING_INSTRUCTION_NODE && !document()->i
sHTMLDocument()) { | 66 if (n->nodeType() == Node::PROCESSING_INSTRUCTION_NODE && !document()->i
sHTMLDocument()) { |
| 66 // Processing instruction (XML documents only). | 67 // Processing instruction (XML documents only). |
| 67 // We don't support linking to embedded CSS stylesheets, see <https:
//bugs.webkit.org/show_bug.cgi?id=49281> for discussion. | 68 // We don't support linking to embedded CSS stylesheets, see <https:
//bugs.webkit.org/show_bug.cgi?id=49281> for discussion. |
| 68 ProcessingInstruction* pi = toProcessingInstruction(n); | 69 ProcessingInstruction* pi = toProcessingInstruction(n); |
| 69 // Don't apply XSL transforms to already transformed documents -- <r
dar://problem/4132806> | 70 // Don't apply XSL transforms to already transformed documents -- <r
dar://problem/4132806> |
| 70 if (pi->isXSL() && !document()->transformSourceDocument()) { | 71 if (RuntimeEnabledFeatures::xsltEnabled() && pi->isXSL() && !documen
t()->transformSourceDocument()) { |
| 71 // Don't apply XSL transforms until loading is finished. | 72 // Don't apply XSL transforms until loading is finished. |
| 72 if (!document()->parsing() && !pi->isLoading()) | 73 if (!document()->parsing() && !pi->isLoading()) |
| 73 document()->applyXSLTransform(pi); | 74 document()->applyXSLTransform(pi); |
| 74 return; | 75 return; |
| 75 } | 76 } |
| 76 sheet = pi->sheet(); | 77 sheet = pi->sheet(); |
| 77 if (sheet && !sheet->disabled() && sheet->isCSSStyleSheet()) | 78 if (sheet && !sheet->disabled() && sheet->isCSSStyleSheet()) |
| 78 activeSheet = static_cast<CSSStyleSheet*>(sheet); | 79 activeSheet = static_cast<CSSStyleSheet*>(sheet); |
| 79 } else if ((n->isHTMLElement() && (n->hasTagName(linkTag) || n->hasTagNa
me(styleTag))) || (n->isSVGElement() && n->hasTagName(SVGNames::styleTag))) { | 80 } else if ((n->isHTMLElement() && (n->hasTagName(linkTag) || n->hasTagNa
me(styleTag))) || (n->isSVGElement() && n->hasTagName(SVGNames::styleTag))) { |
| 80 Element* e = toElement(n); | 81 Element* e = toElement(n); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 178 } |
| 178 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); | 179 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); |
| 179 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); | 180 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); |
| 180 m_styleSheetsForStyleSheetList.swap(styleSheets); | 181 m_styleSheetsForStyleSheetList.swap(styleSheets); |
| 181 updateUsesRemUnits(); | 182 updateUsesRemUnits(); |
| 182 | 183 |
| 183 return requiresFullStyleRecalc; | 184 return requiresFullStyleRecalc; |
| 184 } | 185 } |
| 185 | 186 |
| 186 } | 187 } |
| OLD | NEW |