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

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

Issue 2709033003: Migrate WTF::HashMap::get() to ::at() (Closed)
Patch Set: rebase Created 3 years, 9 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 } else { 466 } else {
467 // Only handle HTML elements and text nodes. 467 // Only handle HTML elements and text nodes.
468 continue; 468 continue;
469 } 469 }
470 lastStyledNode = node; 470 lastStyledNode = node;
471 471
472 MutableStylePropertySet* inlineStyle = 472 MutableStylePropertySet* inlineStyle =
473 copyStyleOrCreateEmpty(element->inlineStyle()); 473 copyStyleOrCreateEmpty(element->inlineStyle());
474 float currentFontSize = computedFontSize(node); 474 float currentFontSize = computedFontSize(node);
475 float desiredFontSize = max( 475 float desiredFontSize = max(
476 MinimumFontSize, startingFontSizes.get(node) + style->fontSizeDelta()); 476 MinimumFontSize, startingFontSizes.at(node) + style->fontSizeDelta());
477 const CSSValue* value = 477 const CSSValue* value =
478 inlineStyle->getPropertyCSSValue(CSSPropertyFontSize); 478 inlineStyle->getPropertyCSSValue(CSSPropertyFontSize);
479 if (value) { 479 if (value) {
480 element->removeInlineStyleProperty(CSSPropertyFontSize); 480 element->removeInlineStyleProperty(CSSPropertyFontSize);
481 currentFontSize = computedFontSize(node); 481 currentFontSize = computedFontSize(node);
482 } 482 }
483 if (currentFontSize != desiredFontSize) { 483 if (currentFontSize != desiredFontSize) {
484 inlineStyle->setProperty( 484 inlineStyle->setProperty(
485 CSSPropertyFontSize, 485 CSSPropertyFontSize,
486 *CSSPrimitiveValue::create(desiredFontSize, 486 *CSSPrimitiveValue::create(desiredFontSize,
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 2021
2022 DEFINE_TRACE(ApplyStyleCommand) { 2022 DEFINE_TRACE(ApplyStyleCommand) {
2023 visitor->trace(m_style); 2023 visitor->trace(m_style);
2024 visitor->trace(m_start); 2024 visitor->trace(m_start);
2025 visitor->trace(m_end); 2025 visitor->trace(m_end);
2026 visitor->trace(m_styledInlineElement); 2026 visitor->trace(m_styledInlineElement);
2027 CompositeEditCommand::trace(visitor); 2027 CompositeEditCommand::trace(visitor);
2028 } 2028 }
2029 2029
2030 } // namespace blink 2030 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698