blob: 33cc247620635d46e39abe2bfd0ff82f54686af7 [file] [log] [blame]
Test that we only invalidate the style when changing an attribute referenced by a stylesheet. This test requires the internals object to work properly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
Changing the attribute 'foo', it is not referenced by any stylesheet and should not cause any invalidation.
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
Changing the attribute 'CamelCase'. It is used by the stylesheet and should cause the target to be invalidated.
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is true
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is true
Getting the computed style should for the style to be resolved.
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
Removing the attribute should also invalidate the style.
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is true
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is true
Getting the computed style should for the style to be resolved.
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
Changing the attribute 'camelcase'. Since XML attributes are case sensitive, this does not invalidate the style since it is a different attribute.
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
Changing the attribute 'CAMELCASE'. Same deal, this is a different attribute.
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[0]) is false
PASS window.internals.nodeNeedsStyleRecalc(document.querySelectorAll("target")[1]) is false
PASS successfullyParsed is true
TEST COMPLETE