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