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

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

Issue 2035373002: Made StylePropertySet::getPropertyCSSValue return a const CSSValue* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_fix_cssparser_font_face_descriptor_to_return_const
Patch Set: Rebase Created 4 years, 5 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) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 element = span; 422 element = span;
423 } else { 423 } else {
424 // Only handle HTML elements and text nodes. 424 // Only handle HTML elements and text nodes.
425 continue; 425 continue;
426 } 426 }
427 lastStyledNode = node; 427 lastStyledNode = node;
428 428
429 MutableStylePropertySet* inlineStyle = copyStyleOrCreateEmpty(element->i nlineStyle()); 429 MutableStylePropertySet* inlineStyle = copyStyleOrCreateEmpty(element->i nlineStyle());
430 float currentFontSize = computedFontSize(node); 430 float currentFontSize = computedFontSize(node);
431 float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta()); 431 float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta());
432 CSSValue* value = inlineStyle->getPropertyCSSValue(CSSPropertyFontSize); 432 const CSSValue* value = inlineStyle->getPropertyCSSValue(CSSPropertyFont Size);
433 if (value) { 433 if (value) {
434 element->removeInlineStyleProperty(CSSPropertyFontSize); 434 element->removeInlineStyleProperty(CSSPropertyFontSize);
435 currentFontSize = computedFontSize(node); 435 currentFontSize = computedFontSize(node);
436 } 436 }
437 if (currentFontSize != desiredFontSize) { 437 if (currentFontSize != desiredFontSize) {
438 inlineStyle->setProperty(CSSPropertyFontSize, CSSPrimitiveValue::cre ate(desiredFontSize, CSSPrimitiveValue::UnitType::Pixels), false); 438 inlineStyle->setProperty(CSSPropertyFontSize, CSSPrimitiveValue::cre ate(desiredFontSize, CSSPrimitiveValue::UnitType::Pixels), false);
439 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex t())); 439 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex t()));
440 } 440 }
441 if (inlineStyle->isEmpty()) { 441 if (inlineStyle->isEmpty()) {
442 removeElementAttribute(element, styleAttr); 442 removeElementAttribute(element, styleAttr);
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 DEFINE_TRACE(ApplyStyleCommand) 1731 DEFINE_TRACE(ApplyStyleCommand)
1732 { 1732 {
1733 visitor->trace(m_style); 1733 visitor->trace(m_style);
1734 visitor->trace(m_start); 1734 visitor->trace(m_start);
1735 visitor->trace(m_end); 1735 visitor->trace(m_end);
1736 visitor->trace(m_styledInlineElement); 1736 visitor->trace(m_styledInlineElement);
1737 CompositeEditCommand::trace(visitor); 1737 CompositeEditCommand::trace(visitor);
1738 } 1738 }
1739 1739
1740 } // namespace blink 1740 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698