Commit 70afc63b authored by bdash's avatar bdash

2007-03-18 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-18  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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b453da68
2007-03-18 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.
2007-03-18 Dan Waylonis <waylonis@mac.com>
Reviewed by Tim Hatcher.
......@@ -16,5 +16,5 @@ Problem: copy/pasting some HTML including tables can give rise to a <div> elemen
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>
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>
<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>
2007-03-18 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-18 Dan Waylonis <waylonis@mac.com>
Reviewed by Tim Hatcher.
......
......@@ -190,7 +190,7 @@ static DeprecatedString startMarkup(const Node *node, const Range *range, EAnnot
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();
......@@ -201,7 +201,7 @@ static DeprecatedString startMarkup(const Node *node, const Range *range, EAnnot
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 = "";
}
......@@ -213,7 +213,7 @@ static DeprecatedString startMarkup(const Node *node, const Range *range, EAnnot
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() + "\"";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment