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

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

Issue 1960373002: nodeAtPoint(): Perform the early-check EARLY. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | 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) 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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 LayoutUnit marginAfterForChild(const LayoutBoxModelObject& child) const { re turn child.marginAfter(style()); } 233 LayoutUnit marginAfterForChild(const LayoutBoxModelObject& child) const { re turn child.marginAfter(style()); }
234 LayoutUnit marginStartForChild(const LayoutBoxModelObject& child) const { re turn child.marginStart(style()); } 234 LayoutUnit marginStartForChild(const LayoutBoxModelObject& child) const { re turn child.marginStart(style()); }
235 LayoutUnit marginEndForChild(const LayoutBoxModelObject& child) const { retu rn child.marginEnd(style()); } 235 LayoutUnit marginEndForChild(const LayoutBoxModelObject& child) const { retu rn child.marginEnd(style()); }
236 void setMarginStartForChild(LayoutBox& child, LayoutUnit value) const { chil d.setMarginStart(value, style()); } 236 void setMarginStartForChild(LayoutBox& child, LayoutUnit value) const { chil d.setMarginStart(value, style()); }
237 void setMarginEndForChild(LayoutBox& child, LayoutUnit value) const { child. setMarginEnd(value, style()); } 237 void setMarginEndForChild(LayoutBox& child, LayoutUnit value) const { child. setMarginEnd(value, style()); }
238 void setMarginBeforeForChild(LayoutBox& child, LayoutUnit value) const { chi ld.setMarginBefore(value, style()); } 238 void setMarginBeforeForChild(LayoutBox& child, LayoutUnit value) const { chi ld.setMarginBefore(value, style()); }
239 void setMarginAfterForChild(LayoutBox& child, LayoutUnit value) const { chil d.setMarginAfter(value, style()); } 239 void setMarginAfterForChild(LayoutBox& child, LayoutUnit value) const { chil d.setMarginAfter(value, style()); }
240 LayoutUnit collapsedMarginBeforeForChild(const LayoutBox& child) const; 240 LayoutUnit collapsedMarginBeforeForChild(const LayoutBox& child) const;
241 LayoutUnit collapsedMarginAfterForChild(const LayoutBox& child) const; 241 LayoutUnit collapsedMarginAfterForChild(const LayoutBox& child) const;
242 242
243 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
244
245 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v erticalScrollbarChanged*/); 243 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v erticalScrollbarChanged*/);
246 244
247 LayoutUnit availableLogicalWidthForContent() const { return (logicalRightOff setForContent() - logicalLeftOffsetForContent()).clampNegativeToZero(); } 245 LayoutUnit availableLogicalWidthForContent() const { return (logicalRightOff setForContent() - logicalLeftOffsetForContent()).clampNegativeToZero(); }
248 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } 246 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
249 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo rContent() + availableLogicalWidth(); } 247 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo rContent() + availableLogicalWidth(); }
250 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor Content(); } 248 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor Content(); }
251 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC ontent(); } 249 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC ontent(); }
252 250
253 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const; 251 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const;
254 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const; 252 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutUnit position) const;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 315
318 int firstLineBoxBaseline() const override; 316 int firstLineBoxBaseline() const override;
319 int inlineBlockBaseline(LineDirectionMode) const override; 317 int inlineBlockBaseline(LineDirectionMode) const override;
320 318
321 // This function disables the 'overflow' check in inlineBlockBaseline. 319 // This function disables the 'overflow' check in inlineBlockBaseline.
322 // For 'inline-block', CSS says that the baseline is the bottom margin edge 320 // For 'inline-block', CSS says that the baseline is the bottom margin edge
323 // if 'overflow' is not visible. But some descendant classes want to ignore 321 // if 'overflow' is not visible. But some descendant classes want to ignore
324 // this condition. 322 // this condition.
325 virtual bool shouldIgnoreOverflowPropertyForInlineBlockBaseline() const { re turn false; } 323 virtual bool shouldIgnoreOverflowPropertyForInlineBlockBaseline() const { re turn false; }
326 324
325 bool hitTestOverflowControl(HitTestResult&, const HitTestLocation&, const La youtPoint& adjustedLocation) override;
327 bool hitTestChildren(HitTestResult&, const HitTestLocation& locationInContai ner, const LayoutPoint& accumulatedOffset, HitTestAction) override; 326 bool hitTestChildren(HitTestResult&, const HitTestLocation& locationInContai ner, const LayoutPoint& accumulatedOffset, HitTestAction) override;
328 void updateHitTestResult(HitTestResult&, const LayoutPoint&) override; 327 void updateHitTestResult(HitTestResult&, const LayoutPoint&) override;
329 328
330 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be 329 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be
331 // called. This function is used when a flexbox is laying out its 330 // called. This function is used when a flexbox is laying out its
332 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(), 331 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(),
333 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro llInfo() 332 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro llInfo()
334 // is called the same number of times. 333 // is called the same number of times.
335 // finishDelayUpdateScrollInfo returns true when it marked something for lay out. 334 // finishDelayUpdateScrollInfo returns true when it marked something for lay out.
336 // It will also return a map of saved scroll positions that the caller shoul d restore 335 // It will also return a map of saved scroll positions that the caller shoul d restore
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 // FIXME: This is temporary as we move code that accesses block flow 504 // FIXME: This is temporary as we move code that accesses block flow
506 // member variables out of LayoutBlock and into LayoutBlockFlow. 505 // member variables out of LayoutBlock and into LayoutBlockFlow.
507 friend class LayoutBlockFlow; 506 friend class LayoutBlockFlow;
508 }; 507 };
509 508
510 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); 509 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock());
511 510
512 } // namespace blink 511 } // namespace blink
513 512
514 #endif // LayoutBlock_h 513 #endif // LayoutBlock_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698