| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 return CSSAnimatableValueFactory::create(property, *state.style()); | 554 return CSSAnimatableValueFactory::create(property, *state.style()); |
| 555 } | 555 } |
| 556 | 556 |
| 557 PassRefPtr<RenderStyle> StyleResolver::defaultStyleForElement() | 557 PassRefPtr<RenderStyle> StyleResolver::defaultStyleForElement() |
| 558 { | 558 { |
| 559 StyleResolverState state(document(), 0); | 559 StyleResolverState state(document(), 0); |
| 560 state.setStyle(RenderStyle::create()); | 560 state.setStyle(RenderStyle::create()); |
| 561 state.fontBuilder().initForStyleResolve(document(), state.style()); | 561 state.fontBuilder().initForStyleResolve(document(), state.style()); |
| 562 state.style()->setLineHeight(RenderStyle::initialLineHeight()); | 562 state.style()->setLineHeight(RenderStyle::initialLineHeight()); |
| 563 state.setLineHeightValue(0); | 563 state.setLineHeightValue(0); |
| 564 state.fontBuilder().setInitial(state.style()->effectiveZoom()); | 564 state.fontBuilder().setInitial(); |
| 565 state.style()->font().update(document().styleEngine()->fontSelector()); | 565 state.style()->font().update(document().styleEngine()->fontSelector()); |
| 566 return state.takeStyle(); | 566 return state.takeStyle(); |
| 567 } | 567 } |
| 568 | 568 |
| 569 PassRefPtr<RenderStyle> StyleResolver::styleForText(Text* textNode) | 569 PassRefPtr<RenderStyle> StyleResolver::styleForText(Text* textNode) |
| 570 { | 570 { |
| 571 ASSERT(textNode); | 571 ASSERT(textNode); |
| 572 | 572 |
| 573 Node* parentNode = NodeRenderingTraversal::parent(textNode); | 573 Node* parentNode = NodeRenderingTraversal::parent(textNode); |
| 574 if (!parentNode || !parentNode->renderStyle()) | 574 if (!parentNode || !parentNode->renderStyle()) |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 | 877 |
| 878 // Now we have all of the matched rules in the appropriate order. Walk the r
ules and apply | 878 // Now we have all of the matched rules in the appropriate order. Walk the r
ules and apply |
| 879 // high-priority properties first, i.e., those properties that other propert
ies depend on. | 879 // high-priority properties first, i.e., those properties that other propert
ies depend on. |
| 880 // The order is (1) high-priority not important, (2) high-priority important
, (3) normal not important | 880 // The order is (1) high-priority not important, (2) high-priority important
, (3) normal not important |
| 881 // and (4) normal important. | 881 // and (4) normal important. |
| 882 state.setLineHeightValue(0); | 882 state.setLineHeightValue(0); |
| 883 applyMatchedProperties<HighPriorityProperties>(state, matchResult, false, 0,
matchResult.matchedProperties.size() - 1, applyInheritedOnly); | 883 applyMatchedProperties<HighPriorityProperties>(state, matchResult, false, 0,
matchResult.matchedProperties.size() - 1, applyInheritedOnly); |
| 884 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, mat
chResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInherit
edOnly); | 884 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, mat
chResult.ranges.firstAuthorRule, matchResult.ranges.lastAuthorRule, applyInherit
edOnly); |
| 885 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, mat
chResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); | 885 applyMatchedProperties<HighPriorityProperties>(state, matchResult, true, mat
chResult.ranges.firstUARule, matchResult.ranges.lastUARule, applyInheritedOnly); |
| 886 | 886 |
| 887 if (cachedMatchedProperties && cachedMatchedProperties->renderStyle->effecti
veZoom() != state.style()->effectiveZoom()) { | |
| 888 state.fontBuilder().setFontDirty(true); | |
| 889 applyInheritedOnly = false; | |
| 890 } | |
| 891 | |
| 892 // If our font got dirtied, go ahead and update it now. | 887 // If our font got dirtied, go ahead and update it now. |
| 893 updateFont(state); | 888 updateFont(state); |
| 894 | 889 |
| 895 // Line-height is set when we are sure we decided on the font-size. | 890 // Line-height is set when we are sure we decided on the font-size. |
| 896 if (state.lineHeightValue()) | 891 if (state.lineHeightValue()) |
| 897 StyleBuilder::applyProperty(CSSPropertyLineHeight, state, state.lineHeig
htValue()); | 892 StyleBuilder::applyProperty(CSSPropertyLineHeight, state, state.lineHeig
htValue()); |
| 898 | 893 |
| 899 // Many properties depend on the font. If it changes we just apply all prope
rties. | 894 // Many properties depend on the font. If it changes we just apply all prope
rties. |
| 900 if (cachedMatchedProperties && cachedMatchedProperties->renderStyle->fontDes
cription() != state.style()->fontDescription()) | 895 if (cachedMatchedProperties && cachedMatchedProperties->renderStyle->fontDes
cription() != state.style()->fontDescription()) |
| 901 applyInheritedOnly = false; | 896 applyInheritedOnly = false; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 visitor->trace(m_viewportDependentMediaQueryResults); | 994 visitor->trace(m_viewportDependentMediaQueryResults); |
| 1000 visitor->trace(m_features); | 995 visitor->trace(m_features); |
| 1001 visitor->trace(m_attributeRuleSet); | 996 visitor->trace(m_attributeRuleSet); |
| 1002 visitor->trace(m_styleSharingLists); | 997 visitor->trace(m_styleSharingLists); |
| 1003 visitor->trace(m_pendingStyleSheets); | 998 visitor->trace(m_pendingStyleSheets); |
| 1004 visitor->trace(m_document); | 999 visitor->trace(m_document); |
| 1005 #endif | 1000 #endif |
| 1006 } | 1001 } |
| 1007 | 1002 |
| 1008 } // namespace blink | 1003 } // namespace blink |
| OLD | NEW |