This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 8215 - Amaya crashes when selecting elements styled with border & background
Summary: Amaya crashes when selecting elements styled with border & background
Status: RESOLVED FIXED
Alias: None
Product: Amaya
Classification: Unclassified
Component: CSS (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 critical
Target Milestone: ---
Assignee: Vatton
QA Contact: Vatton
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-06 08:07 UTC by D. Gardiner
Modified: 2010-03-16 18:41 UTC (History)
6 users (show)

See Also:


Attachments

Description D. Gardiner 2009-11-06 08:07:45 UTC
This fault was noticed on Nov 5 2009 on Amaya 11.3 build(Sep 9 2009)
under Windows XP SP2 on a Compaq Presario SR1603WM (AMD Sempron).
---------
Under certain conditions, selecting an element from the palette, with a combination of "border" and "background" styles defined in CSS, will cause Amaya to suddenly terminate without the expected Windows error report.


Normally, one should be able to set an element by choosing it in the palette, and begin typing to write text with the applied rule; e.g. select P and begin typing a paragraph. Alternately, text may be selected, and an element chosen to apply the rule to the selection.

However, I have discovered that an element using both border and background in the same rule will cause the application to terminate upon choosing that element in the palette without a current selection.

An example exists in Amaya's own welcome page, AmayaPage_WX.html using amaya.css - to wit, the h2 style is defined in css thus:

h2 {
 margin: 0 0 0.4em 0;
 padding: 0.3em;
 border: 0; 
 border-bottom: 1px solid #62698C;
 border-right: 1px solid #62698C;
 font-style:italic;
 color: #1B319D;
 background: url("title.png") left bottom no-repeat;
}

Consequently, placing the I-beam cursor on the page and choosing T2 will cause the application to crash instantly. However, if some text is selected, and the T2 is chosen, the rule is properly applied and the application continues to function.
Furthermore, upon recovery of the application and restoration of the salvage copies of the pages, the style will be displayed in place on the page, without text (in this example, an "empty box" bearing the borders and background image).
Attempting to place the cursor on this space will again cause Amaya to terminate.

This fault can be avoided either by removing the background rule, or by removing the border rules. Note also that using background: in conjunction with any one or all of the border rules will cause the bug to manifest.
Also, the effect applies to any element where these two are used together, for example:

p {
 border: 0; 
 background: url("title.png") left bottom no-repeat;
}

... will cause the crash when the cursor is placed and P is chosen in the palette.

This bug can be reproduced via the palette, as well as via menu selection and via hotkey, indicating that the fault resides beneath the UI.

While it causes unexpected termination, it is not necessarily a mission-stopper, as given the above conditions, one may first type the text, select it, and then choose the element to successfully apply the rule to the selected text without a crash. However, this work-around may not be readily apparent to all who may chance to encounter this bug.
Comment 1 Vatton 2009-11-12 08:53:43 UTC
(In reply to comment #0)
> This fault was noticed on Nov 5 2009 on Amaya 11.3 build(Sep 9 2009)
> under Windows XP SP2 on a Compaq Presario SR1603WM (AMD Sempron).

I suspect a problem with 64bit support, but I'm not able to reproduce the bug.

> ---------
> Under certain conditions, selecting an element from the palette, with a
> combination of "border" and "background" styles defined in CSS, will cause
> Amaya to suddenly terminate without the expected Windows error report.
> 
> 
> Normally, one should be able to set an element by choosing it in the palette,
> and begin typing to write text with the applied rule; e.g. select P and begin
> typing a paragraph. Alternately, text may be selected, and an element chosen to
> apply the rule to the selection.
> 
> However, I have discovered that an element using both border and background in
> the same rule will cause the application to terminate upon choosing that
> element in the palette without a current selection.
> 
> An example exists in Amaya's own welcome page, AmayaPage_WX.html using
> amaya.css - to wit, the h2 style is defined in css thus:
> 
> h2 {
>  margin: 0 0 0.4em 0;
>  padding: 0.3em;
>  border: 0; 
>  border-bottom: 1px solid #62698C;
>  border-right: 1px solid #62698C;
>  font-style:italic;
>  color: #1B319D;
>  background: url("title.png") left bottom no-repeat;
> }
> 
> Consequently, placing the I-beam cursor on the page and choosing T2 will cause
> the application to crash instantly. However, if some text is selected, and the
> T2 is chosen, the rule is properly applied and the application continues to
> function.
> Furthermore, upon recovery of the application and restoration of the salvage
> copies of the pages, the style will be displayed in place on the page, without
> text (in this example, an "empty box" bearing the borders and background
> image).
> Attempting to place the cursor on this space will again cause Amaya to
> terminate.
> 
> This fault can be avoided either by removing the background rule, or by
> removing the border rules. Note also that using background: in conjunction with
> any one or all of the border rules will cause the bug to manifest.
> Also, the effect applies to any element where these two are used together, for
> example:
> 
> p {
>  border: 0; 
>  background: url("title.png") left bottom no-repeat;
> }
> 
> ... will cause the crash when the cursor is placed and P is chosen in the
> palette.
> 
> This bug can be reproduced via the palette, as well as via menu selection and
> via hotkey, indicating that the fault resides beneath the UI.
> 
> While it causes unexpected termination, it is not necessarily a
> mission-stopper, as given the above conditions, one may first type the text,
> select it, and then choose the element to successfully apply the rule to the
> selected text without a crash. However, this work-around may not be readily
> apparent to all who may chance to encounter this bug.
> 

Comment 2 Bartolom 2010-01-18 20:58:47 UTC
I think I have found a simple example of this problem.
I have created a bug
<a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=8779">http://www.w3.org/Bugs/Public/show_bug.cgi?id=8779</a> explaining it.
Sorry for creating another bug report instead of adding a comment in this one, but I have not looked for.