Commit a4d42b5d authored by ap@webkit.org's avatar ap@webkit.org

Reviewed by Darin. Tweaked and landed by Alexey.

        http://bugs.webkit.org/show_bug.cgi?id=17411
        Ideographic comma and full stop should be treated as line-breakable characters

        Test: fast/text/line-breaks-after-ideographic-comma-or-full-stop.html

        * platform/text/CharacterNames.h: Added ideographicComma and ideographicFullStop.
        * rendering/break_lines.cpp: (WebCore::shouldBreakAfter): Added a workaround for an issue in
        Unicode 5.0 that is causing this.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30592 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a481d02f
2008-02-26 Satoshi Nakagawa <artension@gmail.com>
Reviewed by Darin. Tweaked and landed by Alexey.
- test for http://bugs.webkit.org/show_bug.cgi?id=17411
* fast/text/line-breaks-after-ideographic-comma-or-full-stop.html: Added.
* fast/text/line-breaks-after-ideographic-comma-or-full-stop-expected.txt: Added
2008-02-25 Dan Bernstein <mitz@apple.com>
Reviewed by Sam Weinig.
These are good:
う、
texttexttexttext
う。
texttexttexttext
The following two should look like “good”:
う、texttexttexttext
う。texttexttexttext
These are bad:
う、texttexttexttext
う。texttexttexttext
PASS
<html>
<head>
<title>Line breaks after ideographic comma or full stop</title>
</head>
<body>
These are good:
<div style="font-family:'Lucida Grande'; font-size:16pt; text-decoration:underline; width:5em;">
<p style="border:solid green 1px;">
&#x3046;&#x3001;<br>texttexttexttext
</p>
<p style="border:solid green 1px;">
&#x3046;&#x3002;<br>texttexttexttext
</p>
</div>
The following two should look like &ldquo;good&rdquo;:
<div style="font-family:'Lucida Grande'; font-size:16pt; text-decoration:underline; width:5em;">
<p style="border:solid blue 1px;">
&#x3046;&#x3001;texttexttexttext
</p>
<p style="border:solid blue 1px;">
&#x3046;&#x3002;texttexttexttext
</p>
</div>
These are bad:
<div style="font-family:'Lucida Grande'; font-size:16pt; text-decoration:underline; width:5em;">
<p style="border:solid red 1px;">
<nobr>&#x3046;&#x3001;texttexttexttext</nobr>
</p>
<p style="border:solid red 1px;">
<nobr>&#x3046;&#x3002;texttexttexttext</nobr>
</p>
</div>
<div id=result></div>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function paragraphHeight(paragraphNumber) {
return document.defaultView.getComputedStyle(document.getElementsByTagName("p")[paragraphNumber], null).getPropertyValue("height")
}
document.getElementById("result").innerHTML = (paragraphHeight(0) == paragraphHeight(2) && paragraphHeight(1) == paragraphHeight(3)) ? "PASS" : "FAIL";
</script>
</body>
</html>
2008-02-26 Satoshi Nakagawa <artension@gmail.com>
Reviewed by Darin. Tweaked and landed by Alexey.
http://bugs.webkit.org/show_bug.cgi?id=17411
Ideographic comma and full stop should be treated as line-breakable characters
Test: fast/text/line-breaks-after-ideographic-comma-or-full-stop.html
* platform/text/CharacterNames.h: Added ideographicComma and ideographicFullStop.
* rendering/break_lines.cpp: (WebCore::shouldBreakAfter): Added a workaround for an issue in
Unicode 5.0 that is causing this.
2008-02-26 MorganL <morganl.webkit@yahoo.com>
Reviewed by eseidel. Landed by eseidel
......@@ -39,6 +39,8 @@ namespace WebCore {
const UChar bullet = 0x2022;
const UChar horizontalEllipsis = 0x2026;
const UChar ideographicSpace = 0x3000;
const UChar ideographicComma = 0x3001;
const UChar ideographicFullStop = 0x3002;
const UChar leftToRightMark = 0x200E;
const UChar leftToRightEmbed = 0x202A;
const UChar leftToRightOverride = 0x202D;
......
......@@ -47,10 +47,16 @@ static inline bool isBreakableSpace(UChar ch, bool treatNoBreakSpaceAsBreak)
static inline bool shouldBreakAfter(UChar ch)
{
// Match WinIE's breaking strategy, which is to always allow breaks after hyphens and question marks.
// FIXME: it appears that IE behavior is more complex, see <http://bugs.webkit.org/show_bug.cgi?id=17475>.
switch (ch) {
case '-':
case '?':
case softHyphen:
// FIXME: cases for ideographicComma and ideographicFullStop are a workaround for an issue in Unicode 5.0
// which is likely to be resolved in Unicode 5.1 <http://bugs.webkit.org/show_bug.cgi?id=17411>.
// We may want to remove or conditionalize this workaround at some point.
case ideographicComma:
case ideographicFullStop:
return true;
default:
return false;
......
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