Skip to content

Commit

Permalink
Convert word-wrap to an alias of overflow-wrap
Browse files Browse the repository at this point in the history
word-wrap was previously defined as its own property in
CSSProperties.json5, but with the same behavior as overflow-wrap.
However, this meant that word-wrap showed up alongside word-wrap in
cssText. This patch converts word-wrap to be an alias of overflow-wrap,
as this will prevent the issue of both properties showing up in cssText
and matches the resolution in
w3c/csswg-drafts#866.

Bug: 679068
Change-Id: I3d415eb1cde9a92dffa2a045ba5fa8b015eeb2d7
  • Loading branch information
csnardi authored and Chrome-bot committed Jun 6, 2018
1 parent 7cd0b88 commit a0a05f3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions css/css-text/overflow-wrap/word-wrap-alias.html
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/css-text-3/#propdef-word-wrap">
<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/866">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="test" style="word-wrap: break-word; overflow-wrap: break-word;"></div>
<script>
test(function() {
const div = document.getElementById("test");
assert_equals(div.style.cssText, "overflow-wrap: break-word;", "Only overflow-wrap should appear when serializing the declaration.");
assert_equals(div.style.wordWrap, "break-word");
assert_equals(div.style.overflowWrap, "break-word");
assert_equals(getComputedStyle(div).wordWrap, "break-word");
assert_equals(getComputedStyle(div).overflowWrap, "break-word");
}, "word-wrap should be defined as an alias of overflow-wrap");
</script>

0 comments on commit a0a05f3

Please sign in to comment.