Skip to content

Commit

Permalink
Bug 1562690. Fix parsing of HTML dimension values to follow spec upda…
Browse files Browse the repository at this point in the history
…te and align better with other browsers. r=mccr8

See whatwg/html#4747 for the spec changes

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

UltraBlame original commit: 0db6b1468cc36416a86f9a8a70da14f878281929
  • Loading branch information
marco-c committed Oct 4, 2019
1 parent 6531348 commit f01523a
Show file tree
Hide file tree
Showing 11 changed files with 1,765 additions and 1,968 deletions.
296 changes: 143 additions & 153 deletions dom/base/nsAttrValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7078,7 +7078,7 @@ dimension
values
/
/
Step
Steps
1
and
2
Expand Down Expand Up @@ -7160,6 +7160,7 @@ true
/
Step
3
.
while
(
position
Expand Down Expand Up @@ -7195,111 +7196,15 @@ position
/
Step
4
if
(
position
=
=
end
)
{
return
false
;
}
/
/
Step
5
if
(
*
position
=
=
char16_t
(
'
+
'
)
)
{
canonical
=
false
;
/
/
Leading
'
+
'
+
+
position
;
/
/
Step
6
.
The
spec
has
this
happening
regardless
of
whether
we
found
'
+
'
/
/
but
there
'
s
no
point
repeating
the
step
4
test
if
we
didn
'
t
advance
/
/
position
.
if
(
position
=
=
end
)
{
return
false
;
}
}
/
/
Step
7
.
if
(
|
|
*
position
<
Expand Down Expand Up @@ -7329,7 +7234,7 @@ false
/
/
Step
8
5
.
CheckedInt32
value
Expand Down Expand Up @@ -7515,7 +7420,7 @@ position
/
/
Step
9
6
is
implemented
implicitly
Expand Down Expand Up @@ -7545,7 +7450,51 @@ doubleValue
/
/
Step
10
7
.
The
return
in
step
7
.
2
is
handled
by
just
falling
through
to
the
/
/
code
below
this
block
when
we
reach
end
of
input
or
a
non
-
digit
because
/
/
the
while
loop
will
terminate
at
that
point
.
if
(
Expand Down Expand Up @@ -7590,6 +7539,13 @@ we
started
with
.
/
/
Step
7
.
1
.
+
+
position
Expand Down Expand Up @@ -7656,6 +7612,13 @@ value
)
)
;
/
/
Step
7
.
3
.
double
divisor
=
Expand All @@ -7665,55 +7628,11 @@ divisor
;
/
/
Per
spec
we
should
now
return
a
number
if
there
is
no
next
char
or
if
the
/
/
next
char
is
not
a
digit
but
no
one
does
that
Step
7
.
See
/
/
https
:
/
/
github
4
.
com
/
whatwg
/
html
/
issues
/
4736
while
(
position
Expand Down Expand Up @@ -7746,6 +7665,15 @@ char16_t
)
)
{
/
/
Step
7
.
4
.
1
.
divisor
=
divisor
Expand All @@ -7754,6 +7682,15 @@ divisor
.
0f
;
/
/
Step
7
.
4
.
2
.
doubleValue
.
ref
Expand All @@ -7775,10 +7712,53 @@ char16_t
/
divisor
;
/
/
Step
7
.
4
.
3
.
+
+
position
;
/
/
Step
7
.
4
.
4
and
7
.
4
.
5
are
captured
in
the
while
loop
condition
and
the
/
/
"
position
!
=
end
"
checks
below
.
}
}
if
Expand Down Expand Up @@ -7826,10 +7806,20 @@ false
}
/
/
Steps
11
-
13
Step
8
and
the
spec
'
s
early
return
from
step
7
.
2
.
ValueType
type
Expand Down
Loading

0 comments on commit f01523a

Please sign in to comment.