Closed
Bug 1274692
Opened 9 years ago
Closed 8 years ago
Using CSS filter on elements taller than 16383px causes element to be cropped at 2048px height
Categories
(Core :: Web Painting, defect, P3)
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: toriningen.me, Assigned: ethlin)
References
()
Details
Attachments
(1 file, 1 obsolete file)
1.23 KB,
patch
|
mstange
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160502172042
Steps to reproduce:
Create any element of height 16384px or more and give it any CSS filter.
See interactive fiddle here: https://jsfiddle.net/toriningen/hhcf56nc/1/
Actual results:
Element will crop at 2048px height, rest of element will be rendered transparent.
Expected results:
It should have rendered in full regardless of height.
Reporter | ||
Updated•9 years ago
|
OS: Unspecified → All
Version: 46 Branch → 49 Branch
Reporter | ||
Updated•9 years ago
|
Reporter | ||
Updated•9 years ago
|
Component: Untriaged → Layout: View Rendering
Product: Firefox → Core
Version: 49 Branch → 46 Branch
Reporter | ||
Comment 1•9 years ago
|
||
Another example where this problem is live:
1. visit https://mrakopedia.ru/wiki/%D0%94%D1%80%D1%83%D0%B6%D0%B1%D0%B0_%E2%80%94_%D1%8D%D1%82%D0%BE_%D0%BE%D0%BF%D1%82%D0%B8%D0%BC%D1%83%D0%BC
2. either click on "ночной режим" link on the topmost bar, or execute `toggleNightMode()` from dev console.
3. scroll approx 2-3 screens down to see truncated content. You can toggle night mode once again to see content appear.
Removing CSS filter via devtools makes content appear back. If there is no plan to fix this soon, is there any workaround that can be applied to make content visible, yet with filter applied?
CJ, any chance you could look in to what's happening here?
Flags: needinfo?(cku)
Sure. It happens on Mac only, I can not reproduce it on windows device. Keep need-info
1. drop-shadow/ blur: Element is cropped at 2048px height, even if spanner.style.height == 16383px
2. I can reproduce this problem after switch to other backends, such as Skia.
[68221] WARNING: Surface size too large (exceeds CoreGraphics limit)!: file /Users/cjcool/repository/gecko-dev/gfx/thebes/gfxASurface.cpp, line 400
Because of this limitation, we see surface trimmed:
https://dxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxASurface.cpp#399
This limitation existed, I think, before we support tile rendering, we should extend this limitation when "layers.enable-tiles" pref-on.
Review commit: https://reviewboard.mozilla.org/r/56344/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/56344/
Basic idea is
nsSVGUtils::ConvertToSurfaceSize is called at three places
1. nsSVGMaskFrame::GetMaskForMaskedFrame
call ConvertToSurfaceSize to get a boundary size, base on this size, create a DrawTarget.
In this case, there is no need to do CG-image-height-upper-bound check[1]. Two reasons.
I. The created DrawTarget may not be DrawTargetCG. Even on MacOS, it could be a DrawTargetSkia.
II. Even if it's a DrawTargetCG, we can still check by DrawTargetCG::IsValid on the fly.
2. nsFilterInstance::OutputFilterSpaceBounds(): we are not create any buffer here, there is no need to check CG image height in this path either.
3. nsSVGPatternFrame::PaintPattern: reason is the same with #1.
[1] https://dxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxASurface.cpp#399
Hi Milan,
It's a domain that I am not that familiar. May I know who it the right person to feedback/review this change?
Flags: needinfo?(milan)
We're actually removing CG as a valid OS X backend, so we may be able to just removed that code completely. Mason, when did we get rid of CG?
Flags: needinfo?(milan) → needinfo?(mchang)
Comment 11•9 years ago
|
||
Is there a META bug for remove CG? I want to remove some workaround code, such as [1], after that.
[1] https://dxr.mozilla.org/mozilla-central/source/layout/svg/nsSVGIntegrationUtils.cpp#467
Comment 12•9 years ago
|
||
Deleting CG will happen in bug 1258751, but not until Skia content on OS X hits release. Skia content is riding the trains starting in 48, so we still have a few more releases to go until we can delete CG.
Flags: needinfo?(mchang)
Assignee | ||
Comment 14•8 years ago
|
||
CG is removed. So we can remove the related limitation.
Attachment #8757993 -
Attachment is obsolete: true
Attachment #8802844 -
Flags: review?(mstange)
Updated•8 years ago
|
Attachment #8802844 -
Flags: review?(mstange) → review+
Comment 15•8 years ago
|
||
(In reply to C.J. Ku[:cjku](UTC+8) from comment #8)
> 2. nsFilterInstance::OutputFilterSpaceBounds(): we are not create any buffer
> here, there is no need to check CG image height in this path either.
I agree.
> nsSVGUtils::ConvertToSurfaceSize is called at three places
> 1. nsSVGMaskFrame::GetMaskForMaskedFrame
> call ConvertToSurfaceSize to get a boundary size, base on this size,
> create a DrawTarget.
> 3. nsSVGPatternFrame::PaintPattern: reason is the same with #1.
If these two cases cause us to clip rendering, then we're not computing efficient intermediate surface sizes. We should not need any surfaces that are bigger than the display port, regardless of the size of the whole element.
Comment 16•8 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #15)
> If these two cases cause us to clip rendering, then we're not computing
> efficient intermediate surface sizes. We should not need any surfaces that
> are bigger than the display port, regardless of the size of the whole
> element.
Hi mstange,
Do you know where this limitation comes from? How to limited clip region of a gfxContext in the size of display port?
Does my patch in bug 1299715 break this limitation?
http://searchfox.org/mozilla-central/source/layout/generic/nsFrame.cpp#2436
Flags: needinfo?(mstange)
Comment 17•8 years ago
|
||
(In reply to C.J. Ku[:cjku](UTC+8) from comment #16)
> (In reply to Markus Stange [:mstange] from comment #15)
> > If these two cases cause us to clip rendering, then we're not computing
> > efficient intermediate surface sizes. We should not need any surfaces that
> > are bigger than the display port, regardless of the size of the whole
> > element.
> Hi mstange,
> Do you know where this limitation comes from? How to limited clip region of
> a gfxContext in the size of display port?
>
> Does my patch in bug 1299715 break this limitation?
> http://searchfox.org/mozilla-central/source/layout/generic/nsFrame.cpp#2436
No, it shouldn't
Flags: needinfo?(mstange)
Updated•8 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: -- → P3
Assignee | ||
Comment 18•8 years ago
|
||
Keywords: checkin-needed
Comment 19•8 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/06ed2770b58d
Remove CG limitation since the backend is skia. r=mstange
Keywords: checkin-needed
Comment 20•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Updated•6 years ago
|
Component: Layout: View Rendering → Layout: Web Painting
You need to log in
before you can comment on or make changes to this bug.
Description
•