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

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

Issue 209433004: Do not zero-initialize RawPtr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. Created 6 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 | Annotate | Revision Log
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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 style->setProperty(m_propertyID, value->cssText()); 287 style->setProperty(m_propertyID, value->cssText());
288 } 288 }
289 289
290 PassRefPtrWillBeRawPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSVal ue(Element* element) const 290 PassRefPtrWillBeRawPtr<CSSValue> HTMLAttributeEquivalent::attributeValueAsCSSVal ue(Element* element) const
291 { 291 {
292 ASSERT(element); 292 ASSERT(element);
293 const AtomicString& value = element->getAttribute(m_attrName); 293 const AtomicString& value = element->getAttribute(m_attrName);
294 if (value.isNull()) 294 if (value.isNull())
295 return nullptr; 295 return nullptr;
296 296
297 RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle; 297 RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = nullptr;
298 dummyStyle = MutableStylePropertySet::create(); 298 dummyStyle = MutableStylePropertySet::create();
299 dummyStyle->setProperty(m_propertyID, value); 299 dummyStyle->setProperty(m_propertyID, value);
300 return dummyStyle->getPropertyCSSValue(m_propertyID); 300 return dummyStyle->getPropertyCSSValue(m_propertyID);
301 } 301 }
302 302
303 class HTMLFontSizeEquivalent FINAL : public HTMLAttributeEquivalent { 303 class HTMLFontSizeEquivalent FINAL : public HTMLAttributeEquivalent {
304 public: 304 public:
305 static PassOwnPtr<HTMLFontSizeEquivalent> create() 305 static PassOwnPtr<HTMLFontSizeEquivalent> create()
306 { 306 {
307 return adoptPtr(new HTMLFontSizeEquivalent()); 307 return adoptPtr(new HTMLFontSizeEquivalent());
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 { 932 {
933 if (!m_mutableStyle) 933 if (!m_mutableStyle)
934 return; 934 return;
935 935
936 // ReplaceSelectionCommand::handleStyleSpans() requires that this function o nly removes the editing style. 936 // ReplaceSelectionCommand::handleStyleSpans() requires that this function o nly removes the editing style.
937 // If this function was modified in the future to delete all redundant prope rties, then add a boolean value to indicate 937 // If this function was modified in the future to delete all redundant prope rties, then add a boolean value to indicate
938 // which one of editingStyleAtPosition or computedStyle is called. 938 // which one of editingStyleAtPosition or computedStyle is called.
939 RefPtr<EditingStyle> editingStyleAtPosition = EditingStyle::create(position, EditingPropertiesInEffect); 939 RefPtr<EditingStyle> editingStyleAtPosition = EditingStyle::create(position, EditingPropertiesInEffect);
940 StylePropertySet* styleAtPosition = editingStyleAtPosition->m_mutableStyle.g et(); 940 StylePropertySet* styleAtPosition = editingStyleAtPosition->m_mutableStyle.g et();
941 941
942 RefPtrWillBeRawPtr<CSSValue> unicodeBidi; 942 RefPtrWillBeRawPtr<CSSValue> unicodeBidi = nullptr;
943 RefPtrWillBeRawPtr<CSSValue> direction; 943 RefPtrWillBeRawPtr<CSSValue> direction = nullptr;
944 if (shouldPreserveWritingDirection == PreserveWritingDirection) { 944 if (shouldPreserveWritingDirection == PreserveWritingDirection) {
945 unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi ); 945 unicodeBidi = m_mutableStyle->getPropertyCSSValue(CSSPropertyUnicodeBidi );
946 direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection); 946 direction = m_mutableStyle->getPropertyCSSValue(CSSPropertyDirection);
947 } 947 }
948 948
949 m_mutableStyle->removeEquivalentProperties(styleAtPosition); 949 m_mutableStyle->removeEquivalentProperties(styleAtPosition);
950 950
951 if (textAlignResolvingStartAndEnd(m_mutableStyle.get()) == textAlignResolvin gStartAndEnd(styleAtPosition)) 951 if (textAlignResolvingStartAndEnd(m_mutableStyle.get()) == textAlignResolvin gStartAndEnd(styleAtPosition))
952 m_mutableStyle->removeProperty(CSSPropertyTextAlign); 952 m_mutableStyle->removeProperty(CSSPropertyTextAlign);
953 953
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 { 1634 {
1635 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) { 1635 for (Node* ancestor = node; ancestor; ancestor = ancestor->parentNode()) {
1636 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl aration::create(ancestor); 1636 RefPtr<CSSComputedStyleDeclaration> ancestorStyle = CSSComputedStyleDecl aration::create(ancestor);
1637 if (!hasTransparentBackgroundColor(ancestorStyle.get())) 1637 if (!hasTransparentBackgroundColor(ancestorStyle.get()))
1638 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor ); 1638 return ancestorStyle->getPropertyCSSValue(CSSPropertyBackgroundColor );
1639 } 1639 }
1640 return nullptr; 1640 return nullptr;
1641 } 1641 }
1642 1642
1643 } 1643 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698