Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: Source/core/dom/Element.cpp

Issue 147903002: CSS rem units should properly resolve on <body> (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 renderer->setAnimatableStyle(newStyle.get()); 1633 renderer->setAnimatableStyle(newStyle.get());
1634 } else { 1634 } else {
1635 // Although no change occurred, we use the new style so that the cou sin style sharing code won't get 1635 // Although no change occurred, we use the new style so that the cou sin style sharing code won't get
1636 // fooled into believing this style is the same. 1636 // fooled into believing this style is the same.
1637 // FIXME: We may be able to remove this hack, see discussion in 1637 // FIXME: We may be able to remove this hack, see discussion in
1638 // https://codereview.chromium.org/30453002/ 1638 // https://codereview.chromium.org/30453002/
1639 renderer->setStyleInternal(newStyle.get()); 1639 renderer->setStyleInternal(newStyle.get());
1640 } 1640 }
1641 } 1641 }
1642 1642
1643 // If "rem" units are used anywhere in the document, and if the document ele ment's font size changes, then go ahead and force font updating
1644 // all the way down the tree. This is simpler than having to maintain a cach e of objects (and such font size changes should be rare anyway).
1645 if (document().styleEngine()->usesRemUnits() && document().documentElement() == this && oldStyle->fontSize() != newStyle->fontSize()) {
1646 // Cached RenderStyles may depend on the re units.
1647 document().ensureStyleResolver().invalidateMatchedPropertiesCache();
1648 return Force;
1649 }
1650
1651 if (styleChangeType() >= SubtreeStyleChange) 1643 if (styleChangeType() >= SubtreeStyleChange)
1652 return Force; 1644 return Force;
1653 1645
1654 if (change <= Inherit) 1646 if (change <= Inherit)
1655 return localChange; 1647 return localChange;
1656 1648
1657 return max(localChange, change); 1649 return max(localChange, change);
1658 } 1650 }
1659 1651
1660 void Element::recalcChildStyle(StyleRecalcChange change) 1652 void Element::recalcChildStyle(StyleRecalcChange change)
(...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after
3628 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi stItems 3620 // Before doing so, we need to resolve issues in HTMLSelectElement::recalcLi stItems
3629 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg i?id=88405 3621 // and RenderMenuList::setText. See also https://bugs.webkit.org/show_bug.cg i?id=88405
3630 if (hasTagName(optionTag) || hasTagName(optgroupTag)) 3622 if (hasTagName(optionTag) || hasTagName(optgroupTag))
3631 return false; 3623 return false;
3632 if (FullscreenElementStack::isActiveFullScreenElement(this)) 3624 if (FullscreenElementStack::isActiveFullScreenElement(this))
3633 return false; 3625 return false;
3634 return true; 3626 return true;
3635 } 3627 }
3636 3628
3637 } // namespace WebCore 3629 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698