[Webkit-unassigned] [Bug 102691] New: when pasting into a contenteditable div or setting a color style of any element via javascript using #xxx color notation, color styles are translated to rgb(, , ) notation
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Nov 19 08:24:42 PST 2012
https://bugs.webkit.org/show_bug.cgi?id=102691
Summary: when pasting into a contenteditable div or setting a
color style of any element via javascript using #xxx
color notation, color styles are translated to rgb(,,)
notation
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
OS/Version: Unspecified
Status: NEW
Severity: Minor
Priority: P3
Component: Layout and Rendering
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: arielk at google.com
CC: playmobil at google.com
Created an attachment (id=174987)
--> (https://bugs.webkit.org/attachment.cgi?id=174987&action=review)
demo html file demonstrating copy paste of snippet with color attribute changes
Using a contenteditable=true div, when pasting an HTML fragment containing #xxx color notation, the newly created elements will contain rgb(x,y,z) color notation.
Also when updating a color attribute using elemnet_foo.style['border-color'] = '#xxx', the element will contain rgb(x,y,z) color notation.
This short snippet reproduces the style change after setting the style using javascript:
<html>
<div id="foo" style="border: 2px solid #ddd;">
foo bar
</div>
<script>
var div = document.getElementById('foo');
document.write('before: ' + div.getAttribute('style') + '<br>');
div.style['border-color'] = '#ddd';
document.write('after: ' + div.getAttribute('style') + '<br>');
</script>
</html>
attached is a test file that demonstrates both cases:
to show copy paste issue:
1. click [select all] button
2. use shortcut key for copy (ctrl-c)
3. move caret down using down arrow
4. use shortcut key for paste (ctrl-v)
5. click [show style attributes] button
two style attributes are shown: the original with #ccc color and the copy with rgb(221, 221, 221)
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list