Closed
Bug 554810
Opened 14 years ago
Closed 14 years ago
CSS resize property need a transparent resize grip
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: phiw2, Assigned: enndeakin)
References
Details
Attachments
(9 files, 3 obsolete files)
82.18 KB,
image/png
|
Details | |
18.09 KB,
image/png
|
Details | |
9.23 KB,
image/png
|
Details | |
203 bytes,
image/png
|
Details | |
190 bytes,
image/png
|
Details | |
180 bytes,
image/png
|
Details | |
44.28 KB,
image/png
|
Details | |
57.81 KB,
image/png
|
Details | |
34.09 KB,
patch
|
roc
:
review+
ehsan.akhgari
:
feedback+
|
Details | Diff | Splinter Review |
When a background colour is specified for a text area the resize grip (image) shows a white background. It should let the background-colour of the textarea shine through – which is what WebKit does. (and eventually, the image shouldn't show a border…) The attached screenshot shows WebKit on top, Gecko at the bottom. The testarea uses the following style: textarea { border:1px solid #090; background: #dfd; color: #000; -moz-resize: both; resize: both; }
Assignee | ||
Comment 1•14 years ago
|
||
Markus, do we have control over the background for native resizers? A Windows version of this bug is 553752.
Comment 2•14 years ago
|
||
I'll check how Webkit does it.
Comment 3•14 years ago
|
||
They use an image: http://trac.webkit.org/export/56518/trunk/WebCore/Resources/textAreaResizeCorner.tiff
Assignee | ||
Comment 4•14 years ago
|
||
OK, maybe we should create an image as well, and use it in all or some situations. This might make it easier to support resizers in other directions as well. This is needed on Mac and Windows Classic at least.
I think an image would make it easier for theme-creators too, so you have my support on that.
Comment 6•14 years ago
|
||
What happens when the textarea has scrollbars?
Reporter | ||
Comment 7•14 years ago
|
||
(In reply to comment #6) > What happens when the textarea has scrollbars? What WebKit does: the grip has a white background-color (similar to how two scrollbars intersect on a window).
Comment 8•14 years ago
|
||
Top-to-Bottom: Linux, Windows, Mac
Comment 9•14 years ago
|
||
Comment 10•14 years ago
|
||
Comment 11•14 years ago
|
||
Assignee | ||
Comment 12•14 years ago
|
||
This patch fixes the following: This Bug - uses transparent resizer images when a custom background or border is present and no scrollbars are visible Bug 553752 - resizers in windows classic Bug 553796 - horizontal and vertical resizers not visible Bug 558201 - resizer cursor in rtl I disabled native theme rendering of rtl resizers, due to the -moz-transform conflicting with it, as the transform needs to apply to the non-native image versions. One minor issue is that the resizer images here are 16x16 but the native resizers are 15x15.
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Comment 13•14 years ago
|
||
(In reply to comment #12) > One minor issue is that the resizer images here are 16x16 but the native > resizers are 15x15. I can resize them to 15x15 if that would be better.
Assignee | ||
Comment 14•14 years ago
|
||
(In reply to comment #13) > I can resize them to 15x15 if that would be better. That would be good. I noticed some minor alignment problems and it might be the cause.
Assignee | ||
Comment 15•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #443913 -
Attachment is obsolete: true
Assignee | ||
Comment 16•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #444128 -
Flags: review?(roc)
Assignee | ||
Comment 17•14 years ago
|
||
Comment on attachment 444128 [details] [diff] [review] with 15x15 images This patch works well as the image shows. Non-native images are used when custom backgrounds/borders are present, except when the scrollbar is visible on Mac. I don't like how I had to disable rtl support in the native theme, but the -moz-transform needed for the non-native image conflicts with it. Is there a way around this? Another option is to include a second set of horizontally flipped images, but it would be nice to also be able to support resizers in the other corners (vertically flipped) if needed.
Assignee | ||
Comment 18•14 years ago
|
||
I also meant to say that I plan on writing some tests for this as well.
Comment 19•14 years ago
|
||
Note that things are worse for Windows Classic, since the default resizer background is not the same as the default textarea background. Is it perhaps possible to create both scrollcorners and resizers (with the resizer painting over the scrollcorner), but only showing the scrollcorner when at least two of (resizer, hscrollbar, vscrollbar) are visible?
Comment 20•14 years ago
|
||
Can the square border (?) around the grippy be removed? I find it rather distracting, and it just seems to hang out into space...
IE, the screenshots in attachment 444129 [details] look as I'd expect where the background is colored, but not where it's white. Also seems odd for it to be different in those two cases.
Comment 21•14 years ago
|
||
(In reply to comment #20) > Can the square border (?) around the grippy be removed? I find it rather > distracting, and it just seems to hang out into space... > > IE, the screenshots in attachment 444129 [details] look as I'd expect where the > background is colored, but not where it's white. Also seems odd for it to be > different in those two cases. I agree it would probably look best to have it without the white box unless there are scrollbars and it doesn't serve any purpose in the non-scrollbar case.
I agree we should lose the box when there are no scrollbars. With scrollbars, I don't mind if the box is there or not.
Comment 23•14 years ago
|
||
That either means getting rid of Mac native resizer theming completely and always using the image, or making Mac native theming draw a transparent resizer without box, i.e. drawing the lines manually. The second option is what Colin did in bug 363757. Carbon native theme drawing doesn't give us the option to draw a transparent resizer; in fact for some Carbon applications you can tell that they're Carbon by looking at their native window resizer (e.g. compare Opera 10.10 and 10.50).
That's unfortunate, but drawing the resizer by hand still seems worth it to me.
Assignee | ||
Comment 25•14 years ago
|
||
One issue with this patch is that the resizer-bottomend-rtl.xul test fails as it uses: <resizer dir="bottomend" style="direction: rtl"/> but the native theme rtl support has been disabled. Is this something that needs to be supported or is there a better fix here?
Comment 26•14 years ago
|
||
I think we still need to support this. In fact, I'm not so sure what you mean here, are you suggesting that we stop handling resizer elements which have an rtl style?
Assignee | ||
Comment 27•14 years ago
|
||
(In reply to comment #26) > I think we still need to support this. In fact, I'm not so sure what you mean > here, are you suggesting that we stop handling resizer elements which have an > rtl style? No, the problem is that the images use -moz-transform which conflicts with the native theme. See comment 17.
Comment 28•14 years ago
|
||
Would this work? - make nsNativeThemeCocoa::DrawResizer draw a transparent resizer using the hard-coded line drawing approach from attachment 294300 [details] [diff] [review] - draw the lines mirrored for RTL - always use native theming for resizers on Mac, i.e. #ifndef the whole block you add in nsNativeTheme::IsWidgetStyled.
Assignee | ||
Comment 29•14 years ago
|
||
(In reply to comment #28) > Would this work? > - make nsNativeThemeCocoa::DrawResizer draw a transparent resizer using the > hard-coded line drawing approach from attachment 294300 [details] [diff] [review] > - draw the lines mirrored for RTL > - always use native theming for resizers on Mac, i.e. #ifndef the whole block > you add in nsNativeTheme::IsWidgetStyled. You could do that, but the same would need to be implemented on the other platforms.
Comment 30•14 years ago
|
||
Hm, yeah. What about avoiding the transforms altogether and use two separate images for LTR and RTL resizers?
Assignee | ||
Comment 31•14 years ago
|
||
Attachment #444128 -
Attachment is obsolete: true
Attachment #447526 -
Flags: review?(roc)
Attachment #447526 -
Flags: feedback?(mstange)
Attachment #444128 -
Flags: review?(roc)
Updated•14 years ago
|
Attachment #447526 -
Flags: feedback?(mstange) → feedback+
Comment 32•14 years ago
|
||
Comment on attachment 447526 [details] [diff] [review] use separate images for ltr and rtl resizers Does this patch preserve the behavior implemented in bug 240536?
The code looks OK but it's confusing, e.g. on Mac to have the native theme code only draw resizers in scrollframes with scrollbars, but on Windows to have the native theme code only draw resizers when NOT in scrollframes. We need documentation somewhere to explain what our strategy actually is for drawing resizers in different situations on different platforms.
Comment 34•14 years ago
|
||
(Just pointing out one more example of where transparent grippies should work better. This is on TB+PL, when starring a build.)
Assignee | ||
Comment 35•14 years ago
|
||
(In reply to comment #33) > The code looks OK but it's confusing, e.g. on Mac to have the native theme code > only draw resizers in scrollframes with scrollbars, but on Windows to have the > native theme code only draw resizers when NOT in scrollframes. We need > documentation somewhere to explain what our strategy actually is for drawing > resizers in different situations on different platforms. Mainly, this is response to comment 22, and to bug 553752. I will add more clarification.
Assignee | ||
Comment 36•14 years ago
|
||
This patch adds more comments to the native widget styling code and updates the resizer css to properly handle the rtl cursor in some cases. I also made a fix so that on Mac, resizers in non-scrollable areas are native themed.
Attachment #447526 -
Attachment is obsolete: true
Attachment #451299 -
Flags: review?(roc)
Attachment #451299 -
Flags: feedback?(ehsan)
Attachment #447526 -
Flags: review?(roc)
Comment 37•14 years ago
|
||
Comment on attachment 451299 [details] [diff] [review] added more comments Here's a screenshot of how the patch looks like for the main window in RTL window: http://grab.by/4X87 Here's how it looks for the show passwords dialog. http://grab.by/4X8f f- based on this. (The patch looks good on textarea resizer controls though)
Attachment #451299 -
Flags: feedback?(ehsan) → feedback-
Assignee | ||
Comment 38•14 years ago
|
||
Ehsan, the issue with the show passwords dialog is bug 556645 and occurs without this patch as well. I don't understand what you're indicating in the first image. The image looks correct to me.
Comment 39•14 years ago
|
||
Looks correct to me, too - the window resizer is supplied by the OS and its position is not under our control.
Comment 40•14 years ago
|
||
(In reply to comment #38) > Ehsan, the issue with the show passwords dialog is bug 556645 and occurs > without this patch as well. Yes. I'm talking about the right-size resizer. > I don't understand what you're indicating in the first image. The image looks > correct to me. It should be mirrored, and should appear on the left side.
Assignee | ||
Comment 41•14 years ago
|
||
The position of the resizer isn't this bug, so I'm not clear what the objection is here. This bug adjusts only the appearance of the resizer (see bug dependencies) as well as the cursor (the latter is bug 558201).
Comment 42•14 years ago
|
||
Comment on attachment 451299 [details] [diff] [review] added more comments OK, I guess we can fix the window resizer in another bug.
Attachment #451299 -
Flags: feedback- → feedback+
Comment 43•14 years ago
|
||
Filed bug 572455 for that.
Attachment #451299 -
Flags: review?(roc) → review+
Comment 44•14 years ago
|
||
Comment on attachment 451299 [details] [diff] [review] added more comments Presumably this patch only fixes things for the default theme?
Assignee | ||
Comment 45•14 years ago
|
||
(In reply to comment #44) > (From update of attachment 451299 [details] [diff] [review]) > Presumably this patch only fixes things for the default theme? Yes, are there changes you think could be made?
Assignee | ||
Comment 46•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/d0801f21095f
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Comment 47•14 years ago
|
||
(In reply to comment #45) > (In reply to comment #44) > > (From update of attachment 451299 [details] [diff] [review]) > > Presumably this patch only fixes things for the default theme? > Yes, are there changes you think could be made? Well, rather than giving the native theme code "insider" knowledge of the scroll frame, my suggestion would have been to make the resizer always transparent and display a scrollcorner element underneath it when either scrollbar is visible.
Comment 48•3 years ago
|
||
Okay, so I stumbled upon an issue with material-components-web. And they referred me to this bugreport.
https://github.com/material-components/material-components-web/issues/6783
This seems to be an issue still smh?
Apparently they use something like:
<style>
#resize {
width: 250px;
height: 56px;
border: 1px solid black;
background: darkgray;
resize: both;
overflow: hidden;
}
</style>
<div id="resize"></div>
And then it seems to still use the old intransparent handler on "some combinations of linux and firefox".
Demo: https://codepen.io/rebootl/pen/ZEpdpJx
So I tested on Ubuntu 20.04, firefox 84.0.2 aswell as Arch Linux, firefox 84.0.2, and it happened in both cases.
Thx.
You need to log in
before you can comment on or make changes to this bug.
Description
•