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

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

Issue 2366243002: Remove all ordering requirements in CSSValueKeywords.in (WIP) (Closed)
Patch Set: Some mor efixes Created 4 years, 1 month 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
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 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1996 FontSize::fontSizeForKeyword(document, legacyFontSize, 1996 FontSize::fontSizeForKeyword(document, legacyFontSize,
1997 isMonospaceFont) == pixelFontSize) 1997 isMonospaceFont) == pixelFontSize)
1998 return legacyFontSize; 1998 return legacyFontSize;
1999 1999
2000 return 0; 2000 return 0;
2001 } 2001 }
2002 } 2002 }
2003 2003
2004 if (value->isIdentifierValue()) { 2004 if (value->isIdentifierValue()) {
2005 const CSSIdentifierValue& identifierValue = toCSSIdentifierValue(*value); 2005 const CSSIdentifierValue& identifierValue = toCSSIdentifierValue(*value);
2006 if (CSSValueXSmall <= identifierValue.getValueID() && 2006 switch (identifierValue.getValueID()) {
2007 identifierValue.getValueID() <= CSSValueWebkitXxxLarge) 2007 case CSSValueXSmall:
2008 return identifierValue.getValueID() - CSSValueXSmall + 1; 2008 return 1;
2009 case CSSValueSmall:
2010 return 2;
2011 case CSSValueMedium:
2012 return 3;
2013 case CSSValueLarge:
2014 return 4;
2015 case CSSValueXLarge:
2016 return 5;
2017 case CSSValueXxLarge:
2018 return 6;
2019 case CSSValueWebkitXxxLarge:
2020 return 7;
2021 default:
2022 return 0;
2023 }
2009 } 2024 }
2010 2025
2011 return 0; 2026 return 0;
2012 } 2027 }
2013 2028
2014 bool isTransparentColorValue(const CSSValue* cssValue) { 2029 bool isTransparentColorValue(const CSSValue* cssValue) {
2015 if (!cssValue) 2030 if (!cssValue)
2016 return true; 2031 return true;
2017 if (cssValue->isColorValue()) 2032 if (cssValue->isColorValue())
2018 return !toCSSColorValue(cssValue)->value().alpha(); 2033 return !toCSSColorValue(cssValue)->value().alpha();
(...skipping 18 matching lines...) Expand all
2037 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 2052 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
2038 CSSComputedStyleDeclaration* ancestorStyle = 2053 CSSComputedStyleDeclaration* ancestorStyle =
2039 CSSComputedStyleDeclaration::create(ancestor); 2054 CSSComputedStyleDeclaration::create(ancestor);
2040 if (!hasTransparentBackgroundColor(ancestorStyle)) 2055 if (!hasTransparentBackgroundColor(ancestorStyle))
2041 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor); 2056 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor);
2042 } 2057 }
2043 return nullptr; 2058 return nullptr;
2044 } 2059 }
2045 2060
2046 } // namespace blink 2061 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698