@@ -1488,22 +1488,6 @@ bool ComputedCSSStyle::SetFontSize(const tasm::CSSValue& value,
14881488 return base::FloatsNotEqual (text_attributes_->font_size , old_value);
14891489}
14901490
1491- bool ComputedCSSStyle::SetXPlaceholderFontSize (const tasm::CSSValue& value,
1492- const bool reset) {
1493- PrepareOptionalForPlaceholderTextAttributes ();
1494- const float default_font_size =
1495- DEFAULT_FONT_SIZE_DP * length_context_.layouts_unit_per_px_ ;
1496- auto old_value = placeholder_text_attributes_->font_size ;
1497- if (reset) {
1498- placeholder_text_attributes_->font_size = default_font_size;
1499- } else {
1500- CalculateCSSValueToFloat (value, placeholder_text_attributes_->font_size ,
1501- length_context_, parser_configs_);
1502- }
1503- return base::FloatsNotEqual (placeholder_text_attributes_->font_size ,
1504- old_value);
1505- }
1506-
15071491bool ComputedCSSStyle::SetLineHeight (const tasm::CSSValue& value,
15081492 const bool reset) {
15091493 PrepareOptionalForTextAttributes ();
@@ -2175,35 +2159,6 @@ bool ComputedCSSStyle::SetColor(const tasm::CSSValue& value, const bool reset) {
21752159 old_value_gradient != text_attributes_->text_gradient ;
21762160}
21772161
2178- bool ComputedCSSStyle::SetXPlaceholderColor (const tasm::CSSValue& value,
2179- const bool reset) {
2180- PrepareOptionalForPlaceholderTextAttributes ();
2181- auto old_value_color = placeholder_text_attributes_->color ;
2182- auto old_value_gradient = placeholder_text_attributes_->text_gradient ;
2183- if (reset) {
2184- placeholder_text_attributes_->color = DefaultColor::DEFAULT_TEXT_COLOR;
2185- placeholder_text_attributes_->text_gradient .reset ();
2186- } else {
2187- CSS_HANDLER_FAIL_IF_NOT (
2188- value.IsNumber () || value.IsArray (),
2189- parser_configs_.enable_css_strict_mode , tasm::TYPE_MUST_BE,
2190- tasm::CSSProperty::GetPropertyName (tasm::kPropertyIDXPlaceholderColor )
2191- .c_str (),
2192- tasm::ARRAY_OR_NUMBER_TYPE)
2193-
2194- if (value.IsNumber ()) {
2195- placeholder_text_attributes_->color =
2196- static_cast <uint32_t >(value.GetValue ().Number ());
2197- placeholder_text_attributes_->text_gradient .reset ();
2198- } else {
2199- placeholder_text_attributes_->color = DefaultColor::DEFAULT_TEXT_COLOR;
2200- placeholder_text_attributes_->text_gradient = value.GetValue ();
2201- }
2202- }
2203- return old_value_color != placeholder_text_attributes_->color ||
2204- old_value_gradient != placeholder_text_attributes_->text_gradient ;
2205- }
2206-
22072162bool ComputedCSSStyle::SetBackground (const tasm::CSSValue& value,
22082163 const bool reset) {
22092164 return tasm::UnitHandler::CSSMethodUnreachable (
@@ -2422,14 +2377,6 @@ bool ComputedCSSStyle::SetFontFamily(const tasm::CSSValue& value,
24222377 " font family must be a string!" , parser_configs_);
24232378}
24242379
2425- bool ComputedCSSStyle::SetXPlaceholderFontFamily (const tasm::CSSValue& value,
2426- const bool reset) {
2427- PrepareOptionalForPlaceholderTextAttributes ();
2428- return CSSStyleUtils::ComputeStringStyle (
2429- value, reset, placeholder_text_attributes_->font_family , base::String (),
2430- " font family must be a string!" , parser_configs_);
2431- }
2432-
24332380bool ComputedCSSStyle::SetCaretColor (const lynx::tasm::CSSValue& value,
24342381 bool reset) {
24352382 return CSSStyleUtils::ComputeStringStyle (
@@ -2463,15 +2410,6 @@ bool ComputedCSSStyle::SetFontWeight(const tasm::CSSValue& value,
24632410 parser_configs_);
24642411}
24652412
2466- bool ComputedCSSStyle::SetXPlaceholderFontWeight (const tasm::CSSValue& value,
2467- const bool reset) {
2468- PrepareOptionalForPlaceholderTextAttributes ();
2469- return CSSStyleUtils::ComputeEnumStyle<starlight::FontWeightType>(
2470- value, reset, placeholder_text_attributes_->font_weight ,
2471- DefaultComputedStyle::DEFAULT_FONT_WEIGHT, " font weight must be an enum!" ,
2472- parser_configs_);
2473- }
2474-
24752413bool ComputedCSSStyle::SetWordBreak (const tasm::CSSValue& value,
24762414 const bool reset) {
24772415 PrepareOptionalForTextAttributes ();
@@ -2490,15 +2428,6 @@ bool ComputedCSSStyle::SetFontStyle(const tasm::CSSValue& value,
24902428 parser_configs_);
24912429}
24922430
2493- bool ComputedCSSStyle::SetXPlaceholderFontStyle (const tasm::CSSValue& value,
2494- const bool reset) {
2495- PrepareOptionalForPlaceholderTextAttributes ();
2496- return CSSStyleUtils::ComputeEnumStyle<starlight::FontStyleType>(
2497- value, reset, placeholder_text_attributes_->font_style ,
2498- DefaultComputedStyle::DEFAULT_FONT_STYLE, " font style must be an enum!" ,
2499- parser_configs_);
2500- }
2501-
25022431bool ComputedCSSStyle::SetTextAlign (const tasm::CSSValue& value,
25032432 const bool reset) {
25042433 PrepareOptionalForTextAttributes ();
@@ -3087,14 +3016,6 @@ lepus_value ComputedCSSStyle::FontSizeToLepus() {
30873016 }
30883017}
30893018
3090- lepus_value ComputedCSSStyle::XPlaceholderFontSizeToLepus () {
3091- if (placeholder_text_attributes_) {
3092- return lepus_value (placeholder_text_attributes_->font_size );
3093- } else {
3094- return lepus_value ();
3095- }
3096- }
3097-
30983019lepus_value ComputedCSSStyle::LineHeightToLepus () {
30993020 if (text_attributes_) {
31003021 return lepus_value (text_attributes_->computed_line_height );
@@ -3178,19 +3099,6 @@ lepus_value ComputedCSSStyle::ColorToLepus() {
31783099 }
31793100}
31803101
3181- lepus_value ComputedCSSStyle::XPlaceholderColorToLepus () {
3182- if (placeholder_text_attributes_) {
3183- if (placeholder_text_attributes_->text_gradient .has_value () &&
3184- placeholder_text_attributes_->text_gradient ->IsArray ()) {
3185- return *placeholder_text_attributes_->text_gradient ;
3186- } else {
3187- return lepus_value (placeholder_text_attributes_->color );
3188- }
3189- } else {
3190- return lepus_value ();
3191- }
3192- }
3193-
31943102lepus_value ComputedCSSStyle::BackgroundToLepus () { return lepus_value (); }
31953103
31963104lepus_value ComputedCSSStyle::BackgroundColorToLepus () {
@@ -3552,14 +3460,6 @@ lepus_value ComputedCSSStyle::FontFamilyToLepus() {
35523460 }
35533461}
35543462
3555- lepus_value ComputedCSSStyle::XPlaceholderFontFamilyToLepus () {
3556- if (placeholder_text_attributes_) {
3557- return lepus_value (placeholder_text_attributes_->font_family );
3558- } else {
3559- return lepus_value ();
3560- }
3561- }
3562-
35633463lepus_value ComputedCSSStyle::CaretColorToLepus () {
35643464 return lepus::Value (caret_color_);
35653465}
@@ -3611,15 +3511,6 @@ lepus_value ComputedCSSStyle::FontWeightToLepus() {
36113511 }
36123512}
36133513
3614- lepus_value ComputedCSSStyle::XPlaceholderFontWeightToLepus () {
3615- if (placeholder_text_attributes_) {
3616- return lepus_value (
3617- static_cast <int >(placeholder_text_attributes_->font_weight ));
3618- } else {
3619- return lepus_value ();
3620- }
3621- }
3622-
36233514lepus_value ComputedCSSStyle::FontStyleToLepus () {
36243515 if (text_attributes_) {
36253516 return lepus_value (static_cast <int >(text_attributes_->font_style ));
@@ -3628,15 +3519,6 @@ lepus_value ComputedCSSStyle::FontStyleToLepus() {
36283519 }
36293520}
36303521
3631- lepus_value ComputedCSSStyle::XPlaceholderFontStyleToLepus () {
3632- if (placeholder_text_attributes_) {
3633- return lepus_value (
3634- static_cast <int >(placeholder_text_attributes_->font_style ));
3635- } else {
3636- return lepus_value ();
3637- }
3638- }
3639-
36403522lepus_value ComputedCSSStyle::TextAlignToLepus () {
36413523 if (text_attributes_) {
36423524 return lepus_value (static_cast <int >(text_attributes_->text_align ));
0 commit comments