Closed
Bug 417967
Opened 16 years ago
Closed 16 years ago
text-decoration lines (underline/strikeout/overline) are sometimes anti aliased in sub frames
Categories
(Core :: Layout, defect, P2)
Core
Layout
Tracking
()
VERIFIED
FIXED
People
(Reporter: masayuki, Assigned: roc)
References
()
Details
Attachments
(6 files, 4 obsolete files)
11.56 KB,
image/png
|
Details | |
32.36 KB,
image/png
|
Details | |
241 bytes,
text/html
|
Details | |
257 bytes,
text/html
|
Details | |
6.70 KB,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
121.73 KB,
image/jpeg
|
Details |
In some sub frames, the text-decoration lines are anti aliased. We should snap the line rect to device pixels when we can do it. I referenced gfxContext::Rectangle code for the attached patch. I'm not sure this is correct...
Attachment #303764 -
Flags: superreview?(roc)
Attachment #303764 -
Flags: review?(vladimir)
Reporter | ||
Comment 1•16 years ago
|
||
Comment on attachment 303764 [details] [diff] [review] Patch v1.0 er, this patch is incorrect.
Attachment #303764 -
Flags: superreview?(roc)
Attachment #303764 -
Flags: review?(vladimir)
Attachment #303764 -
Flags: review-
Reporter | ||
Comment 2•16 years ago
|
||
We should not do the extra work if the rect is not changed, and if the context is already save, we must not re-save it.
Attachment #303764 -
Attachment is obsolete: true
Attachment #303767 -
Flags: superreview?(roc)
Attachment #303767 -
Flags: review?(vladimir)
Reporter | ||
Comment 3•16 years ago
|
||
Comment on attachment 303767 [details] [diff] [review] Patch v1.1 mmm.... this approach is incorrect. Because the underlines are not always positioned to same offset from each baseline.
Attachment #303767 -
Flags: superreview?(roc)
Attachment #303767 -
Flags: review?(vladimir)
Attachment #303767 -
Flags: review-
Reporter | ||
Comment 4•16 years ago
|
||
I think that this is correct. If we can snap to device pixels, we need to send the device pixels to GetTextDecorationRectInternal, otherwise, we can send the user pixels. # Note that the bottom changing in the patch is removing the non-needed function call.
Attachment #303767 -
Attachment is obsolete: true
Attachment #303795 -
Flags: superreview?(roc)
Attachment #303795 -
Flags: review?(vladimir)
Reporter | ||
Comment 5•16 years ago
|
||
This patch also fixes the same bug in print preview.
Attachment #303795 -
Attachment is obsolete: true
Attachment #303800 -
Flags: superreview?(roc)
Attachment #303800 -
Flags: review?(vladimir)
Attachment #303795 -
Flags: superreview?(roc)
Attachment #303795 -
Flags: review?(vladimir)
Reporter | ||
Updated•16 years ago
|
Flags: blocking1.9?
Assignee | ||
Comment 6•16 years ago
|
||
This patch won't always work well because nsTextFrameThebes needs to snap the text baseline consistently with the underline or we get the wrong size gap between the text and the underline. To be honest, I was planning to not fix this for 1.9. It's not that common and it's not that bad when it happens. When we do Compositor post-1.9, it won't happen anymore because we'll always paint into a widget whose appunit origin is pixel-aligned.
Reporter | ||
Comment 7•16 years ago
|
||
(In reply to comment #6) > This patch won't always work well because nsTextFrameThebes needs to snap the > text baseline consistently with the underline or we get the wrong size gap > between the text and the underline. I'm not sure what case you said. Actually, I can see the text is rendered in wrong position at scrolling, but it's rare case in my experiments. I believe that this patch works fine in most cases. > To be honest, I was planning to not fix this for 1.9. It's not that common and > it's not that bad when it happens. When we do Compositor post-1.9, it won't > happen anymore because we'll always paint into a widget whose appunit origin is > pixel-aligned. Sounds great. But I hope that we fix this bug in most cases except that the current patch has a damage for tp value.
Reporter | ||
Comment 8•16 years ago
|
||
roc: And note that maybe, you see the AAed underline with AAed text. However, CJK text of Win32 are rendered bitmap glyphs in most cases. So, the AAed underline is a striking difference.
Reporter | ||
Comment 9•16 years ago
|
||
Reporter | ||
Comment 10•16 years ago
|
||
especially, the print preview rendering is too ugly.
Assignee | ||
Comment 11•16 years ago
|
||
This patch adds complexity and it's not fully correct because it makes the algorithm for rounding the position of the underline different from the algorithm nsTextFrameThebes uses to round the baseline of text. I don't know exactly what testcases this will break but it will definitely break something and then we'll have to waste time trying to figure out what caused the break, and we'll also run the risk that the break is serious. I really don't want to do this.
If this is really specific to subframes, shouldn't we be pixel-snapping the interior of the frame instead?
Assignee | ||
Updated•16 years ago
|
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Assignee | ||
Comment 13•16 years ago
|
||
I'll take a look at this and see if I can do something like that.
Assignee: masayuki → roc
Status: ASSIGNED → NEW
Assignee | ||
Comment 14•16 years ago
|
||
This testcase shows the problem if I zoom in one level. The text outside the IFRAME still has a good underline but the text inside the IFRAME has an antialiased underline.
Assignee | ||
Comment 15•16 years ago
|
||
If I put the testcase into standards mode (which I should have done in the first place) it shows the problem without zooming.
Assignee | ||
Comment 16•16 years ago
|
||
Basically nsDisplayList::Paint and its callers e.g. nsLayoutUtils::PaintFrame and PresShell::Paint want (0,0) in the incoming rendering context to map to something pixel-aligned; the display item implementations do rounding based on that assumption. This breaks down in nsViewManager::RenderViews (and its caller nsViewManager::Refresh) which translate the rendering context so that (0,0) is transformed to the root view's origin, which may be at a fractional offset relative to the origin of the widget. I'll try just snapping the root view origin to device pixels through the gfxContext. This should fix up the pixel alignment in a way that's consistent with other draw snapping (e.g. border drawing).
Assignee | ||
Comment 17•16 years ago
|
||
This is a little bit gnarly but the comments explain it, I hope.
Attachment #303800 -
Attachment is obsolete: true
Attachment #304957 -
Flags: superreview?(bzbarsky)
Attachment #304957 -
Flags: review?(bzbarsky)
Attachment #303800 -
Flags: superreview?(roc)
Attachment #303800 -
Flags: review?(vladimir)
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs review]
Comment 18•16 years ago
|
||
Comment on attachment 304957 [details] [diff] [review] fix I assume that it's not an issue that we're translating the rc and the dirty rect by different amounts, because the dirty rect needs to line up with frame coords while the rc needs to line up with the widgets? If that's OK, r+sr=bzbarsky.
Attachment #304957 -
Flags: superreview?(bzbarsky)
Attachment #304957 -
Flags: superreview+
Attachment #304957 -
Flags: review?(bzbarsky)
Attachment #304957 -
Flags: review+
Reporter | ||
Comment 19•16 years ago
|
||
The patch also fixes some case of bug 408913. But there are some buggy cases.
Assignee | ||
Comment 20•16 years ago
|
||
(In reply to comment #18) > (From update of attachment 304957 [details] [diff] [review]) > I assume that it's not an issue that we're translating the rc and the dirty > rect by different amounts, because the dirty rect needs to line up with frame > coords while the rc needs to line up with the widgets? That's the idea, yes. Thanks! (In reply to comment #19) > The patch also fixes some case of bug 408913. But there are some buggy cases. You mean there are some buggy cases caused by this patch, or there are some existing buggy cases not fixed by this patch?
Whiteboard: [needs review] → [needs landing]
Reporter | ||
Comment 21•16 years ago
|
||
(In reply to comment #20) > (In reply to comment #19) > > The patch also fixes some case of bug 408913. But there are some buggy cases. > > You mean there are some buggy cases caused by this patch, or there are some > existing buggy cases not fixed by this patch? Maybe, latter. It seems that the patch changes the conditions of the bug. The patch fixes the bug when the testcases are with the current reproduceable conditions. However, some other cases become buggy. (Probably, it's not a regression. The patch only changes the conditions of the testcases, I think.)
Assignee | ||
Comment 22•16 years ago
|
||
seems likely yes.
Assignee | ||
Comment 23•16 years ago
|
||
checked in.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
Comment 25•16 years ago
|
||
regression ? http://forums.mozillazine.org/viewtopic.php?p=3273035#3273035
Assignee | ||
Comment 26•16 years ago
|
||
Yes, I think so. It needs a new bug with a testcase
Comment 27•16 years ago
|
||
I cannot create a testcase. please file a bug, if you/someone can.
Comment 28•16 years ago
|
||
This checkin is also responsible for the black vertical line that recently appeared on Acid3. The regression range for Acid3's breakage was: Working: 20080224_1731_firefox-3.0b4pre Broken (black vertical lines): 20080224_1809_firefox-3.0b4pre -> This Bug.
Comment 29•16 years ago
|
||
(In reply to comment #25) > Created an attachment (id=306176) [details] > screenshot > filed, no testcase. bug 420413
You need to log in
before you can comment on or make changes to this bug.
Description
•