Edit report at http://pear.php.net/bugs/bug.php?id=5177&edit=1

ID: 5177
Updated by: [email protected]
Reported By: malbe at adinet dot com dot uy
Summary: CSS declarations and CSS stylesheets should be
rendered in the given order
-Status: Assigned
+Status: Wont fix
Type: Feature/Change Request
Package: HTML_Page2
Operating System: Linux 2.4.26
PHP Version: 4.3.10
Assigned To: iwarner
Roadmap Versions:
New Comment:

-Status: Assigned
+Status: Wont fix
There is no real reason for this feature - and it would cause too much
trouble internally.

Previous Comments:

[2006-11-01 00:19:56] iwarner at php dot net

To override a style declaration with a style sheet seems an odd way to
do things. You obviously have control over the declarations and so
should try to minimise this output within your code.

The usual method it to overwrite a style sheet with a declaration,
which works fine as you have experienced with the all grey.

Please provide a real world scenario of why you want to do this, so we
can further understand then we will look into it.


[2005-08-22 19:06:39] thesaur

OK, I'll see what I can do about it. It will require some internal
changes, but I think I can work it out without too much trouble :)


[2005-08-22 17:55:32] malbe at adinet dot com dot uy

HTML_Page2 version: 0.5.0beta

To be more clear, let me define two terms first:
- style declaration: css style added using
- stylesheet: css file added using

Now, to the "bug":
To follow the real spirit of CSS, stylesheets and style declarations
should be rendered inside the <head> in the order that the programmer
adds them, instead of adding all the stylesheets first and then the
style declarations.
The problem with the current method is that if you want to overwrite
some properties of a style declaration with a stylesheet, you simply
can't, because your stylesheet will always appear before the styel
declaration, thus giving exactly the opposite result than the expected
(the style properties in the stylesheet are overwritten with the ones in
the style declaration)

Test script:
require_once 'HTML/Page2.php';

$some_css_declaration = 'html, body { background-color: #EEE; }';

$p = new HTML_Page2();

// add a declaration with a grey background

// try to overwrite background-color property of the html, body
// using the ones in this stylesheet

// add some content...
$p->addBodyContent('The background should be white, as declared in the
StyleSheet, but it\'s grey, as specified in the $some_css_declaration
style declaration');


Expected result:
The page's body background should be white

Actual result:
The background appears grey (Due to the fact that the order in which
the stylesheets and declarations appear in the <head> isn't the same
order in which they were added)


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedAug 11, '09 at 9:49p
activeAug 11, '09 at 9:49p

1 user in discussion

Cweiske: 1 post



site design / logo © 2023 Grokbase