Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 778003003: List marker pseudo elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 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) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
1433 containingBlock()->showLineTreeAndMark(0, 0, 0, 0, this); 1433 containingBlock()->showLineTreeAndMark(0, 0, 0, 0, this);
1434 } 1434 }
1435 1435
1436 void RenderObject::showRenderObject() const 1436 void RenderObject::showRenderObject() const
1437 { 1437 {
1438 showRenderObject(0); 1438 showRenderObject(0);
1439 } 1439 }
1440 1440
1441 void RenderObject::showRenderObject(int printedCharacters) const 1441 void RenderObject::showRenderObject(int printedCharacters) const
1442 { 1442 {
1443 printedCharacters += fprintf(stderr, "%s %p", renderName(), this); 1443 IntRect size = absoluteBoundingBoxRect();
1444 printedCharacters += fprintf(stderr, "%s %p (%d,%d %dx%d)", renderName(), th is, size.x(), size.y(), size.width(), size.height());
1444 1445
1445 if (isText() && toRenderText(this)->isTextFragment()) 1446 if (isText() && toRenderText(this)->isTextFragment())
1446 printedCharacters += fprintf(stderr, " \"%s\" ", toRenderText(this)->tex t().ascii().data()); 1447 printedCharacters += fprintf(stderr, " \"%s\" ", toRenderText(this)->tex t().ascii().data());
1447 1448
1448 if (node()) { 1449 if (node()) {
1449 if (printedCharacters) 1450 if (printedCharacters)
1450 for (; printedCharacters < showTreeCharacterOffset; printedCharacter s++) 1451 for (; printedCharacters < showTreeCharacterOffset; printedCharacter s++)
1451 fputc(' ', stderr); 1452 fputc(' ', stderr);
1452 fputc('\t', stderr); 1453 fputc('\t', stderr);
1454 fputc('\t', stderr);
1453 node()->showNode(); 1455 node()->showNode();
1454 } else 1456 } else
1455 fputc('\n', stderr); 1457 fputc('\n', stderr);
1456 } 1458 }
1457 1459
1458 void RenderObject::showRenderTreeAndMark(const RenderObject* markedObject1, cons t char* markedLabel1, const RenderObject* markedObject2, const char* markedLabel 2, int depth) const 1460 void RenderObject::showRenderTreeAndMark(const RenderObject* markedObject1, cons t char* markedLabel1, const RenderObject* markedObject2, const char* markedLabel 2, int depth) const
1459 { 1461 {
1460 int printedCharacters = 0; 1462 int printedCharacters = 0;
1461 if (markedObject1 == this && markedLabel1) 1463 if (markedObject1 == this && markedLabel1)
1462 printedCharacters += fprintf(stderr, "%s", markedLabel1); 1464 printedCharacters += fprintf(stderr, "%s", markedLabel1);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 if (diff.needsPaintInvalidationLayer() && !hasLayer()) { 1588 if (diff.needsPaintInvalidationLayer() && !hasLayer()) {
1587 diff.clearNeedsPaintInvalidation(); 1589 diff.clearNeedsPaintInvalidation();
1588 diff.setNeedsPaintInvalidationObject(); 1590 diff.setNeedsPaintInvalidationObject();
1589 } 1591 }
1590 1592
1591 return diff; 1593 return diff;
1592 } 1594 }
1593 1595
1594 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle) 1596 void RenderObject::setPseudoStyle(PassRefPtr<RenderStyle> pseudoStyle)
1595 { 1597 {
1596 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT ER || pseudoStyle->styleType() == FIRST_LETTER); 1598 ASSERT(pseudoStyle->styleType() == BEFORE || pseudoStyle->styleType() == AFT ER || pseudoStyle->styleType() == FIRST_LETTER
1599 || (RuntimeEnabledFeatures::listMarkerPseudoElementEnabled() && pseudoSt yle->styleType() == MARKER));
1597 1600
1598 // FIXME: We should consider just making all pseudo items use an inherited s tyle. 1601 // FIXME: We should consider just making all pseudo items use an inherited s tyle.
1599 1602
1600 // Images are special and must inherit the pseudoStyle so the width and heig ht of 1603 // Images are special and must inherit the pseudoStyle so the width and heig ht of
1601 // the pseudo element doesn't change the size of the image. In all other cas es we 1604 // the pseudo element doesn't change the size of the image. In all other cas es we
1602 // can just share the style. 1605 // can just share the style.
1603 // 1606 //
1604 // Quotes are also RenderInline, so we need to create an inherited style to avoid 1607 // Quotes are also RenderInline, so we need to create an inherited style to avoid
1605 // getting an inline with positioning or an invalid display. 1608 // getting an inline with positioning or an invalid display.
1606 // 1609 //
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 ASSERT(document().styleEngine()->usesFirstLineRules()); 2670 ASSERT(document().styleEngine()->usesFirstLineRules());
2668 2671
2669 if (RefPtr<RenderStyle> style = firstLineStyleForCachedUncachedType(Cached, isText() ? parent() : this, m_style.get())) 2672 if (RefPtr<RenderStyle> style = firstLineStyleForCachedUncachedType(Cached, isText() ? parent() : this, m_style.get()))
2670 return style.get(); 2673 return style.get();
2671 2674
2672 return m_style.get(); 2675 return m_style.get();
2673 } 2676 }
2674 2677
2675 RenderStyle* RenderObject::getCachedPseudoStyle(PseudoId pseudo, RenderStyle* pa rentStyle) const 2678 RenderStyle* RenderObject::getCachedPseudoStyle(PseudoId pseudo, RenderStyle* pa rentStyle) const
2676 { 2679 {
2677 if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo)) 2680 // FIXME: adding display != LIST_ITEM seems wrong ... wrap in method?
2681 if (pseudo < FIRST_INTERNAL_PSEUDOID && !style()->hasPseudoStyle(pseudo) && style()->display() != LIST_ITEM)
2678 return 0; 2682 return 0;
2679 2683
2680 RenderStyle* cachedStyle = style()->getCachedPseudoStyle(pseudo); 2684 RenderStyle* cachedStyle = style()->getCachedPseudoStyle(pseudo);
2681 if (cachedStyle) 2685 if (cachedStyle)
2682 return cachedStyle; 2686 return cachedStyle;
2683 2687
2684 RefPtr<RenderStyle> result = getUncachedPseudoStyle(PseudoStyleRequest(pseud o), parentStyle); 2688 RefPtr<RenderStyle> result = getUncachedPseudoStyle(PseudoStyleRequest(pseud o), parentStyle);
2685 if (result) 2689 if (result)
2686 return style()->addCachedPseudoStyle(result.release()); 2690 return style()->addCachedPseudoStyle(result.release());
2687 return 0; 2691 return 0;
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
3194 { 3198 {
3195 if (object1) { 3199 if (object1) {
3196 const blink::RenderObject* root = object1; 3200 const blink::RenderObject* root = object1;
3197 while (root->parent()) 3201 while (root->parent())
3198 root = root->parent(); 3202 root = root->parent();
3199 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3203 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3200 } 3204 }
3201 } 3205 }
3202 3206
3203 #endif 3207 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698