OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 } | 445 } |
446 | 446 |
447 void StyleResolver::matchScopedAuthorRules(ElementRuleCollector& collector, bool
includeEmptyRules) | 447 void StyleResolver::matchScopedAuthorRules(ElementRuleCollector& collector, bool
includeEmptyRules) |
448 { | 448 { |
449 // fast path | 449 // fast path |
450 if (m_styleTree.hasOnlyScopeResolverForDocument()) { | 450 if (m_styleTree.hasOnlyScopeResolverForDocument()) { |
451 m_styleTree.scopedStyleResolverForDocument()->matchAuthorRules(collector
, includeEmptyRules, true); | 451 m_styleTree.scopedStyleResolverForDocument()->matchAuthorRules(collector
, includeEmptyRules, true); |
452 return; | 452 return; |
453 } | 453 } |
454 | 454 |
455 Vector<std::pair<ScopedStyleResolver*, bool>, 8> stack; | 455 Vector<ScopedStyleResolver*, 8> stack; |
456 m_styleTree.resolveScopeStyles(m_state.element(), stack); | 456 m_styleTree.resolveScopeStyles(m_state.element(), stack); |
457 if (stack.isEmpty()) | 457 if (stack.isEmpty()) |
458 return; | 458 return; |
459 | 459 |
460 for (int i = stack.size() - 1; i >= 0; --i) { | 460 bool applyAuthorStyles = m_state.element()->treeScope()->applyAuthorStyles()
; |
461 ScopedStyleResolver* scopeResolver = stack.at(i).first; | 461 for (int i = stack.size() - 1; i >= 0; --i) |
462 bool applyAuthorStyles = stack.at(i).second; | 462 stack.at(i)->matchAuthorRules(collector, includeEmptyRules, applyAuthorS
tyles); |
463 scopeResolver->matchAuthorRules(collector, includeEmptyRules, applyAutho
rStyles); | 463 |
464 } | 464 matchHostRules(stack.first(), collector, includeEmptyRules); |
465 matchHostRules(stack.first().first, collector, includeEmptyRules); | |
466 } | 465 } |
467 | 466 |
468 void StyleResolver::matchAuthorRules(ElementRuleCollector& collector, bool inclu
deEmptyRules) | 467 void StyleResolver::matchAuthorRules(ElementRuleCollector& collector, bool inclu
deEmptyRules) |
469 { | 468 { |
470 matchScopedAuthorRules(collector, includeEmptyRules); | 469 matchScopedAuthorRules(collector, includeEmptyRules); |
471 matchShadowDistributedRules(collector, includeEmptyRules); | 470 matchShadowDistributedRules(collector, includeEmptyRules); |
472 } | 471 } |
473 | 472 |
474 void StyleResolver::matchUserRules(ElementRuleCollector& collector, bool include
EmptyRules) | 473 void StyleResolver::matchUserRules(ElementRuleCollector& collector, bool include
EmptyRules) |
475 { | 474 { |
(...skipping 3252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3728 info.addMember(m_state, "state"); | 3727 info.addMember(m_state, "state"); |
3729 | 3728 |
3730 // FIXME: move this to a place where it would be called only once? | 3729 // FIXME: move this to a place where it would be called only once? |
3731 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); | 3730 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); |
3732 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl
e"); | 3731 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl
e"); |
3733 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle"
); | 3732 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle"
); |
3734 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo
urceStyle"); | 3733 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo
urceStyle"); |
3735 } | 3734 } |
3736 | 3735 |
3737 } // namespace WebCore | 3736 } // namespace WebCore |
OLD | NEW |