tree: 396945c4bf9e7db3c81714444cc553aada2e01de [path history] [tgz]
  1. BUILD.gn
  2. BackgroundBleedAvoidance.h
  3. BidiRun.h
  4. BidiRunForLine.cpp
  5. BidiRunForLine.h
  6. ClipRect.cpp
  7. ClipRect.h
  8. ClipRects.h
  9. ClipRectsCache.h
  10. ColumnBalancer.cpp
  11. ColumnBalancer.h
  12. ContentChangeType.h
  13. CounterNode.cpp
  14. CounterNode.h
  15. DepthOrderedLayoutObjectList.cpp
  16. DepthOrderedLayoutObjectList.h
  17. FloatingObjects.cpp
  18. FloatingObjects.h
  19. FragmentainerIterator.cpp
  20. FragmentainerIterator.h
  21. FragmentationContext.h
  22. GapRects.h
  23. GeneratedChildren.h
  24. HitTestCache.cpp
  25. HitTestCache.h
  26. HitTestCanvasResult.cpp
  27. HitTestCanvasResult.h
  28. HitTestLocation.cpp
  29. HitTestLocation.h
  30. HitTestRequest.h
  31. HitTestResult.cpp
  32. HitTestResult.h
  33. HitTestingTransformState.cpp
  34. HitTestingTransformState.h
  35. ImageQualityController.cpp
  36. ImageQualityController.h
  37. ImageQualityControllerTest.cpp
  38. InlineTextBoxTest.cpp
  39. LayoutAnalyzer.cpp
  40. LayoutAnalyzer.h
  41. LayoutBR.cpp
  42. LayoutBR.h
  43. LayoutBlock.cpp
  44. LayoutBlock.h
  45. LayoutBlockFlow.cpp
  46. LayoutBlockFlow.h
  47. LayoutBlockFlowLine.cpp
  48. LayoutBlockTest.cpp
  49. LayoutBox.cpp
  50. LayoutBox.h
  51. LayoutBoxModelObject.cpp
  52. LayoutBoxModelObject.h
  53. LayoutBoxModelObjectTest.cpp
  54. LayoutBoxTest.cpp
  55. LayoutButton.cpp
  56. LayoutButton.h
  57. LayoutCounter.cpp
  58. LayoutCounter.h
  59. LayoutDeprecatedFlexibleBox.cpp
  60. LayoutDeprecatedFlexibleBox.h
  61. LayoutDetailsMarker.cpp
  62. LayoutDetailsMarker.h
  63. LayoutEmbeddedObject.cpp
  64. LayoutEmbeddedObject.h
  65. LayoutFieldset.cpp
  66. LayoutFieldset.h
  67. LayoutFileUploadControl.cpp
  68. LayoutFileUploadControl.h
  69. LayoutFlexibleBox.cpp
  70. LayoutFlexibleBox.h
  71. LayoutFlowThread.cpp
  72. LayoutFlowThread.h
  73. LayoutFrame.cpp
  74. LayoutFrame.h
  75. LayoutFrameSet.cpp
  76. LayoutFrameSet.h
  77. LayoutFullScreen.cpp
  78. LayoutFullScreen.h
  79. LayoutGeometryMap.cpp
  80. LayoutGeometryMap.h
  81. LayoutGeometryMapStep.h
  82. LayoutGrid.cpp
  83. LayoutGrid.h
  84. LayoutHTMLCanvas.cpp
  85. LayoutHTMLCanvas.h
  86. LayoutIFrame.cpp
  87. LayoutIFrame.h
  88. LayoutImage.cpp
  89. LayoutImage.h
  90. LayoutImageResource.cpp
  91. LayoutImageResource.h
  92. LayoutImageResourceStyleImage.cpp
  93. LayoutImageResourceStyleImage.h
  94. LayoutInline.cpp
  95. LayoutInline.h
  96. LayoutInlineTest.cpp
  97. LayoutListBox.cpp
  98. LayoutListBox.h
  99. LayoutListItem.cpp
  100. LayoutListItem.h
  101. LayoutListMarker.cpp
  102. LayoutListMarker.h
  103. LayoutMedia.cpp
  104. LayoutMedia.h
  105. LayoutMenuList.cpp
  106. LayoutMenuList.h
  107. LayoutMultiColumnFlowThread.cpp
  108. LayoutMultiColumnFlowThread.h
  109. LayoutMultiColumnFlowThreadTest.cpp
  110. LayoutMultiColumnSet.cpp
  111. LayoutMultiColumnSet.h
  112. LayoutMultiColumnSpannerPlaceholder.cpp
  113. LayoutMultiColumnSpannerPlaceholder.h
  114. LayoutObject.cpp
  115. LayoutObject.h
  116. LayoutObjectChildList.cpp
  117. LayoutObjectChildList.h
  118. LayoutObjectInlines.h
  119. LayoutObjectTest.cpp
  120. LayoutPagedFlowThread.cpp
  121. LayoutPagedFlowThread.h
  122. LayoutPart.cpp
  123. LayoutPart.h
  124. LayoutPartTest.cpp
  125. LayoutProgress.cpp
  126. LayoutProgress.h
  127. LayoutProgressTest.cpp
  128. LayoutQuote.cpp
  129. LayoutQuote.h
  130. LayoutReplaced.cpp
  131. LayoutReplaced.h
  132. LayoutReplica.cpp
  133. LayoutReplica.h
  134. LayoutRuby.cpp
  135. LayoutRuby.h
  136. LayoutRubyBase.cpp
  137. LayoutRubyBase.h
  138. LayoutRubyRun.cpp
  139. LayoutRubyRun.h
  140. LayoutRubyText.cpp
  141. LayoutRubyText.h
  142. LayoutScrollbar.cpp
  143. LayoutScrollbar.h
  144. LayoutScrollbarPart.cpp
  145. LayoutScrollbarPart.h
  146. LayoutScrollbarTheme.cpp
  147. LayoutScrollbarTheme.h
  148. LayoutSearchField.cpp
  149. LayoutSearchField.h
  150. LayoutSlider.cpp
  151. LayoutSlider.h
  152. LayoutSliderContainer.cpp
  153. LayoutSliderContainer.h
  154. LayoutSliderThumb.cpp
  155. LayoutSliderThumb.h
  156. LayoutState.cpp
  157. LayoutState.h
  158. LayoutTable.cpp
  159. LayoutTable.h
  160. LayoutTableBoxComponent.cpp
  161. LayoutTableBoxComponent.h
  162. LayoutTableCaption.cpp
  163. LayoutTableCaption.h
  164. LayoutTableCell.cpp
  165. LayoutTableCell.h
  166. LayoutTableCellTest.cpp
  167. LayoutTableCol.cpp
  168. LayoutTableCol.h
  169. LayoutTableRow.cpp
  170. LayoutTableRow.h
  171. LayoutTableRowTest.cpp
  172. LayoutTableSection.cpp
  173. LayoutTableSection.h
  174. LayoutTableSectionTest.cpp
  175. LayoutTestHelper.cpp
  176. LayoutTestHelper.h
  177. LayoutText.cpp
  178. LayoutText.h
  179. LayoutTextCombine.cpp
  180. LayoutTextCombine.h
  181. LayoutTextControl.cpp
  182. LayoutTextControl.h
  183. LayoutTextControlMultiLine.cpp
  184. LayoutTextControlMultiLine.h
  185. LayoutTextControlSingleLine.cpp
  186. LayoutTextControlSingleLine.h
  187. LayoutTextFragment.cpp
  188. LayoutTextFragment.h
  189. LayoutTextTest.cpp
  190. LayoutTextTrackContainer.cpp
  191. LayoutTextTrackContainer.h
  192. LayoutTheme.cpp
  193. LayoutTheme.h
  194. LayoutThemeAndroid.cpp
  195. LayoutThemeAndroid.h
  196. LayoutThemeDefault.cpp
  197. LayoutThemeDefault.h
  198. LayoutThemeFontProvider.cpp
  199. LayoutThemeFontProvider.h
  200. LayoutThemeFontProviderDefault.cpp
  201. LayoutThemeFontProviderWin.cpp
  202. LayoutThemeLinux.cpp
  203. LayoutThemeLinux.h
  204. LayoutThemeMac.h
  205. LayoutThemeMac.mm
  206. LayoutThemeMobile.cpp
  207. LayoutThemeMobile.h
  208. LayoutThemeTest.cpp
  209. LayoutThemeWin.cpp
  210. LayoutThemeWin.h
  211. LayoutTreeAsText.cpp
  212. LayoutTreeAsText.h
  213. LayoutVTTCue.cpp
  214. LayoutVTTCue.h
  215. LayoutVideo.cpp
  216. LayoutVideo.h
  217. LayoutView.cpp
  218. LayoutView.h
  219. LayoutWordBreak.cpp
  220. LayoutWordBreak.h
  221. ListMarkerText.cpp
  222. ListMarkerText.h
  223. MapCoordinatesTest.cpp
  224. MultiColumnFragmentainerGroup.cpp
  225. MultiColumnFragmentainerGroup.h
  226. MultiColumnFragmentainerGroupTest.cpp
  227. OWNERS
  228. OrderIterator.cpp
  229. OrderIterator.h
  230. OverflowModel.h
  231. OverflowModelTest.cpp
  232. PaginationTest.cpp
  233. PaintContainmentTest.cpp
  234. PaintInvalidationState.cpp
  235. PaintInvalidationState.h
  236. PointerEventsHitRules.cpp
  237. PointerEventsHitRules.h
  238. README.md
  239. ScrollAlignment.cpp
  240. ScrollAlignment.h
  241. ScrollAnchor.cpp
  242. ScrollAnchor.h
  243. ScrollAnchorTest.cpp
  244. ScrollEnums.h
  245. SubtreeLayoutScope.cpp
  246. SubtreeLayoutScope.h
  247. TableLayoutAlgorithm.h
  248. TableLayoutAlgorithmAuto.cpp
  249. TableLayoutAlgorithmAuto.h
  250. TableLayoutAlgorithmFixed.cpp
  251. TableLayoutAlgorithmFixed.h
  252. TextAutosizer.cpp
  253. TextAutosizer.h
  254. TextAutosizerTest.cpp
  255. TextRunConstructor.cpp
  256. TextRunConstructor.h
  257. TracedLayoutObject.cpp
  258. TracedLayoutObject.h
  259. VerticalPositionCache.h
  260. ViewFragmentationContext.cpp
  261. ViewFragmentationContext.h
  262. VisualRectMappingTest.cpp
  263. api/
  264. compositing/
  265. line/
  266. ng/
  267. shapes/
  268. svg/
