Simple line layout: use std::upper_bound in splitFragmentToFitLine()
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Feb 2015 23:53:26 +0000 (23:53 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Feb 2015 23:53:26 +0000 (23:53 +0000)
commitf107712313804886a112afa197c16a83a2b14f67
tree2f9489e43215e01b68064ea8cc2acbaff9f12a2c
parent807b079e3b27910cea551f616b3c35d3f20bf24e
Simple line layout: use std::upper_bound in splitFragmentToFitLine()
https://bugs.webkit.org/show_bug.cgi?id=141146

Reviewed by Antti Koivisto.

Replace the custom binary search implementation with std::upper_bound and
move splitting functionality to TextFragment.

No change in functionality.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator):
(WebCore::SimpleLineLayout::FragmentForwardIterator::operator++):
(WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=):
(WebCore::SimpleLineLayout::FragmentForwardIterator::operator*):
(WebCore::SimpleLineLayout::begin):
(WebCore::SimpleLineLayout::end):
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
* rendering/SimpleLineLayoutFlowContentsIterator.cpp:
(WebCore::SimpleLineLayout::FlowContentsIterator::runWidth):
* rendering/SimpleLineLayoutFlowContentsIterator.h:
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::split):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebCore/rendering/SimpleLineLayoutFlowContentsIterator.cpp
Source/WebCore/rendering/SimpleLineLayoutFlowContentsIterator.h