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

Side by Side Diff: Source/core/rendering/svg/RenderSVGText.cpp

Issue 136723007: Share more code between RenderSVGText and RenderSVGForeignObject (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add FINAL Created 6 years, 11 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
« no previous file with comments | « Source/core/rendering/svg/RenderSVGText.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. 2 * Copyright (C) 2006 Apple Computer, Inc.
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> 4 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 5 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
6 * Copyright (C) 2008 Rob Buis <buis@kde.org> 6 * Copyright (C) 2008 Rob Buis <buis@kde.org>
7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved.
9 * Copyright (C) 2012 Google Inc. 9 * Copyright (C) 2012 Google Inc.
10 * 10 *
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 const RenderSVGText* RenderSVGText::locateRenderSVGTextAncestor(const RenderObje ct* start) 86 const RenderSVGText* RenderSVGText::locateRenderSVGTextAncestor(const RenderObje ct* start)
87 { 87 {
88 ASSERT(start); 88 ASSERT(start);
89 while (start && !start->isSVGText()) 89 while (start && !start->isSVGText())
90 start = start->parent(); 90 start = start->parent();
91 if (!start || !start->isSVGText()) 91 if (!start || !start->isSVGText())
92 return 0; 92 return 0;
93 return toRenderSVGText(start); 93 return toRenderSVGText(start);
94 } 94 }
95 95
96 LayoutRect RenderSVGText::clippedOverflowRectForRepaint(const RenderLayerModelOb ject* repaintContainer) const
97 {
98 return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContaine r);
99 }
100
101 void RenderSVGText::computeRectForRepaint(const RenderLayerModelObject* repaintC ontainer, LayoutRect& rect, bool fixed) const 96 void RenderSVGText::computeRectForRepaint(const RenderLayerModelObject* repaintC ontainer, LayoutRect& rect, bool fixed) const
102 { 97 {
103 FloatRect repaintRect = rect; 98 FloatRect repaintRect = rect;
104 computeFloatRectForRepaint(repaintContainer, repaintRect, fixed); 99 computeFloatRectForRepaint(repaintContainer, repaintRect, fixed);
105 rect = enclosingLayoutRect(repaintRect); 100 rect = enclosingLayoutRect(repaintRect);
106 } 101 }
107 102
108 void RenderSVGText::computeFloatRectForRepaint(const RenderLayerModelObject* rep aintContainer, FloatRect& repaintRect, bool fixed) const
109 {
110 SVGRenderSupport::computeFloatRectForRepaint(this, repaintContainer, repaint Rect, fixed);
111 }
112
113 void RenderSVGText::mapLocalToContainer(const RenderLayerModelObject* repaintCon tainer, TransformState& transformState, MapCoordinatesFlags, bool* wasFixed) con st
114 {
115 SVGRenderSupport::mapLocalToContainer(this, repaintContainer, transformState , wasFixed);
116 }
117
118 const RenderObject* RenderSVGText::pushMappingToContainer(const RenderLayerModel Object* ancestorToStopAt, RenderGeometryMap& geometryMap) const
119 {
120 return SVGRenderSupport::pushMappingToContainer(this, ancestorToStopAt, geom etryMap);
121 }
122
123 static inline void collectLayoutAttributes(RenderObject* text, Vector<SVGTextLay outAttributes*>& attributes) 103 static inline void collectLayoutAttributes(RenderObject* text, Vector<SVGTextLay outAttributes*>& attributes)
124 { 104 {
125 for (RenderObject* descendant = text; descendant; descendant = descendant->n extInPreOrder(text)) { 105 for (RenderObject* descendant = text; descendant; descendant = descendant->n extInPreOrder(text)) {
126 if (descendant->isSVGInlineText()) 106 if (descendant->isSVGInlineText())
127 attributes.append(toRenderSVGInlineText(descendant)->layoutAttribute s()); 107 attributes.append(toRenderSVGInlineText(descendant)->layoutAttribute s());
128 } 108 }
129 } 109 }
130 110
131 static inline bool findPreviousAndNextAttributes(RenderObject* start, RenderSVGI nlineText* locateElement, bool& stopAfterNext, SVGTextLayoutAttributes*& previou s, SVGTextLayoutAttributes*& next) 111 static inline bool findPreviousAndNextAttributes(RenderObject* start, RenderSVGI nlineText* locateElement, bool& stopAfterNext, SVGTextLayoutAttributes*& previou s, SVGTextLayoutAttributes*& next)
132 { 112 {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 return false; 440 return false;
461 441
462 HitTestLocation hitTestLocation(LayoutPoint(flooredIntPoint(localPoi nt))); 442 HitTestLocation hitTestLocation(LayoutPoint(flooredIntPoint(localPoi nt)));
463 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, La youtPoint(), hitTestAction); 443 return RenderBlock::nodeAtPoint(request, result, hitTestLocation, La youtPoint(), hitTestAction);
464 } 444 }
465 } 445 }
466 446
467 return false; 447 return false;
468 } 448 }
469 449
470 bool RenderSVGText::nodeAtPoint(const HitTestRequest&, HitTestResult&, const Hit TestLocation&, const LayoutPoint&, HitTestAction)
471 {
472 ASSERT_NOT_REACHED();
473 return false;
474 }
475
476 PositionWithAffinity RenderSVGText::positionForPoint(const LayoutPoint& pointInC ontents) 450 PositionWithAffinity RenderSVGText::positionForPoint(const LayoutPoint& pointInC ontents)
477 { 451 {
478 RootInlineBox* rootBox = firstRootBox(); 452 RootInlineBox* rootBox = firstRootBox();
479 if (!rootBox) 453 if (!rootBox)
480 return createPositionWithAffinity(0, DOWNSTREAM); 454 return createPositionWithAffinity(0, DOWNSTREAM);
481 455
482 ASSERT(!rootBox->nextRootBox()); 456 ASSERT(!rootBox->nextRootBox());
483 ASSERT(childrenInline()); 457 ASSERT(childrenInline());
484 458
485 InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosi tion(pointInContents); 459 InlineBox* closestBox = toSVGRootInlineBox(rootBox)->closestLeafChildForPosi tion(pointInContents);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 return 0; 535 return 0;
562 } 536 }
563 537
564 // Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Styl e 538 // Fix for <rdar://problem/8048875>. We should not render :first-letter CSS Styl e
565 // in a SVG text element context. 539 // in a SVG text element context.
566 void RenderSVGText::updateFirstLetter() 540 void RenderSVGText::updateFirstLetter()
567 { 541 {
568 } 542 }
569 543
570 } 544 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGText.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698