Changeset 105468 in webkit


Ignore:
Timestamp:
Jan 19, 2012 5:47:41 PM (12 years ago)
Author:
caryclark@google.com
Message:

[Skia Mac] Match style of platform error underline for misspellings
https://bugs.webkit.org/show_bug.cgi?id=76556

Reviewed by Stephen White.

Source/WebCore:

Add Darwin-specific code in Skia to draw the error underline so that
it matches the CoreGraphics style.

Many existing layout tests inadvertantly trigger the misspelling
underline by including the word 'foo' in an editable field. Those
tests are temporarily suppressed separately in an edit to
test_expectations.txt.

  • platform/graphics/skia/GraphicsContextSkia.cpp:

(WebCore::GraphicsContext::drawLineForTextChecking):

LayoutTests:

Suppress editing tests with misspellings, since the error underline
is drawn differently.

  • platform/chromium/test_expectations.txt:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r105466 r105468  
     12012-01-19  Cary Clark  <caryclark@google.com>
     2
     3        [Skia Mac] Match style of platform error underline for misspellings
     4        https://bugs.webkit.org/show_bug.cgi?id=76556
     5
     6        Reviewed by Stephen White.
     7
     8        Suppress editing tests with misspellings, since the error underline
     9        is drawn differently.
     10
     11        * platform/chromium/test_expectations.txt:
     12
    1132012-01-19  Stephen Chenney  <schenney@chromium.org>
    214
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r105466 r105468  
    39173917BUGWK76646 : svg/foreignObject/text-tref-02-b.svg = TEXT
    39183918
     3919// Change error (misspelling) underlines from Windows look to Mac look.
     3920BUG_CARYCLARK MAC : editing/deleting/delete-3928305-fix.html = IMAGE
     3921BUG_CARYCLARK MAC : editing/deleting/delete-3959464-fix.html = IMAGE
     3922BUG_CARYCLARK MAC : editing/deleting/delete-and-undo.html = IMAGE
     3923BUG_CARYCLARK MAC : editing/deleting/delete-block-contents-003.html = IMAGE
     3924BUG_CARYCLARK MAC : editing/deleting/delete-contiguous-ws-001.html = IMAGE
     3925BUG_CARYCLARK MAC : editing/deleting/delete-tab-002.html = IMAGE
     3926BUG_CARYCLARK MAC : editing/deleting/delete-tab-003.html = IMAGE
     3927BUG_CARYCLARK MAC : editing/deleting/delete-to-select-table.html = IMAGE
     3928BUG_CARYCLARK MAC : editing/deleting/delete-trailing-ws-002.html = IMAGE
     3929BUG_CARYCLARK MAC : editing/deleting/delete-ws-fixup-001.html = IMAGE
     3930BUG_CARYCLARK MAC : editing/deleting/delete-ws-fixup-002.html = IMAGE
     3931BUG_CARYCLARK MAC : editing/execCommand/5569741.html = IMAGE
     3932BUG_CARYCLARK MAC : editing/execCommand/insert-list-and-stitch.html = IMAGE
     3933BUG_CARYCLARK MAC : editing/execCommand/insertHorizontalRule.html = IMAGE
     3934BUG_CARYCLARK MAC : editing/inserting/5418891.html = IMAGE
     3935BUG_CARYCLARK MAC : editing/inserting/editing-empty-divs.html = IMAGE
     3936BUG_CARYCLARK MAC : editing/inserting/insert-br-004.html = IMAGE
     3937BUG_CARYCLARK MAC : editing/inserting/insert-br-005.html = IMAGE
     3938BUG_CARYCLARK MAC : editing/inserting/insert-br-007.html = IMAGE
     3939BUG_CARYCLARK MAC : editing/inserting/insert-div-007.html = IMAGE
     3940BUG_CARYCLARK MAC : editing/inserting/insert-div-012.html = IMAGE
     3941BUG_CARYCLARK MAC : editing/inserting/insert-div-013.html = IMAGE
     3942BUG_CARYCLARK MAC : editing/inserting/insert-div-014.html = IMAGE
     3943BUG_CARYCLARK MAC : editing/inserting/insert-div-015.html = IMAGE
     3944BUG_CARYCLARK MAC : editing/inserting/insert-div-016.html = IMAGE
     3945BUG_CARYCLARK MAC : editing/inserting/insert-div-017.html = IMAGE
     3946BUG_CARYCLARK MAC : editing/inserting/insert-div-018.html = IMAGE
     3947BUG_CARYCLARK MAC : editing/inserting/insert-div-019.html = IMAGE
     3948BUG_CARYCLARK MAC : editing/inserting/insert-div-020.html = IMAGE
     3949BUG_CARYCLARK MAC : editing/inserting/insert-div-022.html = IMAGE
     3950BUG_CARYCLARK MAC : editing/inserting/insert-div-025.html = IMAGE
     3951BUG_CARYCLARK MAC : editing/inserting/insert-div-027.html = IMAGE
     3952BUG_CARYCLARK MAC : editing/inserting/insert-paragraph-02.html = IMAGE
     3953BUG_CARYCLARK MAC : editing/inserting/insert-paragraph-03.html = IMAGE
     3954BUG_CARYCLARK MAC : editing/inserting/insert-tab-002.html = IMAGE
     3955BUG_CARYCLARK MAC : editing/inserting/insert-tab-003.html = IMAGE
     3956BUG_CARYCLARK MAC : editing/inserting/insert-text-with-newlines.html = IMAGE
     3957BUG_CARYCLARK MAC : editing/inserting/paragraph-separator-01.html = IMAGE
     3958BUG_CARYCLARK MAC : editing/inserting/paragraph-separator-02.html = IMAGE
     3959BUG_CARYCLARK MAC : editing/inserting/paragraph-separator-03.html = IMAGE
     3960BUG_CARYCLARK MAC : editing/inserting/return-key-with-selection-001.html = IMAGE
     3961BUG_CARYCLARK MAC : editing/inserting/return-key-with-selection-002.html = IMAGE
     3962BUG_CARYCLARK MAC : editing/inserting/return-key-with-selection-003.html = IMAGE
     3963BUG_CARYCLARK MAC : editing/inserting/typing-002.html = IMAGE
     3964BUG_CARYCLARK MAC : editing/inserting/typing-around-br-001.html = IMAGE
     3965BUG_CARYCLARK MAC : editing/pasteboard/4242293.html = IMAGE
     3966BUG_CARYCLARK MAC : editing/pasteboard/4944770-1.html = IMAGE
     3967BUG_CARYCLARK MAC : editing/pasteboard/8145-2.html = IMAGE
     3968BUG_CARYCLARK MAC : editing/pasteboard/cut-text-001.html = IMAGE
     3969BUG_CARYCLARK MAC : editing/pasteboard/merge-after-delete-1.html = IMAGE
     3970BUG_CARYCLARK MAC : editing/pasteboard/merge-after-delete-2.html = IMAGE
     3971BUG_CARYCLARK MAC : editing/pasteboard/merge-after-delete.html = IMAGE
     3972BUG_CARYCLARK MAC : editing/pasteboard/merge-end-blockquote.html = IMAGE
     3973BUG_CARYCLARK MAC : editing/pasteboard/paste-text-013.html = IMAGE
     3974BUG_CARYCLARK MAC : editing/pasteboard/paste-text-014.html = IMAGE
     3975BUG_CARYCLARK MAC : editing/pasteboard/paste-text-019.html = IMAGE
     3976BUG_CARYCLARK MAC : editing/pasteboard/undoable-fragment-removes.html = IMAGE
     3977BUG_CARYCLARK MAC : editing/selection/13804.html = IMAGE
     3978BUG_CARYCLARK MAC : editing/selection/5234383-1.html = IMAGE
     3979BUG_CARYCLARK MAC : editing/selection/5234383-2.html = IMAGE
     3980BUG_CARYCLARK MAC : editing/selection/extend-by-word-001.html = IMAGE
     3981BUG_CARYCLARK MAC : editing/selection/move-backwords-by-word-001.html = IMAGE
     3982BUG_CARYCLARK MAC : editing/selection/move-by-character-001.html = IMAGE
     3983BUG_CARYCLARK MAC : editing/selection/move-by-line-001.html = IMAGE
     3984BUG_CARYCLARK MAC : editing/selection/move-by-word-001.html = IMAGE
     3985BUG_CARYCLARK MAC : editing/selection/select-from-textfield-outwards.html = IMAGE
     3986BUG_CARYCLARK MAC : editing/selection/unrendered-002.html = IMAGE
     3987BUG_CARYCLARK MAC : editing/spelling/inline_spelling_markers.html = IMAGE
     3988BUG_CARYCLARK MAC : editing/spelling/spelling.html = IMAGE
     3989BUG_CARYCLARK MAC : editing/style/5046875-2.html = IMAGE
     3990BUG_CARYCLARK MAC : editing/style/block-styles-007.html = IMAGE
     3991BUG_CARYCLARK MAC : editing/style/create-block-for-style-002.html = IMAGE
     3992BUG_CARYCLARK MAC : editing/style/create-block-for-style-003.html = IMAGE
     3993BUG_CARYCLARK MAC : editing/style/create-block-for-style-004.html = IMAGE
     3994BUG_CARYCLARK MAC : editing/style/create-block-for-style-006.html = IMAGE
     3995BUG_CARYCLARK MAC : editing/style/create-block-for-style-008.html = IMAGE
     3996BUG_CARYCLARK MAC : editing/style/create-block-for-style-009.html = IMAGE
     3997BUG_CARYCLARK MAC : editing/style/create-block-for-style-011.html = IMAGE
     3998BUG_CARYCLARK MAC : editing/style/create-block-for-style-012.html = IMAGE
     3999BUG_CARYCLARK MAC : editing/style/create-block-for-style-013.html = IMAGE
     4000
    39194001// Need to implement file name logging.
    39204002BUGWK76572 : http/tests/download = FAIL
  • trunk/Source/WebCore/ChangeLog

    r105467 r105468  
     12012-01-19  Cary Clark  <caryclark@google.com>
     2
     3        [Skia Mac] Match style of platform error underline for misspellings
     4        https://bugs.webkit.org/show_bug.cgi?id=76556
     5
     6        Reviewed by Stephen White.
     7
     8        Add Darwin-specific code in Skia to draw the error underline so that
     9        it matches the CoreGraphics style.
     10
     11        Many existing layout tests inadvertantly trigger the misspelling
     12        underline by including the word 'foo' in an editable field. Those
     13        tests are temporarily suppressed separately in an edit to
     14        test_expectations.txt.
     15
     16        * platform/graphics/skia/GraphicsContextSkia.cpp:
     17        (WebCore::GraphicsContext::drawLineForTextChecking):
     18
    1192012-01-19  No'am Rosenthal  <noam.rosenthal@nokia.com>
    220
  • trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r104861 r105468  
    657657    static SkBitmap* misspellBitmap = 0;
    658658    if (!misspellBitmap) {
     659#if PLATFORM(CHROMIUM) && OS(DARWIN)
     660        // Match the artwork used by the Mac.
     661        const int rowPixels = 4;
     662        const int colPixels = 3;
     663#else
    659664        // We use a 2-pixel-high misspelling indicator because that seems to be
    660665        // what WebKit is designed for, and how much room there is in a typical
     
    662667        const int rowPixels = 32;  // Must be multiple of 4 for pattern below.
    663668        const int colPixels = 2;
     669#endif
    664670        misspellBitmap = new SkBitmap;
    665671        misspellBitmap->setConfig(SkBitmap::kARGB_8888_Config,
     
    668674
    669675        misspellBitmap->eraseARGB(0, 0, 0, 0);
     676#if PLATFORM(CHROMIUM) && OS(DARWIN)
     677        const uint32_t colors[] = { 0x2A2A0600, 0x57571000, // left half of 4x3
     678                                    0xA8A81B00, 0xBFBF1F00,
     679                                    0x70701200, 0xE0E02400 };
     680        const uint32_t transparentColor = 0x00000000;
     681
     682        // Pattern: a b a   a b a
     683        //          c d c   c d c
     684        //          e f e   e f e
     685        for (int x = 0; x < colPixels; ++x) {
     686            uint32_t* row = misspellBitmap->getAddr32(0, x);
     687            row[0] = colors[x * 2];
     688            row[1] = colors[x * 2 + 1];
     689            row[2] = colors[x * 2];
     690            row[3] = transparentColor;
     691        }
     692#else
    670693        const uint32_t lineColor = 0xFFFF0000;  // Opaque red.
    671694        const uint32_t antiColor = 0x60600000;  // Semitransparent red.
     
    693716            }
    694717        }
    695     }
    696 
     718#endif
     719    }
     720
     721    SkScalar originX = WebCoreFloatToSkScalar(pt.x());
     722#if PLATFORM(CHROMIUM) && OS(DARWIN)
     723    SkScalar originY = WebCoreFloatToSkScalar(pt.y());
     724#else
    697725    // Offset it vertically by 1 so that there's some space under the text.
    698     SkScalar originX = WebCoreFloatToSkScalar(pt.x());
    699726    SkScalar originY = WebCoreFloatToSkScalar(pt.y()) + 1;
     727#endif
    700728
    701729    // Make a shader for the bitmap with an origin of the box we'll draw. This
Note: See TracChangeset for help on using the changeset viewer.