Bug 203828

Summary: TestWebKitAPI.WebKit.DocumentEditingContext is failing on iPad
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Tools / TestsAssignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: mmaxfield, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 13   
Bug Depends on: 203817    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
To Land none

Description Daniel Bates 2019-11-04 15:15:46 PST
On iPad, TestWebKitAPI.WebKit.DocumentEditingContext fails with output like:

[[
/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:213
Expected equality of these values:
  23
  rects[0].CGRectValue.size.width
    Which is: 16


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:213
Expected equality of these values:
  24
  rects[0].CGRectValue.size.height
    Which is: 17


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:214
Expected equality of these values:
  23
  rects[1].CGRectValue.origin.x
    Which is: 16


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:214
Expected equality of these values:
  23
  rects[1].CGRectValue.size.width
    Which is: 16


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:214
Expected equality of these values:
  24
  rects[1].CGRectValue.size.height
    Which is: 17


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:215
Expected equality of these values:
  46
  rects[2].CGRectValue.origin.x
    Which is: 32


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:215
Expected equality of these values:
  23
  rects[2].CGRectValue.size.width
    Which is: 16


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:215
Expected equality of these values:
  24
  rects[2].CGRectValue.size.height
    Which is: 17


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:216
Expected equality of these values:
  69
  rects[3].CGRectValue.origin.x
    Which is: 48


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:216
Expected equality of these values:
  23
  rects[3].CGRectValue.size.width
    Which is: 16


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:216
Expected equality of these values:
  24
  rects[3].CGRectValue.size.height
    Which is: 17


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:224
Expected equality of these values:
  23
  rects.firstObject.CGRectValue.size.width
    Which is: 16


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:224
Expected equality of these values:
  24
  rects.firstObject.CGRectValue.size.height
    Which is: 17


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:227
Expected equality of these values:
  138
  rects.firstObject.CGRectValue.origin.x
    Which is: 96


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:227
Expected equality of these values:
  23
  rects.firstObject.CGRectValue.size.width
    Which is: 16


/Volumes/.../Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:227
Expected equality of these values:
  24
  rects.firstObject.CGRectValue.size.height
    Which is: 17
]]
Comment 1 Daniel Bates 2019-11-04 15:15:56 PST
<rdar://problem/55854631>
Comment 2 Daniel Bates 2019-11-04 15:27:08 PST
Created attachment 382781 [details]
Patch

This patch will fail to apply because it depends on patch for bug #203817.
Comment 3 Daniel Bates 2019-11-04 20:52:38 PST
EWS reports the test failed on iOS:

[[
    
    /Volumes/Data/worker/iOS-13-Simulator-Build-EWS/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:209
    Expected equality of these values:
      CGRectMake(0, 0, glyphWidth, glyphWidth)
        Which is: (origin = (x = 0, y = 0), size = (width = 25, height = 25))
      rects[0].CGRectValue
        Which is: (origin = (x = 0, y = 0), size = (width = 30, height = 30))
    
    
    /Volumes/Data/worker/iOS-13-Simulator-Build-EWS/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:210
    Expected equality of these values:
      CGRectMake(glyphWidth, 0, glyphWidth, glyphWidth)
        Which is: (origin = (x = 25, y = 0), size = (width = 25, height = 25))
      rects[1].CGRectValue
        Which is: (origin = (x = 30, y = 0), size = (width = 30, height = 30))
    
    
    /Volumes/Data/worker/iOS-13-Simulator-Build-EWS/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:211
    Expected equality of these values:
      CGRectMake(2 * glyphWidth, 0, glyphWidth, glyphWidth)
        Which is: (origin = (x = 50, y = 0), size = (width = 25, height = 25))
      rects[2].CGRectValue
        Which is: (origin = (x = 60, y = 0), size = (width = 30, height = 30))
    
    
    /Volumes/Data/worker/iOS-13-Simulator-Build-EWS/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:212
    Expected equality of these values:
      CGRectMake(3 * glyphWidth, 0, glyphWidth, glyphWidth)
        Which is: (origin = (x = 75, y = 0), size = (width = 25, height = 25))
      rects[3].CGRectValue
        Which is: (origin = (x = 90, y = 0), size = (width = 30, height = 30))
    
    
    /Volumes/Data/worker/iOS-13-Simulator-Build-EWS/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:220
    Expected equality of these values:
      CGRectMake(0, 0, glyphWidth, glyphWidth)
        Which is: (origin = (x = 0, y = 0), size = (width = 25, height = 25))
      rects.firstObject.CGRectValue
        Which is: (origin = (x = 0, y = 0), size = (width = 30, height = 30))
    
    
    /Volumes/Data/worker/iOS-13-Simulator-Build-EWS/build/Tools/TestWebKitAPI/Tests/WebKitCocoa/DocumentEditingContext.mm:223
    Expected equality of these values:
      CGRectMake(6 * glyphWidth, 0, glyphWidth, glyphWidth)
        Which is: (origin = (x = 150, y = 0), size = (width = 25, height = 25))
      rects.firstObject.CGRectValue
        Which is: (origin = (x = 180, y = 0), size = (width = 30, height = 30))
]]

Why is the width 30!?!? I asked for 25px square glyphs. Something is blowing up the rects...
Comment 4 Daniel Bates 2019-11-05 10:06:11 PST
It's the viewport. I was testing my patch with an iPad simulator. EWS uses the iPhone simulator.
Comment 5 Daniel Bates 2019-11-05 10:17:40 PST
If I put:

<meta name='viewport' content='initial-scale=2'>

Then the test passes in both iPad 9.7 and iPhone 8 simulators. I don't understand...
Comment 6 Tim Horton 2019-11-05 10:20:42 PST
(In reply to Daniel Bates from comment #5)
> If I put:
> 
> <meta name='viewport' content='initial-scale=2'>
> 
> Then the test passes in both iPad 9.7 and iPhone 8 simulators. I don't
> understand...

Is it text autosizing?
Comment 7 Daniel Bates 2019-11-05 10:26:39 PST
(In reply to Tim Horton from comment #6)
> (In reply to Daniel Bates from comment #5)
> > If I put:
> > 
> > <meta name='viewport' content='initial-scale=2'>
> > 
> > Then the test passes in both iPad 9.7 and iPhone 8 simulators. I don't
> > understand...
> 
> Is it text autosizing?

Yes
Comment 8 Daniel Bates 2019-11-05 10:26:54 PST
(In reply to Daniel Bates from comment #7)
> (In reply to Tim Horton from comment #6)
> > (In reply to Daniel Bates from comment #5)
> > > If I put:
> > > 
> > > <meta name='viewport' content='initial-scale=2'>
> > > 
> > > Then the test passes in both iPad 9.7 and iPhone 8 simulators. I don't
> > > understand...
> > 
> > Is it text autosizing?
> 
> Yes

Forgot...
Comment 9 Daniel Bates 2019-11-05 10:38:14 PST
Created attachment 382833 [details]
To Land
Comment 10 Daniel Bates 2019-11-05 10:39:55 PST
Comment on attachment 382833 [details]
To Land

Clearing flags on attachment: 382833

Committed r252061: <https://trac.webkit.org/changeset/252061>
Comment 11 Daniel Bates 2019-11-05 10:39:57 PST
All reviewed patches have been landed.  Closing bug.