Changeset 194206 in webkit
- Timestamp:
- Dec 16, 2015 7:48:34 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r194204 r194206 1 2015-12-16 Simon Fraser <simon.fraser@apple.com> 2 3 ViewportConfiguration functions should return a bool to say if anything changed 4 https://bugs.webkit.org/show_bug.cgi?id=152353 5 6 Reviewed by Tim Horton. 7 8 Rather than callers all checking whether setting ViewportConfiguration values 9 changes state, have its functions return a bool if the values change. 10 11 * page/ViewportConfiguration.cpp: 12 (WebCore::ViewportConfiguration::setContentsSize): 13 (WebCore::ViewportConfiguration::setMinimumLayoutSize): 14 (WebCore::ViewportConfiguration::setViewportArguments): 15 (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): 16 * page/ViewportConfiguration.h: 17 (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): Deleted. 18 1 19 2015-12-16 Andreas Kling <akling@apple.com> 2 20 -
trunk/Source/WebCore/page/ViewportConfiguration.cpp
r193940 r194206 67 67 } 68 68 69 voidViewportConfiguration::setContentsSize(const IntSize& contentSize)69 bool ViewportConfiguration::setContentsSize(const IntSize& contentSize) 70 70 { 71 71 if (m_contentSize == contentSize) 72 return ;72 return false; 73 73 74 74 m_contentSize = contentSize; 75 75 updateConfiguration(); 76 } 77 78 void ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutSize) 76 return true; 77 } 78 79 bool ViewportConfiguration::setMinimumLayoutSize(const FloatSize& minimumLayoutSize) 79 80 { 80 81 if (m_minimumLayoutSize == minimumLayoutSize) 81 return ;82 return false; 82 83 83 84 m_minimumLayoutSize = minimumLayoutSize; 84 85 updateConfiguration(); 85 } 86 87 void ViewportConfiguration::setViewportArguments(const ViewportArguments& viewportArguments) 86 return true; 87 } 88 89 bool ViewportConfiguration::setViewportArguments(const ViewportArguments& viewportArguments) 88 90 { 89 91 if (m_viewportArguments == viewportArguments) 90 return ;92 return false; 91 93 92 94 m_viewportArguments = viewportArguments; 93 95 updateConfiguration(); 96 return true; 97 } 98 99 bool ViewportConfiguration::setCanIgnoreScalingConstraints(bool canIgnoreScalingConstraints) 100 { 101 if (canIgnoreScalingConstraints == m_canIgnoreScalingConstraints) 102 return false; 103 104 m_canIgnoreScalingConstraints = canIgnoreScalingConstraints; 105 updateConfiguration(); 106 return true; 94 107 } 95 108 -
trunk/Source/WebCore/page/ViewportConfiguration.h
r191243 r194206 74 74 75 75 const IntSize& contentsSize() const { return m_contentSize; } 76 WEBCORE_EXPORT voidsetContentsSize(const IntSize&);76 WEBCORE_EXPORT bool setContentsSize(const IntSize&); 77 77 78 78 const FloatSize& minimumLayoutSize() const { return m_minimumLayoutSize; } 79 WEBCORE_EXPORT voidsetMinimumLayoutSize(const FloatSize&);79 WEBCORE_EXPORT bool setMinimumLayoutSize(const FloatSize&); 80 80 81 81 const ViewportArguments& viewportArguments() const { return m_viewportArguments; } 82 WEBCORE_EXPORT voidsetViewportArguments(const ViewportArguments&);82 WEBCORE_EXPORT bool setViewportArguments(const ViewportArguments&); 83 83 84 void setCanIgnoreScalingConstraints(bool canIgnoreScalingConstraints) { m_canIgnoreScalingConstraints = canIgnoreScalingConstraints; }84 WEBCORE_EXPORT bool setCanIgnoreScalingConstraints(bool); 85 85 void setForceAlwaysUserScalable(bool forceAlwaysUserScalable) { m_forceAlwaysUserScalable = forceAlwaysUserScalable; } 86 86 -
trunk/Source/WebKit2/ChangeLog
r194205 r194206 1 2015-12-16 Simon Fraser <simon.fraser@apple.com> 2 3 ViewportConfiguration functions should return a bool to say if anything changed 4 https://bugs.webkit.org/show_bug.cgi?id=152353 5 6 Reviewed by Tim Horton. 7 8 Rather than callers all checking whether setting ViewportConfiguration values 9 changes state, have its functions return a bool if the values change. 10 11 * WebProcess/WebPage/WebPage.cpp: 12 (WebKit::WebPage::mainFrameDidLayout): 13 (WebKit::WebPage::didCommitLoad): 14 * WebProcess/WebPage/ios/WebPageIOS.mm: 15 (WebKit::WebPage::viewportPropertiesDidChange): 16 (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): 17 1 18 2015-12-16 Tim Horton <timothy_horton@apple.com> 2 19 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r194108 r194206 3537 3537 if (FrameView* frameView = mainFrameView()) { 3538 3538 IntSize newContentSize = frameView->contentsSizeRespectingOverflow(); 3539 if (m_viewportConfiguration.contentsSize() != newContentSize) { 3540 m_viewportConfiguration.setContentsSize(newContentSize); 3539 if (m_viewportConfiguration.setContentsSize(newContentSize)) 3541 3540 viewportConfigurationChanged(); 3542 }3543 3541 } 3544 3542 m_findController.redraw(); … … 4686 4684 resetViewportDefaultConfiguration(frame); 4687 4685 const Frame* coreFrame = frame->coreFrame(); 4688 m_viewportConfiguration.setContentsSize(coreFrame->view()->contentsSize()); 4689 m_viewportConfiguration.setViewportArguments(coreFrame->document()->viewportArguments()); 4690 viewportConfigurationChanged(); 4686 4687 bool viewportChanged = false; 4688 if (m_viewportConfiguration.setContentsSize(coreFrame->view()->contentsSize())) 4689 viewportChanged = true; 4690 4691 if (m_viewportConfiguration.setViewportArguments(coreFrame->document()->viewportArguments())) 4692 viewportChanged = true; 4693 4694 if (viewportChanged) 4695 viewportConfigurationChanged(); 4691 4696 #endif 4692 4697 -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r194108 r194206 229 229 void WebPage::viewportPropertiesDidChange(const ViewportArguments& viewportArguments) 230 230 { 231 if (m_viewportConfiguration.viewportArguments() == viewportArguments) 232 return; 233 234 m_viewportConfiguration.setViewportArguments(viewportArguments); 235 viewportConfigurationChanged(); 231 if (m_viewportConfiguration.setViewportArguments(viewportArguments)) 232 viewportConfigurationChanged(); 236 233 } 237 234 … … 2540 2537 { 2541 2538 resetTextAutosizingBeforeLayoutIfNeeded(m_viewportConfiguration.minimumLayoutSize(), size); 2542 m_viewportConfiguration.setMinimumLayoutSize(size); 2543 viewportConfigurationChanged(); 2539 2540 if (m_viewportConfiguration.setMinimumLayoutSize(size)) 2541 viewportConfigurationChanged(); 2544 2542 } 2545 2543
Note: See TracChangeset
for help on using the changeset viewer.