Skip to content

Commit

Permalink
Bug 1572805 - Use cbindgen for text-emphasis-style. r=boris
Browse files Browse the repository at this point in the history
I sent mozilla/cbindgen#377 since I got sick of
copy-pasting the private default constructor stuff :)

Differential Revision: https://phabricator.services.mozilla.com/D41419

UltraBlame original commit: 849ca4b3f9de609933014881329f51dc897e13b5
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent 0c7f8df commit a401d78
Show file tree
Hide file tree
Showing 10 changed files with 419 additions and 982 deletions.
6 changes: 3 additions & 3 deletions layout/generic/nsLineLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13183,7 +13183,7 @@ if
aStyleText
-
>
HasTextEmphasis
HasEffectiveTextEmphasis
(
)
)
Expand Down Expand Up @@ -18297,7 +18297,7 @@ if
mStyleText
-
>
HasTextEmphasis
HasEffectiveTextEmphasis
(
)
)
Expand Down Expand Up @@ -25844,7 +25844,7 @@ StyleText
)
-
>
HasTextEmphasis
HasEffectiveTextEmphasis
(
)
|
Expand Down
254 changes: 243 additions & 11 deletions layout/generic/nsTextFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15206,7 +15206,7 @@ if
textStyle
-
>
HasTextEmphasis
HasEffectiveTextEmphasis
(
)
)
Expand Down Expand Up @@ -36617,6 +36617,236 @@ EmphasisMarkProperty
EmphasisMarkInfo
)
static
void
ComputeTextEmphasisStyleString
(
const
StyleTextEmphasisStyle
&
aStyle
nsAString
&
aOut
)
{
MOZ_ASSERT
(
!
aStyle
.
IsNone
(
)
)
;
if
(
aStyle
.
IsString
(
)
)
{
nsDependentCSubstring
string
=
aStyle
.
AsString
(
)
.
AsString
(
)
;
AppendUTF8toUTF16
(
string
aOut
)
;
return
;
}
const
auto
&
keyword
=
aStyle
.
AsKeyword
(
)
;
const
bool
fill
=
keyword
.
fill
=
=
StyleTextEmphasisFillMode
:
:
Filled
;
switch
(
keyword
.
shape
)
{
case
StyleTextEmphasisShapeKeyword
:
:
Dot
:
return
aOut
.
AppendLiteral
(
fill
?
u
"
\
u2022
"
:
u
"
\
u25e6
"
)
;
case
StyleTextEmphasisShapeKeyword
:
:
Circle
:
return
aOut
.
AppendLiteral
(
fill
?
u
"
\
u25cf
"
:
u
"
\
u25cb
"
)
;
case
StyleTextEmphasisShapeKeyword
:
:
DoubleCircle
:
return
aOut
.
AppendLiteral
(
fill
?
u
"
\
u25c9
"
:
u
"
\
u25ce
"
)
;
case
StyleTextEmphasisShapeKeyword
:
:
Triangle
:
return
aOut
.
AppendLiteral
(
fill
?
u
"
\
u25b2
"
:
u
"
\
u25b3
"
)
;
case
StyleTextEmphasisShapeKeyword
:
:
Sesame
:
return
aOut
.
AppendLiteral
(
fill
?
u
"
\
ufe45
"
:
u
"
\
ufe46
"
)
;
default
:
MOZ_ASSERT_UNREACHABLE
(
"
Unknown
emphasis
style
shape
"
)
;
}
}
static
already_AddRefed
<
gfxTextRun
Expand All @@ -36638,15 +36868,17 @@ nsStyleText
aStyleText
)
{
const
nsString
&
emphasisString
=
nsAutoString
string
;
ComputeTextEmphasisStyleString
(
aStyleText
-
>
mTextEmphasisStyleString
mTextEmphasisStyle
string
)
;
RefPtr
<
Expand Down Expand Up @@ -36735,12 +36967,12 @@ MakeTextRun
char16_t
>
(
emphasisString
string
.
get
(
)
emphasisString
string
.
Length
(
Expand Down Expand Up @@ -36866,7 +37098,7 @@ if
styleText
-
>
HasTextEmphasis
HasEffectiveTextEmphasis
(
)
)
Expand Down Expand Up @@ -50149,7 +50381,7 @@ StyleText
)
-
>
HasTextEmphasis
HasEffectiveTextEmphasis
(
)
)
Expand Down
21 changes: 21 additions & 0 deletions layout/style/ServoBindings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4985,6 +4985,27 @@ grid
GridTemplateComponent
"
}
{
gecko
=
"
StyleTextEmphasisStyle
"
servo
=
"
values
:
:
computed
:
:
text
:
:
TextEmphasisStyle
"
}
]
mapped
-
Expand Down
Loading

0 comments on commit a401d78

Please sign in to comment.