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

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

Issue 2233333002: Made StylePropertySet::setProperty take a const CSSValue& instead of ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 MutableStylePropertySet* inlineStyle = copyStyleOrCreateEmpty(element->i nlineStyle()); 439 MutableStylePropertySet* inlineStyle = copyStyleOrCreateEmpty(element->i nlineStyle());
440 float currentFontSize = computedFontSize(node); 440 float currentFontSize = computedFontSize(node);
441 float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta()); 441 float desiredFontSize = max(MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta());
442 const CSSValue* value = inlineStyle->getPropertyCSSValue(CSSPropertyFont Size); 442 const CSSValue* value = inlineStyle->getPropertyCSSValue(CSSPropertyFont Size);
443 if (value) { 443 if (value) {
444 element->removeInlineStyleProperty(CSSPropertyFontSize); 444 element->removeInlineStyleProperty(CSSPropertyFontSize);
445 currentFontSize = computedFontSize(node); 445 currentFontSize = computedFontSize(node);
446 } 446 }
447 if (currentFontSize != desiredFontSize) { 447 if (currentFontSize != desiredFontSize) {
448 inlineStyle->setProperty(CSSPropertyFontSize, CSSPrimitiveValue::cre ate(desiredFontSize, CSSPrimitiveValue::UnitType::Pixels), false); 448 inlineStyle->setProperty(CSSPropertyFontSize, *CSSPrimitiveValue::cr eate(desiredFontSize, CSSPrimitiveValue::UnitType::Pixels), false);
449 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex t())); 449 setNodeAttribute(element, styleAttr, AtomicString(inlineStyle->asTex t()));
450 } 450 }
451 if (inlineStyle->isEmpty()) { 451 if (inlineStyle->isEmpty()) {
452 removeElementAttribute(element, styleAttr); 452 removeElementAttribute(element, styleAttr);
453 if (isSpanWithoutAttributesOrUnstyledStyleSpan(element)) 453 if (isSpanWithoutAttributesOrUnstyledStyleSpan(element))
454 unstyledSpans.append(element); 454 unstyledSpans.append(element);
455 } 455 }
456 } 456 }
457 457
458 for (const auto& unstyledSpan : unstyledSpans) { 458 for (const auto& unstyledSpan : unstyledSpans) {
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1756 DEFINE_TRACE(ApplyStyleCommand) 1756 DEFINE_TRACE(ApplyStyleCommand)
1757 { 1757 {
1758 visitor->trace(m_style); 1758 visitor->trace(m_style);
1759 visitor->trace(m_start); 1759 visitor->trace(m_start);
1760 visitor->trace(m_end); 1760 visitor->trace(m_end);
1761 visitor->trace(m_styledInlineElement); 1761 visitor->trace(m_styledInlineElement);
1762 CompositeEditCommand::trace(visitor); 1762 CompositeEditCommand::trace(visitor);
1763 } 1763 }
1764 1764
1765 } // namespace blink 1765 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.cpp ('k') | third_party/WebKit/Source/core/html/HTMLElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698