Commit 8423facf authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

LayoutTheme, ThemePainter: Assume LayoutObject::GetNode() is a non-null Element

After LayoutTheme::AdjustStyle() call, we can assume a LayoutObject with
a HasEffectiveAppearnace() style always has a non-null Element for
GetNode(). This CL simplifies blink::LayoutTheme and blink::ThemePainter
by the assumption.

* Change the |const Element*| arguments of |LayoutTheme::
  AdjustSliderContainerStyle()| to |const Element&|.

* Remove unused |const Element*| arguments of |LayoutTheme::
  AdjustMenuList*Style()|.

* Change the argument order of LayoutTheme::AdjustStyle() to follow
  Google C++ style guide.

* Public methods of ThemePainter still take |const Node*| arguments,
  but the methods set up |const Element&| variables at the beginning.

* Protected methods of ThemePainter take |const Element&| arguments.

* Add |const Element&| arguments to some of ThemePainter methods because
  they refer to LayoutObject::GetNode().

* Remove IsDisabled(), IsPressed(), and IsHovered() in
  theme_painter_default.cc.  They are not helpful any longer.

This CL has no behavior changes.

Change-Id: I8a8fee402720ddeacfe77ebf920146b72bf6767e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404510
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806517}
parent 4c286eca
...@@ -695,7 +695,7 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state, ...@@ -695,7 +695,7 @@ void StyleAdjuster::AdjustComputedStyle(StyleResolverState& state,
style.AdjustMaskLayers(); style.AdjustMaskLayers();
// Let the theme also have a crack at adjusting the style. // Let the theme also have a crack at adjusting the style.
LayoutTheme::GetTheme().AdjustStyle(style, element); LayoutTheme::GetTheme().AdjustStyle(element, style);
AdjustStyleForEditing(style); AdjustStyleForEditing(style);
......
...@@ -228,7 +228,7 @@ ControlPart LayoutTheme::AdjustAppearanceWithElementType( ...@@ -228,7 +228,7 @@ ControlPart LayoutTheme::AdjustAppearanceWithElementType(
return part; return part;
} }
void LayoutTheme::AdjustStyle(ComputedStyle& style, Element* e) { void LayoutTheme::AdjustStyle(const Element* e, ComputedStyle& style) {
ControlPart original_part = style.Appearance(); ControlPart original_part = style.Appearance();
style.SetEffectiveAppearance(original_part); style.SetEffectiveAppearance(original_part);
if (original_part == ControlPart::kNoControlPart) if (original_part == ControlPart::kNoControlPart)
...@@ -262,6 +262,9 @@ void LayoutTheme::AdjustStyle(ComputedStyle& style, Element* e) { ...@@ -262,6 +262,9 @@ void LayoutTheme::AdjustStyle(ComputedStyle& style, Element* e) {
DCHECK_NE(part, kAutoPart); DCHECK_NE(part, kAutoPart);
if (part == kNoControlPart) if (part == kNoControlPart)
return; return;
DCHECK(e);
// After this point, a Node must be non-null Element if
// EffectiveAppearance() != kNoControlPart.
AdjustControlPartStyle(style); AdjustControlPartStyle(style);
...@@ -269,14 +272,14 @@ void LayoutTheme::AdjustStyle(ComputedStyle& style, Element* e) { ...@@ -269,14 +272,14 @@ void LayoutTheme::AdjustStyle(ComputedStyle& style, Element* e) {
// value. // value.
switch (part) { switch (part) {
case kMenulistPart: case kMenulistPart:
return AdjustMenuListStyle(style, e); return AdjustMenuListStyle(style);
case kMenulistButtonPart: case kMenulistButtonPart:
return AdjustMenuListButtonStyle(style, e); return AdjustMenuListButtonStyle(style);
case kSliderHorizontalPart: case kSliderHorizontalPart:
case kSliderVerticalPart: case kSliderVerticalPart:
case kMediaSliderPart: case kMediaSliderPart:
case kMediaVolumeSliderPart: case kMediaVolumeSliderPart:
return AdjustSliderContainerStyle(style, e); return AdjustSliderContainerStyle(*e, style);
case kSliderThumbHorizontalPart: case kSliderThumbHorizontalPart:
case kSliderThumbVerticalPart: case kSliderThumbVerticalPart:
return AdjustSliderThumbStyle(style); return AdjustSliderThumbStyle(style);
...@@ -469,20 +472,18 @@ void LayoutTheme::AdjustButtonStyle(ComputedStyle& style) const {} ...@@ -469,20 +472,18 @@ void LayoutTheme::AdjustButtonStyle(ComputedStyle& style) const {}
void LayoutTheme::AdjustInnerSpinButtonStyle(ComputedStyle&) const {} void LayoutTheme::AdjustInnerSpinButtonStyle(ComputedStyle&) const {}
void LayoutTheme::AdjustMenuListStyle(ComputedStyle& style, Element*) const { void LayoutTheme::AdjustMenuListStyle(ComputedStyle& style) const {
// Menulists should have visible overflow // Menulists should have visible overflow
// https://bugs.webkit.org/show_bug.cgi?id=21287 // https://bugs.webkit.org/show_bug.cgi?id=21287
style.SetOverflowX(EOverflow::kVisible); style.SetOverflowX(EOverflow::kVisible);
style.SetOverflowY(EOverflow::kVisible); style.SetOverflowY(EOverflow::kVisible);
} }
void LayoutTheme::AdjustMenuListButtonStyle(ComputedStyle&, Element*) const {} void LayoutTheme::AdjustMenuListButtonStyle(ComputedStyle&) const {}
void LayoutTheme::AdjustSliderContainerStyle(ComputedStyle& style, void LayoutTheme::AdjustSliderContainerStyle(const Element& e,
Element* e) const { ComputedStyle& style) const {
if (!e) const AtomicString& pseudo = e.ShadowPseudoId();
return;
const AtomicString& pseudo = e->ShadowPseudoId();
if (pseudo != shadow_element_names::kPseudoMediaSliderContainer && if (pseudo != shadow_element_names::kPseudoMediaSliderContainer &&
pseudo != shadow_element_names::kPseudoSliderContainer) pseudo != shadow_element_names::kPseudoSliderContainer)
return; return;
......
...@@ -69,7 +69,7 @@ class CORE_EXPORT LayoutTheme : public RefCounted<LayoutTheme> { ...@@ -69,7 +69,7 @@ class CORE_EXPORT LayoutTheme : public RefCounted<LayoutTheme> {
// selection of control size based off the font, the disabling of appearance // selection of control size based off the font, the disabling of appearance
// when certain other properties like "border" are set, or if the appearance // when certain other properties like "border" are set, or if the appearance
// is not supported by the theme. // is not supported by the theme.
void AdjustStyle(ComputedStyle&, Element*); void AdjustStyle(const Element*, ComputedStyle&);
// The remaining methods should be implemented by the platform-specific // The remaining methods should be implemented by the platform-specific
// portion of the theme, e.g., LayoutThemeMac.cpp for Mac OS X. // portion of the theme, e.g., LayoutThemeMac.cpp for Mac OS X.
...@@ -209,9 +209,9 @@ class CORE_EXPORT LayoutTheme : public RefCounted<LayoutTheme> { ...@@ -209,9 +209,9 @@ class CORE_EXPORT LayoutTheme : public RefCounted<LayoutTheme> {
virtual void AdjustButtonStyle(ComputedStyle&) const; virtual void AdjustButtonStyle(ComputedStyle&) const;
virtual void AdjustInnerSpinButtonStyle(ComputedStyle&) const; virtual void AdjustInnerSpinButtonStyle(ComputedStyle&) const;
virtual void AdjustMenuListStyle(ComputedStyle&, Element*) const; virtual void AdjustMenuListStyle(ComputedStyle&) const;
virtual void AdjustMenuListButtonStyle(ComputedStyle&, Element*) const; virtual void AdjustMenuListButtonStyle(ComputedStyle&) const;
virtual void AdjustSliderContainerStyle(ComputedStyle&, Element*) const; virtual void AdjustSliderContainerStyle(const Element&, ComputedStyle&) const;
virtual void AdjustSliderThumbStyle(ComputedStyle&) const; virtual void AdjustSliderThumbStyle(ComputedStyle&) const;
virtual void AdjustSearchFieldStyle(ComputedStyle&) const; virtual void AdjustSearchFieldStyle(ComputedStyle&) const;
virtual void AdjustSearchFieldCancelButtonStyle(ComputedStyle&) const; virtual void AdjustSearchFieldCancelButtonStyle(ComputedStyle&) const;
......
...@@ -238,16 +238,14 @@ void LayoutThemeDefault::AdjustSearchFieldCancelButtonStyle( ...@@ -238,16 +238,14 @@ void LayoutThemeDefault::AdjustSearchFieldCancelButtonStyle(
style.SetHeight(Length::Fixed(cancel_button_size)); style.SetHeight(Length::Fixed(cancel_button_size));
} }
void LayoutThemeDefault::AdjustMenuListStyle(ComputedStyle& style, void LayoutThemeDefault::AdjustMenuListStyle(ComputedStyle& style) const {
Element* element) const { LayoutTheme::AdjustMenuListStyle(style);
LayoutTheme::AdjustMenuListStyle(style, element);
// Height is locked to auto on all browsers. // Height is locked to auto on all browsers.
style.SetLineHeight(ComputedStyleInitialValues::InitialLineHeight()); style.SetLineHeight(ComputedStyleInitialValues::InitialLineHeight());
} }
void LayoutThemeDefault::AdjustMenuListButtonStyle(ComputedStyle& style, void LayoutThemeDefault::AdjustMenuListButtonStyle(ComputedStyle& style) const {
Element* e) const { AdjustMenuListStyle(style);
AdjustMenuListStyle(style, e);
} }
// The following internal paddings are in addition to the user-supplied padding. // The following internal paddings are in addition to the user-supplied padding.
......
...@@ -80,8 +80,8 @@ class CORE_EXPORT LayoutThemeDefault : public LayoutTheme { ...@@ -80,8 +80,8 @@ class CORE_EXPORT LayoutThemeDefault : public LayoutTheme {
// In short, we either go down the MenuList code path or the MenuListButton // In short, we either go down the MenuList code path or the MenuListButton
// codepath. We never go down both. And in both cases, they layout the // codepath. We never go down both. And in both cases, they layout the
// entire menulist. // entire menulist.
void AdjustMenuListStyle(ComputedStyle&, Element*) const override; void AdjustMenuListStyle(ComputedStyle&) const override;
void AdjustMenuListButtonStyle(ComputedStyle&, Element*) const override; void AdjustMenuListButtonStyle(ComputedStyle&) const override;
// These methods define the padding for the MenuList's inner block. // These methods define the padding for the MenuList's inner block.
int PopupInternalPaddingStart(const ComputedStyle&) const override; int PopupInternalPaddingStart(const ComputedStyle&) const override;
......
...@@ -67,19 +67,18 @@ ThemePainter::ThemePainter() = default; ...@@ -67,19 +67,18 @@ ThemePainter::ThemePainter() = default;
#define COUNT_APPEARANCE(doc, feature) \ #define COUNT_APPEARANCE(doc, feature) \
doc.CountUse(WebFeature::kCSSValueAppearance##feature##Rendered) doc.CountUse(WebFeature::kCSSValueAppearance##feature##Rendered)
void CountAppearanceTextFieldPart(const Node* node) { void CountAppearanceTextFieldPart(const Element& element) {
DCHECK(node); if (auto* input = DynamicTo<HTMLInputElement>(element)) {
if (auto* input = DynamicTo<HTMLInputElement>(node)) {
const AtomicString& type = input->type(); const AtomicString& type = input->type();
if (type == input_type_names::kSearch) { if (type == input_type_names::kSearch) {
UseCounter::Count(node->GetDocument(), UseCounter::Count(element.GetDocument(),
WebFeature::kCSSValueAppearanceTextFieldForSearch); WebFeature::kCSSValueAppearanceTextFieldForSearch);
} else if (input->IsTextField()) { } else if (input->IsTextField()) {
UseCounter::Count(node->GetDocument(), UseCounter::Count(element.GetDocument(),
WebFeature::kCSSValueAppearanceTextFieldForTextField); WebFeature::kCSSValueAppearanceTextFieldForTextField);
} else if (IsMultipleFieldsTemporalInput(type)) { } else if (IsMultipleFieldsTemporalInput(type)) {
UseCounter::Count( UseCounter::Count(
node->GetDocument(), element.GetDocument(),
WebFeature::kCSSValueAppearanceTextFieldForTemporalRendered); WebFeature::kCSSValueAppearanceTextFieldForTemporalRendered);
} }
} }
...@@ -89,26 +88,27 @@ void CountAppearanceTextFieldPart(const Node* node) { ...@@ -89,26 +88,27 @@ void CountAppearanceTextFieldPart(const Node* node) {
bool ThemePainter::Paint(const LayoutObject& o, bool ThemePainter::Paint(const LayoutObject& o,
const PaintInfo& paint_info, const PaintInfo& paint_info,
const IntRect& r) { const IntRect& r) {
const Node* node = o.GetNode();
Document& doc = o.GetDocument(); Document& doc = o.GetDocument();
const ComputedStyle& style = o.StyleRef(); const ComputedStyle& style = o.StyleRef();
ControlPart part = o.StyleRef().EffectiveAppearance(); ControlPart part = o.StyleRef().EffectiveAppearance();
// LayoutTheme::AdjustAppearanceWithElementType() ensures |node| is a // LayoutTheme::AdjustAppearanceWithElementType() ensures |node| is a
// non-null Element. // non-null Element.
DCHECK(node); DCHECK(o.GetNode());
DCHECK_NE(part, kNoControlPart); DCHECK_NE(part, kNoControlPart);
const Element& element = *To<Element>(o.GetNode());
if (part == kButtonPart) { if (part == kButtonPart) {
if (IsA<HTMLButtonElement>(node)) { if (IsA<HTMLButtonElement>(element)) {
UseCounter::Count(doc, WebFeature::kCSSValueAppearanceButtonForButton); UseCounter::Count(doc, WebFeature::kCSSValueAppearanceButtonForButton);
} else if (IsA<HTMLInputElement>(node) && } else if (IsA<HTMLInputElement>(element) &&
To<HTMLInputElement>(node)->IsTextButton()) { To<HTMLInputElement>(element).IsTextButton()) {
// Text buttons (type=button, reset, submit) has // Text buttons (type=button, reset, submit) has
// -webkit-appearance:push-button by default. // -webkit-appearance:push-button by default.
UseCounter::Count(doc, UseCounter::Count(doc,
WebFeature::kCSSValueAppearanceButtonForOtherButtons); WebFeature::kCSSValueAppearanceButtonForOtherButtons);
} else if (IsA<HTMLInputElement>(node) && } else if (IsA<HTMLInputElement>(element) &&
To<HTMLInputElement>(node)->type() == input_type_names::kColor) { To<HTMLInputElement>(element).type() ==
input_type_names::kColor) {
// 'button' for input[type=color], of which default appearance is // 'button' for input[type=color], of which default appearance is
// 'square-button', is not deprecated. // 'square-button', is not deprecated.
} }
...@@ -118,51 +118,51 @@ bool ThemePainter::Paint(const LayoutObject& o, ...@@ -118,51 +118,51 @@ bool ThemePainter::Paint(const LayoutObject& o,
switch (part) { switch (part) {
case kCheckboxPart: { case kCheckboxPart: {
COUNT_APPEARANCE(doc, Checkbox); COUNT_APPEARANCE(doc, Checkbox);
return PaintCheckbox(node, o.GetDocument(), style, paint_info, r); return PaintCheckbox(element, o.GetDocument(), style, paint_info, r);
} }
case kRadioPart: { case kRadioPart: {
COUNT_APPEARANCE(doc, Radio); COUNT_APPEARANCE(doc, Radio);
return PaintRadio(node, o.GetDocument(), style, paint_info, r); return PaintRadio(element, o.GetDocument(), style, paint_info, r);
} }
case kPushButtonPart: { case kPushButtonPart: {
COUNT_APPEARANCE(doc, PushButton); COUNT_APPEARANCE(doc, PushButton);
return PaintButton(node, o.GetDocument(), style, paint_info, r); return PaintButton(element, o.GetDocument(), style, paint_info, r);
} }
case kSquareButtonPart: { case kSquareButtonPart: {
COUNT_APPEARANCE(doc, SquareButton); COUNT_APPEARANCE(doc, SquareButton);
return PaintButton(node, o.GetDocument(), style, paint_info, r); return PaintButton(element, o.GetDocument(), style, paint_info, r);
} }
case kButtonPart: case kButtonPart:
// UseCounter for this is handled at the beginning of the function. // UseCounter for this is handled at the beginning of the function.
return PaintButton(node, o.GetDocument(), style, paint_info, r); return PaintButton(element, o.GetDocument(), style, paint_info, r);
case kInnerSpinButtonPart: { case kInnerSpinButtonPart: {
COUNT_APPEARANCE(doc, InnerSpinButton); COUNT_APPEARANCE(doc, InnerSpinButton);
return PaintInnerSpinButton(node, style, paint_info, r); return PaintInnerSpinButton(element, style, paint_info, r);
} }
case kMenulistPart: case kMenulistPart:
COUNT_APPEARANCE(doc, MenuList); COUNT_APPEARANCE(doc, MenuList);
return PaintMenuList(node, o.GetDocument(), style, paint_info, r); return PaintMenuList(element, o.GetDocument(), style, paint_info, r);
case kMeterPart: case kMeterPart:
return true; return true;
case kProgressBarPart: case kProgressBarPart:
COUNT_APPEARANCE(doc, ProgressBar); COUNT_APPEARANCE(doc, ProgressBar);
// Note that |-webkit-appearance: progress-bar| works only for <progress>. // Note that |-webkit-appearance: progress-bar| works only for <progress>.
return PaintProgressBar(o, paint_info, r); return PaintProgressBar(element, o, paint_info, r);
case kSliderHorizontalPart: { case kSliderHorizontalPart: {
COUNT_APPEARANCE(doc, SliderHorizontal); COUNT_APPEARANCE(doc, SliderHorizontal);
return PaintSliderTrack(o, paint_info, r); return PaintSliderTrack(element, o, paint_info, r);
} }
case kSliderVerticalPart: { case kSliderVerticalPart: {
COUNT_APPEARANCE(doc, SliderVertical); COUNT_APPEARANCE(doc, SliderVertical);
return PaintSliderTrack(o, paint_info, r); return PaintSliderTrack(element, o, paint_info, r);
} }
case kSliderThumbHorizontalPart: { case kSliderThumbHorizontalPart: {
COUNT_APPEARANCE(doc, SliderThumbHorizontal); COUNT_APPEARANCE(doc, SliderThumbHorizontal);
return PaintSliderThumb(node, style, paint_info, r); return PaintSliderThumb(element, style, paint_info, r);
} }
case kSliderThumbVerticalPart: { case kSliderThumbVerticalPart: {
COUNT_APPEARANCE(doc, SliderThumbVertical); COUNT_APPEARANCE(doc, SliderThumbVertical);
return PaintSliderThumb(node, style, paint_info, r); return PaintSliderThumb(element, style, paint_info, r);
} }
case kMediaSliderPart: case kMediaSliderPart:
case kMediaSliderThumbPart: case kMediaSliderThumbPart:
...@@ -175,17 +175,17 @@ bool ThemePainter::Paint(const LayoutObject& o, ...@@ -175,17 +175,17 @@ bool ThemePainter::Paint(const LayoutObject& o,
if (!features::IsFormControlsRefreshEnabled()) { if (!features::IsFormControlsRefreshEnabled()) {
return true; return true;
} }
CountAppearanceTextFieldPart(node); CountAppearanceTextFieldPart(element);
return PaintTextField(node, style, paint_info, r); return PaintTextField(element, style, paint_info, r);
case kTextAreaPart: case kTextAreaPart:
if (!features::IsFormControlsRefreshEnabled()) { if (!features::IsFormControlsRefreshEnabled()) {
return true; return true;
} }
COUNT_APPEARANCE(doc, TextArea); COUNT_APPEARANCE(doc, TextArea);
return PaintTextArea(node, style, paint_info, r); return PaintTextArea(element, style, paint_info, r);
case kSearchFieldPart: { case kSearchFieldPart: {
COUNT_APPEARANCE(doc, SearchField); COUNT_APPEARANCE(doc, SearchField);
return PaintSearchField(node, style, paint_info, r); return PaintSearchField(element, style, paint_info, r);
} }
case kSearchFieldCancelButtonPart: { case kSearchFieldCancelButtonPart: {
COUNT_APPEARANCE(doc, SearchCancel); COUNT_APPEARANCE(doc, SearchCancel);
...@@ -206,20 +206,23 @@ bool ThemePainter::PaintBorderOnly(const Node* node, ...@@ -206,20 +206,23 @@ bool ThemePainter::PaintBorderOnly(const Node* node,
const ComputedStyle& style, const ComputedStyle& style,
const PaintInfo& paint_info, const PaintInfo& paint_info,
const IntRect& r) { const IntRect& r) {
DCHECK(style.HasEffectiveAppearance());
DCHECK(node);
const Element& element = *To<Element>(node);
// Call the appropriate paint method based off the appearance value. // Call the appropriate paint method based off the appearance value.
switch (style.EffectiveAppearance()) { switch (style.EffectiveAppearance()) {
case kTextFieldPart: case kTextFieldPart:
if (features::IsFormControlsRefreshEnabled()) { if (features::IsFormControlsRefreshEnabled()) {
return false; return false;
} }
CountAppearanceTextFieldPart(node); CountAppearanceTextFieldPart(element);
return PaintTextField(node, style, paint_info, r); return PaintTextField(element, style, paint_info, r);
case kTextAreaPart: case kTextAreaPart:
if (features::IsFormControlsRefreshEnabled()) { if (features::IsFormControlsRefreshEnabled()) {
return false; return false;
} }
COUNT_APPEARANCE(node->GetDocument(), TextArea); COUNT_APPEARANCE(element.GetDocument(), TextArea);
return PaintTextArea(node, style, paint_info, r); return PaintTextArea(element, style, paint_info, r);
case kMenulistButtonPart: case kMenulistButtonPart:
case kSearchFieldPart: case kSearchFieldPart:
case kListboxPart: case kListboxPart:
...@@ -241,7 +244,7 @@ bool ThemePainter::PaintBorderOnly(const Node* node, ...@@ -241,7 +244,7 @@ bool ThemePainter::PaintBorderOnly(const Node* node,
return false; return false;
default: default:
UseCounter::Count( UseCounter::Count(
node->GetDocument(), element.GetDocument(),
WebFeature::kCSSValueAppearanceNoImplementationSkipBorder); WebFeature::kCSSValueAppearanceNoImplementationSkipBorder);
// TODO(tkent): Should do CSS border painting for non-supported // TODO(tkent): Should do CSS border painting for non-supported
// appearance values. // appearance values.
...@@ -256,11 +259,13 @@ bool ThemePainter::PaintDecorations(const Node* node, ...@@ -256,11 +259,13 @@ bool ThemePainter::PaintDecorations(const Node* node,
const ComputedStyle& style, const ComputedStyle& style,
const PaintInfo& paint_info, const PaintInfo& paint_info,
const IntRect& r) { const IntRect& r) {
DCHECK(node);
// Call the appropriate paint method based off the appearance value. // Call the appropriate paint method based off the appearance value.
switch (style.EffectiveAppearance()) { switch (style.EffectiveAppearance()) {
case kMenulistButtonPart: case kMenulistButtonPart:
COUNT_APPEARANCE(document, MenuListButton); COUNT_APPEARANCE(document, MenuListButton);
return PaintMenuListButton(node, document, style, paint_info, r); return PaintMenuListButton(*To<Element>(node), document, style,
paint_info, r);
case kTextFieldPart: case kTextFieldPart:
case kTextAreaPart: case kTextAreaPart:
case kCheckboxPart: case kCheckboxPart:
......
...@@ -30,6 +30,7 @@ namespace blink { ...@@ -30,6 +30,7 @@ namespace blink {
class ComputedStyle; class ComputedStyle;
class Document; class Document;
class Element;
class IntRect; class IntRect;
class LayoutObject; class LayoutObject;
class Node; class Node;
...@@ -64,76 +65,78 @@ class ThemePainter { ...@@ -64,76 +65,78 @@ class ThemePainter {
void PaintSliderTicks(const LayoutObject&, const PaintInfo&, const IntRect&); void PaintSliderTicks(const LayoutObject&, const PaintInfo&, const IntRect&);
protected: protected:
virtual bool PaintCheckbox(const Node*, virtual bool PaintCheckbox(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintRadio(const Node*, virtual bool PaintRadio(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintButton(const Node*, virtual bool PaintButton(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintInnerSpinButton(const Node*, virtual bool PaintInnerSpinButton(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintTextField(const Node*, virtual bool PaintTextField(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintTextArea(const Node*, virtual bool PaintTextArea(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintMenuList(const Node*, virtual bool PaintMenuList(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintMenuListButton(const Node* node, virtual bool PaintMenuListButton(const Element& element,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintProgressBar(const LayoutObject&, virtual bool PaintProgressBar(const Element& element,
const LayoutObject&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintSliderTrack(const LayoutObject&, virtual bool PaintSliderTrack(const Element& element,
const LayoutObject&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintSliderThumb(const Node*, virtual bool PaintSliderThumb(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
return true; return true;
} }
virtual bool PaintSearchField(const Node*, virtual bool PaintSearchField(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) { const IntRect&) {
......
...@@ -41,54 +41,56 @@ class ThemePainterDefault final : public ThemePainter { ...@@ -41,54 +41,56 @@ class ThemePainterDefault final : public ThemePainter {
explicit ThemePainterDefault(LayoutThemeDefault&); explicit ThemePainterDefault(LayoutThemeDefault&);
private: private:
bool PaintCheckbox(const Node*, bool PaintCheckbox(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintRadio(const Node*, bool PaintRadio(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintButton(const Node*, bool PaintButton(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintTextField(const Node*, bool PaintTextField(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintMenuList(const Node*, bool PaintMenuList(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintMenuListButton(const Node*, bool PaintMenuListButton(const Element&,
const Document&, const Document&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintSliderTrack(const LayoutObject&, bool PaintSliderTrack(const Element& element,
const LayoutObject&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintSliderThumb(const Node*, bool PaintSliderThumb(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintInnerSpinButton(const Node*, bool PaintInnerSpinButton(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintProgressBar(const LayoutObject&, bool PaintProgressBar(const Element& element,
const LayoutObject&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintTextArea(const Node*, bool PaintTextArea(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
bool PaintSearchField(const Node*, bool PaintSearchField(const Element&,
const ComputedStyle&, const ComputedStyle&,
const PaintInfo&, const PaintInfo&,
const IntRect&) override; const IntRect&) override;
......
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