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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutView.h

Issue 2800813006: Move layouet/LayoutView::setSelection() to editing/LayoutSelection (Closed)
Patch Set: nit Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2006 Apple Computer, Inc. 3 * Copyright (C) 2006 Apple Computer, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 141
142 PaintInvalidationReason InvalidatePaintIfNeeded( 142 PaintInvalidationReason InvalidatePaintIfNeeded(
143 const PaintInvalidationState&) override; 143 const PaintInvalidationState&) override;
144 PaintInvalidationReason InvalidatePaintIfNeeded( 144 PaintInvalidationReason InvalidatePaintIfNeeded(
145 const PaintInvalidatorContext&) const override; 145 const PaintInvalidatorContext&) const override;
146 146
147 void Paint(const PaintInfo&, const LayoutPoint&) const override; 147 void Paint(const PaintInfo&, const LayoutPoint&) const override;
148 void PaintBoxDecorationBackground(const PaintInfo&, 148 void PaintBoxDecorationBackground(const PaintInfo&,
149 const LayoutPoint&) const override; 149 const LayoutPoint&) const override;
150 150
151 enum SelectionPaintInvalidationMode {
152 kPaintInvalidationNewXOROld,
153 kPaintInvalidationNewMinusOld
154 };
155 void SetSelection(
156 LayoutObject* start,
157 int start_pos,
158 LayoutObject*,
159 int end_pos,
160 SelectionPaintInvalidationMode = kPaintInvalidationNewXOROld);
161 void ClearSelection(); 151 void ClearSelection();
162 bool HasPendingSelection() const; 152 bool HasPendingSelection() const;
163 void CommitPendingSelection(); 153 void CommitPendingSelection();
164 IntRect SelectionBounds();
165 void SelectionStartEnd(int& start_pos, int& end_pos); 154 void SelectionStartEnd(int& start_pos, int& end_pos);
166 void InvalidatePaintForSelection();
167 155
168 void AbsoluteRects(Vector<IntRect>&, 156 void AbsoluteRects(Vector<IntRect>&,
169 const LayoutPoint& accumulated_offset) const override; 157 const LayoutPoint& accumulated_offset) const override;
170 void AbsoluteQuads(Vector<FloatQuad>&, 158 void AbsoluteQuads(Vector<FloatQuad>&,
171 MapCoordinatesFlags mode = 0) const override; 159 MapCoordinatesFlags mode = 0) const override;
172 160
173 LayoutRect ViewRect() const override; 161 LayoutRect ViewRect() const override;
174 LayoutRect OverflowClipRect( 162 LayoutRect OverflowClipRect(
175 const LayoutPoint& location, 163 const LayoutPoint& location,
176 OverlayScrollbarClipBehavior = 164 OverlayScrollbarClipBehavior =
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 272
285 bool ShouldUsePrintingLayout() const; 273 bool ShouldUsePrintingLayout() const;
286 274
287 int ViewLogicalWidthForBoxSizing() const; 275 int ViewLogicalWidthForBoxSizing() const;
288 int ViewLogicalHeightForBoxSizing() const; 276 int ViewLogicalHeightForBoxSizing() const;
289 277
290 bool PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const override; 278 bool PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const override;
291 279
292 UntracedMember<FrameView> frame_view_; 280 UntracedMember<FrameView> frame_view_;
293 281
294 // The current selection represented as 2 boundaries.
295 // Selection boundaries are represented in LayoutView by a tuple
296 // (LayoutObject, DOM node offset).
297 // See http://www.w3.org/TR/dom/#range for more information.
298 //
299 // |m_selectionStartPos| and |m_selectionEndPos| are only valid for
300 // |Text| node without 'transform' or 'first-letter'.
301 //
302 // Those are used for selection painting and paint invalidation upon
303 // selection change.
304 LayoutObject* selection_start_;
305 LayoutObject* selection_end_;
306
307 // TODO(yosin): Clarify the meaning of these variables. editing/ passes
308 // them as offsets in the DOM tree but layout uses them as offset in the
309 // layout tree.
310 int selection_start_pos_;
311 int selection_end_pos_;
312
313 // The page logical height. 282 // The page logical height.
314 // This is only used during printing to split the content into pages. 283 // This is only used during printing to split the content into pages.
315 // Outside of printing, this is 0. 284 // Outside of printing, this is 0.
316 LayoutUnit page_logical_height_; 285 LayoutUnit page_logical_height_;
317 286
318 // LayoutState is an optimization used during layout. 287 // LayoutState is an optimization used during layout.
319 // |m_layoutState| will be nullptr outside of layout. 288 // |m_layoutState| will be nullptr outside of layout.
320 // 289 //
321 // See the class comment for more details. 290 // See the class comment for more details.
322 LayoutState* layout_state_; 291 LayoutState* layout_state_;
323 292
324 std::unique_ptr<ViewFragmentationContext> fragmentation_context_; 293 std::unique_ptr<ViewFragmentationContext> fragmentation_context_;
325 std::unique_ptr<PaintLayerCompositor> compositor_; 294 std::unique_ptr<PaintLayerCompositor> compositor_;
326 RefPtr<IntervalArena> interval_arena_; 295 RefPtr<IntervalArena> interval_arena_;
327 296
328 LayoutQuote* layout_quote_head_; 297 LayoutQuote* layout_quote_head_;
329 unsigned layout_counter_count_; 298 unsigned layout_counter_count_;
330 299
331 unsigned hit_test_count_; 300 unsigned hit_test_count_;
332 unsigned hit_test_cache_hits_; 301 unsigned hit_test_cache_hits_;
333 Persistent<HitTestCache> hit_test_cache_; 302 Persistent<HitTestCache> hit_test_cache_;
334 }; 303 };
335 304
336 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, IsLayoutView()); 305 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutView, IsLayoutView());
337 306
338 } // namespace blink 307 } // namespace blink
339 308
340 #endif // LayoutView_h 309 #endif // LayoutView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698