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