summaryrefslogtreecommitdiff
path: root/css/css.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2008-02-25 16:37:48 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2008-02-25 16:37:48 +0000
commita4e1ffda1af5e1a7853ab1cd97d05e645d3786f8 (patch)
tree23dbe9e8bc66f20c5d3b4854dfd9b8b6be1f1a33 /css/css.h
parent11959f49f8591896b8bff3ca15beb1a395a6b112 (diff)
downloadnetsurf-a4e1ffda1af5e1a7853ab1cd97d05e645d3786f8.tar.gz
netsurf-a4e1ffda1af5e1a7853ab1cd97d05e645d3786f8.tar.bz2
Improve handling of HTML attributes / markup:
* Only apply presentational HTML attributes if no more important CSS has been set for the property. (NetSurf used to be a bit hit-and-miss when presentational markup and CSS were mixed.) * Change table cellpadding and border handling to happen as soon the boxes styles are available, rather than after the whole table has been constructed. Also fix default table border colour. * Improve handling of CENTER tag and ALIGN attribute. These could not be correctly supported in the default CSS file, so block level element alignment is now done during box construction. (Fixes #1891379, #1824492, #1723853) Form improvements: * Small MAXLENGTH values on text inputs now reduce element width. (Fixes #1894854) * Prevent select option text from wrapping. svn path=/trunk/netsurf/; revision=3866
Diffstat (limited to 'css/css.h')
-rw-r--r--css/css.h35
1 files changed, 32 insertions, 3 deletions
diff --git a/css/css.h b/css/css.h
index e9d374131..f7a7b3048 100644
--- a/css/css.h
+++ b/css/css.h
@@ -481,6 +481,31 @@ struct css_style {
} z_index;
};
+/** Author level CSS importance info for properties that may be set in HTML */
+struct css_importance {
+ /* background properties */
+ bool background_color;
+ bool background_image;
+
+ /* borders */
+ bool border_style[4]; /**< top, right, bottom, left */
+ bool border_color[4];
+ bool border_width[4];
+ bool border_spacing;
+
+ bool color;
+
+ bool height;
+
+ /* margins */
+ bool margin[4]; /**< top, right, bottom, left */
+
+ /* padding */
+ bool padding[4]; /**< top, right, bottom, left */
+
+ bool width;
+};
+
struct css_stylesheet;
typedef enum {
@@ -650,15 +675,19 @@ struct css_working_stylesheet *css_make_working_stylesheet(
struct content **stylesheet_content,
unsigned int stylesheet_count);
void css_get_style(struct css_working_stylesheet *working_stylesheet,
- xmlNode *element, struct css_style *style);
+ xmlNode *element, struct css_style *style,
+ struct css_importance *author);
struct css_style *css_duplicate_style(const struct css_style * const style);
void css_free_style(struct css_style *style);
void css_deep_free_content(struct css_content *content);
void css_deep_free_counter_control(struct css_counter_control *control);
void css_cascade(struct css_style * const style,
- const struct css_style * const apply);
+ const struct css_style * const apply,
+ struct css_importance * const author);
void css_merge(struct css_style * const style,
- const struct css_style * const apply);
+ const struct css_style * const apply,
+ const unsigned long specificity,
+ struct css_importance * const author);
void css_parse_property_list(struct content *c, struct css_style * style,
char * str);
colour named_colour(const char *name);