Bug 256755 - [testcase] [CSS 2.1 Conformance] Negative border-width in border shorthand declaration should be parsed as an error
Summary: [testcase] [CSS 2.1 Conformance] Negative border-width in border shorthand de...
Status: VERIFIED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 4.7.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords: testcase, triaged
Depends on:
Blocks:
 
Reported: 2010-11-13 01:00 UTC by Gérard Talbot (no longer involved)
Modified: 2014-07-30 16:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.13.3
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gérard Talbot (no longer involved) 2010-11-13 01:00:33 UTC
Version:           unspecified (using KDE 4.5.3) 
OS:                Linux

Relevant chunk of code involved
-------------------------------

div#test 
{
border-color: green;
border-style: solid;
border-width: 8px;
border: red solid -1px;
}

 <div id="test">There should be a green border around this text. There should be no red.</div>

Reproducible: Always

Steps to Reproduce:
Testcase (from CSS 2.1 test suite RC3, build 20101027)
--------

http://test.csswg.org/suites/css2.1/20101027/html4/border-width-010.htm

Actual Results:  
There should be a thick solid green border around the sentence.

Expected Results:  
There is a thick solid red border around the sentence.

Notes
-----

IE8, Firefox 3.6.12, Opera 10.63, Chrome 7.0.517.44 and Safari 5.0.2 pass this testcase.

Section 4.1.8 states
"
A user agent must ignore a declaration with an invalid property name or an invalid value.
"
http://www.w3.org/TR/CSS21/syndata.html#declaration


One drawback of the shorthand form is that any error in the declaration will make the whole declaration parsed as invalid, therefore will be and should be ignored while an extended form will only make the faulty declaration rejected.

E.g.

h1 { 
  font-weight: XXXX; 
  font-size: 24px;
  line-height: 32px; 
  font-family: Helvetica, serif; 
  font-variant: small-caps;
  font-style: italic;
}

is not parsed and should not be parsed the same way as

h1 { font: italic small-caps XXXX 24px/32px Helvetica, serif }

regards, Gérard
Comment 1 Gérard Talbot (no longer involved) 2012-01-20 05:08:19 UTC
Latest version of test

http://test.csswg.org/suites/css2.1/latest/html4/border-width-010.htm
Comment 2 Andrea Iacovitti 2014-06-10 16:48:07 UTC
Git commit 06b655732a664339e0d8ed3b8a52eae30dce5be2 by Andrea Iacovitti.
Committed on 10/06/2014 at 16:45.
Pushed by aiacovitti into branch 'KDE/4.13'.

Negative lengths are not allowed for outline and border -width.
FIXED-IN: 4.13.3

M  +1    -1    khtml/css/cssparser.cpp

http://commits.kde.org/kdelibs/06b655732a664339e0d8ed3b8a52eae30dce5be2
Comment 3 Gérard Talbot (no longer involved) 2014-07-30 16:50:42 UTC
I am using now Konqueror 4.13.3 

Marking as VERIFIED and FIXED. Thank you Andrea!!

Gérard