Changeset 178213 in webkit


Ignore:
Timestamp:
Jan 9, 2015, 3:36:04 PM (10 years ago)
Author:
enrica@apple.com
Message:

[iOS] Support additional text styles.
https://bugs.webkit.org/show_bug.cgi?id=140310
rdar://problem/18568864

Reviewed by Joseph Pecoraro.

Source/WebCore:

Add support for three new text styles.

  • css/CSSValueKeywords.in:
  • rendering/RenderThemeIOS.mm:

(WebCore::RenderThemeIOS::systemFont):

Source/WebInspectorUI:

Add support for three new text styles.

  • UserInterface/Models/CSSKeywordCompletions.js:

LayoutTests:

Updates the existing test to include the new text styles.

  • platform/ios-simulator/ios/fast/text/opticalFontWithTextStyle-expected.txt:
  • platform/ios-simulator/ios/fast/text/opticalFontWithTextStyle.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r178210 r178213  
     12015-01-09  Enrica Casucci  <enrica@apple.com>
     2
     3        [iOS] Support additional text styles.
     4        https://bugs.webkit.org/show_bug.cgi?id=140310
     5        rdar://problem/18568864
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Updates the existing test to include the new text styles.
     10
     11        * platform/ios-simulator/ios/fast/text/opticalFontWithTextStyle-expected.txt:
     12        * platform/ios-simulator/ios/fast/text/opticalFontWithTextStyle.html:
     13
    1142015-01-09  Eric Carlson  <eric.carlson@apple.com>
    215
  • trunk/LayoutTests/platform/ios-simulator/ios/fast/text/opticalFontWithTextStyle-expected.txt

    r178197 r178213  
    77        RenderText {#text} at (0,1) size 107x22
    88          text run at (0,1) width 107: "H1 / Headline"
    9       RenderBlock {DIV} at (0,39) size 784x24
    10         RenderText {#text} at (0,1) size 707x22
    11           text run at (0,1) width 707: "Body Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ornare ornare mi"
    12       RenderBlock {DIV} at (0,78) size 784x26
    13         RenderText {#text} at (0,2) size 739x22
    14           text run at (0,2) width 739: "Tall Body Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ornare ornare mi"
    15       RenderBlock {DIV} at (0,119) size 784x22
     9      RenderBlock {DIV} at (0,39) size 784x35
     10        RenderText {#text} at (0,0) size 122x34
     11          text run at (0,0) width 122: "T1 / Title1"
     12      RenderBlock {DIV} at (0,89) size 784x29
     13        RenderText {#text} at (0,1) size 98x27
     14          text run at (0,1) width 98: "T2 / Title2"
     15      RenderBlock {DIV} at (0,133) size 784x26
     16        RenderText {#text} at (0,0) size 89x25
     17          text run at (0,0) width 89: "T3 / Title3"
     18      RenderBlock {DIV} at (0,174) size 784x24
     19        RenderText {#text} at (0,1) size 705x22
     20          text run at (0,1) width 705: "Body Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ornare ornare mi"
     21      RenderBlock {DIV} at (0,213) size 784x26
     22        RenderText {#text} at (0,2) size 735x22
     23          text run at (0,2) width 735: "Tall Body Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ornare ornare mi"
     24      RenderBlock {DIV} at (0,254) size 784x22
    1625        RenderText {#text} at (0,1) size 87x19
    1726          text run at (0,1) width 87: "Subheadline"
    18       RenderBlock {DIV} at (0,156) size 784x20
     27      RenderBlock {DIV} at (0,291) size 784x20
    1928        RenderText {#text} at (0,1) size 81x17
    2029          text run at (0,1) width 81: "FN / Footnote"
    21       RenderBlock {DIV} at (0,191) size 784x17
     30      RenderBlock {DIV} at (0,326) size 784x17
    2231        RenderText {#text} at (0,1) size 96x15
    2332          text run at (0,1) width 96: "Cap 1 / Caption 1"
    24       RenderBlock {DIV} at (0,223) size 784x14
     33      RenderBlock {DIV} at (0,358) size 784x14
    2534        RenderText {#text} at (0,0) size 88x14
    2635          text run at (0,0) width 88: "Cap 2 / Caption 2"
    27       RenderBlock {DIV} at (0,252) size 784x22
     36      RenderBlock {DIV} at (0,387) size 784x22
    2837        RenderText {#text} at (0,0) size 154x22
    2938          text run at (0,0) width 154: "Short H1 / Headline"
    30       RenderBlock {DIV} at (0,289) size 784x22
    31         RenderText {#text} at (0,0) size 753x22
    32           text run at (0,0) width 753: "Short Body Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ornare ornare mi"
    33       RenderBlock {DIV} at (0,326) size 784x20
     39      RenderBlock {DIV} at (0,424) size 784x22
     40        RenderText {#text} at (0,0) size 751x22
     41          text run at (0,0) width 751: "Short Body Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ornare ornare mi"
     42      RenderBlock {DIV} at (0,461) size 784x20
    3443        RenderText {#text} at (0,0) size 128x19
    3544          text run at (0,0) width 128: "Short Subheadline"
    36       RenderBlock {DIV} at (0,361) size 784x18
     45      RenderBlock {DIV} at (0,496) size 784x18
    3746        RenderText {#text} at (0,0) size 116x17
    3847          text run at (0,0) width 116: "Short FN / Footnote"
    39       RenderBlock {DIV} at (0,394) size 784x15
     48      RenderBlock {DIV} at (0,529) size 784x15
    4049        RenderText {#text} at (0,0) size 128x15
    4150          text run at (0,0) width 128: "Short Cap 1 / Caption 1"
  • trunk/LayoutTests/platform/ios-simulator/ios/fast/text/opticalFontWithTextStyle.html

    r178197 r178213  
    66<body>
    77    <div style="margin-top: 15px; font: -apple-system-headline">H1 / Headline</div>
     8    <div style="margin-top: 15px; font: -apple-system-title1">T1 / Title1</div>
     9    <div style="margin-top: 15px; font: -apple-system-title2">T2 / Title2</div>
     10    <div style="margin-top: 15px; font: -apple-system-title3">T3 / Title3</div>
    811    <div style="margin-top: 15px; font: -apple-system-body">Body Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ornare ornare mi</div>
    912    <div style="margin-top: 15px; font: -apple-system-tall-body">Tall Body Text: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ornare ornare mi</div>
  • trunk/Source/WebCore/ChangeLog

    r178212 r178213  
     12015-01-09  Enrica Casucci  <enrica@apple.com>
     2
     3        [iOS] Support additional text styles.
     4        https://bugs.webkit.org/show_bug.cgi?id=140310
     5        rdar://problem/18568864
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Add support for three new text styles.
     10
     11        * css/CSSValueKeywords.in:
     12        * rendering/RenderThemeIOS.mm:
     13        (WebCore::RenderThemeIOS::systemFont):
     14
    1152015-01-09  Anders Carlsson  <andersca@apple.com>
    216
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r177858 r178213  
    4646-apple-system-short-caption1
    4747-apple-system-tall-body
     48-apple-system-title1
     49-apple-system-title2
     50-apple-system-title3
    4851#endif
    4952
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r177955 r178213  
    11201120    static NeverDestroyed<FontDescription> shortCaption1Font;
    11211121    static NeverDestroyed<FontDescription> tallBodyFont;
     1122    static NeverDestroyed<FontDescription> title1Font;
     1123    static NeverDestroyed<FontDescription> title2Font;
     1124    static NeverDestroyed<FontDescription> title3Font;
    11221125
    11231126    static CFStringRef userTextSize = contentSizeCategory();
     
    11561159            fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(textStyle, userTextSize, 0));
    11571160        break;
     1161    case CSSValueAppleSystemTitle1:
     1162        cachedDesc = &title1Font.get();
     1163        textStyle = kCTUIFontTextStyleTitle1;
     1164        if (!title1Font.get().isAbsoluteSize())
     1165            fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(textStyle, userTextSize, 0));
     1166        break;
     1167    case CSSValueAppleSystemTitle2:
     1168        cachedDesc = &title2Font.get();
     1169        textStyle = kCTUIFontTextStyleTitle2;
     1170        if (!title2Font.get().isAbsoluteSize())
     1171            fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(textStyle, userTextSize, 0));
     1172        break;
     1173    case CSSValueAppleSystemTitle3:
     1174        cachedDesc = &title3Font.get();
     1175        textStyle = kCTUIFontTextStyleTitle3;
     1176        if (!title3Font.get().isAbsoluteSize())
     1177            fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(textStyle, userTextSize, 0));
     1178        break;
    11581179    case CSSValueAppleSystemSubheadline:
    11591180        cachedDesc = &subheadlineFont.get();
  • trunk/Source/WebInspectorUI/ChangeLog

    r178184 r178213  
     12015-01-09  Enrica Casucci  <enrica@apple.com>
     2
     3        [iOS] Support additional text styles.
     4        https://bugs.webkit.org/show_bug.cgi?id=140310
     5        rdar://problem/18568864
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        Add support for three new text styles.
     10
     11        * UserInterface/Models/CSSKeywordCompletions.js:
     12
    1132015-01-09  Timothy Hatcher  <timothy@apple.com>
    214
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js

    r173705 r178213  
    452452        "-apple-system-subheadline", "-apple-system-footnote", "-apple-system-caption1", "-apple-system-caption2",
    453453        "-apple-system-short-headline", "-apple-system-short-body", "-apple-system-short-subheadline",
    454         "-apple-system-short-footnote", "-apple-system-short-caption1", "-apple-system-tall-body"
     454        "-apple-system-short-footnote", "-apple-system-short-caption1", "-apple-system-tall-body",
     455        "-apple-system-title1", "-apple-system-title2", "-apple-system-title3"
    455456    ],
    456457    "text-overflow-mode": [
Note: See TracChangeset for help on using the changeset viewer.