Permalink
Browse files

Merge branch 'master' of github.com:firebug/firebug

  • Loading branch information...
2 parents 22d1f0a + 2d30838 commit 5948f938758ff9fc4c8e6c7c82f80d3bcbe21e48 @janodvarko janodvarko committed May 29, 2012
@@ -369,14 +369,6 @@ Firebug.CSSModule = Obj.extend(Obj.extend(Firebug.Module, Firebug.EditorSelector
return propInfo;
},
- setColorDisplay: function(event, type)
- {
- Options.set("colorDisplay", type);
-
- var menuItem = event.target;
- menuItem.setAttribute("checked", "true");
- },
-
getColorDisplayOptionMenuItems: function()
{
return [
@@ -387,7 +379,9 @@ Firebug.CSSModule = Obj.extend(Obj.extend(Firebug.Module, Firebug.EditorSelector
type: "radio",
name: "colorDisplay",
id: "colorDisplayHex",
- command: Obj.bind(this.setColorDisplay, this, "hex"),
+ command: function() {
+ return Options.set("colorDisplay", "hex");
+ },
checked: Options.get("colorDisplay") == "hex"
},
{
@@ -396,7 +390,9 @@ Firebug.CSSModule = Obj.extend(Obj.extend(Firebug.Module, Firebug.EditorSelector
type: "radio",
name: "colorDisplay",
id: "colorDisplayRGB",
- command: Obj.bind(this.setColorDisplay, this, "rgb"),
+ command: function() {
+ return Options.set("colorDisplay", "rgb");
+ },
checked: Options.get("colorDisplay") == "rgb"
},
{
@@ -405,7 +401,9 @@ Firebug.CSSModule = Obj.extend(Obj.extend(Firebug.Module, Firebug.EditorSelector
type: "radio",
name: "colorDisplay",
id: "colorDisplayHSL",
- command: Obj.bind(this.setColorDisplay, this, "hsl"),
+ command: function() {
+ return Options.set("colorDisplay", "hsl");
+ },
checked: Options.get("colorDisplay") == "hsl"
}
];
@@ -709,6 +709,8 @@ Css.rgbToHSL = function(value)
{
return value.replace(/\brgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(,\s*(\d.\d+|\d))?\)/gi,
function(_, r, g, b, _, a) {
+ var gray = (r == g && g == b);
+
r /= 255;
g /= 255;
b /= 255;
@@ -720,7 +722,7 @@ Css.rgbToHSL = function(value)
var s = 0;
var l = (max+min)/2;
- if (max != min)
+ if (!gray)
{
var delta = max - min;
s = l > 0.5 ? delta/(2-max-min) : delta/(max+min);
@@ -176,6 +176,7 @@
{group: "html", uri: "html/4826/issue4826.js", desc: "Changing the ID of a node in HTML Panel doesn't update Element Path", testPage: "html/4826/issue4826.html"},
{group: "html", uri: "html/5058/issue5058.js", desc: "Edit HTML button doesn't work", testPage: "html/5058/issue5058.html"},
{group: "html", uri: "html/5255/issue5255.js", desc: "Adding elements through Edit HTML shows them in the wrong place", testPage: "html/5255/issue5255.html"},
+ {group: "html", uri: "html/5448/issue5448.js", desc: "normalize() breaks display of text nodes with entities", testPage: "html/5448/issue5448.html"},
{group: "css", uri: "css/537/issue537.js", desc: "Pseudo-elements are not displayed in Style side panel", testPage: "css/537/issue537.html"},
{group: "css", uri: "css/1189/issue1189.js", desc: "Display errors of inherited CSS styles in combination with CSS shorthand properties", testPage: "css/1189/issue1189.html"},
{group: "css", uri: "css/1338/issue1338.js", desc: "Increment CSS values at least significant digit", testPage: "css/1338/issue1338.html"},
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Issue 5448: normalize() breaks display of text nodes with entities</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <link href="../../_common/testcase.css" type="text/css" rel="stylesheet"/>
+</head>
+<body>
+<header>
+ <h1><a href="http://code.google.com/p/fbug/issues/detail?id=5448">Issue 5448</a>:
+ normalize() breaks display of text nodes with entities</h1>
+</header>
+<div>
+ <section id="content">a åäö b</section>
+ <section id="description">
+ <h3>Steps to reproduce</h3>
+ <ol>
+ <li>Open Firebug, enable the Console panel.</li>
+ <li>Inspect the text above (the text in grey area)</li>
+ <li>Turn on <i>Show Entities As Names</i> (HTML panel option)</li>
+ <li>Switch to the Console panel</li>
+ <li>Execute on the command line:
+ <pre>$0.appendChild(document.createTextNode(' tnode')); $0.normalize();</pre>
+ </li>
+ <li>Switch back to the HTML panel. <code>&lt;section id="content&gt;</code>
+ element must contain:<br/><br/>
+ <pre>a &amp;aring;&amp;auml;&amp;ouml; b</pre>
+ </li>
+ </ol>
+ </section>
+ <footer>Jan Odvarko, odvarko@gmail.com</footer>
+</div>
+</body>
+</html>
@@ -0,0 +1,34 @@
+function runTest()
+{
+ FBTest.sysout("issue5448.START");
+
+ FBTest.openNewTab(basePath + "html/5448/issue5448.html", function(win)
+ {
+ FBTest.openFirebug();
+ FBTest.enableConsolePanel(function()
+ {
+ FBTest.selectPanel("html");
+
+ FBTest.selectElementInHtmlPanel("content", function(node)
+ {
+ // Execute an expression on the Command Line
+ FBTest.selectPanel("console");
+ var expr = "$0.appendChild(document.createTextNode(' tnode')); $0.normalize();";
+ FBTest.executeCommand(expr);
+
+ // Switch back to the HTML panel
+ FBTest.selectPanel("html");
+
+ // Wait till the executed expression causes HTML panel update.
+ FBTest.waitForHtmlMutation(null, "span", function(node)
+ {
+ // Verify HTML panel content after mutation.
+ var expected = /a &aring;&auml;&ouml; b/;
+ FBTest.compare(expected, node.textContent, "The text content must match");
+
+ FBTest.testDone("issue5448.DONE");
+ });
+ });
+ });
+ });
+}

0 comments on commit 5948f93

Please sign in to comment.