mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 18:50:50 +00:00
LibWeb: Implement user-select
This implements all values of user-select.
This commit is contained in:
parent
ba43dfe49a
commit
9370990ff2
Notes:
github-actions[bot]
2025-01-08 14:38:35 +00:00
Author: https://github.com/Psychpsyo
Commit: 9370990ff2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3176
Reviewed-by: https://github.com/AtkinsSJ ✅
11 changed files with 274 additions and 29 deletions
|
@ -1434,6 +1434,12 @@ Optional<CSS::WritingMode> ComputedProperties::writing_mode() const
|
|||
return keyword_to_writing_mode(value.to_keyword());
|
||||
}
|
||||
|
||||
Optional<CSS::UserSelect> ComputedProperties::user_select() const
|
||||
{
|
||||
auto const& value = property(CSS::PropertyID::UserSelect);
|
||||
return keyword_to_user_select(value.to_keyword());
|
||||
}
|
||||
|
||||
Optional<CSS::MaskType> ComputedProperties::mask_type() const
|
||||
{
|
||||
auto const& value = property(CSS::PropertyID::MaskType);
|
||||
|
|
|
@ -159,6 +159,7 @@ public:
|
|||
Optional<CSS::Direction> direction() const;
|
||||
Optional<CSS::UnicodeBidi> unicode_bidi() const;
|
||||
Optional<CSS::WritingMode> writing_mode() const;
|
||||
Optional<CSS::UserSelect> user_select() const;
|
||||
|
||||
static Vector<CSS::Transformation> transformations_for_style_value(CSSStyleValue const& value);
|
||||
Vector<CSS::Transformation> transformations() const;
|
||||
|
|
|
@ -170,6 +170,7 @@ public:
|
|||
static CSS::Direction direction() { return CSS::Direction::Ltr; }
|
||||
static CSS::UnicodeBidi unicode_bidi() { return CSS::UnicodeBidi::Normal; }
|
||||
static CSS::WritingMode writing_mode() { return CSS::WritingMode::HorizontalTb; }
|
||||
static CSS::UserSelect user_select() { return CSS::UserSelect::Auto; }
|
||||
|
||||
// https://www.w3.org/TR/SVG/geometry.html
|
||||
static LengthPercentage cx() { return CSS::Length::make_px(0); }
|
||||
|
@ -424,6 +425,7 @@ public:
|
|||
CSS::Direction direction() const { return m_inherited.direction; }
|
||||
CSS::UnicodeBidi unicode_bidi() const { return m_noninherited.unicode_bidi; }
|
||||
CSS::WritingMode writing_mode() const { return m_inherited.writing_mode; }
|
||||
CSS::UserSelect user_select() const { return m_noninherited.user_select; }
|
||||
|
||||
CSS::LengthBox const& inset() const { return m_noninherited.inset; }
|
||||
const CSS::LengthBox& margin() const { return m_noninherited.margin; }
|
||||
|
@ -675,6 +677,8 @@ protected:
|
|||
CSS::ObjectFit object_fit { InitialValues::object_fit() };
|
||||
CSS::ObjectPosition object_position { InitialValues::object_position() };
|
||||
CSS::UnicodeBidi unicode_bidi { InitialValues::unicode_bidi() };
|
||||
CSS::UserSelect user_select { InitialValues::user_select() };
|
||||
|
||||
Optional<CSS::Transformation> rotate;
|
||||
Optional<CSS::Transformation> translate;
|
||||
Optional<CSS::Transformation> scale;
|
||||
|
@ -846,6 +850,7 @@ public:
|
|||
void set_direction(CSS::Direction value) { m_inherited.direction = value; }
|
||||
void set_unicode_bidi(CSS::UnicodeBidi value) { m_noninherited.unicode_bidi = value; }
|
||||
void set_writing_mode(CSS::WritingMode value) { m_inherited.writing_mode = value; }
|
||||
void set_user_select(CSS::UserSelect value) { m_noninherited.user_select = value; }
|
||||
|
||||
void set_fill(SVGPaint value) { m_inherited.fill = move(value); }
|
||||
void set_stroke(SVGPaint value) { m_inherited.stroke = move(value); }
|
||||
|
|
|
@ -538,6 +538,13 @@
|
|||
"normal",
|
||||
"plaintext"
|
||||
],
|
||||
"user-select": [
|
||||
"all",
|
||||
"auto",
|
||||
"contain",
|
||||
"none",
|
||||
"text"
|
||||
],
|
||||
"vertical-align": [
|
||||
"baseline",
|
||||
"bottom",
|
||||
|
|
|
@ -2825,12 +2825,8 @@
|
|||
"animation-type": "discrete",
|
||||
"inherited": false,
|
||||
"initial": "auto",
|
||||
"valid-identifiers": [
|
||||
"all",
|
||||
"auto",
|
||||
"contain",
|
||||
"none",
|
||||
"text"
|
||||
"valid-types": [
|
||||
"user-select"
|
||||
]
|
||||
},
|
||||
"vertical-align": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue