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

Side by Side Diff: Source/core/editing/EditingStyle.cpp

Issue 468793003: Make style building for 'font-size' less custom. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix regression related to FontDescriptions with isAbsolute=true. Created 6 years, 3 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
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/platform/fonts/FontDescription.h » ('j') | 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) 2007, 2008, 2009 Apple Computer, Inc. 2 * Copyright (C) 2007, 2008, 2009 Apple Computer, Inc.
3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2010, 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 { 1631 {
1632 return value->isFontIndependentLength(); 1632 return value->isFontIndependentLength();
1633 } 1633 }
1634 1634
1635 int legacyFontSizeFromCSSValue(Document* document, CSSPrimitiveValue* value, Fix edPitchFontType fixedPitchFontType, LegacyFontSizeMode mode) 1635 int legacyFontSizeFromCSSValue(Document* document, CSSPrimitiveValue* value, Fix edPitchFontType fixedPitchFontType, LegacyFontSizeMode mode)
1636 { 1636 {
1637 if (isCSSValueLength(value)) { 1637 if (isCSSValueLength(value)) {
1638 int pixelFontSize = value->getIntValue(CSSPrimitiveValue::CSS_PX); 1638 int pixelFontSize = value->getIntValue(CSSPrimitiveValue::CSS_PX);
1639 int legacyFontSize = FontSize::legacyFontSize(document, pixelFontSize, f ixedPitchFontType); 1639 int legacyFontSize = FontSize::legacyFontSize(document, pixelFontSize, f ixedPitchFontType);
1640 // Use legacy font size only if pixel value matches exactly to that of l egacy font size. 1640 // Use legacy font size only if pixel value matches exactly to that of l egacy font size.
1641 CSSValueID cssPrimitiveEquivalent = static_cast<CSSValueID>(legacyFontSi ze - 1 + CSSValueXSmall); 1641 if (mode == AlwaysUseLegacyFontSize || FontSize::fontSizeForKeyword(docu ment, legacyFontSize, fixedPitchFontType) == pixelFontSize)
1642 if (mode == AlwaysUseLegacyFontSize || FontSize::fontSizeForKeyword(docu ment, cssPrimitiveEquivalent, fixedPitchFontType) == pixelFontSize)
1643 return legacyFontSize; 1642 return legacyFontSize;
1644 1643
1645 return 0; 1644 return 0;
1646 } 1645 }
1647 1646
1648 if (CSSValueXSmall <= value->getValueID() && value->getValueID() <= CSSValue WebkitXxxLarge) 1647 if (CSSValueXSmall <= value->getValueID() && value->getValueID() <= CSSValue WebkitXxxLarge)
1649 return value->getValueID() - CSSValueXSmall + 1; 1648 return value->getValueID() - CSSValueXSmall + 1;
1650 1649
1651 return 0; 1650 return 0;
1652 } 1651 }
(...skipping 26 matching lines...) Expand all
1679 { 1678 {
1680 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1679 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1681 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor); 1680 RefPtrWillBeRawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSCompu tedStyleDeclaration::create(ancestor);
1682 if (!hasTransparentBackgroundColor(ancestorStyle.get())) 1681 if (!hasTransparentBackgroundColor(ancestorStyle.get()))
1683 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1682 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1684 } 1683 }
1685 return nullptr; 1684 return nullptr;
1686 } 1685 }
1687 1686
1688 } 1687 }
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/platform/fonts/FontDescription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698