| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 return reasons; | 1031 return reasons; |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollin
gReasons reasons) | 1034 String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollin
gReasons reasons) |
| 1035 { | 1035 { |
| 1036 StringBuilder stringBuilder; | 1036 StringBuilder stringBuilder; |
| 1037 | 1037 |
| 1038 if (reasons & MainThreadScrollingReason::kHasBackgroundAttachmentFixedObject
s) | 1038 if (reasons & MainThreadScrollingReason::kHasBackgroundAttachmentFixedObject
s) |
| 1039 stringBuilder.appendLiteral("Has background-attachment:fixed, "); | 1039 stringBuilder.append("Has background-attachment:fixed, "); |
| 1040 if (reasons & MainThreadScrollingReason::kHasNonLayerViewportConstrainedObje
cts) | 1040 if (reasons & MainThreadScrollingReason::kHasNonLayerViewportConstrainedObje
cts) |
| 1041 stringBuilder.appendLiteral("Has non-layer viewport-constrained objects,
"); | 1041 stringBuilder.append("Has non-layer viewport-constrained objects, "); |
| 1042 if (reasons & MainThreadScrollingReason::kHasStickyPositionObjects) | 1042 if (reasons & MainThreadScrollingReason::kHasStickyPositionObjects) |
| 1043 stringBuilder.appendLiteral("Has sticky position objects, "); | 1043 stringBuilder.append("Has sticky position objects, "); |
| 1044 if (reasons & MainThreadScrollingReason::kThreadedScrollingDisabled) | 1044 if (reasons & MainThreadScrollingReason::kThreadedScrollingDisabled) |
| 1045 stringBuilder.appendLiteral("Threaded scrolling is disabled, "); | 1045 stringBuilder.append("Threaded scrolling is disabled, "); |
| 1046 if (reasons & MainThreadScrollingReason::kAnimatingScrollOnMainThread) | 1046 if (reasons & MainThreadScrollingReason::kAnimatingScrollOnMainThread) |
| 1047 stringBuilder.appendLiteral("Animating scroll on main thread, "); | 1047 stringBuilder.append("Animating scroll on main thread, "); |
| 1048 | 1048 |
| 1049 if (stringBuilder.length()) | 1049 if (stringBuilder.length()) |
| 1050 stringBuilder.resize(stringBuilder.length() - 2); | 1050 stringBuilder.resize(stringBuilder.length() - 2); |
| 1051 return stringBuilder.toString(); | 1051 return stringBuilder.toString(); |
| 1052 } | 1052 } |
| 1053 | 1053 |
| 1054 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 1054 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
| 1055 { | 1055 { |
| 1056 ASSERT(m_page->deprecatedLocalMainFrame()->document()->lifecycle().state() >
= DocumentLifecycle::CompositingClean); | 1056 ASSERT(m_page->deprecatedLocalMainFrame()->document()->lifecycle().state() >
= DocumentLifecycle::CompositingClean); |
| 1057 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v
iew()->layerForScrolling())) | 1057 if (WebLayer* scrollLayer = toWebLayer(m_page->deprecatedLocalMainFrame()->v
iew()->layerForScrolling())) |
| 1058 return mainThreadScrollingReasonsAsText(scrollLayer->mainThreadScrolling
Reasons()); | 1058 return mainThreadScrollingReasonsAsText(scrollLayer->mainThreadScrolling
Reasons()); |
| 1059 | 1059 |
| 1060 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); | 1060 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 bool ScrollingCoordinator::frameViewIsDirty() const | 1063 bool ScrollingCoordinator::frameViewIsDirty() const |
| 1064 { | 1064 { |
| 1065 FrameView* frameView = m_page->mainFrame()->isLocalFrame() ? m_page->depreca
tedLocalMainFrame()->view() : nullptr; | 1065 FrameView* frameView = m_page->mainFrame()->isLocalFrame() ? m_page->depreca
tedLocalMainFrame()->view() : nullptr; |
| 1066 bool frameIsScrollable = frameView && frameView->isScrollable(); | 1066 bool frameIsScrollable = frameView && frameView->isScrollable(); |
| 1067 if (frameIsScrollable != m_wasFrameScrollable) | 1067 if (frameIsScrollable != m_wasFrameScrollable) |
| 1068 return true; | 1068 return true; |
| 1069 | 1069 |
| 1070 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) | 1070 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : nullptr) |
| 1071 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); | 1071 return WebSize(frameView->contentsSize()) != scrollLayer->bounds(); |
| 1072 return false; | 1072 return false; |
| 1073 } | 1073 } |
| 1074 | 1074 |
| 1075 } // namespace blink | 1075 } // namespace blink |
| OLD | NEW |