tree: b9bbfe8e03bff12006d56d849579f2b08deb8bc6 [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. LayoutBoxModelObjectTest.cpp
  52. LayoutBoxTest.cpp
  53. LayoutBR.cpp
  54. LayoutBR.h
  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. LayoutTextTrackContainer.cpp
  190. LayoutTextTrackContainer.h
  191. LayoutTheme.cpp
  192. LayoutTheme.h
  193. LayoutThemeAndroid.cpp
  194. LayoutThemeAndroid.h
  195. LayoutThemeDefault.cpp
  196. LayoutThemeDefault.h
  197. LayoutThemeFontProvider.cpp
  198. LayoutThemeFontProvider.h
  199. LayoutThemeFontProviderDefault.cpp
  200. LayoutThemeFontProviderWin.cpp
  201. LayoutThemeLinux.cpp
  202. LayoutThemeLinux.h
  203. LayoutThemeMac.h
  204. LayoutThemeMac.mm
  205. LayoutThemeMobile.cpp
  206. LayoutThemeMobile.h
  207. LayoutThemeTest.cpp
  208. LayoutThemeWin.cpp
  209. LayoutThemeWin.h
  210. LayoutTreeAsText.cpp
  211. LayoutTreeAsText.h
  212. LayoutVideo.cpp
  213. LayoutVideo.h
  214. LayoutView.cpp
  215. LayoutView.h
  216. LayoutVTTCue.cpp
  217. LayoutVTTCue.h
  218. LayoutWordBreak.cpp
  219. LayoutWordBreak.h
  220. ListMarkerText.cpp
  221. ListMarkerText.h
  222. MapCoordinatesTest.cpp
  223. MultiColumnFragmentainerGroup.cpp
  224. MultiColumnFragmentainerGroup.h
  225. MultiColumnFragmentainerGroupTest.cpp
  226. OrderIterator.cpp
  227. OrderIterator.h
  228. OverflowModel.h
  229. OverflowModelTest.cpp
  230. OWNERS
  231. PaginationTest.cpp
  232. PaintContainmentTest.cpp
  233. PaintInvalidationState.cpp
  234. PaintInvalidationState.h
  235. PointerEventsHitRules.cpp
  236. PointerEventsHitRules.h
  237. README.md
  238. ScrollAlignment.cpp
  239. ScrollAlignment.h
  240. ScrollAnchor.cpp
  241. ScrollAnchor.h
  242. ScrollAnchorTest.cpp
  243. ScrollEnums.h
  244. SubtreeLayoutScope.cpp
  245. SubtreeLayoutScope.h
  246. TableLayoutAlgorithm.h
  247. TableLayoutAlgorithmAuto.cpp
  248. TableLayoutAlgorithmAuto.h
  249. TableLayoutAlgorithmFixed.cpp
  250. TableLayoutAlgorithmFixed.h
  251. TextAutosizer.cpp
  252. TextAutosizer.h
  253. TextAutosizerTest.cpp
  254. TextRunConstructor.cpp
  255. TextRunConstructor.h
  256. TracedLayoutObject.cpp
  257. TracedLayoutObject.h
  258. VerticalPositionCache.h
  259. ViewFragmentationContext.cpp
  260. ViewFragmentationContext.h
  261. 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
                |<--------------------->|