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.
Add internals.isCSSPropertyUseCounted functionality
This patch adds the functionality of internals.isCSSPropertyUseCounted to test whether a particular CSSProperty is in use in a file. This function is being added to help improve testing for improvements made to UseCounter methods for counting CSSProperty. There is a currently a internals.isUseCounted that is used for testing whether a current feature is UseCounted. BUG=589343 Review URL: https://codereview.chromium.org/1711703002 Cr-Commit-Position: refs/heads/master@{#377846}
- Loading branch information
nainar
authored and
Commit bot
committed
Feb 26, 2016
1 parent
3f7776e
commit 04de728
Showing
6 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
third_party/WebKit/LayoutTests/fast/css/window-internals-isCSSPropertyUseCounted.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,50 @@ | ||
<!DOCTYPE html> | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
div { | ||
padding-left: 100px; | ||
padding-bottom: 100px; | ||
color:green; | ||
background-color: green; | ||
opacity: invalid value; | ||
border: black solid 5px; | ||
border-left: thick dashed lightgreen; | ||
-webkit-border-end-color: pink; | ||
} | ||
</style> | ||
|
||
<div id="target"></div> | ||
|
||
<script> | ||
test(function() { | ||
assert_true(internals.isCSSPropertyUseCounted(document, "color")); | ||
assert_true(internals.isCSSPropertyUseCounted(document, "background-color")); | ||
assert_true(internals.isCSSPropertyUseCounted(document, "padding-bottom")); | ||
assert_true(internals.isCSSPropertyUseCounted(document, "padding-left")); | ||
assert_true(internals.isCSSPropertyUseCounted(document, "-webkit-border-end-color")); | ||
}, "Test setting and reading css properties"); | ||
|
||
test(function() { | ||
assert_true(internals.isCSSPropertyUseCounted(document, "border")) | ||
assert_false(internals.isCSSPropertyUseCounted(document, "border-color")); | ||
assert_false(internals.isCSSPropertyUseCounted(document, "border-style")); | ||
assert_false(internals.isCSSPropertyUseCounted(document, "border-width")); | ||
|
||
assert_true(internals.isCSSPropertyUseCounted(document, "border-left")) | ||
assert_false(internals.isCSSPropertyUseCounted(document, "border-left-color")); | ||
assert_false(internals.isCSSPropertyUseCounted(document, "border-left-style")); | ||
assert_false(internals.isCSSPropertyUseCounted(document, "border-left-width")); | ||
|
||
}, "Test setting a shorthand and reading longhand"); | ||
|
||
test(function() { | ||
assert_false(internals.isCSSPropertyUseCounted(document, "opacity")); | ||
}, "Test that properties with invalid values aren't counted"); | ||
|
||
test(function() { | ||
assert_false(internals.isCSSPropertyUseCounted(document, "box-sizing")); | ||
}, "Test that properties specified in UA stylesheet aren't counted"); | ||
|
||
</script> |
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
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