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

Unified Diff: Source/core/editing/EditingStyle.h

Issue 423673002: Use tighter typing in editing: EditingStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove isHTMLElement() check Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/editing/DeleteSelectionCommand.cpp ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/EditingStyle.h
diff --git a/Source/core/editing/EditingStyle.h b/Source/core/editing/EditingStyle.h
index 2bfa5764c3d2a4454bf1066f129cde54ba2a54fb..9426998dddad1be20b2c5dc96cb0c3afcaef7102 100644
--- a/Source/core/editing/EditingStyle.h
+++ b/Source/core/editing/EditingStyle.h
@@ -50,6 +50,7 @@ class CSSStyleDeclaration;
class CSSComputedStyleDeclaration;
class CSSPrimitiveValue;
class CSSValue;
+class ContainerNode;
class Document;
class Element;
class HTMLElement;
@@ -74,7 +75,7 @@ public:
return adoptRefWillBeNoop(new EditingStyle());
}
- static PassRefPtrWillBeRawPtr<EditingStyle> create(Node* node, PropertiesToInclude propertiesToInclude = OnlyEditingInheritableProperties)
+ static PassRefPtrWillBeRawPtr<EditingStyle> create(ContainerNode* node, PropertiesToInclude propertiesToInclude = OnlyEditingInheritableProperties)
{
return adoptRefWillBeNoop(new EditingStyle(node, propertiesToInclude));
}
@@ -105,14 +106,14 @@ public:
PassRefPtrWillBeRawPtr<EditingStyle> extractAndRemoveBlockProperties();
PassRefPtrWillBeRawPtr<EditingStyle> extractAndRemoveTextDirection();
void removeBlockProperties();
- void removeStyleAddedByNode(Node*);
- void removeStyleConflictingWithStyleOfNode(Node*);
+ void removeStyleAddedByElement(Element*);
+ void removeStyleConflictingWithStyleOfElement(Element*);
void collapseTextDecorationProperties();
enum ShouldIgnoreTextOnlyProperties { IgnoreTextOnlyProperties, DoNotIgnoreTextOnlyProperties };
TriState triStateOfStyle(EditingStyle*) const;
TriState triStateOfStyle(const VisibleSelection&) const;
- bool conflictsWithInlineStyleOfElement(Element* element) const { return conflictsWithInlineStyleOfElement(element, 0, 0); }
- bool conflictsWithInlineStyleOfElement(Element* element, EditingStyle* extractedStyle, Vector<CSSPropertyID>& conflictingProperties) const
+ bool conflictsWithInlineStyleOfElement(HTMLElement* element) const { return conflictsWithInlineStyleOfElement(element, 0, 0); }
+ bool conflictsWithInlineStyleOfElement(HTMLElement* element, EditingStyle* extractedStyle, Vector<CSSPropertyID>& conflictingProperties) const
{
return conflictsWithInlineStyleOfElement(element, extractedStyle, &conflictingProperties);
}
@@ -127,11 +128,11 @@ public:
void prepareToApplyAt(const Position&, ShouldPreserveWritingDirection = DoNotPreserveWritingDirection);
void mergeTypingStyle(Document*);
enum CSSPropertyOverrideMode { OverrideValues, DoNotOverrideValues };
- void mergeInlineStyleOfElement(Element*, CSSPropertyOverrideMode, PropertiesToInclude = AllProperties);
- static PassRefPtrWillBeRawPtr<EditingStyle> wrappingStyleForSerialization(Node* context, bool shouldAnnotate);
+ void mergeInlineStyleOfElement(HTMLElement*, CSSPropertyOverrideMode, PropertiesToInclude = AllProperties);
+ static PassRefPtrWillBeRawPtr<EditingStyle> wrappingStyleForSerialization(ContainerNode* context, bool shouldAnnotate);
void mergeStyleFromRules(Element*);
void mergeStyleFromRulesForSerialization(Element*);
- void removeStyleFromRulesAndContext(Element*, Node* context);
+ void removeStyleFromRulesAndContext(Element*, ContainerNode* context);
void removePropertiesInElementDefaultStyle(Element*);
void addAbsolutePositioningFromElement(const Element&);
void forceInline();
@@ -147,7 +148,7 @@ public:
private:
EditingStyle();
- EditingStyle(Node*, PropertiesToInclude);
+ EditingStyle(ContainerNode*, PropertiesToInclude);
EditingStyle(const Position&, PropertiesToInclude);
explicit EditingStyle(const StylePropertySet*);
EditingStyle(CSSPropertyID, const String& value);
@@ -157,7 +158,7 @@ private:
void replaceFontSizeByKeywordIfPossible(RenderStyle*, CSSComputedStyleDeclaration*);
void extractFontSizeDelta();
TriState triStateOfStyle(CSSStyleDeclaration* styleToCompare, ShouldIgnoreTextOnlyProperties) const;
- bool conflictsWithInlineStyleOfElement(Element*, EditingStyle* extractedStyle, Vector<CSSPropertyID>* conflictingProperties) const;
+ bool conflictsWithInlineStyleOfElement(HTMLElement*, EditingStyle* extractedStyle, Vector<CSSPropertyID>* conflictingProperties) const;
void mergeInlineAndImplicitStyleOfElement(Element*, CSSPropertyOverrideMode, PropertiesToInclude);
void mergeStyle(const StylePropertySet*, CSSPropertyOverrideMode);
« no previous file with comments | « Source/core/editing/DeleteSelectionCommand.cpp ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698