Closed
Bug 301149
Opened 19 years ago
Closed 18 years ago
:hover is processed in Print Preview mode
Categories
(Core :: Print Preview, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: MatsPalmgren_bugz, Assigned: masayuki)
References
Details
(Keywords: testcase)
Attachments
(2 files, 7 obsolete files)
|
723 bytes,
text/html
|
Details | |
|
4.10 KB,
patch
|
masayuki
:
review+
masayuki
:
superreview+
|
Details | Diff | Splinter Review |
:hover is processed in Print Preview mode STEPS TO REPRODUCE 1. load attached testcase 2. File -> Print Preview 3. move mouse over elements ACTUAL RESULTS DIV and IFRAME disappears when hovered, INPUT doesn't. EXPECTED RESULTS Nothing disappears (:hover not processed). BUILDS & PLATFORMS TESTED Bug occurs in SeaMonkey 2005-07-11-02 trunk Linux
| Reporter | ||
Comment 1•19 years ago
|
||
Comment 2•19 years ago
|
||
The basic problem here is that print preview just looks like a random screen presentation in most ways.... :(
Just like to add that this web address causes the problem as well. http://www.lightreading.com/
| Assignee | ||
Comment 5•18 years ago
|
||
I think that this bug is not INVA. Because the print preview mode is a simulator of the result of the printing. By the limit of the device, the result of the printing doesn't have :hover effect. Therefore, the print preview mode should simulate the same limit.
OS: Linux → All
| Assignee | ||
Comment 6•18 years ago
|
||
This fixes this issue. I think that the focus state and the active state are ignored in print preview mode. If this bug is INVA. We should support those state in print preview.
| Assignee | ||
Updated•18 years ago
|
Assignee: printing → masayuki
QA Contact: printing
| Assignee | ||
Comment 7•18 years ago
|
||
Oops, the previous patch has wrong indent.
Attachment #241870 -
Attachment is obsolete: true
Comment 8•18 years ago
|
||
Doesn't that patch break hover on print-preview scrollbars (when those have a hover effect)?
| Assignee | ||
Comment 9•18 years ago
|
||
Comment on attachment 241872 [details] [diff] [review] Patch rv1.0.1 > Doesn't that patch break hover on print-preview scrollbars (when those have a > hover effect)? You're right.
Attachment #241872 -
Attachment is obsolete: true
| Assignee | ||
Comment 10•18 years ago
|
||
This is checking whether the content is in a scrollbar element of XUL.
| Assignee | ||
Comment 11•18 years ago
|
||
Comment on attachment 241942 [details] [diff] [review] Patch rv2.0 I think that we should fix this issue, so I still think that this is a bug.
Attachment #241942 -
Flags: superreview?(roc)
Attachment #241942 -
Flags: review?(bzbarsky)
Comment 12•18 years ago
|
||
I don't think I should be reviewing this code. I certainly won't have time to any time in the foreseeable future.
Comment 13•18 years ago
|
||
So with patch rv2.0, scrollbars in content on print preview would still get a hover effect?
| Assignee | ||
Comment 14•18 years ago
|
||
Comment on attachment 241942 [details] [diff] [review] Patch rv2.0 (In reply to comment #12) > I don't think I should be reviewing this code. I certainly won't have time to > any time in the foreseeable future. O.K. changing to Roc.
Attachment #241942 -
Flags: review?(bzbarsky) → review?(roc)
| Assignee | ||
Comment 15•18 years ago
|
||
(In reply to comment #13) > So with patch rv2.0, scrollbars in content on print preview would still get a > hover effect? There are no scrollbars in the content of print preview on WinXP. On other platforms, do the scrollbars appear in the content of print preview?
| Assignee | ||
Comment 16•18 years ago
|
||
Oops, sorry. The previous patch doesn't cancel the :hover state of the scrollbar. This patch works fine. And this checking whether the scrollbar owner is root content.
Attachment #241942 -
Attachment is obsolete: true
Attachment #241953 -
Flags: superreview?(roc)
Attachment #241953 -
Flags: review?(roc)
Attachment #241942 -
Flags: superreview?(roc)
Attachment #241942 -
Flags: review?(roc)
Comment on attachment 241953 [details] [diff] [review] Patch rv3.0 Call !mPresContext->IsDynamic() instead of checking the type. This would allow XUL scrollbars that are children of the root element to be hovered even if they're not the real viewport scrollbars. You also should really check for the scrollcorner. But this is fragile because it will break if we change scrollframe anonymous content. A cleaner way to solve this would be to call GetPrimaryFrameFor(aContent), Get the root scrollframe via nsIPresShell::GetRootScrollFrame, QI it to nsIScrollableFrame, call GetScrolledFrame, and check whether aContent's frame IS a descendant of the scrollableFrame but IS NOT a descendant of the scrolledFrame. You might want to put this check in nsLayoutUtils because I have a feeling that we've implemented it elsewhere...
| Assignee | ||
Comment 18•18 years ago
|
||
Thank you, Roc! It's clever idea!
Attachment #241953 -
Attachment is obsolete: true
Attachment #242201 -
Flags: superreview?(roc)
Attachment #242201 -
Flags: review?(roc)
Attachment #241953 -
Flags: superreview?(roc)
Attachment #241953 -
Flags: review?(roc)
| Assignee | ||
Updated•18 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
+ if (!aContent || !aPresContext || !aContent->IsNodeOfType(nsINode::eXUL)) + return PR_FALSE; Skip the IsNodeOfType check. It's not needed, and it might hurt if we ever have nonXUL elements in scroll widgets (someone could actually do this with XBL) + nsIPresShell* presShell = aPresContext->GetPresShell(); + if (!presShell) + return PR_FALSE; Just call ->PresShell(), no need to null check. + nsCOMPtr<nsIScrollableFrame> + rootScrollableFrame = do_QueryInterface(rootScrollFrame); + if (!rootScrollableFrame) + return PR_FALSE; Make this null-check an assertion. It should never fail if GetRootScrollFrame is working correctly. + if (!rootScrolledFrame || !IsProperAncestorFrame(rootScrolledFrame, frame)) + return PR_TRUE; + + return PR_FALSE; Just "return !rootScrolledFrame || !IsProperAncestorFrame(rootScrolledFrame, frame);" Actually I think it would be slightly nicer to make IsViewportScrollbarContent be IsViewportScrollbarFrame and take a single nsIFrame* parameter. (If we ever want to use it again we're more likely to have a frame than an nsIContent*). You can then write nsIFrame* rootScrollFrame = aFrame->GetPresContext()->PresShell()->GetRootScrollFrame(); and continue on as before. The GetPrimaryFrameFor would be moved to SetContentState.
| Assignee | ||
Comment 21•18 years ago
|
||
Sorry for the delay.
Attachment #242201 -
Attachment is obsolete: true
Attachment #243108 -
Flags: superreview?(roc)
Attachment #243108 -
Flags: review?(roc)
Attachment #242201 -
Flags: superreview?(roc)
Attachment #242201 -
Flags: review?(roc)
Sorry, I lost this somehow.
+PRBool
+nsLayoutUtils::IsViewportScrollbarFrame(nsPresContext* aPresContext,
+ nsIFrame* aFrame)
Don't pass aPresContext as a parameter. Just use aFrame->GetPresContext() (which doesn't need to be null-checked).
+ nsCOMPtr<nsIScrollableFrame>
+ rootScrollableFrame = do_QueryInterface(rootScrollFrame);
Use
nsIScrollableFrame* rootScrollableFrame;
CallQueryInterface(rootScrollFrame, &rootScrollableFrame);
since frames aren't reference-counted.
+ } else if (aState == NS_EVENT_STATE_HOVER && !mHoverContent) {
+ // We need to do nothing, because any content is not changed the state.
+ return PR_FALSE;
Do we need this case? It seems to me we could just do newHover = nsnull; and carry on, and it would be correct. If so, then I think we should remove this case to simplify the code.| Assignee | ||
Comment 24•18 years ago
|
||
Attachment #243108 -
Attachment is obsolete: true
Attachment #244275 -
Flags: superreview?(roc)
Attachment #244275 -
Flags: review?(roc)
Attachment #243108 -
Flags: superreview?(roc)
Attachment #243108 -
Flags: review?(roc)
Comment on attachment 244275 [details] [diff] [review] Patch rv6.0 IsViewportScrollbarFrame should return false for the root scrolled frame. Currently it returns true. So + return !rootScrolledFrame || + !IsProperAncestorFrame(rootScrolledFrame, aFrame); Make this !(rootScrolledFrame == aFrame || IsProperAncestorFrame(rootScrollFrame, aFrame))
Comment on attachment 244275 [details] [diff] [review] Patch rv6.0 IsViewportScrollbarFrame should return false for the root scrolled frame. Currently it returns true. So + return !rootScrolledFrame || + !IsProperAncestorFrame(rootScrolledFrame, aFrame); Make this !(rootScrolledFrame == aFrame || IsProperAncestorFrame(rootScrollFrame, aFrame))
Attachment #244275 -
Flags: superreview?(roc)
Attachment #244275 -
Flags: superreview+
Attachment #244275 -
Flags: review?(roc)
Attachment #244275 -
Flags: review+
| Assignee | ||
Comment 27•18 years ago
|
||
Thank you, roc.
Attachment #244275 -
Attachment is obsolete: true
Attachment #244309 -
Flags: superreview+
Attachment #244309 -
Flags: review+
| Assignee | ||
Comment 28•18 years ago
|
||
checked-in, thank you.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•