Commit 885a5dea authored by shend's avatar shend Committed by Commit bot

Cleanup StyleRareInheritedData.

This patch changes StyleRareInheritedData to make it easier to generate:
- Remove unused destructor
- Replace explicit copy constructor with RefCountedCopyable
- Replace forward declarations with #includes.

This is in preparation for generating StyleRareInheritedData. While this
patch may increase compile times, we would have to pay this cost anyway
when we generate StyleRareInheritedData in ComputedStyleBase.

BUG=628043

Review-Url: https://codereview.chromium.org/2881003002
Cr-Commit-Position: refs/heads/master@{#472234}
parent cb86cbdb
...@@ -112,81 +112,6 @@ StyleRareInheritedData::StyleRareInheritedData() ...@@ -112,81 +112,6 @@ StyleRareInheritedData::StyleRareInheritedData()
tab_size_(ComputedStyle::InitialTabSize()), tab_size_(ComputedStyle::InitialTabSize()),
text_size_adjust_(ComputedStyle::InitialTextSizeAdjust()) {} text_size_adjust_(ComputedStyle::InitialTextSizeAdjust()) {}
StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
: RefCounted<StyleRareInheritedData>(),
list_style_image_(o.list_style_image_),
text_stroke_color_(o.text_stroke_color_),
text_stroke_width_(o.text_stroke_width_),
text_fill_color_(o.text_fill_color_),
text_emphasis_color_(o.text_emphasis_color_),
caret_color_(o.caret_color_),
visited_link_text_stroke_color_(o.visited_link_text_stroke_color_),
visited_link_text_fill_color_(o.visited_link_text_fill_color_),
visited_link_text_emphasis_color_(o.visited_link_text_emphasis_color_),
visited_link_caret_color_(o.visited_link_caret_color_),
text_shadow_(o.text_shadow_),
highlight_(o.highlight_),
cursor_data_(o.cursor_data_),
text_indent_(o.text_indent_),
effective_zoom_(o.effective_zoom_),
widows_(o.widows_),
orphans_(o.orphans_),
text_stroke_color_is_current_color_(
o.text_stroke_color_is_current_color_),
text_fill_color_is_current_color_(o.text_fill_color_is_current_color_),
text_emphasis_color_is_current_color_(
o.text_emphasis_color_is_current_color_),
caret_color_is_current_color_(o.caret_color_is_current_color_),
caret_color_is_auto_(o.caret_color_is_auto_),
visited_link_text_stroke_color_is_current_color_(
o.visited_link_text_stroke_color_is_current_color_),
visited_link_text_fill_color_is_current_color_(
o.visited_link_text_fill_color_is_current_color_),
visited_link_text_emphasis_color_is_current_color_(
o.visited_link_text_emphasis_color_is_current_color_),
visited_link_caret_color_is_current_color_(
o.visited_link_caret_color_is_current_color_),
visited_link_caret_color_is_auto_(o.visited_link_caret_color_is_auto_),
text_security_(o.text_security_),
user_modify_(o.user_modify_),
word_break_(o.word_break_),
overflow_wrap_(o.overflow_wrap_),
line_break_(o.line_break_),
user_select_(o.user_select_),
speak_(o.speak_),
hyphens_(o.hyphens_),
text_emphasis_fill_(o.text_emphasis_fill_),
text_emphasis_mark_(o.text_emphasis_mark_),
text_emphasis_position_(o.text_emphasis_position_),
text_align_last_(o.text_align_last_),
text_justify_(o.text_justify_),
text_orientation_(o.text_orientation_),
text_combine_(o.text_combine_),
text_indent_line_(o.text_indent_line_),
text_indent_type_(o.text_indent_type_),
image_rendering_(o.image_rendering_),
text_underline_position_(o.text_underline_position_),
text_decoration_skip_(o.text_decoration_skip_),
ruby_position_(o.ruby_position_),
subtree_will_change_contents_(o.subtree_will_change_contents_),
self_or_ancestor_has_dir_auto_attribute_(
o.self_or_ancestor_has_dir_auto_attribute_),
respect_image_orientation_(o.respect_image_orientation_),
subtree_is_sticky_(o.subtree_is_sticky_),
hyphenation_string_(o.hyphenation_string_),
hyphenation_limit_before_(o.hyphenation_limit_before_),
hyphenation_limit_after_(o.hyphenation_limit_after_),
hyphenation_limit_lines_(o.hyphenation_limit_lines_),
line_height_step_(o.line_height_step_),
text_emphasis_custom_mark_(o.text_emphasis_custom_mark_),
tap_highlight_color_(o.tap_highlight_color_),
applied_text_decorations_(o.applied_text_decorations_),
tab_size_(o.tab_size_),
variables_(o.variables_),
text_size_adjust_(o.text_size_adjust_) {}
StyleRareInheritedData::~StyleRareInheritedData() {}
bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const { bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const {
return text_stroke_color_ == o.text_stroke_color_ && return text_stroke_color_ == o.text_stroke_color_ &&
text_stroke_width_ == o.text_stroke_width_ && text_stroke_width_ == o.text_stroke_width_ &&
......
...@@ -28,8 +28,15 @@ ...@@ -28,8 +28,15 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/css/StyleAutoColor.h" #include "core/css/StyleAutoColor.h"
#include "core/css/StyleColor.h" #include "core/css/StyleColor.h"
#include "core/style/AppliedTextDecoration.h"
#include "core/style/AppliedTextDecorationList.h" #include "core/style/AppliedTextDecorationList.h"
#include "core/style/CursorData.h"
#include "core/style/CursorList.h" #include "core/style/CursorList.h"
#include "core/style/QuotesData.h"
#include "core/style/ShadowData.h"
#include "core/style/ShadowList.h"
#include "core/style/StyleImage.h"
#include "core/style/StyleInheritedVariables.h"
#include "core/style/TextSizeAdjust.h" #include "core/style/TextSizeAdjust.h"
#include "platform/Length.h" #include "platform/Length.h"
#include "platform/graphics/Color.h" #include "platform/graphics/Color.h"
...@@ -54,7 +61,7 @@ class StyleInheritedVariables; ...@@ -54,7 +61,7 @@ class StyleInheritedVariables;
// all methods on it, merging them into copy/creation methods on ComputedStyle // all methods on it, merging them into copy/creation methods on ComputedStyle
// instead. Keep the allocation logic, only allocating a new object if needed. // instead. Keep the allocation logic, only allocating a new object if needed.
class CORE_EXPORT StyleRareInheritedData class CORE_EXPORT StyleRareInheritedData
: public RefCounted<StyleRareInheritedData> { : public RefCountedCopyable<StyleRareInheritedData> {
public: public:
static PassRefPtr<StyleRareInheritedData> Create() { static PassRefPtr<StyleRareInheritedData> Create() {
return AdoptRef(new StyleRareInheritedData); return AdoptRef(new StyleRareInheritedData);
...@@ -62,7 +69,6 @@ class CORE_EXPORT StyleRareInheritedData ...@@ -62,7 +69,6 @@ class CORE_EXPORT StyleRareInheritedData
PassRefPtr<StyleRareInheritedData> Copy() const { PassRefPtr<StyleRareInheritedData> Copy() const {
return AdoptRef(new StyleRareInheritedData(*this)); return AdoptRef(new StyleRareInheritedData(*this));
} }
~StyleRareInheritedData();
bool operator==(const StyleRareInheritedData&) const; bool operator==(const StyleRareInheritedData&) const;
bool operator!=(const StyleRareInheritedData& o) const { bool operator!=(const StyleRareInheritedData& o) const {
...@@ -164,7 +170,7 @@ class CORE_EXPORT StyleRareInheritedData ...@@ -164,7 +170,7 @@ class CORE_EXPORT StyleRareInheritedData
private: private:
StyleRareInheritedData(); StyleRareInheritedData();
StyleRareInheritedData(const StyleRareInheritedData&); StyleRareInheritedData(const StyleRareInheritedData&) = default;
}; };
} // namespace blink } // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment