Skip to content

Commit

Permalink
Fix the updating dir=auto issue when inserting text into a display:none
Browse files Browse the repository at this point in the history
This CL fixes the issue of updating dir=auto when inserting text
into a display:none subtree by moving the
SelfOrAncestorHasDirAutoAttribute flag from ComputedStyle to Node,
and updates the flag of all descendants when dir attribute is changed
from/to auto and the child is inserted.

Bug: 576815
Change-Id: I229aa3df0720572df011e29da90d70a87d073bc4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2617169
Reviewed-by: Rune Lillesveen <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Miyoung Shin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#847591}
  • Loading branch information
MyidShin authored and chromium-wpt-export-bot committed Jan 27, 2021
1 parent 9616abf commit 60d6e8d
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!doctype html>
<html>
<head>
<title>CSS Selectors Level 4 Test: Check for correctly updating :dir=auto when the the directionality is changed in a display:none subtree </title>
<meta charset="utf8">
<link rel="author" title="Miyoung Shin" href="mailto:[email protected]">
<link rel="help" href="http://www.w3.org/TR/selectors4/#dir-pseudo">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
#target {
width: 100px;
height: 100px;
background-color: red;
}
:dir(ltr) + #target {
background-color: green;
}
</style>
</head>

<body>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div dir="auto" style="display:none">
<div>
<div id="inner">رسمية</div>
</div>
</div>
<div id="target"></div>
<script>
inner.offsetTop;
inner.firstChild.data = "LTR";
</script>
</body>
</html>

0 comments on commit 60d6e8d

Please sign in to comment.