summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* RenderTextHarfBuzz: Break runs at parentheses so they aren't affected by ↵Cem Kocagil2014-09-041-2/+1
| | | | | | | | | | | font fallbacks BUG=396776 R=msw@chromium.org, msw Review URL: https://codereview.chromium.org/522343002 Cr-Commit-Position: refs/heads/master@{#293299}
* Enable RenderTextHarfBuzz by defaultckocagil@chromium.org2014-08-091-1/+1
| | | | | | | | | | BUG=321868 TBR=msw Review URL: https://codereview.chromium.org/421053002 Cr-Commit-Position: refs/heads/master@{#288588} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288588 0039d316-1c4b-4281-b951-d872f2087c98
* Move StringToLowerASCII to base namespacebrettw@chromium.org2014-08-071-2/+3
| | | | | | | | TBR=sky Review URL: https://codereview.chromium.org/448853002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288085 0039d316-1c4b-4281-b951-d872f2087c98
* RenderTextHarfBuzz: Check CreateSkiaTypeface return value against NULLckocagil@chromium.org2014-08-031-0/+29
| | | | | | | | BUG=398712 Review URL: https://codereview.chromium.org/435583003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287250 0039d316-1c4b-4281-b951-d872f2087c98
* RenderTextHarfBuzz: Allow mid-glyph cursors in multi-grapheme clustersckocagil@chromium.org2014-07-301-13/+105
| | | | | | | | | | | | Use the Unicode grapheme boundary algorithm via ICU BreakIterator to count graphemes in clusters BUG=383265 TBR=jshin NOTRY=true Review URL: https://codereview.chromium.org/351963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286569 0039d316-1c4b-4281-b951-d872f2087c98
* Prepare to enable RenderTextHarfBuzz by defaultckocagil@chromium.org2014-07-261-9/+17
| | | | | | | | | | | | | - Fix and partially disable the RenderText unit tests to make sure RenderTextHarfBuzz passes the tests. Call EnsureLayout() in GetGlyphBounds() since it has been made public by r252873. - Add a "--disable-harfbuzz-rendertext" switch to make enabling RTHB by default easier. BUG=321868 NOTRY=true Review URL: https://codereview.chromium.org/419753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285761 0039d316-1c4b-4281-b951-d872f2087c98
* RenderText: handle center-aligned text in UpdateCachedBoundsAndOffset()mohsen@chromium.org2014-07-231-3/+39
| | | | | | | | | | | | | In case display width is less than content width, UpdateCachedBoundsAndOffset() does not handle center-aligned text properly when content width is reduced (e.g. by deleting some characters) or display width is increased. BUG=none Review URL: https://codereview.chromium.org/384953003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284897 0039d316-1c4b-4281-b951-d872f2087c98
* Move gfx::ElideText functionality to RenderText.msw@chromium.org2014-07-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a prerequisite for http://crrev.com/23228004 (RenderText must elide correctly for direct Label use) Use RenderText in gfx::ElideText on Win, Linux, Mac. (old impl still needed for iOS and Android, for now) Support additional eliding types in RenderText. (matches behavior of gfx::ElideText, see TextEliderTest) (still fixes the directionality of trailing ellipses) (respect head and middle eliding when truncating) Disambiguate gfx::NO_ELIDE from gfx::TRUNCATE. Make the ElideEmail helper a private RenderText function. Disable tests and no-op gfx::ElideText on iOS/Android. Improve ElideTextSurrogatePairs perf: 7561 ms -> 3196 ms. TODO: Fix RenderText::ElideEmail GetStringWidthF calls. TODO: Support eliding filenames, like gfx::ElideFilename. BUG=249938,327846,240037,125348,338784 R=asvitkine@chromium.org,sky@chromium.org TEST=No observable text eliding behavior changes. Review URL: https://codereview.chromium.org/354963003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282433 0039d316-1c4b-4281-b951-d872f2087c98
* RenderText: Allow setting display offset explicitlymohsen@chromium.org2014-07-101-1/+75
| | | | | | | | | | | | | | | Currently, display offset for a gfx::RenderText is computed automatically to ensure the cursor is always visible. This CL adds the ability to set display offset explicitly which, as an example, can be useful in adding touch scrolling to textfields. Display offset set this way is not permanent and will be recalculated next time a property (text, font, alignment, etc.) is changed. BUG=388862 Review URL: https://codereview.chromium.org/378723003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282308 0039d316-1c4b-4281-b951-d872f2087c98
* Fix and simplify RTHB GetGlyphXBoundary logicckocagil@chromium.org2014-06-131-0/+34
| | | | | | | | | | BUG=382692 R=msw NOTRY=true Review URL: https://codereview.chromium.org/328683003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277069 0039d316-1c4b-4281-b951-d872f2087c98
* Move unusual character block logic to a helper functionckocagil@chromium.org2014-06-121-2/+19
| | | | | | | | | | BUG= NOTRY=true R=msw Review URL: https://codereview.chromium.org/324983002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276776 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land RenderTextHarfBuzz: Decide run direction by BiDi embedding levelckocagil@chromium.org2014-06-121-0/+12
| | | | | | | | | | | | Original CL: https://codereview.chromium.org/326123003/ BUG=382178 NOTRY=true R=msw Review URL: https://codereview.chromium.org/323403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276525 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of RenderTextHarfBuzz: Decide run direction by BiDi embedding level ↵ckocagil@chromium.org2014-06-111-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/326123003/) Reason for revert: Memory leak: http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Tests%20%282%29/builds/3570/steps/ui_unittests/logs/HarfBuzz_RunDirection Original issue's description: > RenderTextHarfBuzz: Decide run direction by BiDi embedding level > > BUG=382178 > NOTRY=true > R=msw > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276379 TBR=msw@chromium.org NOTREECHECKS=true NOTRY=true BUG=382178 Review URL: https://codereview.chromium.org/324413002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276387 0039d316-1c4b-4281-b951-d872f2087c98
* RenderTextHarfBuzz: Decide run direction by BiDi embedding levelckocagil@chromium.org2014-06-111-0/+12
| | | | | | | | | | BUG=382178 NOTRY=true R=msw Review URL: https://codereview.chromium.org/326123003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276379 0039d316-1c4b-4281-b951-d872f2087c98
* Fix the Char to Glyph mapping logic in RenderTextHarfBuzzckocagil@chromium.org2014-06-081-0/+53
| | | | | | | | | | BUG=321868 R=msw@chromium.org NOTRY=true Review URL: https://codereview.chromium.org/300623003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275754 0039d316-1c4b-4281-b951-d872f2087c98
* Add fade eliding for Views Labels; related cleanup.msw@chromium.org2014-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Support fade eliding behavior for Views Label[Button]. (needed for forthcoming LabelButton conversions, etc.) Remove unused head fading behavior, refine fade tail. (fades the end opposite the text's horizontal alignment) (centered fading uses content directionality alignment) (RenderText fades both ends of explicitly centered text) Consolidate gfx::ElideBehavior and Label::ElideBehavior. Nix Canvas::TruncateFadeMode and RenderText fade_[head|tail]. Add ELIDE_EMAIL and FADE_TAIL enum values, hide ElideEmail. Consolidate and rename Canvas::DrawFadedString functions. Refine Examples, cleanup enum and function uses. BUG=155363,249938 TEST=No apparent eliding behavior changes or regressions. R=sky@chromium.org Review URL: https://codereview.chromium.org/312233003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275265 0039d316-1c4b-4281-b951-d872f2087c98
* Add a unit tests for RenderText::FindCursorPosition.msw@chromium.org2014-05-131-7/+18
| | | | | | | | | | | | | | | | | | Verifies that FindCursorPosition works with GetGlyphBounds values. Prompted by a question reviewing Cem's WIP RenderTextHarfBuzz: https://codereview.chromium.org/152473008/diff/100001/ui/gfx/render_text_harfbuzz.cc#newcode787 I thought RenderTextWin::GetRunContainingXCoord needed visual run order. Logical run order is fine as-is, because it checks the range of x bounds. (RenderTextHarfBuzz should probably do the same thing to be safe/correct) BUG=NONE TEST=NONE R=asvitkine@chromium.org Review URL: https://codereview.chromium.org/276123003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269941 0039d316-1c4b-4281-b951-d872f2087c98
* Reland: Fix Views inline autocomplete with multi-char graphemes.msw@chromium.org2014-05-021-17/+47
| | | | | | | | | | | | | | | | | | | | | | | (originally r267752, reverted in r267765 for XP test failures) (test disabled on XP for a lack of font support, issue 106450) Allow RenderText selection bounds amid multi-char graphemes. Add a consolidated IsValidLogicalIndex implementation. (this is less strict than the renamed IsValidCursorIndex) Use adjacent cursor positions in MoveCursor as needed. (prevents invalid cursors when collapsing selections) Skip painting empty glyph ranges on Windows. Add a unit test; minor cleanup and comment changes. BUG=327903,366786,106450 TEST=Search for "จำลอง" in the omnibox; enter "จ" and get a valid selection of the inline autocomplete text. TBR=asvitkine@chromium.org Review URL: https://codereview.chromium.org/265903004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267826 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of Fix Views inline autocomplete with multi-char graphemes. ↵falken@chromium.org2014-05-021-39/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/252563003/) Reason for revert: Sorry to revert. After this patch the following test started failing on XP Tests (3): RenderTextTest.MidGraphemeSelectionBounds Log: http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%283%29/builds/27345/steps/ui_unittests/logs/MidGraphemeSelectionBounds Snippet from log: c:\b\build\slave\cr-win-rel\build\src\ui\gfx\render_text_unittest.cc(930): error: Value of: render_text->IsValidCursorIndex(1) Actual: true Expected: false Original issue's description: > Fix Views inline autocomplete with multi-char graphemes. > > Allow RenderText selection bounds amid multi-char graphemes. > Add a consolidated IsValidLogicalIndex implementation. > (this is less strict than the renamed IsValidCursorIndex) > > Use adjacent cursor positions in MoveCursor as needed. > (prevents invalid cursors when collapsing selections) > > Skip painting empty glyph ranges on Windows. > Add a unit test; minor cleanup and comment changes. > > BUG=327903,366786 > TEST=Search for "จำลอง" in the omnibox; enter "จ" and get a valid selection of the inline autocomplete text. > R=asvitkine@chromium.org > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267752 TBR=asvitkine@chromium.org,msw@chromium.org NOTREECHECKS=true NOTRY=true BUG=327903,366786 Review URL: https://codereview.chromium.org/263833010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267765 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Views inline autocomplete with multi-char graphemes.msw@chromium.org2014-05-021-13/+39
| | | | | | | | | | | | | | | | | | | | Allow RenderText selection bounds amid multi-char graphemes. Add a consolidated IsValidLogicalIndex implementation. (this is less strict than the renamed IsValidCursorIndex) Use adjacent cursor positions in MoveCursor as needed. (prevents invalid cursors when collapsing selections) Skip painting empty glyph ranges on Windows. Add a unit test; minor cleanup and comment changes. BUG=327903,366786 TEST=Search for "จำลอง" in the omnibox; enter "จ" and get a valid selection of the inline autocomplete text. R=asvitkine@chromium.org Review URL: https://codereview.chromium.org/252563003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267752 0039d316-1c4b-4281-b951-d872f2087c98
* Delete the GTK+ port of Chrome.erg@chromium.org2014-04-101-8/+0
| | | | | | | | | BUG=297026 R=ben@chromium.org Review URL: https://codereview.chromium.org/231733005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263101 0039d316-1c4b-4281-b951-d872f2087c98
* Infinite Suggest - views implementation skanuj@chromium.org2014-02-241-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (See comment 36 on crbug.com/327833 for screenshots) RenderText: Allow layout_text_ to be empty if there is no room to render a single character. ---------------- OmniboxResultView: Revises the OmniboxResultView to rely on RenderText for eliding and rendering. The match contents and description can not be rendered together as one string. See crbug.com/331153 for a possible error case. The relevant TODO is removed. ----------------------------------------------------------- Infinite Suggestion: These suggestions show a leading ellipsis to suggest tail completion. Ideally they should appear at an offset equivalent to that of omitted text. This is accomplished by computing the required width as if the full text is present and the actual width required to show the suggestion with leading ellipsis. If the window is not wide enough to show the suggestion at the offset of the omitted text, the suggestions are shifted towards the start edge such that the longest infinite suggestion is visible. The suggestions are never shifted beyond the start edge. The suggestions are shown aligned to the start edge when directionality of suggestion differs from directionality of UI. When the directionality of suggestion differs from directionality of UI, we try to show the suggestions such that the leading ellipsis is still vertically aligned for all suggestions. BUG=327833, 336543, 328699 TBR=msw@chromium.org Review URL: https://codereview.chromium.org/171153004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252873 0039d316-1c4b-4281-b951-d872f2087c98
* Makes FontList light-weighted introducing FontListImpl.yukishiino@chromium.org2014-02-091-2/+1
| | | | | | | | | | | | | | | | | Like Font class has scoped_refptr<PlatformFont>, makes FontList have scoped_refptr<FontListImpl>. FontListImpl is almost the same as the old FontList and implements all functionalities. There are two major benefits with this CL. 1. Copying a FontList to another FontList is very quick. It just copies a scoped_refptr. 2. Calculated font metrics are shared among all FontList instances which refer to the same FontListImpl. In addition, this CL may fix Issue 340396. I don't fully understand the cause yet, but it seems that copying the object in a ctor is causing the issue (It's a little tricky, but I thought it should be okay). This CL doesn't copy the object. So I think this CL may fix the issue. BUG=340396 TEST=Run ui_unittests, views_unittests and unit_tests. Review URL: https://codereview.chromium.org/148773007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249976 0039d316-1c4b-4281-b951-d872f2087c98
* Implement eliding/truncating at end in RenderTextskanuj@chromium.org2014-01-021-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The eliding is determined using binary search similar to the ElideText in ui/gfx/text_elider.cc. The mixed LTR-RTL handling for ellipsis is done using LTR/RTL markers. There is no other way of rendering the ellipsis with the directionality of preceding strong-directional characters. Previous scheme worked because it rendered LTR and RTL sub-strings as different RenderText instances. Added helper method to be able to determine directionality of the trailing text. Made StringSlicer used by text_elider.cc public to be shared by RenderText. Additional Fix: - Changed ellipsis width check to use render text (render_Text.cc) - Modify tests to never have a scenario where the input is less wide than the elided. BUG=327833 TEST=ui_unittests,base_unittests R=msw@chromium.org TBR=jshin@chromium.org,pkasting@chromium.org Review URL: https://codereview.chromium.org/119813002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242828 0039d316-1c4b-4281-b951-d872f2087c98
* Clean-up: Retires obsolete Font methods of RenderText.yukishiino@chromium.org2013-12-291-14/+8
| | | | | | | | | | | Removes obsolete gfx::Font versions of methods in gfx::RenderText. BUG=265485 TEST=Run unit_tests, ui_unittests, views_unittests Review URL: https://codereview.chromium.org/120983004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242706 0039d316-1c4b-4281-b951-d872f2087c98
* Remove UTF string conversion functions from the global namespace.avi@chromium.org2013-12-261-0/+1
| | | | | | | | | | BUG=330556 TEST=no change TBR=ben@chromium.org Review URL: https://codereview.chromium.org/102993018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242519 0039d316-1c4b-4281-b951-d872f2087c98
* Update some uses of char16 to use the base:: namespace.avi@chromium.org2013-12-251-10/+12
| | | | | | | | | | BUG=329295 TEST=no change TBR=ben@chromium.org Review URL: https://codereview.chromium.org/111373008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242507 0039d316-1c4b-4281-b951-d872f2087c98
* Update uses of UTF conversions in ui/ to use the base:: namespace.avi@chromium.org2013-12-251-0/+3
| | | | | | | | | | BUG=330556 TEST=no change TBR=ben@chromium.org Review URL: https://codereview.chromium.org/106383004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242504 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of https://codereview.chromium.org/107513011/szym@chromium.org2013-12-161-86/+0
| | | | | | | | | | | | | Reason for revert: Test fails on main waterfall. TBR=jshin@chromium.org,msw@chromium.org,pkasting@chromium.org,skanuj@chromium.org NOTREECHECKS=true NOTRY=true BUG=327833 Review URL: https://codereview.chromium.org/103053014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241050 0039d316-1c4b-4281-b951-d872f2087c98
* Implement eliding/truncating at end in RenderTextskanuj@chromium.org2013-12-161-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch from issue 112063003 The eliding is determined using binary search similar to the ElideText in ui/gfx/text_elider.cc. The mixed LTR-RTL handling for ellipsis is done using LTR/RTL markers. There is no other way of rendering the ellipsis with the directionality of preceding strong-directional characters. Previous scheme worked because it rendered LTR and RTL sub-strings as different RenderText instances. Added helper method to be able to determine directionality of the trailing text. Made StringSlicer used by text_elider.cc public to be shared by RenderText. Additional Fix: - Call UpdateLayoutText from SetDisplayRect. - Disable erratic tests on versions of windows older than Vista. BUG=327833 TEST=ui_unittests,base_unittests R=msw@chromium.org TBR=jshin@chromium.org,pkasting@chromium.org Review URL: https://codereview.chromium.org/107513011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241000 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of https://codereview.chromium.org/112063003/szym@chromium.org2013-12-131-71/+0
| | | | | | | | | | | | Reason for revert: RenderTextTest.ElidedText fails on XP Tests (3) TBR=msw@chromium.org,pkasting@chromium.org,jshin@chromium.org,skanuj@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/103493003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240694 0039d316-1c4b-4281-b951-d872f2087c98
* Implement eliding/truncating at end in RenderTextskanuj@chromium.org2013-12-131-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | The eliding is determined using binary search similar to the ElideText in ui/gfx/text_elider.cc. The mixed LTR-RTL handling for ellipsis is done using LTR/RTL markers. There is no other way of rendering the ellipsis with the directionality of preceding strong-directional characters. Previous scheme worked because it rendered LTR and RTL sub-strings as different RenderText instances. Added helper method to be able to determine directionality of the trailing text. Made StringSlicer used by text_elider.cc public to be shared by RenderText. BUG=327833 TEST=ui_unittests,base_unittests R=msw@chromium.org TBR=jshin@chromium.org,pkasting@chromium.org Review URL: https://codereview.chromium.org/112063003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240572 0039d316-1c4b-4281-b951-d872f2087c98
* Enables font-related unittests again.yukishiino@chromium.org2013-12-111-4/+7
| | | | | | | | | | | | | | | Enables the unittests which got disabled because Symbol font was missing on trybots. See http://crrev.com/67523002 Symbol font has been installed on trybots. See http://crbug.com/320391 BUG=316955 TEST=none Review URL: https://codereview.chromium.org/79263004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240048 0039d316-1c4b-4281-b951-d872f2087c98
* RenderTextWin: Break line on a newline character ('\n')ckocagil@chromium.org2013-11-281-0/+47
| | | | | | | | | BUG=248597 R=msw Review URL: https://codereview.chromium.org/88423005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237752 0039d316-1c4b-4281-b951-d872f2087c98
* Disable the following tests:rockot@google.com2013-11-091-2/+4
| | | | | | | | | | | | | FontListTest.Fonts_GetHeight_GetBaseline RenderTextTest.SetFontList RenderTextTest.StringSizeRespectsFontListMetrics LabelTest.FontPropertySymbol BUG=316955 Review URL: https://codereview.chromium.org/67523002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234045 0039d316-1c4b-4281-b951-d872f2087c98
* mac: Prepare most test code for -Wunused-functions too.thakis@chromium.org2013-11-081-0/+2
| | | | | | | | | | BUG=315884 R=akalin@chromium.org, isherman@chromium.org, thestig@chromium.org, yzshen@chromium.org TBR=piman, sergeyu Review URL: https://codereview.chromium.org/65813002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233737 0039d316-1c4b-4281-b951-d872f2087c98
* ozone: Allow building for ozone without depending on pangosadrul@chromium.org2013-11-061-4/+4
| | | | | | | | | | | | | | Notable changes in this CL: * Rename files that depend on pango to have _pango suffix. * Add a filename gyp rule to exclude _pango* files when use_pango = 0 * Add empty implementations for a few font-related API for ozone. BUG=313793 R=jam@chromium.org, msw@chromium.org, rjkroege@chromium.org Review URL: https://codereview.chromium.org/26541007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233228 0039d316-1c4b-4281-b951-d872f2087c98
* Always aligns text at vertically center (Textfield, Label).yukishiino@chromium.org2013-11-011-18/+20
| | | | | | | | | | | | | Re-applies http://crrev.com/25039002 with only the change s/numeric_limits<int>::max()/INT_MAX/ This CL makes Textfield and Label put the content text at vertically center respecting the cap height. Also removes vertical alignment support (ALIGN_{TOP,BOTTOM,VCENTER}). BUG=146236, 264436 TEST=Test manually + ui_unittests Review URL: https://codereview.chromium.org/54353002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232374 0039d316-1c4b-4281-b951-d872f2087c98
* RenderTextWin: Break runs at UBLOCK_GEOMETRIC_SHAPES.msw@chromium.org2013-10-311-0/+20
| | | | | | | | | | | | | | | | | Based on Cem's original CL: http://crrev.com/23522018 His r221850 was reverted in r228312 for Issue 287816. That perf regression is due to unnecessary run breaking. This version of the CL performs more limited run breaking. (just the ('▶') play character's UBLOCK_GEOMETRIC_SHAPES) BUG=278913,287816 TEST=YouTube/SoundCloud tab titles don't use weird fonts when they contain '▶'; no perf regression. R=asvitkine@chromium.org,ckocagil@chromium.org, Review URL: https://codereview.chromium.org/53033002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232076 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 231107 "Always aligns text at vertically center (Textfiel..."kuan@chromium.org2013-10-251-20/+18
| | | | | | | | | | | | | | | | | | | | | | | > Always aligns text at vertically center (Textfield, Label). > > This CL makes Textfield and Label put their content text at vertically center respecting the cap height. > > Also this CL removes vertical alignment support, which we no longer need. > > I think this CL fixes all issues related to vertical alignment and font height. > > BUG=146236, 264436 > TEST=Test manually + ui_unittests > > Review URL: https://codereview.chromium.org/25039002 Cannot use kInvalidBaseLine in render_text.cc as static initializer. TBR=yukishiino@chromium.org Review URL: https://codereview.chromium.org/45173003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231117 0039d316-1c4b-4281-b951-d872f2087c98
* Always aligns text at vertically center (Textfield, Label).yukishiino@chromium.org2013-10-251-18/+20
| | | | | | | | | | | | | | | This CL makes Textfield and Label put their content text at vertically center respecting the cap height. Also this CL removes vertical alignment support, which we no longer need. I think this CL fixes all issues related to vertical alignment and font height. BUG=146236, 264436 TEST=Test manually + ui_unittests Review URL: https://codereview.chromium.org/25039002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231107 0039d316-1c4b-4281-b951-d872f2087c98
* Fix and re-enable RenderTextTest.Multiline_NormalWidth on XPckocagil@chromium.org2013-10-121-7/+1
| | | | | | | | | BUG=248597 TBR=asvitkine@chromium.org Review URL: https://codereview.chromium.org/26358015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228344 0039d316-1c4b-4281-b951-d872f2087c98
* Temporarily revert r221850 to get a tighter range on XP perf botsckocagil@chromium.org2013-10-121-22/+0
| | | | | | | | BUG=287816 Review URL: https://codereview.chromium.org/26663003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228312 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up a few more unused globals.thakis@chromium.org2013-09-251-1/+3
| | | | | | | | | | | Found by clang's new -Wunused-const-variable. BUG=290204 R=akalin@chromium.org, avi@chromium.org, isherman@chromium.org, jamesr@chromium.org, joi@chromium.org, sergeyu@chromium.org, sky@chromium.org, thestig@chromium.org, xhwang@chromium.org Review URL: https://codereview.chromium.org/24649002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225273 0039d316-1c4b-4281-b951-d872f2087c98
* Remove explicit namespace resolution from code in gfx namespaceckocagil@chromium.org2013-09-181-37/+37
| | | | | | | | | BUG=103304 R=sky@chromium.org Review URL: https://codereview.chromium.org/24053002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223952 0039d316-1c4b-4281-b951-d872f2087c98
* Disable RenderTextTest.Multiline_NormalWidth on XPckocagil@chromium.org2013-09-161-0/+6
| | | | | | | | BUG=248597 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223452 0039d316-1c4b-4281-b951-d872f2087c98
* Windows implementation of multiline RenderTextckocagil@chromium.org2013-09-161-10/+85
| | | | | | | | | | | | | | Multi-line text rendering in the Chromium UI is currently done by slicing the string into multiple lines by using text metrics from cross-platform libraries and rendering text by using different RenderText instances - one for each line. This approach has poor performance and is very bug-prone. This CL adds a cross-platform interface and data structures to RenderText to support multi-line text rendering. This CL also implements the required platform-specific bits for Windows. Support for other platforms will be implemented in subsequent CLs. Multi-line rendering as implemented in this CL is limited. Newline characters are ignored. RTL and complex scripts are supported, while there are be issues with selection highlights. Text-space <-> view-space mappings do not support RTL/complex scripts. BUG=248597 Review URL: https://chromiumcodereview.appspot.com/16867016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223394 0039d316-1c4b-4281-b951-d872f2087c98
* Re-land: "RenderTextWin: Break runs between any two characters that are not ↵ckocagil@chromium.org2013-09-071-0/+22
| | | | | | | | | | | | | | | | in the same code block" Original CL: https://codereview.chromium.org/23522018/ Last CL had a mid-air collision with r221762. It is now merged. BUG=278913 TBR=asvitkine@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/23857008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221850 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 221776 "RenderTextWin: Break runs between any two charact..."rouslan@chromium.org2013-09-061-22/+0
| | | | | | | | | | | | | | | | | | | | | Compile error: render_text_unittest.cc(1662) :error C2039: 'Range' : is not a member of 'ui' Revision 221776 change collided with revision 221762, which moved Range from ui to gfx namespace. > RenderTextWin: Break runs between any two characters that are not in the same code block > > BUG=278913 > > Review URL: https://chromiumcodereview.appspot.com/23522018 TBR=ckocagil@chromium.org Review URL: https://codereview.chromium.org/23707025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221780 0039d316-1c4b-4281-b951-d872f2087c98
* RenderTextWin: Break runs between any two characters that are not in the ↵ckocagil@chromium.org2013-09-061-0/+22
| | | | | | | | | | same code block BUG=278913 Review URL: https://chromiumcodereview.appspot.com/23522018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221776 0039d316-1c4b-4281-b951-d872f2087c98