Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 469 ts << "\n"; | 469 ts << "\n"; |
| 470 | 470 |
| 471 if (o.isText() && !o.isBR()) { | 471 if (o.isText() && !o.isBR()) { |
| 472 const RenderText& text = *toRenderText(&o); | 472 const RenderText& text = *toRenderText(&o); |
| 473 for (InlineTextBox* box = text.firstTextBox(); box; box = box->nextTextB ox()) { | 473 for (InlineTextBox* box = text.firstTextBox(); box; box = box->nextTextB ox()) { |
| 474 writeIndent(ts, indent + 1); | 474 writeIndent(ts, indent + 1); |
| 475 writeTextRun(ts, text, *box); | 475 writeTextRun(ts, text, *box); |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 | 478 |
| 479 // FIXME: temporary hack to avoid rebase of regions tests | 479 // FIXME: temporary hack to avoid rebase of regions tests |
|
Julien - ping for review
2013/11/22 01:23:34
Shouldn't this FIXME be removed? If not, it should
| |
| 480 if (!o.isRenderNamedFlowFragmentContainer()) { | 480 for (RenderObject* child = o.firstChild(); child; child = child->nextSibling ()) { |
| 481 for (RenderObject* child = o.firstChild(); child; child = child->nextSib ling()) { | 481 if (child->hasLayer()) |
| 482 if (child->hasLayer()) | 482 continue; |
| 483 continue; | 483 write(ts, *child, indent + 1, behavior); |
| 484 write(ts, *child, indent + 1, behavior); | |
| 485 } | |
| 486 } | 484 } |
| 487 | 485 |
| 488 if (o.isWidget()) { | 486 if (o.isWidget()) { |
| 489 Widget* widget = toRenderWidget(&o)->widget(); | 487 Widget* widget = toRenderWidget(&o)->widget(); |
| 490 if (widget && widget->isFrameView()) { | 488 if (widget && widget->isFrameView()) { |
| 491 FrameView* view = toFrameView(widget); | 489 FrameView* view = toFrameView(widget); |
| 492 RenderView* root = view->frame().contentRenderer(); | 490 RenderView* root = view->frame().contentRenderer(); |
| 493 if (root) { | 491 if (root) { |
| 494 view->layout(); | 492 view->layout(); |
| 495 RenderLayer* l = root->layer(); | 493 RenderLayer* l = root->layer(); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 563 | 561 |
| 564 ts << "\n"; | 562 ts << "\n"; |
| 565 | 563 |
| 566 if (paintPhase != LayerPaintPhaseBackground) | 564 if (paintPhase != LayerPaintPhaseBackground) |
| 567 write(ts, *l.renderer(), indent + 1, behavior); | 565 write(ts, *l.renderer(), indent + 1, behavior); |
| 568 } | 566 } |
| 569 | 567 |
| 570 static void writeRenderRegionList(const RenderRegionList& flowThreadRegionList, TextStream& ts, int indent) | 568 static void writeRenderRegionList(const RenderRegionList& flowThreadRegionList, TextStream& ts, int indent) |
| 571 { | 569 { |
| 572 for (RenderRegionList::const_iterator itRR = flowThreadRegionList.begin(); i tRR != flowThreadRegionList.end(); ++itRR) { | 570 for (RenderRegionList::const_iterator itRR = flowThreadRegionList.begin(); i tRR != flowThreadRegionList.end(); ++itRR) { |
| 573 RenderRegion* renderRegion = *itRR; | 571 RenderRegion* renderRegion = *itRR; |
|
Julien - ping for review
2013/11/22 01:23:34
Any reason |renderRegion| is non-const?
| |
| 574 writeIndent(ts, indent + 2); | 572 |
| 575 ts << "RenderRegion"; | 573 writeIndent(ts, indent); |
| 574 ts << static_cast<const RenderObject*>(renderRegion)->renderName(); | |
|
Julien - ping for review
2013/11/22 01:23:34
That's just gross and unneeded, RenderRegion is al
| |
| 575 | |
| 576 Node* generatingNodeForRegion = renderRegion->generatingNodeForRegion(); | 576 Node* generatingNodeForRegion = renderRegion->generatingNodeForRegion(); |
| 577 if (generatingNodeForRegion) { | 577 if (generatingNodeForRegion) { |
| 578 String tagName = getTagName(generatingNodeForRegion); | 578 if (renderRegion->hasCustomRegionStyle()) |
| 579 if (!tagName.isEmpty()) | 579 ts << " region style: 1"; |
| 580 ts << " {" << tagName << "}"; | 580 if (renderRegion->hasAutoLogicalHeight()) |
| 581 ts << " hasAutoLogicalHeight"; | |
| 582 | |
| 583 bool isRenderNamedFlowFragment = renderRegion->isRenderNamedFlowFrag ment(); | |
| 584 if (isRenderNamedFlowFragment) | |
| 585 ts << " (anonymous child of"; | |
| 586 | |
| 587 StringBuilder tagName; | |
| 588 tagName.append(generatingNodeForRegion->nodeName()); | |
| 589 | |
| 590 Node* nodeForRegion = renderRegion->nodeForRegion(); | |
| 591 if (nodeForRegion->isPseudoElement()) { | |
| 592 if (nodeForRegion->isBeforePseudoElement()) | |
| 593 tagName.append("::before"); | |
| 594 else if (nodeForRegion->isAfterPseudoElement()) | |
| 595 tagName.append("::after"); | |
| 596 } | |
| 597 | |
| 598 ts << " {" << tagName.toString() << "}"; | |
| 599 | |
| 581 if (generatingNodeForRegion->isElementNode() && generatingNodeForReg ion->hasID()) { | 600 if (generatingNodeForRegion->isElementNode() && generatingNodeForReg ion->hasID()) { |
| 582 Element* element = toElement(generatingNodeForRegion); | 601 Element* element = toElement(generatingNodeForRegion); |
| 583 ts << " #" << element->idForStyleResolution(); | 602 ts << " #" << element->idForStyleResolution(); |
| 584 } | 603 } |
| 585 if (renderRegion->hasCustomRegionStyle()) | 604 |
| 586 ts << " region style: 1"; | 605 if (isRenderNamedFlowFragment) |
| 587 if (renderRegion->hasAutoLogicalHeight()) | 606 ts << ")"; |
| 588 ts << " hasAutoLogicalHeight"; | |
| 589 } | 607 } |
| 590 if (!renderRegion->isValid()) | 608 |
| 591 ts << " invalid"; | |
|
Julien - ping for review
2013/11/22 01:23:34
Why are we removing this information? (it seems us
| |
| 592 ts << "\n"; | 609 ts << "\n"; |
| 593 } | 610 } |
| 594 } | 611 } |
| 595 | 612 |
| 596 static void writeRenderNamedFlowThreads(TextStream& ts, RenderView* renderView, const RenderLayer* rootLayer, | 613 static void writeRenderNamedFlowThreads(TextStream& ts, RenderView* renderView, const RenderLayer* rootLayer, |
| 597 const LayoutRect& paintRect, int indent, RenderAsTextBeh avior behavior) | 614 const LayoutRect& paintRect, int indent, RenderAsTextBeh avior behavior) |
| 598 { | 615 { |
| 599 if (!renderView->hasRenderNamedFlowThreads()) | 616 if (!renderView->hasRenderNamedFlowThreads()) |
| 600 return; | 617 return; |
| 601 | 618 |
| 602 const RenderNamedFlowThreadList* list = renderView->flowThreadController()-> renderNamedFlowThreadList(); | 619 const RenderNamedFlowThreadList* list = renderView->flowThreadController()-> renderNamedFlowThreadList(); |
| 603 | 620 |
| 604 writeIndent(ts, indent); | 621 writeIndent(ts, indent); |
| 605 ts << "Flow Threads\n"; | 622 ts << "Named flows\n"; |
| 606 | 623 |
| 607 for (RenderNamedFlowThreadList::const_iterator iter = list->begin(); iter != list->end(); ++iter) { | 624 for (RenderNamedFlowThreadList::const_iterator iter = list->begin(); iter != list->end(); ++iter) { |
| 608 const RenderNamedFlowThread* renderFlowThread = *iter; | 625 const RenderNamedFlowThread* renderFlowThread = *iter; |
| 609 | 626 |
| 610 writeIndent(ts, indent + 1); | 627 writeIndent(ts, indent + 1); |
| 611 ts << "Thread with flow-name '" << renderFlowThread->flowThreadName() << "'\n"; | 628 ts << "Named flow '" << renderFlowThread->flowThreadName() << "'\n"; |
| 612 | 629 |
| 613 RenderLayer* layer = renderFlowThread->layer(); | 630 RenderLayer* layer = renderFlowThread->layer(); |
| 614 RenderTreeAsText::writeLayers(ts, rootLayer, layer, paintRect, indent + 2, behavior); | 631 RenderTreeAsText::writeLayers(ts, rootLayer, layer, paintRect, indent + 2, behavior); |
| 615 | 632 |
| 616 // Display the valid and invalid render regions attached to this flow th read. | 633 // Display the valid and invalid render regions attached to this flow th read. |
| 617 const RenderRegionList& validRegionsList = renderFlowThread->renderRegio nList(); | 634 const RenderRegionList& validRegionsList = renderFlowThread->renderRegio nList(); |
| 635 if (!validRegionsList.isEmpty()) { | |
| 636 writeIndent(ts, indent + 2); | |
| 637 ts << "Regions for named flow '" << renderFlowThread->flowThreadName () << "'\n"; | |
| 638 writeRenderRegionList(validRegionsList, ts, indent + 3); | |
| 639 } | |
| 640 | |
| 618 const RenderRegionList& invalidRegionsList = renderFlowThread->invalidRe nderRegionList(); | 641 const RenderRegionList& invalidRegionsList = renderFlowThread->invalidRe nderRegionList(); |
| 619 if (!validRegionsList.isEmpty() || !invalidRegionsList.isEmpty()) { | 642 if (!invalidRegionsList.isEmpty()) { |
| 620 writeIndent(ts, indent + 1); | 643 writeIndent(ts, indent + 2); |
| 621 ts << "Regions for flow '"<< renderFlowThread->flowThreadName() << " '\n"; | 644 ts << "Invalid regions for named flow '" << renderFlowThread->flowTh readName() << "'\n"; |
| 622 writeRenderRegionList(validRegionsList, ts, indent); | 645 writeRenderRegionList(invalidRegionsList, ts, indent + 3); |
| 623 writeRenderRegionList(invalidRegionsList, ts, indent); | |
| 624 } | 646 } |
| 625 } | 647 } |
| 626 } | 648 } |
| 627 | 649 |
| 628 void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer, RenderLayer* layer, | 650 void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer, RenderLayer* layer, |
| 629 const LayoutRect& paintRect, int indent, RenderAsTextBeh avior behavior) | 651 const LayoutRect& paintRect, int indent, RenderAsTextBeh avior behavior) |
| 630 { | 652 { |
| 631 // FIXME: Apply overflow to the root layer to not break every test. Complet e hack. Sigh. | 653 // FIXME: Apply overflow to the root layer to not break every test. Complet e hack. Sigh. |
| 632 LayoutRect paintDirtyRect(paintRect); | 654 LayoutRect paintDirtyRect(paintRect); |
| 633 if (rootLayer == layer) { | 655 if (rootLayer == layer) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 828 element->document().updateLayout(); | 850 element->document().updateLayout(); |
| 829 | 851 |
| 830 RenderObject* renderer = element->renderer(); | 852 RenderObject* renderer = element->renderer(); |
| 831 if (!renderer || !renderer->isListItem()) | 853 if (!renderer || !renderer->isListItem()) |
| 832 return String(); | 854 return String(); |
| 833 | 855 |
| 834 return toRenderListItem(renderer)->markerText(); | 856 return toRenderListItem(renderer)->markerText(); |
| 835 } | 857 } |
| 836 | 858 |
| 837 } // namespace WebCore | 859 } // namespace WebCore |
| OLD | NEW |