OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 #if !ENABLE(OILPAN) | 326 #if !ENABLE(OILPAN) |
327 // RenderObjects are allocated out of the rendering partition. | 327 // RenderObjects are allocated out of the rendering partition. |
328 void* operator new(size_t); | 328 void* operator new(size_t); |
329 void operator delete(void*); | 329 void operator delete(void*); |
330 #endif | 330 #endif |
331 | 331 |
332 public: | 332 public: |
333 bool isPseudoElement() const { return node() && node()->isPseudoElement(); } | 333 bool isPseudoElement() const { return node() && node()->isPseudoElement(); } |
334 | 334 |
335 virtual bool isBoxModelObject() const { return false; } | 335 virtual bool isBoxModelObject() const { return false; } |
336 virtual bool isBR() const { return false; } | 336 bool isBR() const { return isOfType(RenderObjectBr); } |
337 virtual bool isCanvas() const { return false; } | 337 bool isCanvas() const { return isOfType(RenderObjectCanvas); } |
338 virtual bool isCounter() const { return false; } | 338 bool isCounter() const { return isOfType(RenderObjectCounter); } |
339 virtual bool isDetailsMarker() const { return false; } | 339 bool isDetailsMarker() const { return isOfType(RenderObjectDetailsMarker); } |
340 virtual bool isEmbeddedObject() const { return false; } | 340 bool isEmbeddedObject() const { return isOfType(RenderObjectEmbeddedObject);
} |
341 virtual bool isFieldset() const { return false; } | 341 bool isFieldset() const { return isOfType(RenderObjectFieldset); } |
342 virtual bool isFileUploadControl() const { return false; } | 342 bool isFileUploadControl() const { return isOfType(RenderObjectFileUploadCon
trol); } |
343 virtual bool isFrame() const { return false; } | 343 bool isFrame() const { return isOfType(RenderObjectFrame); } |
344 virtual bool isFrameSet() const { return false; } | 344 bool isFrameSet() const { return isOfType(RenderObjectFrameSet); } |
| 345 bool isListBox() const { return isOfType(RenderObjectListBox); } |
| 346 bool isListItem() const { return isOfType(RenderObjectListItem); } |
| 347 bool isListMarker() const { return isOfType(RenderObjectListMarker); } |
| 348 bool isMarquee() const { return isOfType(RenderObjectMarquee); } |
| 349 bool isMedia() const { return isOfType(RenderObjectMedia); } |
| 350 bool isMenuList() const { return isOfType(RenderObjectMenuList); } |
| 351 bool isMeter() const { return isOfType(RenderObjectMeter); } |
| 352 bool isProgress() const { return isOfType(RenderObjectProgress); } |
| 353 bool isQuote() const { return isOfType(RenderObjectQuote); } |
| 354 bool isRenderButton() const { return isOfType(RenderObjectRenderButton); } |
| 355 bool isRenderFullScreen() const { return isOfType(RenderObjectRenderFullScre
en); } |
| 356 bool isRenderFullScreenPlaceholder() const { return isOfType(RenderObjectRen
derFullScreenPlaceholder); } |
| 357 bool isRenderGrid() const { return isOfType(RenderObjectRenderGrid); } |
| 358 bool isRenderIFrame() const { return isOfType(RenderObjectRenderIFrame); } |
| 359 bool isRenderImage() const { return isOfType(RenderObjectRenderImage); } |
| 360 bool isRenderMultiColumnSet() const { return isOfType(RenderObjectRenderMult
iColumnSet); } |
| 361 bool isRenderRegion() const { return isOfType(RenderObjectRenderRegion); } |
| 362 bool isRenderScrollbarPart() const { return isOfType(RenderObjectRenderScrol
lbarPart); } |
| 363 bool isRenderTableCol() const { return isOfType(RenderObjectRenderTableCol);
} |
| 364 bool isRenderView() const { return isOfType(RenderObjectRenderView); } |
| 365 bool isReplica() const { return isOfType(RenderObjectReplica); } |
| 366 bool isRuby() const { return isOfType(RenderObjectRuby); } |
| 367 bool isRubyBase() const { return isOfType(RenderObjectRubyBase); } |
| 368 bool isRubyRun() const { return isOfType(RenderObjectRubyRun); } |
| 369 bool isRubyText() const { return isOfType(RenderObjectRubyText); } |
| 370 bool isSlider() const { return isOfType(RenderObjectSlider); } |
| 371 bool isSliderThumb() const { return isOfType(RenderObjectSliderThumb); } |
| 372 bool isTable() const { return isOfType(RenderObjectTable); } |
| 373 bool isTableCaption() const { return isOfType(RenderObjectTableCaption); } |
| 374 bool isTableCell() const { return isOfType(RenderObjectTableCell); } |
| 375 bool isTableRow() const { return isOfType(RenderObjectTableRow); } |
| 376 bool isTableSection() const { return isOfType(RenderObjectTableSection); } |
| 377 bool isTextArea() const { return isOfType(RenderObjectTextArea); } |
| 378 bool isTextControl() const { return isOfType(RenderObjectTextControl); } |
| 379 bool isTextField() const { return isOfType(RenderObjectTextField); } |
| 380 bool isVideo() const { return isOfType(RenderObjectVideo); } |
| 381 bool isWidget() const { return isOfType(RenderObjectWidget); } |
| 382 |
345 virtual bool isImage() const { return false; } | 383 virtual bool isImage() const { return false; } |
| 384 |
346 virtual bool isInlineBlockOrInlineTable() const { return false; } | 385 virtual bool isInlineBlockOrInlineTable() const { return false; } |
347 virtual bool isLayerModelObject() const { return false; } | 386 virtual bool isLayerModelObject() const { return false; } |
348 virtual bool isListBox() const { return false; } | |
349 virtual bool isListItem() const { return false; } | |
350 virtual bool isListMarker() const { return false; } | |
351 virtual bool isMarquee() const { return false; } | |
352 virtual bool isMedia() const { return false; } | |
353 virtual bool isMenuList() const { return false; } | |
354 virtual bool isMeter() const { return false; } | |
355 virtual bool isProgress() const { return false; } | |
356 virtual bool isQuote() const { return false; } | |
357 virtual bool isRenderBlock() const { return false; } | 387 virtual bool isRenderBlock() const { return false; } |
358 virtual bool isRenderBlockFlow() const { return false; } | 388 virtual bool isRenderBlockFlow() const { return false; } |
359 virtual bool isRenderButton() const { return false; } | |
360 virtual bool isRenderFlowThread() const { return false; } | 389 virtual bool isRenderFlowThread() const { return false; } |
361 virtual bool isRenderFullScreen() const { return false; } | |
362 virtual bool isRenderFullScreenPlaceholder() const { return false; } | |
363 virtual bool isRenderGrid() const { return false; } | |
364 virtual bool isRenderIFrame() const { return false; } | |
365 virtual bool isRenderImage() const { return false; } | |
366 virtual bool isRenderInline() const { return false; } | 390 virtual bool isRenderInline() const { return false; } |
367 virtual bool isRenderMultiColumnSet() const { return false; } | |
368 virtual bool isRenderPart() const { return false; } | 391 virtual bool isRenderPart() const { return false; } |
369 virtual bool isRenderRegion() const { return false; } | |
370 virtual bool isRenderScrollbarPart() const { return false; } | |
371 virtual bool isRenderTableCol() const { return false; } | |
372 virtual bool isRenderView() const { return false; } | |
373 virtual bool isReplica() const { return false; } | |
374 virtual bool isRuby() const { return false; } | |
375 virtual bool isRubyBase() const { return false; } | |
376 virtual bool isRubyRun() const { return false; } | |
377 virtual bool isRubyText() const { return false; } | |
378 virtual bool isSlider() const { return false; } | |
379 virtual bool isSliderThumb() const { return false; } | |
380 virtual bool isTable() const { return false; } | |
381 virtual bool isTableCaption() const { return false; } | |
382 virtual bool isTableCell() const { return false; } | |
383 virtual bool isTableRow() const { return false; } | |
384 virtual bool isTableSection() const { return false; } | |
385 virtual bool isTextArea() const { return false; } | |
386 virtual bool isTextControl() const { return false; } | |
387 virtual bool isTextField() const { return false; } | |
388 virtual bool isVideo() const { return false; } | |
389 | 392 |
390 bool isDocumentElement() const { return document().documentElement() == m_no
de; } | 393 bool isDocumentElement() const { return document().documentElement() == m_no
de; } |
391 // isBody is called from RenderBox::styleWillChange and is thus quite hot. | 394 // isBody is called from RenderBox::styleWillChange and is thus quite hot. |
392 bool isBody() const { return node() && node()->hasTagName(HTMLNames::bodyTag
); } | 395 bool isBody() const { return node() && node()->hasTagName(HTMLNames::bodyTag
); } |
393 bool isHR() const; | 396 bool isHR() const; |
394 bool isLegend() const; | 397 bool isLegend() const; |
395 | 398 |
396 bool isTablePart() const { return isTableCell() || isRenderTableCol() || isT
ableCaption() || isTableRow() || isTableSection(); } | 399 bool isTablePart() const { return isTableCell() || isRenderTableCol() || isT
ableCaption() || isTableRow() || isTableSection(); } |
397 | 400 |
398 inline bool isBeforeContent() const; | 401 inline bool isBeforeContent() const; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 InsideInFlowThread = 2, | 437 InsideInFlowThread = 2, |
435 }; | 438 }; |
436 | 439 |
437 void setFlowThreadStateIncludingDescendants(FlowThreadState); | 440 void setFlowThreadStateIncludingDescendants(FlowThreadState); |
438 | 441 |
439 FlowThreadState flowThreadState() const { return m_bitfields.flowThreadState
(); } | 442 FlowThreadState flowThreadState() const { return m_bitfields.flowThreadState
(); } |
440 void setFlowThreadState(FlowThreadState state) { m_bitfields.setFlowThreadSt
ate(state); } | 443 void setFlowThreadState(FlowThreadState state) { m_bitfields.setFlowThreadSt
ate(state); } |
441 | 444 |
442 // FIXME: Until all SVG renders can be subclasses of RenderSVGModelObject we
have | 445 // FIXME: Until all SVG renders can be subclasses of RenderSVGModelObject we
have |
443 // to add SVG renderer methods to RenderObject with an ASSERT_NOT_REACHED()
default implementation. | 446 // to add SVG renderer methods to RenderObject with an ASSERT_NOT_REACHED()
default implementation. |
444 virtual bool isSVG() const { return false; } | 447 bool isSVG() const { return isOfType(RenderObjectSVG); } |
445 virtual bool isSVGRoot() const { return false; } | 448 bool isSVGRoot() const { return isOfType(RenderObjectSVGRoot); } |
446 virtual bool isSVGContainer() const { return false; } | 449 bool isSVGContainer() const { return isOfType(RenderObjectSVGContainer); } |
447 virtual bool isSVGTransformableContainer() const { return false; } | 450 bool isSVGTransformableContainer() const { return isOfType(RenderObjectSVGTr
ansformableContainer); } |
448 virtual bool isSVGViewportContainer() const { return false; } | 451 bool isSVGViewportContainer() const { return isOfType(RenderObjectSVGViewpor
tContainer); } |
449 virtual bool isSVGGradientStop() const { return false; } | 452 bool isSVGGradientStop() const { return isOfType(RenderObjectSVGGradientStop
); } |
450 virtual bool isSVGHiddenContainer() const { return false; } | 453 bool isSVGHiddenContainer() const { return isOfType(RenderObjectSVGHiddenCon
tainer); } |
451 virtual bool isSVGShape() const { return false; } | 454 bool isSVGShape() const { return isOfType(RenderObjectSVGShape); } |
452 virtual bool isSVGText() const { return false; } | 455 bool isSVGText() const { return isOfType(RenderObjectSVGText); } |
453 virtual bool isSVGTextPath() const { return false; } | 456 bool isSVGTextPath() const { return isOfType(RenderObjectSVGTextPath); } |
454 virtual bool isSVGInline() const { return false; } | 457 bool isSVGInline() const { return isOfType(RenderObjectSVGInline); } |
455 virtual bool isSVGInlineText() const { return false; } | 458 bool isSVGInlineText() const { return isOfType(RenderObjectSVGInlineText); } |
456 virtual bool isSVGImage() const { return false; } | 459 bool isSVGImage() const { return isOfType(RenderObjectSVGImage); } |
457 virtual bool isSVGForeignObject() const { return false; } | 460 bool isSVGForeignObject() const { return isOfType(RenderObjectSVGForeignObje
ct); } |
458 virtual bool isSVGResourceContainer() const { return false; } | 461 bool isSVGResourceContainer() const { return isOfType(RenderObjectSVGResourc
eContainer); } |
459 virtual bool isSVGResourceFilter() const { return false; } | 462 bool isSVGResourceFilter() const { return isOfType(RenderObjectSVGResourceFi
lter); } |
460 virtual bool isSVGResourceFilterPrimitive() const { return false; } | 463 bool isSVGResourceFilterPrimitive() const { return isOfType(RenderObjectSVGR
esourceFilterPrimitive); } |
461 | 464 |
462 // FIXME: Those belong into a SVG specific base-class for all renderers (see
above) | 465 // FIXME: Those belong into a SVG specific base-class for all renderers (see
above) |
463 // Unfortunately we don't have such a class yet, because it's not possible f
or all renderers | 466 // Unfortunately we don't have such a class yet, because it's not possible f
or all renderers |
464 // to inherit from RenderSVGObject -> RenderObject (some need RenderBlock in
heritance for instance) | 467 // to inherit from RenderSVGObject -> RenderObject (some need RenderBlock in
heritance for instance) |
465 virtual void setNeedsTransformUpdate() { } | 468 virtual void setNeedsTransformUpdate() { } |
466 virtual void setNeedsBoundariesUpdate(); | 469 virtual void setNeedsBoundariesUpdate(); |
467 | 470 |
468 // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects,
opacity and stroke-width. | 471 // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects,
opacity and stroke-width. |
469 // This is used for all computation of objectBoundingBox relative units and
by SVGLocatable::getBBox(). | 472 // This is used for all computation of objectBoundingBox relative units and
by SVGLocatable::getBBox(). |
470 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we i
gnore them | 473 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we i
gnore them |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 } | 1045 } |
1043 | 1046 |
1044 bool supportsPaintInvalidationStateCachedOffsets() const { return !hasColumn
s() && !hasTransform() && !hasReflection() && !style()->isFlippedBlocksWritingMo
de(); } | 1047 bool supportsPaintInvalidationStateCachedOffsets() const { return !hasColumn
s() && !hasTransform() && !hasReflection() && !style()->isFlippedBlocksWritingMo
de(); } |
1045 | 1048 |
1046 void setNeedsOverflowRecalcAfterStyleChange(); | 1049 void setNeedsOverflowRecalcAfterStyleChange(); |
1047 void markContainingBlocksForOverflowRecalc(); | 1050 void markContainingBlocksForOverflowRecalc(); |
1048 | 1051 |
1049 virtual LayoutRect viewRect() const; | 1052 virtual LayoutRect viewRect() const; |
1050 | 1053 |
1051 protected: | 1054 protected: |
| 1055 enum RenderObjectType { |
| 1056 RenderObjectBr, |
| 1057 RenderObjectCanvas, |
| 1058 RenderObjectFieldset, |
| 1059 RenderObjectCounter, |
| 1060 RenderObjectDetailsMarker, |
| 1061 RenderObjectEmbeddedObject, |
| 1062 RenderObjectFileUploadControl, |
| 1063 RenderObjectFrame, |
| 1064 RenderObjectFrameSet, |
| 1065 RenderObjectListBox, |
| 1066 RenderObjectListItem, |
| 1067 RenderObjectListMarker, |
| 1068 RenderObjectMarquee, |
| 1069 RenderObjectMedia, |
| 1070 RenderObjectMenuList, |
| 1071 RenderObjectMeter, |
| 1072 RenderObjectProgress, |
| 1073 RenderObjectQuote, |
| 1074 RenderObjectRenderButton, |
| 1075 RenderObjectRenderFlowThread, |
| 1076 RenderObjectRenderFullScreen, |
| 1077 RenderObjectRenderFullScreenPlaceholder, |
| 1078 RenderObjectRenderGrid, |
| 1079 RenderObjectRenderIFrame, |
| 1080 RenderObjectRenderImage, |
| 1081 RenderObjectRenderInline, |
| 1082 RenderObjectRenderMultiColumnSet, |
| 1083 RenderObjectRenderPart, |
| 1084 RenderObjectRenderRegion, |
| 1085 RenderObjectRenderScrollbarPart, |
| 1086 RenderObjectRenderTableCol, |
| 1087 RenderObjectRenderView, |
| 1088 RenderObjectReplica, |
| 1089 RenderObjectRuby, |
| 1090 RenderObjectRubyBase, |
| 1091 RenderObjectRubyRun, |
| 1092 RenderObjectRubyText, |
| 1093 RenderObjectSlider, |
| 1094 RenderObjectSliderThumb, |
| 1095 RenderObjectTable, |
| 1096 RenderObjectTableCaption, |
| 1097 RenderObjectTableCell, |
| 1098 RenderObjectTableRow, |
| 1099 RenderObjectTableSection, |
| 1100 RenderObjectTextArea, |
| 1101 RenderObjectTextControl, |
| 1102 RenderObjectTextField, |
| 1103 RenderObjectVideo, |
| 1104 RenderObjectWidget, |
| 1105 |
| 1106 RenderObjectSVG, /* Keep by itself? */ |
| 1107 RenderObjectSVGRoot, |
| 1108 RenderObjectSVGContainer, |
| 1109 RenderObjectSVGTransformableContainer, |
| 1110 RenderObjectSVGViewportContainer, |
| 1111 RenderObjectSVGHiddenContainer, |
| 1112 RenderObjectSVGGradientStop, |
| 1113 RenderObjectSVGShape, |
| 1114 RenderObjectSVGText, |
| 1115 RenderObjectSVGTextPath, |
| 1116 RenderObjectSVGInline, |
| 1117 RenderObjectSVGInlineText, |
| 1118 RenderObjectSVGImage, |
| 1119 RenderObjectSVGForeignObject, |
| 1120 RenderObjectSVGResourceContainer, |
| 1121 RenderObjectSVGResourceFilter, |
| 1122 RenderObjectSVGResourceFilterPrimitive, |
| 1123 }; |
| 1124 virtual bool isOfType(RenderObjectType type) const { return false; } |
| 1125 |
1052 inline bool layerCreationAllowedForSubtree() const; | 1126 inline bool layerCreationAllowedForSubtree() const; |
1053 | 1127 |
1054 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time | 1128 // Overrides should call the superclass at the end. m_style will be 0 the fi
rst time |
1055 // this function will be called. | 1129 // this function will be called. |
1056 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); | 1130 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle); |
1057 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first | 1131 // Overrides should call the superclass at the start. |oldStyle| will be 0 t
he first |
1058 // time this function is called. | 1132 // time this function is called. |
1059 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); | 1133 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); |
1060 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); | 1134 void propagateStyleToAnonymousChildren(bool blockChildrenOnly = false); |
1061 virtual void updateAnonymousChildStyle(const RenderObject* child, RenderStyl
e* style) const { } | 1135 virtual void updateAnonymousChildStyle(const RenderObject* child, RenderStyl
e* style) const { } |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1536 void showTree(const blink::RenderObject*); | 1610 void showTree(const blink::RenderObject*); |
1537 void showLineTree(const blink::RenderObject*); | 1611 void showLineTree(const blink::RenderObject*); |
1538 void showRenderTree(const blink::RenderObject* object1); | 1612 void showRenderTree(const blink::RenderObject* object1); |
1539 // We don't make object2 an optional parameter so that showRenderTree | 1613 // We don't make object2 an optional parameter so that showRenderTree |
1540 // can be called from gdb easily. | 1614 // can be called from gdb easily. |
1541 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); | 1615 void showRenderTree(const blink::RenderObject* object1, const blink::RenderObjec
t* object2); |
1542 | 1616 |
1543 #endif | 1617 #endif |
1544 | 1618 |
1545 #endif // RenderObject_h | 1619 #endif // RenderObject_h |
OLD | NEW |