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

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

Issue 1863793003: Make CSSValuePool thread local to ensure correct parsing in colors on workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with master Created 4 years, 8 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
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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 static Color cssValueToColor(CSSValue* colorValue) 394 static Color cssValueToColor(CSSValue* colorValue)
395 { 395 {
396 if (!colorValue || (!colorValue->isColorValue() && !colorValue->isPrimitiveV alue())) 396 if (!colorValue || (!colorValue->isColorValue() && !colorValue->isPrimitiveV alue()))
397 return Color::transparent; 397 return Color::transparent;
398 398
399 if (colorValue->isColorValue()) 399 if (colorValue->isColorValue())
400 return toCSSColorValue(colorValue)->value(); 400 return toCSSColorValue(colorValue)->value();
401 401
402 Color color = 0; 402 Color color = 0;
403 // FIXME: Why ignore the return value? 403 // FIXME: Why ignore the return value?
404 CSSParser::parseColor(color, colorValue->cssText()); 404 CSSParser::parseColor(color, colorValue->cssText(), nullptr);
405 return color; 405 return color;
406 } 406 }
407 407
408 static inline Color getFontColor(CSSStyleDeclaration* style) 408 static inline Color getFontColor(CSSStyleDeclaration* style)
409 { 409 {
410 return cssValueToColor(style->getPropertyCSSValueInternal(CSSPropertyColor). get()); 410 return cssValueToColor(style->getPropertyCSSValueInternal(CSSPropertyColor). get());
411 } 411 }
412 412
413 static inline Color getFontColor(StylePropertySet* style) 413 static inline Color getFontColor(StylePropertySet* style)
414 { 414 {
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 { 1724 {
1725 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1725 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1726 RawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl aration::create(ancestor); 1726 RawPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl aration::create(ancestor);
1727 if (!hasTransparentBackgroundColor(ancestorStyle.get())) 1727 if (!hasTransparentBackgroundColor(ancestorStyle.get()))
1728 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1728 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1729 } 1729 }
1730 return nullptr; 1730 return nullptr;
1731 } 1731 }
1732 1732
1733 } // namespace blink 1733 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ExecutionContext.cpp ('k') | third_party/WebKit/Source/core/html/HTMLBodyElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698