Reviewed by Tim Hatcher.
- fix http://bugs.webkit.org/show_bug.cgi?id=13091
REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
Test: fast/innerHTML/additional-inline-style.html
* editing/markup.cpp:
(WebCore::startMarkup): Changed to add inline style based on CSS rules only
in AnnotateForInterchange mode.
2007-03-19 Mitz Pettel <mitz@webkit.org>
Reviewed by Tim Hatcher.
- test and updated result for http://bugs.webkit.org/show_bug.cgi?id=13091
REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
* editing/pasteboard/paste-table-002-expected.txt:
* fast/innerHTML/additional-inline-style-expected.txt: Added.
* fast/innerHTML/additional-inline-style.html: Added.
* webarchive/test-duplicate-resources-expected.txt:
* webarchive/test-frameset-expected.txt:
* webarchive/test-link-href-expected.txt:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@20319
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-03-19 Mitz Pettel <mitz@webkit.org>
+
+ Reviewed by Tim Hatcher.
+
+ - test and updated result for http://bugs.webkit.org/show_bug.cgi?id=13091
+ REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
+
+ * editing/pasteboard/paste-table-002-expected.txt:
+ * fast/innerHTML/additional-inline-style-expected.txt: Added.
+ * fast/innerHTML/additional-inline-style.html: Added.
+ * webarchive/test-duplicate-resources-expected.txt:
+ * webarchive/test-frameset-expected.txt:
+ * webarchive/test-link-href-expected.txt:
+
2007-03-18 Sam Weinig <sam@webkit.org>
Reviewed by Mark.
abcdef
foo bar
ghijk
-<div id="test" class="editing" style="border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: red; border-right-color: red; border-bottom-color: red; border-left-color: red; font-size: 24px; "> <div>abcdef<div style="text-align: center"><table><tbody><tr><td>foo</td><td>bar</td></tr></tbody></table>ghijk</div> </div> </div>
+<div id="test" class="editing"> <div>abcdef<div style="text-align: center"><table><tbody><tr><td>foo</td><td>bar</td></tr></tbody></table>ghijk</div> </div> </div>
--- /dev/null
+Test for http://bugs.webkit.org/show_bug.cgi?id=13091 REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD.
+
+This tests that .innerHTML does not introduce additional inline style.
+
+The following markup should not include a style attribute:
+
+<span></span>
+
--- /dev/null
+<html>
+<head>
+ <title></title>
+ <style>
+ span { color: blue; }
+ </style>
+ <script>
+ function test()
+ {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var result = document.getElementById("result");
+ var target = document.getElementById("target");
+
+ document.body.offsetTop;
+ result.appendChild(document.createTextNode(target.innerHTML));
+ }
+ </script>
+</head>
+<body onload="test()">
+ <p>
+ Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=13091">http://bugs.webkit.org/show_bug.cgi?id=13091</a>
+ REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD</i>.
+ </p>
+ <p>
+ This tests that <tt>.innerHTML</tt> does not introduce additional inline style.
+ </p>
+ <p>
+ The following markup should not include a <tt>style</tt> attribute:
+ </p>
+ <div id="target"><span></span></div>
+ <pre id="result"></pre>
+</body>
+</html>
<script src="resources/dump-webarchive.js" language="javascript" type="text/javascript"></script>
<link rel="stylesheet" href="resources/test-style.css" type="text/css">
</head><body>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
<img src="resources/apple.gif">
</div>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
This is not a frameset. This text should be red sans-serif.
</div>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
<img src="resources/apple.gif">
</div>
<iframe src="resources/test-frame.html"></iframe>
<string><html><head>
<link rel="stylesheet" href="test-style.css" type="text/css">
</head><body>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
<img src="apple.gif">
</div>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
This is a subframe. This text should be red sans-serif.
</div>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
<img src="apple.gif">
</div>
<string><html><head>
<link rel="stylesheet" href="test-style.css" type="text/css">
</head><body>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
<img src="apple.gif">
</div>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
This is a subframe. This text should be red sans-serif.
</div>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
<img src="apple.gif">
</div>
</script>
<link rel="stylesheet" href="resources/test-style.css" type="text/css">
</head><body>
-<div style="font-family: Arial, Helvetica, sans-serif; color: red; ">
+<div>
This text should be red sans-serif.
</div>
+2007-03-19 Mitz Pettel <mitz@webkit.org>
+
+ Reviewed by Tim Hatcher.
+
+ - fix http://bugs.webkit.org/show_bug.cgi?id=13091
+ REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
+
+ Test: fast/innerHTML/additional-inline-style.html
+
+ * editing/markup.cpp:
+ (WebCore::startMarkup): Changed to add inline style based on CSS rules only
+ in AnnotateForInterchange mode.
+
2007-03-19 Zack Rusin <zrusin@trolltech.com>
Compile fix.
const Element* el = static_cast<const Element*>(node);
markup += el->nodeNamePreservingCase().deprecatedString();
String additionalStyle;
- if (el->isHTMLElement()) {
+ if (annotate && el->isHTMLElement()) {
RefPtr<CSSMutableStyleDeclaration> style = styleFromMatchedRulesForElement(const_cast<Element*>(el));
if (style->length() > 0)
additionalStyle = style->cssText();
for (unsigned int i = 0; i < length; i++) {
Attribute *attr = attrs->attributeItem(i);
String value = attr->value();
- if (attr->name() == styleAttr && additionalStyle.length() > 0) {
+ if (annotate && attr->name() == styleAttr && additionalStyle.length()) {
value += "; " + additionalStyle;
additionalStyle = "";
}
markup += "=\"" + escapeTextForMarkup(value.deprecatedString(), true) + "\"";
}
- if (additionalStyle.length() > 0)
+ if (annotate && additionalStyle.length())
// FIXME: Handle case where additionalStyle has illegal characters in it, like "
markup += " " + styleAttr.localName().deprecatedString() + "=\"" + additionalStyle.deprecatedString() + "\"";