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, 2011, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 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) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. |
(...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 // and then trigger a full document recalc. We also need to clear it here si
nce the | 1653 // and then trigger a full document recalc. We also need to clear it here si
nce the |
1654 // call to styleForElement on the body above can cache bad values for rem un
its if the | 1654 // call to styleForElement on the body above can cache bad values for rem un
its if the |
1655 // documentElement's style was dirty. We could keep track of which elements
depend on | 1655 // documentElement's style was dirty. We could keep track of which elements
depend on |
1656 // rem units like we do for viewport styles, but we assume root font size ch
anges are | 1656 // rem units like we do for viewport styles, but we assume root font size ch
anges are |
1657 // rare and just invalidate the cache for now. | 1657 // rare and just invalidate the cache for now. |
1658 if (styleEngine()->usesRemUnits() && (documentElement()->needsAttach() || do
cumentElement()->computedStyle()->fontSize() != documentElementStyle->fontSize()
)) { | 1658 if (styleEngine()->usesRemUnits() && (documentElement()->needsAttach() || do
cumentElement()->computedStyle()->fontSize() != documentElementStyle->fontSize()
)) { |
1659 ensureStyleResolver().invalidateMatchedPropertiesCache(); | 1659 ensureStyleResolver().invalidateMatchedPropertiesCache(); |
1660 documentElement()->setNeedsStyleRecalc(SubtreeStyleChange); | 1660 documentElement()->setNeedsStyleRecalc(SubtreeStyleChange); |
1661 } | 1661 } |
1662 | 1662 |
1663 EOverflow overflowX = OAUTO; | |
1664 EOverflow overflowY = OAUTO; | |
1665 float columnGap = 0; | |
1666 if (overflowStyle) { | |
1667 overflowX = overflowStyle->overflowX(); | |
1668 overflowY = overflowStyle->overflowY(); | |
1669 // Visible overflow on the viewport is meaningless, and the spec says to
treat it as 'auto': | |
1670 if (overflowX == OVISIBLE) | |
1671 overflowX = OAUTO; | |
1672 if (overflowY == OVISIBLE) | |
1673 overflowY = OAUTO; | |
1674 // Column-gap is (ab)used by the current paged overflow implementation (
in lack of other | |
1675 // ways to specify gaps between pages), so we have to propagate it too. | |
1676 columnGap = overflowStyle->columnGap(); | |
1677 } | |
1678 | |
1679 RefPtr<RenderStyle> documentStyle = renderView()->style(); | 1663 RefPtr<RenderStyle> documentStyle = renderView()->style(); |
1680 if (documentStyle->writingMode() != rootWritingMode | 1664 if (documentStyle->writingMode() != rootWritingMode |
1681 || documentStyle->direction() != rootDirection | 1665 || documentStyle->direction() != rootDirection |
1682 || documentStyle->overflowX() != overflowX | 1666 || (overflowStyle && (documentStyle->overflowX() != overflowStyle->overf
lowX() || documentStyle->overflowY() != overflowStyle->overflowY()))) { |
1683 || documentStyle->overflowY() != overflowY | |
1684 || documentStyle->columnGap() != columnGap) { | |
1685 RefPtr<RenderStyle> newStyle = RenderStyle::clone(documentStyle.get()); | 1667 RefPtr<RenderStyle> newStyle = RenderStyle::clone(documentStyle.get()); |
1686 newStyle->setWritingMode(rootWritingMode); | 1668 newStyle->setWritingMode(rootWritingMode); |
1687 newStyle->setDirection(rootDirection); | 1669 newStyle->setDirection(rootDirection); |
1688 newStyle->setColumnGap(columnGap); | 1670 EOverflow overflowX = OAUTO; |
| 1671 EOverflow overflowY = OAUTO; |
| 1672 if (overflowStyle) { |
| 1673 overflowX = overflowStyle->overflowX(); |
| 1674 overflowY = overflowStyle->overflowY(); |
| 1675 // Visible overflow on the viewport is meaningless, and the spec say
s to treat it as 'auto': |
| 1676 if (overflowX == OVISIBLE) |
| 1677 overflowX = OAUTO; |
| 1678 if (overflowY == OVISIBLE) |
| 1679 overflowY = OAUTO; |
| 1680 |
| 1681 // Column-gap is (ab)used by the current paged overflow implementati
on (in lack of other |
| 1682 // ways to specify gaps between pages), so we have to propagate it t
oo. |
| 1683 newStyle->setColumnGap(overflowStyle->columnGap()); |
| 1684 } |
1689 newStyle->setOverflowX(overflowX); | 1685 newStyle->setOverflowX(overflowX); |
1690 newStyle->setOverflowY(overflowY); | 1686 newStyle->setOverflowY(overflowY); |
1691 renderView()->setStyle(newStyle); | 1687 renderView()->setStyle(newStyle); |
1692 setupFontBuilder(newStyle.get()); | 1688 setupFontBuilder(newStyle.get()); |
1693 } | 1689 } |
1694 | 1690 |
1695 if (body) { | 1691 if (body) { |
1696 if (RenderStyle* style = body->renderStyle()) { | 1692 if (RenderStyle* style = body->renderStyle()) { |
1697 if (style->direction() != rootDirection || style->writingMode() != r
ootWritingMode) | 1693 if (style->direction() != rootDirection || style->writingMode() != r
ootWritingMode) |
1698 body->setNeedsStyleRecalc(SubtreeStyleChange); | 1694 body->setNeedsStyleRecalc(SubtreeStyleChange); |
(...skipping 3739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5438 void Document::defaultEventHandler(Event* event) | 5434 void Document::defaultEventHandler(Event* event) |
5439 { | 5435 { |
5440 if (frame() && frame()->remotePlatformLayer()) { | 5436 if (frame() && frame()->remotePlatformLayer()) { |
5441 frame()->chromeClient().forwardInputEvent(this, event); | 5437 frame()->chromeClient().forwardInputEvent(this, event); |
5442 return; | 5438 return; |
5443 } | 5439 } |
5444 Node::defaultEventHandler(event); | 5440 Node::defaultEventHandler(event); |
5445 } | 5441 } |
5446 | 5442 |
5447 } // namespace WebCore | 5443 } // namespace WebCore |
OLD | NEW |