forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new ComputedStyle instance for kNoChange.
Even if the computed style doesn't change, AffectedBy* flags may have changed, which means we need to set the current ComputedStyle to the new instance. We can however skip any invalidation diffs. This is a re-land of the revert of this functionality which did not make us recover from the memory regression reported in 771294. Bug: 768406, 771294 Change-Id: Icc7eeee8a982eed53243d52d04d45e313d79a10d Reviewed-on: https://chromium-review.googlesource.com/870391 Reviewed-by: nainar <nainar@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#530468}
- Loading branch information
Rune Lillesveen
authored and
Commit Bot
committed
Jan 19, 2018
1 parent
334a196
commit 394e62d
Showing
6 changed files
with
57 additions
and
27 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
third_party/WebKit/LayoutTests/external/wpt/css/selectors/hover-002-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>Selectors: Change class to enable :hover</title> | ||
<link rel="author" title="Rune Lillesveen" href="futhark@chromium.org"> | ||
<link rel="help" href="https://drafts.csswg.org/selectors/#the-hover-pseudo"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<style> | ||
.affected:hover { color: green } | ||
#hoveredContents { display: contents } | ||
</style> | ||
<div id="hovered">Hover me - should become green</div> | ||
<div id="hoveredContents"> | ||
<div id="hovered2">Hover me - should become green</div> | ||
</div> | ||
<script> | ||
function testElementGreen(test, element) { | ||
element.addEventListener("mouseover", test.step_func(event => { | ||
assert_equals(getComputedStyle(element).color, "rgb(0, 128, 0)"); | ||
test.done(); | ||
})); | ||
} | ||
|
||
// Setting the affected classes here makes the two elements go from never | ||
// reacting to hover to being affected by hover without changing computed | ||
// style. | ||
hovered.offsetTop; | ||
hovered.className = "affected"; | ||
hoveredContents.className = "affected"; | ||
|
||
async_test(t => { testElementGreen(t, hovered); }, "Hover #hovered element should make it go green"); | ||
async_test(t => { testElementGreen(t, hovered2); }, "Hover #hoveredContents child should make it go green"); | ||
</script> |
7 changes: 7 additions & 0 deletions
7
...y/WebKit/LayoutTests/external/wpt_automation/css/selectors/hover-002-manual-automation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
importAutomationScript('/pointerevents/pointerevent_common_input.js'); | ||
|
||
function inject_input() { | ||
return mouseMoveIntoTarget("#hovered").then(() => { | ||
return mouseMoveIntoTarget("#hovered2"); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters