2 * css_renderstyledeclarationimpl.cpp
4 * Copyright 2004 Zack Rusin <zack@kde.org>
5 * Copyright 2004,2005 Apple Computer, Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #include "css_renderstyledeclarationimpl.h"
24 #include "rendering/render_style.h"
25 #include "rendering/render_object.h"
27 #include "cssproperties.h"
28 #include "cssvalues.h"
30 #include <dom/dom_exception.h>
33 using namespace khtml
;
35 // List of all properties we know how to compute, omitting shorthands.
36 static const int computedProperties
[] = {
37 CSS_PROP_BACKGROUND_COLOR
,
38 CSS_PROP_BACKGROUND_IMAGE
,
39 CSS_PROP_BACKGROUND_REPEAT
,
40 CSS_PROP_BACKGROUND_ATTACHMENT
,
41 CSS_PROP_BACKGROUND_POSITION
,
42 CSS_PROP_BACKGROUND_POSITION_X
,
43 CSS_PROP_BACKGROUND_POSITION_Y
,
44 CSS_PROP_BORDER_COLLAPSE
,
45 CSS_PROP_BORDER_SPACING
,
46 CSS_PROP__KHTML_BORDER_HORIZONTAL_SPACING
,
47 CSS_PROP__KHTML_BORDER_VERTICAL_SPACING
,
48 CSS_PROP__KHTML_BORDER_TOP_RIGHT_RADIUS
,
49 CSS_PROP__KHTML_BORDER_BOTTOM_RIGHT_RADIUS
,
50 CSS_PROP__KHTML_BORDER_BOTTOM_LEFT_RADIUS
,
51 CSS_PROP__KHTML_BORDER_TOP_LEFT_RADIUS
,
52 CSS_PROP_BORDER_TOP_COLOR
,
53 CSS_PROP_BORDER_RIGHT_COLOR
,
54 CSS_PROP_BORDER_BOTTOM_COLOR
,
55 CSS_PROP_BORDER_LEFT_COLOR
,
56 CSS_PROP_BORDER_TOP_STYLE
,
57 CSS_PROP_BORDER_RIGHT_STYLE
,
58 CSS_PROP_BORDER_BOTTOM_STYLE
,
59 CSS_PROP_BORDER_LEFT_STYLE
,
60 CSS_PROP_BORDER_TOP_WIDTH
,
61 CSS_PROP_BORDER_RIGHT_WIDTH
,
62 CSS_PROP_BORDER_BOTTOM_WIDTH
,
63 CSS_PROP_BORDER_LEFT_WIDTH
,
66 CSS_PROP_CAPTION_SIDE
,
77 CSS_PROP_FONT_VARIANT
,
81 CSS_PROP_LETTER_SPACING
,
83 CSS_PROP_LIST_STYLE_IMAGE
,
84 CSS_PROP_LIST_STYLE_POSITION
,
85 CSS_PROP_LIST_STYLE_TYPE
,
87 CSS_PROP_MARGIN_RIGHT
,
88 CSS_PROP_MARGIN_BOTTOM
,
90 CSS_PROP__KHTML_MARQUEE_DIRECTION
,
91 CSS_PROP__KHTML_MARQUEE_INCREMENT
,
92 CSS_PROP__KHTML_MARQUEE_REPETITION
,
93 CSS_PROP__KHTML_MARQUEE_STYLE
,
100 CSS_PROP_OUTLINE_STYLE
,
104 CSS_PROP_PADDING_TOP
,
105 CSS_PROP_PADDING_RIGHT
,
106 CSS_PROP_PADDING_BOTTOM
,
107 CSS_PROP_PADDING_LEFT
,
108 CSS_PROP_PAGE_BREAK_AFTER
,
109 CSS_PROP_PAGE_BREAK_BEFORE
,
110 CSS_PROP_PAGE_BREAK_INSIDE
,
113 CSS_PROP_TABLE_LAYOUT
,
115 CSS_PROP_TEXT_DECORATION
,
116 CSS_PROP_TEXT_INDENT
,
117 CSS_PROP_TEXT_OVERFLOW
,
118 CSS_PROP_TEXT_SHADOW
,
119 CSS_PROP_TEXT_TRANSFORM
,
121 CSS_PROP_UNICODE_BIDI
,
122 CSS_PROP_VERTICAL_ALIGN
,
124 CSS_PROP_WHITE_SPACE
,
127 CSS_PROP_WORD_SPACING
,
131 const unsigned numComputedProperties
= sizeof(computedProperties
) / sizeof(computedProperties
[0]);
134 static CSSValueImpl
*valueForLength(const Length
&length
, int max
)
136 if (length
.isPercent()) {
137 return new CSSPrimitiveValueImpl(length
.value(), CSSPrimitiveValue::CSS_PERCENTAGE
);
140 return new CSSPrimitiveValueImpl(length
.minWidth(max
), CSSPrimitiveValue::CSS_PX
);
144 static CSSValueImpl
*valueForLength2(const Length
&length
)
146 if (length
.isPercent()) {
147 return new CSSPrimitiveValueImpl(length
.value(), CSSPrimitiveValue::CSS_PERCENTAGE
);
150 return new CSSPrimitiveValueImpl(length
.value(), CSSPrimitiveValue::CSS_PX
);
154 static CSSValueImpl
*valueForBorderStyle(EBorderStyle style
)
158 return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_NATIVE
);
160 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
162 return new CSSPrimitiveValueImpl(CSS_VAL_HIDDEN
);
164 return new CSSPrimitiveValueImpl(CSS_VAL_INSET
);
166 return new CSSPrimitiveValueImpl(CSS_VAL_GROOVE
);
168 return new CSSPrimitiveValueImpl(CSS_VAL_RIDGE
);
170 return new CSSPrimitiveValueImpl(CSS_VAL_OUTSET
);
172 return new CSSPrimitiveValueImpl(CSS_VAL_DOTTED
);
174 return new CSSPrimitiveValueImpl(CSS_VAL_DASHED
);
176 return new CSSPrimitiveValueImpl(CSS_VAL_SOLID
);
178 return new CSSPrimitiveValueImpl(CSS_VAL_DOUBLE
);
184 static CSSValueImpl
*valueForBorderRadii(BorderRadii radii
)
186 CSSPrimitiveValueImpl
* h
= new CSSPrimitiveValueImpl(radii
.horizontal
, CSSPrimitiveValue::CSS_PX
);
187 CSSPrimitiveValueImpl
* v
= new CSSPrimitiveValueImpl(radii
.vertical
, CSSPrimitiveValue::CSS_PX
);
188 return new CSSPrimitiveValueImpl(new PairImpl(h
, v
));
191 static CSSValueImpl
*valueForTextAlign(ETextAlign align
)
195 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
197 return new CSSPrimitiveValueImpl(CSS_VAL_LEFT
);
199 return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT
);
201 return new CSSPrimitiveValueImpl(CSS_VAL_CENTER
);
203 return new CSSPrimitiveValueImpl(CSS_VAL_JUSTIFY
);
204 case khtml::KHTML_LEFT
:
205 return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_LEFT
);
206 case khtml::KHTML_RIGHT
:
207 return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_RIGHT
);
208 case khtml::KHTML_CENTER
:
209 return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_CENTER
);
215 DOMString
khtml::stringForListStyleType(EListStyleType type
)
226 case khtml::LDIAMOND
:
227 return "-khtml-diamond";
228 case khtml::LDECIMAL
:
230 case khtml::DECIMAL_LEADING_ZERO
:
231 return "decimal-leading-zero";
232 case khtml::ARABIC_INDIC
:
233 return "-khtml-arabic-indic";
237 return "-khtml-persian";
239 return "-khtml-urdu";
241 return "-khtml-thai";
243 return "-khtml-tibetan";
244 case khtml::LOWER_ROMAN
:
245 return "lower-roman";
246 case khtml::UPPER_ROMAN
:
247 return "upper-roman";
250 case khtml::ARMENIAN
:
252 case khtml::GEORGIAN
:
254 case khtml::CJK_IDEOGRAPHIC
:
255 return "cjk-ideographic";
256 case khtml::JAPANESE_FORMAL
:
257 return "-khtml-japanese-formal";
258 case khtml::JAPANESE_INFORMAL
:
259 return "-khtml-japanese-informal";
260 case khtml::SIMP_CHINESE_FORMAL
:
261 return "-khtml-simp-chinese-formal";
262 case khtml::SIMP_CHINESE_INFORMAL
:
263 return "-khtml-simp-chinese-informal";
264 case khtml::TRAD_CHINESE_FORMAL
:
265 return "-khtml-trad-chinese-formal";
266 case khtml::TRAD_CHINESE_INFORMAL
:
267 return "-khtml-trad-chinese-informal";
268 case khtml::LOWER_GREEK
:
269 return "lower-greek";
270 case khtml::UPPER_GREEK
:
271 return "-khtml-upper-greek";
272 case khtml::LOWER_ALPHA
:
273 return "lower-alpha";
274 case khtml::UPPER_ALPHA
:
275 return "upper-alpha";
276 case khtml::LOWER_LATIN
:
277 return "lower-latin";
278 case khtml::UPPER_LATIN
:
279 return "upper-latin";
280 case khtml::HIRAGANA
:
282 case khtml::KATAKANA
:
284 case khtml::HIRAGANA_IROHA
:
285 return "hiragana-iroha";
286 case khtml::KATAKANA_IROHA
:
287 return "katakana_iroha";
295 static CSSPrimitiveValueImpl
* valueForColor(QColor color
)
298 return new CSSPrimitiveValueImpl(color
.rgba());
300 return new CSSPrimitiveValueImpl(khtml::transparentColor
);
303 static CSSValueImpl
* valueForShadow(const ShadowData
*shadow
)
306 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
307 CSSValueListImpl
*list
= new CSSValueListImpl
;
308 for (const ShadowData
*s
= shadow
; s
; s
= s
->next
) {
309 CSSPrimitiveValueImpl
*x
= new CSSPrimitiveValueImpl(s
->x
, CSSPrimitiveValue::CSS_PX
);
310 CSSPrimitiveValueImpl
*y
= new CSSPrimitiveValueImpl(s
->y
, CSSPrimitiveValue::CSS_PX
);
311 CSSPrimitiveValueImpl
*blur
= new CSSPrimitiveValueImpl(s
->blur
, CSSPrimitiveValue::CSS_PX
);
312 CSSPrimitiveValueImpl
*color
= valueForColor(s
->color
);
313 list
->append(new ShadowValueImpl(x
, y
, blur
, color
));
318 static CSSValueImpl
*getPositionOffsetValue(RenderObject
*renderer
, int propertyID
)
323 RenderStyle
*style
= renderer
->style();
328 switch (propertyID
) {
338 case CSS_PROP_BOTTOM
:
345 if (renderer
->isPositioned())
346 return valueForLength(l
, renderer
->contentWidth());
348 if (renderer
->isRelPositioned())
349 // FIXME: It's not enough to simply return "auto" values for one offset if the other side is defined.
350 // In other words if left is auto and right is not auto, then left's computed value is negative right.
351 // So we should get the opposite length unit and see if it is auto.
352 return valueForLength(l
, renderer
->contentWidth());
354 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
357 RenderStyleDeclarationImpl::RenderStyleDeclarationImpl( DOM::NodeImpl
*node
)
358 : CSSStyleDeclarationImpl(0), m_node(node
)
360 //kDebug() << "Render Style Declaration created";
363 RenderStyleDeclarationImpl::~RenderStyleDeclarationImpl()
365 //kDebug() << "Render Style Declaration destroyed";
368 DOM::DOMString
RenderStyleDeclarationImpl::cssText() const
372 for (unsigned i
= 0; i
< numComputedProperties
; i
++) {
375 result
+= getPropertyName(computedProperties
[i
]);
377 result
+= getPropertyValue(computedProperties
[i
]);
384 void RenderStyleDeclarationImpl::setCssText( DOM::DOMString
)
386 // ### report that this sucka is read only
389 CSSValueImpl
*RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID
) const
391 NodeImpl
*node
= m_node
.get();
395 // Make sure our layout is up to date before we allow a query on these attributes.
396 DocumentImpl
* docimpl
= node
->document();
398 docimpl
->updateLayout();
401 RenderStyle
*style
= node
->computedStyle();
404 RenderObject
*renderer
= node
->renderer(); // can be NULL
406 // temporary(?) measure to handle with missing render object
407 // check how we can better deal with it on a case-by-case basis
408 #define RETURN_NULL_ON_NULL(ptr) if(ptr == 0) return 0;
412 case CSS_PROP_BACKGROUND_COLOR
:
413 return valueForColor(style
->backgroundColor());
414 case CSS_PROP_BACKGROUND_IMAGE
:
415 if (style
->backgroundImage())
416 return new CSSPrimitiveValueImpl(style
->backgroundImage()->url(),
417 CSSPrimitiveValue::CSS_URI
);
418 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
419 case CSS_PROP_BACKGROUND_REPEAT
:
420 switch (style
->backgroundRepeat()) {
422 return new CSSPrimitiveValueImpl(CSS_VAL_REPEAT
);
423 case khtml::REPEAT_X
:
424 return new CSSPrimitiveValueImpl(CSS_VAL_REPEAT_X
);
425 case khtml::REPEAT_Y
:
426 return new CSSPrimitiveValueImpl(CSS_VAL_REPEAT_Y
);
427 case khtml::NO_REPEAT
:
428 return new CSSPrimitiveValueImpl(CSS_VAL_NO_REPEAT
);
432 case CSS_PROP_BACKGROUND_ATTACHMENT
:
433 if (style
->backgroundAttachment())
434 return new CSSPrimitiveValueImpl(CSS_VAL_SCROLL
);
436 return new CSSPrimitiveValueImpl(CSS_VAL_FIXED
);
437 case CSS_PROP_BACKGROUND_POSITION
:
439 RETURN_NULL_ON_NULL(renderer
);
441 Length
length(style
->backgroundXPosition());
442 if (length
.isPercent())
443 string
= QString::number(length
.value()) + "%";
445 string
= QString::number(length
.minWidth(renderer
->contentWidth())) + "px";
447 length
= style
->backgroundYPosition();
448 if (length
.isPercent())
449 string
+= QString::number(length
.value()) + "%";
451 string
+= QString::number(length
.minWidth(renderer
->contentWidth())) + "px";
452 return new CSSPrimitiveValueImpl(string
, CSSPrimitiveValue::CSS_STRING
);
454 case CSS_PROP_BACKGROUND_POSITION_X
:
455 RETURN_NULL_ON_NULL(renderer
);
456 return valueForLength(style
->backgroundXPosition(), renderer
->contentWidth());
457 case CSS_PROP_BACKGROUND_POSITION_Y
:
458 RETURN_NULL_ON_NULL(renderer
);
459 return valueForLength(style
->backgroundYPosition(), renderer
->contentHeight());
460 case CSS_PROP_BORDER_COLLAPSE
:
461 if (style
->borderCollapse())
462 return new CSSPrimitiveValueImpl(CSS_VAL_COLLAPSE
);
464 return new CSSPrimitiveValueImpl(CSS_VAL_SEPARATE
);
465 case CSS_PROP_BORDER_SPACING
:
467 QString
string(QString::number(style
->borderHorizontalSpacing()) +
469 QString::number(style
->borderVerticalSpacing()) +
471 return new CSSPrimitiveValueImpl(DOMString(string
), CSSPrimitiveValue::CSS_STRING
);
473 case CSS_PROP__KHTML_BORDER_HORIZONTAL_SPACING
:
474 return new CSSPrimitiveValueImpl(style
->borderHorizontalSpacing(),
475 CSSPrimitiveValue::CSS_PX
);
476 case CSS_PROP__KHTML_BORDER_VERTICAL_SPACING
:
477 return new CSSPrimitiveValueImpl(style
->borderVerticalSpacing(),
478 CSSPrimitiveValue::CSS_PX
);
479 case CSS_PROP__KHTML_BORDER_TOP_RIGHT_RADIUS
:
480 return valueForBorderRadii(style
->borderTopRightRadius());
481 case CSS_PROP__KHTML_BORDER_BOTTOM_RIGHT_RADIUS
:
482 return valueForBorderRadii(style
->borderBottomRightRadius());
483 case CSS_PROP__KHTML_BORDER_BOTTOM_LEFT_RADIUS
:
484 return valueForBorderRadii(style
->borderBottomLeftRadius());
485 case CSS_PROP__KHTML_BORDER_TOP_LEFT_RADIUS
:
486 return valueForBorderRadii(style
->borderTopLeftRadius());
487 case CSS_PROP_BORDER_TOP_COLOR
:
488 return valueForColor(style
->borderTopColor());
489 case CSS_PROP_BORDER_RIGHT_COLOR
:
490 return valueForColor(style
->borderRightColor());
491 case CSS_PROP_BORDER_BOTTOM_COLOR
:
492 return valueForColor(style
->borderBottomColor());
493 case CSS_PROP_BORDER_LEFT_COLOR
:
494 return valueForColor(style
->borderLeftColor());
495 case CSS_PROP_BORDER_TOP_STYLE
:
496 return valueForBorderStyle(style
->borderTopStyle());
497 case CSS_PROP_BORDER_RIGHT_STYLE
:
498 return valueForBorderStyle(style
->borderRightStyle());
499 case CSS_PROP_BORDER_BOTTOM_STYLE
:
500 return valueForBorderStyle(style
->borderBottomStyle());
501 case CSS_PROP_BORDER_LEFT_STYLE
:
502 return valueForBorderStyle(style
->borderLeftStyle());
503 case CSS_PROP_BORDER_TOP_WIDTH
:
504 return new CSSPrimitiveValueImpl( style
->borderTopWidth(), CSSPrimitiveValue::CSS_PX
);
505 case CSS_PROP_BORDER_RIGHT_WIDTH
:
506 return new CSSPrimitiveValueImpl( style
->borderRightWidth(), CSSPrimitiveValue::CSS_PX
);
507 case CSS_PROP_BORDER_BOTTOM_WIDTH
:
508 return new CSSPrimitiveValueImpl( style
->borderBottomWidth(), CSSPrimitiveValue::CSS_PX
);
509 case CSS_PROP_BORDER_LEFT_WIDTH
:
510 return new CSSPrimitiveValueImpl( style
->borderLeftWidth(), CSSPrimitiveValue::CSS_PX
);
511 case CSS_PROP_BOTTOM
:
512 RETURN_NULL_ON_NULL(renderer
);
513 return getPositionOffsetValue(renderer
, CSS_PROP_BOTTOM
);
514 case CSS_PROP_BOX_SIZING
:
515 if (style
->boxSizing() == BORDER_BOX
)
516 return new CSSPrimitiveValueImpl(CSS_VAL_BORDER_BOX
);
518 return new CSSPrimitiveValueImpl(CSS_VAL_CONTENT_BOX
);
519 case CSS_PROP_CAPTION_SIDE
:
520 switch (style
->captionSide()) {
522 return new CSSPrimitiveValueImpl(CSS_VAL_LEFT
);
524 return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT
);
526 return new CSSPrimitiveValueImpl(CSS_VAL_TOP
);
528 return new CSSPrimitiveValueImpl(CSS_VAL_BOTTOM
);
533 switch (style
->clear()) {
535 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
537 return new CSSPrimitiveValueImpl(CSS_VAL_LEFT
);
539 return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT
);
541 return new CSSPrimitiveValueImpl(CSS_VAL_BOTH
);
548 return valueForColor(style
->color());
549 case CSS_PROP_CONTENT
:
551 case CSS_PROP_COUNTER_INCREMENT
:
553 case CSS_PROP_COUNTER_RESET
:
555 case CSS_PROP_CURSOR
:
556 switch (style
->cursor()) {
558 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
560 return new CSSPrimitiveValueImpl(CSS_VAL_DEFAULT
);
562 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
563 case CURSOR_CONTEXT_MENU
:
564 return new CSSPrimitiveValueImpl(CSS_VAL_CONTEXT_MENU
);
566 return new CSSPrimitiveValueImpl(CSS_VAL_HELP
);
568 return new CSSPrimitiveValueImpl(CSS_VAL_POINTER
);
569 case CURSOR_PROGRESS
:
570 return new CSSPrimitiveValueImpl(CSS_VAL_PROGRESS
);
572 return new CSSPrimitiveValueImpl(CSS_VAL_WAIT
);
574 return new CSSPrimitiveValueImpl(CSS_VAL_CELL
);
576 return new CSSPrimitiveValueImpl(CSS_VAL_CROSSHAIR
);
578 return new CSSPrimitiveValueImpl(CSS_VAL_TEXT
);
579 case CURSOR_VERTICAL_TEXT
:
580 return new CSSPrimitiveValueImpl(CSS_VAL_VERTICAL_TEXT
);
582 return new CSSPrimitiveValueImpl(CSS_VAL_ALIAS
);
584 return new CSSPrimitiveValueImpl(CSS_VAL_COPY
);
586 return new CSSPrimitiveValueImpl(CSS_VAL_MOVE
);
588 return new CSSPrimitiveValueImpl(CSS_VAL_NO_DROP
);
589 case CURSOR_NOT_ALLOWED
:
590 return new CSSPrimitiveValueImpl(CSS_VAL_NOT_ALLOWED
);
591 case CURSOR_E_RESIZE
:
592 return new CSSPrimitiveValueImpl(CSS_VAL_E_RESIZE
);
593 case CURSOR_N_RESIZE
:
594 return new CSSPrimitiveValueImpl(CSS_VAL_N_RESIZE
);
595 case CURSOR_NE_RESIZE
:
596 return new CSSPrimitiveValueImpl(CSS_VAL_NE_RESIZE
);
597 case CURSOR_NW_RESIZE
:
598 return new CSSPrimitiveValueImpl(CSS_VAL_NW_RESIZE
);
599 case CURSOR_S_RESIZE
:
600 return new CSSPrimitiveValueImpl(CSS_VAL_S_RESIZE
);
601 case CURSOR_SE_RESIZE
:
602 return new CSSPrimitiveValueImpl(CSS_VAL_SE_RESIZE
);
603 case CURSOR_SW_RESIZE
:
604 return new CSSPrimitiveValueImpl(CSS_VAL_SW_RESIZE
);
605 case CURSOR_W_RESIZE
:
606 return new CSSPrimitiveValueImpl(CSS_VAL_W_RESIZE
);
607 case CURSOR_EW_RESIZE
:
608 return new CSSPrimitiveValueImpl(CSS_VAL_EW_RESIZE
);
609 case CURSOR_NS_RESIZE
:
610 return new CSSPrimitiveValueImpl(CSS_VAL_NS_RESIZE
);
611 case CURSOR_NESW_RESIZE
:
612 return new CSSPrimitiveValueImpl(CSS_VAL_NESW_RESIZE
);
613 case CURSOR_NWSE_RESIZE
:
614 return new CSSPrimitiveValueImpl(CSS_VAL_NWSE_RESIZE
);
615 case CURSOR_COL_RESIZE
:
616 return new CSSPrimitiveValueImpl(CSS_VAL_COL_RESIZE
);
617 case CURSOR_ROW_RESIZE
:
618 return new CSSPrimitiveValueImpl(CSS_VAL_ROW_RESIZE
);
619 case CURSOR_ALL_SCROLL
:
620 return new CSSPrimitiveValueImpl(CSS_VAL_ALL_SCROLL
);
624 case CSS_PROP_DIRECTION
:
625 switch (style
->direction()) {
627 return new CSSPrimitiveValueImpl(CSS_VAL_LTR
);
629 return new CSSPrimitiveValueImpl(CSS_VAL_RTL
);
633 case CSS_PROP_DISPLAY
:
634 switch (style
->display()) {
636 return new CSSPrimitiveValueImpl(CSS_VAL_INLINE
);
638 return new CSSPrimitiveValueImpl(CSS_VAL_BLOCK
);
640 return new CSSPrimitiveValueImpl(CSS_VAL_LIST_ITEM
);
642 return new CSSPrimitiveValueImpl(CSS_VAL_RUN_IN
);
644 return new CSSPrimitiveValueImpl(CSS_VAL_COMPACT
);
646 return new CSSPrimitiveValueImpl(CSS_VAL_INLINE_BLOCK
);
648 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE
);
650 return new CSSPrimitiveValueImpl(CSS_VAL_INLINE_TABLE
);
651 case TABLE_ROW_GROUP
:
652 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_ROW_GROUP
);
653 case TABLE_HEADER_GROUP
:
654 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_HEADER_GROUP
);
655 case TABLE_FOOTER_GROUP
:
656 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_FOOTER_GROUP
);
658 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_ROW
);
659 case TABLE_COLUMN_GROUP
:
660 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_COLUMN_GROUP
);
662 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_COLUMN
);
664 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_CELL
);
666 return new CSSPrimitiveValueImpl(CSS_VAL_TABLE_CAPTION
);
668 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
672 case CSS_PROP_EMPTY_CELLS
:
673 switch (style
->emptyCells()) {
675 return new CSSPrimitiveValueImpl(CSS_VAL_SHOW
);
677 return new CSSPrimitiveValueImpl(CSS_VAL_HIDE
);
683 switch (style
->floating()) {
685 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
687 return new CSSPrimitiveValueImpl(CSS_VAL_LEFT
);
689 return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT
);
691 return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_LEFT
);
693 return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_RIGHT
);
696 case CSS_PROP_FONT_FAMILY
:
698 FontDef def
= style
->htmlFont().getFontDef();
699 return new CSSPrimitiveValueImpl(DOMString(def
.family
), CSSPrimitiveValue::CSS_STRING
);
701 case CSS_PROP_FONT_SIZE
:
703 FontDef def
= style
->htmlFont().getFontDef();
704 return new CSSPrimitiveValueImpl(def
.size
, CSSPrimitiveValue::CSS_PX
);
706 case CSS_PROP_FONT_STYLE
:
708 // FIXME: handle oblique
709 FontDef def
= style
->htmlFont().getFontDef();
711 return new CSSPrimitiveValueImpl(CSS_VAL_ITALIC
);
713 return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL
);
715 case CSS_PROP_FONT_VARIANT
:
717 FontDef def
= style
->htmlFont().getFontDef();
719 return new CSSPrimitiveValueImpl(CSS_VAL_SMALL_CAPS
);
721 return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL
);
723 case CSS_PROP_FONT_WEIGHT
:
725 // FIXME: this does not reflect the full range of weights
726 // that can be expressed with CSS
727 FontDef def
= style
->htmlFont().getFontDef();
728 if (def
.weight
== QFont::Bold
)
729 return new CSSPrimitiveValueImpl(CSS_VAL_BOLD
);
731 return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL
);
733 case CSS_PROP_HEIGHT
:
735 return new CSSPrimitiveValueImpl(renderer
->contentHeight(), CSSPrimitiveValue::CSS_PX
);
736 return valueForLength2(style
->height());
738 RETURN_NULL_ON_NULL(renderer
);
739 return getPositionOffsetValue(renderer
, CSS_PROP_LEFT
);
740 case CSS_PROP_LETTER_SPACING
:
741 if (style
->letterSpacing() == 0)
742 return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL
);
743 return new CSSPrimitiveValueImpl(style
->letterSpacing(), CSSPrimitiveValue::CSS_PX
);
744 case CSS_PROP_LINE_HEIGHT
:
746 // Note: internally a specified <number> value gets encoded as a percentage,
747 // so the isPercent() case corresponds to the <number> case;
748 // values < 0 are used to mark "normal"; and specified %%
749 // get computed down to px by the time they get to RenderStyle
751 Length
length(style
->lineHeight());
752 if (length
.value() < 0)
753 return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL
);
754 if (length
.isPercent()) {
755 //XXX: merge from webcore the computedStyle/specifiedStyle distinction in rendering/font.h
756 float computedSize
= style
->htmlFont().getFontDef().size
;
757 return new CSSPrimitiveValueImpl((int)(length
.value() * computedSize
) / 100, CSSPrimitiveValue::CSS_PX
);
760 return new CSSPrimitiveValueImpl(length
.value(), CSSPrimitiveValue::CSS_PX
);
763 case CSS_PROP_LIST_STYLE_IMAGE
:
764 if (style
->listStyleImage())
765 return new CSSPrimitiveValueImpl(style
->listStyleImage()->url(), CSSPrimitiveValue::CSS_URI
);
766 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
767 case CSS_PROP_LIST_STYLE_POSITION
:
768 switch (style
->listStylePosition()) {
770 return new CSSPrimitiveValueImpl(CSS_VAL_OUTSIDE
);
772 return new CSSPrimitiveValueImpl(CSS_VAL_INSIDE
);
776 case CSS_PROP_LIST_STYLE_TYPE
:
777 return new CSSPrimitiveValueImpl(stringForListStyleType(style
->listStyleType()), CSSPrimitiveValue::CSS_STRING
);
778 case CSS_PROP_MARGIN_TOP
:
780 return new CSSPrimitiveValueImpl(renderer
->marginTop(), CSSPrimitiveValue::CSS_PX
);
781 return valueForLength2(style
->marginTop());
782 case CSS_PROP_MARGIN_RIGHT
:
784 return new CSSPrimitiveValueImpl(renderer
->marginRight(), CSSPrimitiveValue::CSS_PX
);
785 return valueForLength2(style
->marginRight());
786 case CSS_PROP_MARGIN_BOTTOM
:
788 return new CSSPrimitiveValueImpl(renderer
->marginBottom(), CSSPrimitiveValue::CSS_PX
);
789 return valueForLength2(style
->marginBottom());
790 case CSS_PROP_MARGIN_LEFT
:
792 return new CSSPrimitiveValueImpl(renderer
->marginLeft(), CSSPrimitiveValue::CSS_PX
);
793 return valueForLength2(style
->marginLeft());
794 case CSS_PROP__KHTML_MARQUEE
:
795 // FIXME: unimplemented
797 case CSS_PROP__KHTML_MARQUEE_DIRECTION
:
798 switch (style
->marqueeDirection()) {
800 return new CSSPrimitiveValueImpl(CSS_VAL_FORWARDS
);
802 return new CSSPrimitiveValueImpl(CSS_VAL_BACKWARDS
);
804 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
806 return new CSSPrimitiveValueImpl(CSS_VAL_UP
);
808 return new CSSPrimitiveValueImpl(CSS_VAL_DOWN
);
810 return new CSSPrimitiveValueImpl(CSS_VAL_LEFT
);
812 return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT
);
816 case CSS_PROP__KHTML_MARQUEE_INCREMENT
:
817 RETURN_NULL_ON_NULL(renderer
);
818 return valueForLength(style
->marqueeIncrement(), renderer
->contentWidth());
819 case CSS_PROP__KHTML_MARQUEE_REPETITION
:
820 if (style
->marqueeLoopCount() < 0)
821 return new CSSPrimitiveValueImpl(CSS_VAL_INFINITE
);
822 return new CSSPrimitiveValueImpl(style
->marqueeLoopCount(), CSSPrimitiveValue::CSS_NUMBER
);
823 case CSS_PROP__KHTML_MARQUEE_SPEED
:
824 // FIXME: unimplemented
826 case CSS_PROP__KHTML_MARQUEE_STYLE
:
827 switch (style
->marqueeBehavior()) {
829 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
831 return new CSSPrimitiveValueImpl(CSS_VAL_SCROLL
);
833 return new CSSPrimitiveValueImpl(CSS_VAL_SLIDE
);
835 return new CSSPrimitiveValueImpl(CSS_VAL_ALTERNATE
);
837 return new CSSPrimitiveValueImpl(CSS_VAL_UNFURL
);
841 case CSS_PROP_MAX_HEIGHT
:
842 RETURN_NULL_ON_NULL(renderer
);
843 return new CSSPrimitiveValueImpl( renderer
->availableHeight(),
844 CSSPrimitiveValue::CSS_PX
);
846 case CSS_PROP_MAX_WIDTH
:
847 RETURN_NULL_ON_NULL(renderer
);
848 return new CSSPrimitiveValueImpl( renderer
->maxWidth(),
849 CSSPrimitiveValue::CSS_PX
);
851 case CSS_PROP_MIN_HEIGHT
:
852 RETURN_NULL_ON_NULL(renderer
);
853 return new CSSPrimitiveValueImpl( renderer
->contentHeight(),
854 CSSPrimitiveValue::CSS_PX
);
856 case CSS_PROP_MIN_WIDTH
:
857 RETURN_NULL_ON_NULL(renderer
);
858 return new CSSPrimitiveValueImpl( renderer
->minWidth(),
859 CSSPrimitiveValue::CSS_PX
);
861 case CSS_PROP_OPACITY
:
862 return new CSSPrimitiveValueImpl(style
->opacity(), CSSPrimitiveValue::CSS_NUMBER
);
863 case CSS_PROP_ORPHANS
:
864 return new CSSPrimitiveValueImpl(style
->orphans(), CSSPrimitiveValue::CSS_NUMBER
);
865 case CSS_PROP_OUTLINE_COLOR
:
867 case CSS_PROP_OUTLINE_OFFSET
:
869 case CSS_PROP_OUTLINE_STYLE
:
870 if (style
->outlineStyleIsAuto())
871 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
872 return valueForBorderStyle(style
->outlineStyle());
873 case CSS_PROP_OUTLINE_WIDTH
:
875 case CSS_PROP_OVERFLOW
:
876 case CSS_PROP_OVERFLOW_X
:
877 case CSS_PROP_OVERFLOW_Y
: {
879 switch (propertyID
) {
880 case CSS_PROP_OVERFLOW_X
:
881 overflow
= style
->overflowX();
883 case CSS_PROP_OVERFLOW_Y
:
884 overflow
= style
->overflowY();
887 overflow
= qMax(style
->overflowX(), style
->overflowY());
891 return new CSSPrimitiveValueImpl(CSS_VAL_VISIBLE
);
893 return new CSSPrimitiveValueImpl(CSS_VAL_HIDDEN
);
895 return new CSSPrimitiveValueImpl(CSS_VAL_SCROLL
);
897 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
899 return new CSSPrimitiveValueImpl(CSS_VAL_MARQUEE
);
904 case CSS_PROP_PADDING_TOP
:
906 return new CSSPrimitiveValueImpl(renderer
->paddingTop(), CSSPrimitiveValue::CSS_PX
);
907 return valueForLength2(style
->paddingTop());
908 case CSS_PROP_PADDING_RIGHT
:
910 return new CSSPrimitiveValueImpl(renderer
->paddingRight(), CSSPrimitiveValue::CSS_PX
);
911 return valueForLength2(style
->paddingRight());
912 case CSS_PROP_PADDING_BOTTOM
:
914 return new CSSPrimitiveValueImpl(renderer
->paddingBottom(), CSSPrimitiveValue::CSS_PX
);
915 return valueForLength2(style
->paddingBottom());
916 case CSS_PROP_PADDING_LEFT
:
918 return new CSSPrimitiveValueImpl(renderer
->paddingLeft(), CSSPrimitiveValue::CSS_PX
);
919 return valueForLength2(style
->paddingLeft());
920 case CSS_PROP_PAGE_BREAK_AFTER
:
921 switch (style
->pageBreakAfter()) {
923 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
925 return new CSSPrimitiveValueImpl(CSS_VAL_ALWAYS
);
927 return new CSSPrimitiveValueImpl(CSS_VAL_AVOID
);
929 return new CSSPrimitiveValueImpl(CSS_VAL_LEFT
);
931 return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT
);
935 case CSS_PROP_PAGE_BREAK_BEFORE
:
936 switch (style
->pageBreakBefore()) {
938 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
940 return new CSSPrimitiveValueImpl(CSS_VAL_ALWAYS
);
942 return new CSSPrimitiveValueImpl(CSS_VAL_AVOID
);
944 return new CSSPrimitiveValueImpl(CSS_VAL_LEFT
);
946 return new CSSPrimitiveValueImpl(CSS_VAL_RIGHT
);
950 case CSS_PROP_PAGE_BREAK_INSIDE
:
951 if (style
->pageBreakInside())
952 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
954 return new CSSPrimitiveValueImpl(CSS_VAL_AVOID
);
957 case CSS_PROP_POSITION
:
958 switch (style
->position()) {
960 return new CSSPrimitiveValueImpl(CSS_VAL_STATIC
);
962 return new CSSPrimitiveValueImpl(CSS_VAL_RELATIVE
);
964 return new CSSPrimitiveValueImpl(CSS_VAL_ABSOLUTE
);
966 return new CSSPrimitiveValueImpl(CSS_VAL_FIXED
);
970 case CSS_PROP_QUOTES
:
973 RETURN_NULL_ON_NULL(renderer
);
974 return getPositionOffsetValue(renderer
, CSS_PROP_RIGHT
);
977 case CSS_PROP_TABLE_LAYOUT
:
978 switch (style
->tableLayout()) {
980 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
982 return new CSSPrimitiveValueImpl(CSS_VAL_FIXED
);
986 case CSS_PROP_TEXT_ALIGN
:
987 return valueForTextAlign(style
->textAlign());
988 case CSS_PROP_TEXT_DECORATION
:
991 if (style
->textDecoration() & khtml::UNDERLINE
)
992 string
+= "underline";
993 if (style
->textDecoration() & khtml::OVERLINE
) {
994 if (string
.length() > 0)
996 string
+= "overline";
998 if (style
->textDecoration() & khtml::LINE_THROUGH
) {
999 if (string
.length() > 0)
1001 string
+= "line-through";
1003 if (style
->textDecoration() & khtml::BLINK
) {
1004 if (string
.length() > 0)
1008 if (string
.length() == 0)
1010 return new CSSPrimitiveValueImpl(DOMString(string
), CSSPrimitiveValue::CSS_STRING
);
1012 case CSS_PROP_TEXT_INDENT
:
1013 RETURN_NULL_ON_NULL(renderer
);
1014 return valueForLength(style
->textIndent(), renderer
->contentWidth());
1015 case CSS_PROP_TEXT_SHADOW
:
1016 return valueForShadow(style
->textShadow());
1017 case CSS_PROP_TEXT_TRANSFORM
:
1018 switch (style
->textTransform()) {
1020 return new CSSPrimitiveValueImpl(CSS_VAL_CAPITALIZE
);
1022 return new CSSPrimitiveValueImpl(CSS_VAL_UPPERCASE
);
1024 return new CSSPrimitiveValueImpl(CSS_VAL_LOWERCASE
);
1026 return new CSSPrimitiveValueImpl(CSS_VAL_NONE
);
1031 RETURN_NULL_ON_NULL(renderer
);
1032 return getPositionOffsetValue(renderer
, CSS_PROP_TOP
);
1033 case CSS_PROP_UNICODE_BIDI
:
1034 switch (style
->unicodeBidi()) {
1036 return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL
);
1038 return new CSSPrimitiveValueImpl(CSS_VAL_EMBED
);
1040 return new CSSPrimitiveValueImpl(CSS_VAL_BIDI_OVERRIDE
);
1044 case CSS_PROP_VERTICAL_ALIGN
:
1046 switch (style
->verticalAlign()) {
1048 return new CSSPrimitiveValueImpl(CSS_VAL_BASELINE
);
1050 return new CSSPrimitiveValueImpl(CSS_VAL_MIDDLE
);
1052 return new CSSPrimitiveValueImpl(CSS_VAL_SUB
);
1054 return new CSSPrimitiveValueImpl(CSS_VAL_SUPER
);
1056 return new CSSPrimitiveValueImpl(CSS_VAL_TEXT_TOP
);
1058 return new CSSPrimitiveValueImpl(CSS_VAL_TEXT_BOTTOM
);
1060 return new CSSPrimitiveValueImpl(CSS_VAL_TOP
);
1062 return new CSSPrimitiveValueImpl(CSS_VAL_BOTTOM
);
1063 case BASELINE_MIDDLE
:
1064 return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_BASELINE_MIDDLE
);
1066 RETURN_NULL_ON_NULL(renderer
);
1067 return valueForLength(style
->verticalAlignLength(), renderer
->contentWidth());
1072 case CSS_PROP_VISIBILITY
:
1073 switch (style
->visibility()) {
1074 case khtml::VISIBLE
:
1075 return new CSSPrimitiveValueImpl(CSS_VAL_VISIBLE
);
1077 return new CSSPrimitiveValueImpl(CSS_VAL_HIDDEN
);
1078 case khtml::COLLAPSE
:
1079 return new CSSPrimitiveValueImpl(CSS_VAL_COLLAPSE
);
1083 case CSS_PROP_WHITE_SPACE
:
1085 switch (style
->whiteSpace()) {
1087 return new CSSPrimitiveValueImpl(CSS_VAL_NORMAL
);
1089 return new CSSPrimitiveValueImpl(CSS_VAL_PRE
);
1091 return new CSSPrimitiveValueImpl(CSS_VAL_PRE_WRAP
);
1093 return new CSSPrimitiveValueImpl(CSS_VAL_PRE_LINE
);
1095 return new CSSPrimitiveValueImpl(CSS_VAL_NOWRAP
);
1097 return new CSSPrimitiveValueImpl(CSS_VAL__KHTML_NOWRAP
);
1102 case CSS_PROP_WIDOWS
:
1103 return new CSSPrimitiveValueImpl(style
->widows(), CSSPrimitiveValue::CSS_NUMBER
);
1104 case CSS_PROP_WIDTH
:
1106 return new CSSPrimitiveValueImpl(renderer
->contentWidth(),
1107 CSSPrimitiveValue::CSS_PX
);
1108 return valueForLength2(style
->width());
1109 case CSS_PROP_WORD_SPACING
:
1110 return new CSSPrimitiveValueImpl(style
->wordSpacing(), CSSPrimitiveValue::CSS_PX
);
1111 case CSS_PROP_Z_INDEX
:
1112 if (style
->hasAutoZIndex())
1113 return new CSSPrimitiveValueImpl(CSS_VAL_AUTO
);
1114 return new CSSPrimitiveValueImpl(style
->zIndex(), CSSPrimitiveValue::CSS_NUMBER
);
1115 case CSS_PROP_BACKGROUND
:
1117 case CSS_PROP_BORDER
:
1119 case CSS_PROP_BORDER_COLOR
:
1121 case CSS_PROP_BORDER_STYLE
:
1123 case CSS_PROP_BORDER_TOP
:
1124 RETURN_NULL_ON_NULL(renderer
);
1125 return new CSSPrimitiveValueImpl( renderer
->borderTop(),
1126 CSSPrimitiveValue::CSS_PX
);
1128 case CSS_PROP_BORDER_RIGHT
:
1129 RETURN_NULL_ON_NULL(renderer
);
1130 return new CSSPrimitiveValueImpl( renderer
->borderRight(),
1131 CSSPrimitiveValue::CSS_PX
);
1133 case CSS_PROP_BORDER_BOTTOM
:
1134 RETURN_NULL_ON_NULL(renderer
);
1135 return new CSSPrimitiveValueImpl( renderer
->borderBottom(),
1136 CSSPrimitiveValue::CSS_PX
);
1138 case CSS_PROP_BORDER_LEFT
:
1139 RETURN_NULL_ON_NULL(renderer
);
1140 return new CSSPrimitiveValueImpl( renderer
->borderLeft(),
1141 CSSPrimitiveValue::CSS_PX
);
1143 case CSS_PROP_BORDER_WIDTH
:
1147 case CSS_PROP_LIST_STYLE
:
1149 case CSS_PROP_MARGIN
:
1151 case CSS_PROP_OUTLINE
:
1153 case CSS_PROP_PADDING
:
1155 case CSS_PROP_SCROLLBAR_BASE_COLOR
:
1157 case CSS_PROP_SCROLLBAR_FACE_COLOR
:
1159 case CSS_PROP_SCROLLBAR_SHADOW_COLOR
:
1161 case CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR
:
1163 case CSS_PROP_SCROLLBAR_3DLIGHT_COLOR
:
1165 case CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR
:
1167 case CSS_PROP_SCROLLBAR_TRACK_COLOR
:
1169 case CSS_PROP_SCROLLBAR_ARROW_COLOR
:
1171 case CSS_PROP__KHTML_FLOW_MODE
:
1173 case CSS_PROP__KHTML_USER_INPUT
:
1175 case CSS_PROP_TEXT_OVERFLOW
:
1176 if (style
->textOverflow())
1177 return new CSSPrimitiveValueImpl(CSS_VAL_ELLIPSIS
);
1179 return new CSSPrimitiveValueImpl(CSS_VAL_CLIP
);
1182 kWarning() << "Unhandled property:" << getPropertyName(propertyID
);
1189 #undef RETURN_NULL_ON_NULL
1191 DOMString
RenderStyleDeclarationImpl::getPropertyValue( int propertyID
) const
1193 CSSValueImpl
* value
= getPropertyCSSValue(propertyID
);
1195 DOMString val
= value
->cssText();
1202 bool RenderStyleDeclarationImpl::getPropertyPriority( int ) const
1204 // All computed styles have a priority of false (not "important").
1208 void RenderStyleDeclarationImpl::removeProperty(int, DOM::DOMString
*)
1210 // ### emit error since we're read-only
1213 void RenderStyleDeclarationImpl::removePropertiesInSet(const int* set
, unsigned length
)
1215 // ### emit error since we're read-only
1218 bool RenderStyleDeclarationImpl::setProperty ( int, const DOM::DOMString
&, bool, int &ec
)
1220 ec
= DOMException::NO_MODIFICATION_ALLOWED_ERR
;
1224 bool RenderStyleDeclarationImpl::setProperty ( int, const DOM::DOMString
&, bool )
1226 // ### emit error since we're read-only
1230 void RenderStyleDeclarationImpl::setProperty ( int, int, bool )
1232 // ### emit error since we're read-only
1235 void RenderStyleDeclarationImpl::setLengthProperty( int, const DOM::DOMString
&, bool,
1238 // ### emit error since we're read-only
1241 void RenderStyleDeclarationImpl::setProperty( const DOMString
& )
1243 // ### emit error since we're read-only
1246 unsigned long RenderStyleDeclarationImpl::length() const
1248 return numComputedProperties
;
1251 DOM::DOMString
RenderStyleDeclarationImpl::item( unsigned long i
) const
1253 if (i
>= numComputedProperties
)
1256 return getPropertyName(computedProperties
[i
]);
1259 CSSProperty
RenderStyleDeclarationImpl::property( int id
) const
1263 prop
.m_important
= false;
1265 CSSValueImpl
* v
= getPropertyCSSValue( id
);
1267 v
= new CSSPrimitiveValueImpl
;