Closed
Bug 26831
Opened 25 years ago
Closed 24 years ago
Implement table and cell selection as border highlighting instead of content highlighting
Categories
(Core :: DOM: Editor, defect, P1)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
mozilla0.9.1
People
(Reporter: cmanske, Assigned: mjudge)
References
Details
Attachments
(4 files)
4.96 KB,
patch
|
Details | Diff | Splinter Review | |
1.76 KB,
patch
|
Details | Diff | Splinter Review | |
9.11 KB,
patch
|
Details | Diff | Splinter Review | |
5.37 KB,
patch
|
Details | Diff | Splinter Review |
When we select entire cells or the entire table, we want the border to be
highlighted, like the blue border we used earlier. Currently, selecting a cell
does the usual text selection style on the cell's contents.
Reporter | ||
Updated•25 years ago
|
Target Milestone: M15
Comment 3•25 years ago
|
||
Neither of those bugs are duplicates of this one. They are, however, duplicates
of each other.
Bug #29393 and Bug #29476 both refer to being able to select rectangular areas
of a table. This bug is about how selections should be highlighted.
Comment 4•25 years ago
|
||
actually they are duplicates; if you get the blue selection border then you'll
have your rectangular selection.
Updated•25 years ago
|
OS: Windows NT → All
Hardware: PC → All
Target Milestone: M15 → M16
Comment 5•25 years ago
|
||
updating keyword and status whiteboard to reflect that this is a beta 2 feature
work bug that the Composer team deems a must fix for beta 2.
fixed, style color will be implemented when they get to css3 pseudo style
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
I just tested this in my Win32 10/27/00 Netscape_20000922_BRANCH build. I don't
see any border highlighting (rectangle drawn around the cell or table) ... if I
control click on a cell the entire cell background gets filled in with the
hilight color. Control clicking on an outside table border changes the
background of all cells to the hilight color.
Was border highlighting disabled in favor of this new method?
I also see the same behavior mentions in my 10/30 build...REOPENING
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 9•24 years ago
|
||
moving off M16 since that was long ago...
Target Milestone: M16 → mozilla0.9
Reporter | ||
Comment 10•24 years ago
|
||
*** Bug 61278 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 11•24 years ago
|
||
*** Bug 53741 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 12•24 years ago
|
||
*** Bug 66360 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 13•24 years ago
|
||
Note that this problem is frequently encountered as a "can't set table or cell
background color" problem. The number of bug duplicates supports this.
Let's please try to get this fixed for 0.9.
Comment 14•24 years ago
|
||
If you use border highlighting instead of background highlighting, I imagine
you'll have two new problems. (1) Instead of getting `Can't set table/cell
background color' bugs, you'll start to get `Can't set table/cell border' bugs.
(2) In large tables, especially where part of the selection is outside the
window, it will be very difficult to tell what is selected and what isn't.
I suggest using a pixel-checkerboard pattern of the selection color to cover the
cell background.
X X X X
X X X X
X X X X
X X X X
That way the cell/table will obviously be highlighted, but the existing
background will still be visible. (The same thing applies for selecting images,
bug 14835.)
Reporter | ||
Comment 15•24 years ago
|
||
*** Bug 68857 has been marked as a duplicate of this bug. ***
Comment 16•24 years ago
|
||
is bug 50794 a dup of this ?
Assignee | ||
Comment 17•24 years ago
|
||
This is a no-win situation. The background highlighting for table cell
selection is a good method. the only side affect to this is the temporary
confusion that the background color did not take. moving to .091 for now
Status: REOPENED → ASSIGNED
Target Milestone: mozilla0.9 → mozilla0.9.1
Comment 18•24 years ago
|
||
could we use a hatched pattern? background overlay a png file
<pattern>
X0
0X
</pattern>
X is translucent, O is 100% transparent.
Assignee | ||
Comment 19•24 years ago
|
||
ok here are some patches. we can flip switch back easily if people get upset at
the result
Assignee | ||
Comment 20•24 years ago
|
||
Assignee | ||
Comment 21•24 years ago
|
||
Assignee | ||
Comment 22•24 years ago
|
||
kin allready reviewed this so r=kin if he doesnt add that to this bug himself
Comment 23•24 years ago
|
||
(cc'ing karnze, who may have other comments on nsTableCellFrame.)
In nsTableCellFrame.cpp, it seems like this whole big mess should be moved out
to a separate function. The nesting is starting to walk off the right edge of my
screen. What do you think?
Probably don't need to check in the commented out stuff:
+ if (NS_SUCCEEDED(result) && tableCellSelectionMode) {
+ //frameSelection->GetTableCellSelectionStyleColor(&myColor);
I think spaces around `==' are prevalent style in this file.
+ if(displaySelection==nsISelectionController::SELECTION_DISABLED) {
Shouldn't this come from nsILookAndFeel?
+ bordercolor = NS_RGB(176,176,176);// disabled color
Usually, people call this `t2p' for twips-to-pixels:
+ float twipsfloat;
+ if (NS_SUCCEEDED(aPresContext->GetPixelsToTwips(&twipsfloat)))
+ {
+ PRInt16 twipsperpixel = (PRInt16)twipsfloat;
Are you sure that myColor is initialized by this point? (I didn't look carefully
at the code preceding the patch.)
+ //compare bordercolor to ((nsStyleColor
*)myColor)->mBackgroundColor)
+ bordercolor = EnsureDifferentColors(bordercolor,
myColor->mBackgroundColor);
In nsSelection.cpp,
I think you want ``#undef OLD_SELECTION'' here:
+#define OLD_SELECTION 0
+//#define OLD_TABLE_SELECTION 1
Comment 24•24 years ago
|
||
Also, just a note on the number of calculations that are done in the patch:
We can reduce 6 muliplications (2*twipsperpixel) down to one with the use of a
temporary variable.
Same goes for the various (width - twipsperpixel), (height - twipsperpixel),
(width - 2*twipsperpixel), (height - 2*twipsperpixel) values which are used more
than once.
Comment 25•24 years ago
|
||
Also, I didn't see any comments/reply to timeless and mpt's request for using
hatched patterns instead. Should they file that as a seperate bug/RFE?
Reporter | ||
Comment 26•24 years ago
|
||
I agree that if we can do a hatched pattern, it would be much better.
I'll help test as soon as I can get &%$# cvs to let me pull everything!
Assignee | ||
Comment 27•24 years ago
|
||
as far as the review goes...
took out comment.
added in spaces around "==".
nsILookAndFeel doesnt have "disabled selection".
changed variable to t2p/t2pfloat.
mycolor is initialized and then asserted on. (I moved the assertion checks
closer to assignment to be more clear there.)
I actually didnt add that OLD_SELECTION i just moved it. it uses #if not #ifdef
to check. I have made it #ifdef and #undef to make it more clear.
added 2 methods to break out the functions from paint so paint looks neater.
Assignee | ||
Comment 28•24 years ago
|
||
Assignee | ||
Comment 29•24 years ago
|
||
Assignee | ||
Comment 30•24 years ago
|
||
ok so far as the hatch pattern..
i cant find a method that will allow a filled rectangle to be drawn with a
pattern in an XP way. if anyone finds one let me know.
we could do an "X" or vertical and horizontals to make like "#" but the
diagonals are to much a pain to do just for nsTableCellFrame::Paint i think. i
want to check in this patch with the understanding that it is better than what
it was and that we can argue over the exact pattern to be used.
Comment 31•24 years ago
|
||
Cool, thanks. Couple more nits! :-)
> nsILookAndFeel doesnt have "disabled selection".
Should it? (Seems like it should to me.) If so, please file another bug (maybe
on XPToolkit?) If not, just tell me to go to my corner.
+ const nsStyleColor* myColor = (const
nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color);
+#ifdef OLD_TABLE_SELECTION
+ myColor = GetColorStyleFromSelection(mycolor);
^^^^^^^
Did you mean my*C*olor (intercaps)? (It's ifdef'd out, so probably not caught by
compile.)
Do you want to address kin's gripe about extra multiplies?
Looks good to me. sr=waterson
Comment 32•24 years ago
|
||
i was hoping you could just use a PNG, i don't actually know how.
Assignee | ||
Comment 33•24 years ago
|
||
yeah mycolor should be myColor i actually changed that here allready when i
tested it with ifdef on. thanks. png transparancy.. hmm let me talk to pavlov.
either way i am going to check this in and then we can keep talking about the
specifics.
yes lookandfeel could have disabled selection. let me see if i can talk to
pierre before he leaves.
Assignee | ||
Comment 34•24 years ago
|
||
resolving the bug. if you want to make a fancier pattern/ blending we need a new
bug on this. talked to pav and until gfx2 goes in it doesnt look good for either
right now.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 24 years ago
Resolution: --- → FIXED
Whiteboard: Composer feature work [QAHP]
You need to log in
before you can comment on or make changes to this bug.
Description
•