third_party/WebKit/Source/core/layout/README.md

Source/core/layout

Overflow rects and scroll offsets

PaintLayerScrollableArea uses a “scroll origin” to conceptually represent the distance between the top-left corner of the box‘es content rect and the top-left corner of its overflow rect when the box is scrolled to the logical beginning of its content (.e.g. all the way to the left for LTR, all the way to the right for RTL). For left-to-right and top-to-bottom flows, the scroll origin is zero, i.e., the top/left of the overflow rect is at the same position as the top/left of the box’es content rect when scrolled to the beginning of flow. For right-to-left and bottom-to-top flows, the overflow rect extends to the top/left of the client rect.

The default calculation for scroll origin is the distance between the top-left corner of the content rect and the top-left corner of the overflow rect. To illustrate, here is a box with left overflow and no vertical scrollbar:

                         content
                           rect
                       |<-------->|
                scroll
                origin
            |<-------->|
             _____________________
            |          |          |
            |          |          |
            |          |          |

direction:rtl | | box | | | | | | | |||

                  overflow rect
            |<--------------------->|

However, if the box has a scrollbar for the orthogonal direction (e.g., a vertical scrollbar in a direction:rtl block), the size of the scrollbar must be added to the scroll origin calculation. Here are two examples -- note that it doesn't matter whether the vertical scrollbar is placed on the right or left of the box (the vertical scrollbar is the |/| part):

                           content
                             rect
                         |<-------->|
                scroll
                origin
            |<---------->|
             _______________________
            |          |/|          |
            |          |/|          |
            |          |/|          |

direction:rtl | |/| box | | |/| | | |/| | ||/||

                  overflow rect
            |<--------------------->|
            
            
            
                             content
                               rect
                           |<-------->|
                  scroll
                  origin
              |<---------->|
                 _______________________
                |          |          |/|
                |          |          |/|
                |          |          |/|

writing-mode: | | |/| vertical-rl | | |/| | | |/| | | |/| | | |/| |||/|

                      overflow rect
                |<--------------------->|

Coordinate Spaces

TODO(wkorman): Document writing mode, particularly flipped blocks.