| 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 548 } |
| 549 } | 549 } |
| 550 | 550 |
| 551 PassRefPtr<ComputedStyle> StyleResolver::styleForDocument(Document& document) | 551 PassRefPtr<ComputedStyle> StyleResolver::styleForDocument(Document& document) |
| 552 { | 552 { |
| 553 const LocalFrame* frame = document.frame(); | 553 const LocalFrame* frame = document.frame(); |
| 554 | 554 |
| 555 RefPtr<ComputedStyle> documentStyle = ComputedStyle::create(); | 555 RefPtr<ComputedStyle> documentStyle = ComputedStyle::create(); |
| 556 documentStyle->setRTLOrdering(document.visuallyOrdered() ? VisualOrder : Log
icalOrder); | 556 documentStyle->setRTLOrdering(document.visuallyOrdered() ? VisualOrder : Log
icalOrder); |
| 557 documentStyle->setZoom(frame && !document.printing() ? frame->pageZoomFactor
() : 1); | 557 documentStyle->setZoom(frame && !document.printing() ? frame->pageZoomFactor
() : 1); |
| 558 FontDescription documentFontDescription = documentStyle->fontDescription(); | 558 FontDescription documentFontDescription = documentStyle->getFontDescription(
); |
| 559 documentFontDescription.setLocale(document.contentLanguage()); | 559 documentFontDescription.setLocale(document.contentLanguage()); |
| 560 documentStyle->setFontDescription(documentFontDescription); | 560 documentStyle->setFontDescription(documentFontDescription); |
| 561 documentStyle->setZIndex(0); | 561 documentStyle->setZIndex(0); |
| 562 documentStyle->setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONL
Y); | 562 documentStyle->setUserModify(document.inDesignMode() ? READ_WRITE : READ_ONL
Y); |
| 563 // These are designed to match the user-agent stylesheet values for the docu
ment element | 563 // These are designed to match the user-agent stylesheet values for the docu
ment element |
| 564 // so that the common case doesn't need to create a new ComputedStyle in | 564 // so that the common case doesn't need to create a new ComputedStyle in |
| 565 // Document::inheritHtmlAndBodyElementStyles. | 565 // Document::inheritHtmlAndBodyElementStyles. |
| 566 documentStyle->setDisplay(BLOCK); | 566 documentStyle->setDisplay(BLOCK); |
| 567 documentStyle->setPosition(AbsolutePosition); | 567 documentStyle->setPosition(AbsolutePosition); |
| 568 | 568 |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 | 1460 |
| 1461 if (cachedMatchedProperties && cachedMatchedProperties->computedStyle->effec
tiveZoom() != state.style()->effectiveZoom()) { | 1461 if (cachedMatchedProperties && cachedMatchedProperties->computedStyle->effec
tiveZoom() != state.style()->effectiveZoom()) { |
| 1462 state.fontBuilder().didChangeEffectiveZoom(); | 1462 state.fontBuilder().didChangeEffectiveZoom(); |
| 1463 applyInheritedOnly = false; | 1463 applyInheritedOnly = false; |
| 1464 } | 1464 } |
| 1465 | 1465 |
| 1466 // If our font got dirtied, go ahead and update it now. | 1466 // If our font got dirtied, go ahead and update it now. |
| 1467 updateFont(state); | 1467 updateFont(state); |
| 1468 | 1468 |
| 1469 // Many properties depend on the font. If it changes we just apply all prope
rties. | 1469 // Many properties depend on the font. If it changes we just apply all prope
rties. |
| 1470 if (cachedMatchedProperties && cachedMatchedProperties->computedStyle->fontD
escription() != state.style()->fontDescription()) | 1470 if (cachedMatchedProperties && cachedMatchedProperties->computedStyle->getFo
ntDescription() != state.style()->getFontDescription()) |
| 1471 applyInheritedOnly = false; | 1471 applyInheritedOnly = false; |
| 1472 | 1472 |
| 1473 // Now do the normal priority UA properties. | 1473 // Now do the normal priority UA properties. |
| 1474 applyMatchedProperties<LowPropertyPriority>(state, matchResult.uaRules(), fa
lse, applyInheritedOnly); | 1474 applyMatchedProperties<LowPropertyPriority>(state, matchResult.uaRules(), fa
lse, applyInheritedOnly); |
| 1475 | 1475 |
| 1476 // Cache the UA properties to pass them to LayoutTheme in adjustComputedStyl
e. | 1476 // Cache the UA properties to pass them to LayoutTheme in adjustComputedStyl
e. |
| 1477 state.cacheUserAgentBorderAndBackground(); | 1477 state.cacheUserAgentBorderAndBackground(); |
| 1478 | 1478 |
| 1479 // Now do the author and user normal priority properties and all the !import
ant properties. | 1479 // Now do the author and user normal priority properties and all the !import
ant properties. |
| 1480 applyMatchedProperties<LowPropertyPriority>(state, matchResult.authorRules()
, false, applyInheritedOnly); | 1480 applyMatchedProperties<LowPropertyPriority>(state, matchResult.authorRules()
, false, applyInheritedOnly); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 visitor->trace(m_uncommonAttributeRuleSet); | 1612 visitor->trace(m_uncommonAttributeRuleSet); |
| 1613 visitor->trace(m_watchedSelectorsRules); | 1613 visitor->trace(m_watchedSelectorsRules); |
| 1614 visitor->trace(m_treeBoundaryCrossingScopes); | 1614 visitor->trace(m_treeBoundaryCrossingScopes); |
| 1615 visitor->trace(m_styleSharingLists); | 1615 visitor->trace(m_styleSharingLists); |
| 1616 visitor->trace(m_pendingStyleSheets); | 1616 visitor->trace(m_pendingStyleSheets); |
| 1617 visitor->trace(m_document); | 1617 visitor->trace(m_document); |
| 1618 #endif | 1618 #endif |
| 1619 } | 1619 } |
| 1620 | 1620 |
| 1621 } // namespace blink | 1621 } // namespace blink |
| OLD | NEW |