Opened 16 years ago
Closed 15 years ago
#3599 closed Bug (fixed)
Issue with nested Font size and background color
Reported by: | Damian | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.3 |
Component: | Core : Styles | Version: | SVN (CKEditor) - OLD |
Keywords: | IBM Confirmed Review+ | Cc: | Alfonso Martínez de Lizarrondo |
Description
It seems that there is a special case required to be handled by the font style features.
The issue is that when the size of a default text is set to a large size e.g. 72px, then a background color is applied to the same selection, the background style will not have the right font-size set. This results in the background color appearing as a narrow band behind the large font.
E.g.
<span style="background-color: rgb(238, 130, 238);"><span style="font-size: 72px;">Test</span></span>
Attachments (3)
Change History (24)
comment:1 Changed 16 years ago by
Keywords: | Confirmed added |
---|---|
Owner: | set to Tobiasz Cudnik |
Status: | new → assigned |
comment:2 Changed 16 years ago by
How about:
<span style="font-size: 72px;"><span style="background-color: rgb(238, 130, 238);">Test</span></span>
comment:3 Changed 16 years ago by
comment:4 Changed 16 years ago by
Both solutions from garry.yao and alfonsoml includes scanning tree to the root and cloning the background property for each font-affected nodes. When background is changed in some node it will be needed to scan tree from modified node to each leaf and change the actually modified background to new one.
While inline-block is css2.1-correct way of dealing with such issues and doesn't require any of mentioned operations.
comment:5 follow-up: 6 Changed 16 years ago by
Milestone: | CKEditor 3.0 → CKEditor 3.1 |
---|
There is no real bug in the editor, but in the browsers (and probably the HTML specifications). After all, we're talking about an HTML feature. Of course, we understand the end user impact of it, so we should try finding a way to workaround it.
@garry.yao: easy to say, difficult to have. But it looks like the only solution, if we would ever try to fix this. The idea would be having a special stylying case (possibly identified by the style definition), which specifies that the style is to be applied to text nodes and self closing inline elements (<img>) only. In this way it would not embrace existing tags.
@alfonsoml: consider that the font style may be available in any kind of tag, including <font> or even specially styled elements, <strong class="my_strong_class">.
@tobiasz: we're talking about the content generated by the editor, so we cannot have different solutions for different browsers. We may consider this as a temporary fix, ignoring FF2.
comment:6 Changed 16 years ago by
Replying to fredck:
@tobiasz: we're talking about the content generated by the editor, so we cannot have different solutions for different browsers. We may consider this as a temporary fix, ignoring FF2.
Maybe we can use this as solution:
<p> <span style="display: -moz-box; background-color: rgb(238,130,238)"> <span style="display: inline-block; background-color: rgb(238,130,238)"> <span style="font-size: 72px">Test</span> </span> </span> inline </p>
We could use it only for content generated by the editor, like you sad. The editor itself will have browser-specific solution and only one SPAN.
comment:7 Changed 15 years ago by
Keywords: | Discussion added |
---|
comment:8 Changed 15 years ago by
Milestone: | CKEditor 3.1 → CKEditor 3.2 |
---|
comment:9 Changed 15 years ago by
Milestone: | CKEditor 3.2 → CKEditor 3.3 |
---|---|
Owner: | Tobiasz Cudnik deleted |
Status: | assigned → new |
Changed 15 years ago by
Attachment: | 3599.patch added |
---|
comment:10 Changed 15 years ago by
Keywords: | Review? added; Discussion removed |
---|---|
Owner: | set to Garry Yao |
Status: | new → assigned |
Version: | → SVN (CKEditor) |
Thanks to #4772 which make the fix pretty simple.
comment:11 Changed 15 years ago by
Keywords: | Review+ added; Review? removed |
---|
comment:13 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Now when you apply again a background color it will create a new span, so if you test several times you end with
<span style="background-color: rgb(255, 0, 0);"><span style="background-color: rgb(47, 79, 79);"><span style="background-color: rgb(64, 224, 208);">using </span></span></span>
and previously it kept only the latest change.
I'm not sure if the new problem is worth the fix or we should leave it this way and wait for the "span compaction" in a future fix.
comment:14 Changed 15 years ago by
Keywords: | Review? added; Review+ removed |
---|
Excellent review! The customizable style rule functionality made this bug, where similar style (same background-color property with different values in the above sample) couldn't get removed before applying the new style.
Fortunately this situation bring by this new approach is still under our control, with my new patch. While it has successfully passed all design tests of the styles plugin, we should still test it throughly.
Changed 15 years ago by
Attachment: | 3599_2.patch added |
---|
comment:15 Changed 15 years ago by
Cc: | Alfonso Martínez de Lizarrondo added |
---|
Please give a continual review to this problem.
comment:16 Changed 15 years ago by
Keywords: | Review+ added; Review? removed |
---|
Remember to adjust the indenting to one tab and put the spaces for "if( " statements.
Instead of candidates1 and candidates2 you could use elementCandidates and overrideCandidates names, and avoid the count1 and 2 variables by doing the loops downwards:
for ( i = elementCandidates.length - 1 ; i >= 0 ; i-- )
comment:17 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Thanks for the prompt.
Fixed with [5251].
comment:18 Changed 15 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Changed 15 years ago by
Attachment: | 3599_3.patch added |
---|
comment:19 Changed 15 years ago by
Keywords: | Review? added; Review+ removed |
---|
Proposing another approach for fixing the bug raised by alfonsoml.
comment:20 Changed 15 years ago by
Keywords: | Review+ added; Review? removed |
---|
Please do not keep re-opening already closed tickets.
comment:21 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I'm proposing use of inline-block.
For every browser other than FF2 (including IE6):
For FF2
Does anyone see anything agains it ?