[webkit-changes] [221690] trunk/Tools

2017-09-06 Thread mmaxfield
Title: [221690] trunk/Tools








Revision 221690
Author mmaxfi...@apple.com
Date 2017-09-06 12:34:29 -0700 (Wed, 06 Sep 2017)


Log Message
WSL should support the bool type
https://bugs.webkit.org/show_bug.cgi?id=176285

Reviewed by Filip Pizlo.

I forgot to commit a couple files.

* WebGPUShadingLanguageRI/StandardLibraryEpilogue.js: Added.
(const.standardLibraryEpilogue.operator.bool.T.Equatable):
* WebGPUShadingLanguageRI/StandardLibraryPrologue.js: Added.
(operator.T.T):

Modified Paths

trunk/Tools/ChangeLog


Added Paths

trunk/Tools/WebGPUShadingLanguageRI/StandardLibraryEpilogue.js
trunk/Tools/WebGPUShadingLanguageRI/StandardLibraryPrologue.js




Diff

Modified: trunk/Tools/ChangeLog (221689 => 221690)

--- trunk/Tools/ChangeLog	2017-09-06 18:49:47 UTC (rev 221689)
+++ trunk/Tools/ChangeLog	2017-09-06 19:34:29 UTC (rev 221690)
@@ -1,5 +1,19 @@
 2017-09-06  Myles C. Maxfield  
 
+WSL should support the bool type
+https://bugs.webkit.org/show_bug.cgi?id=176285
+
+Reviewed by Filip Pizlo.
+
+I forgot to commit a couple files.
+
+* WebGPUShadingLanguageRI/StandardLibraryEpilogue.js: Added.
+(const.standardLibraryEpilogue.operator.bool.T.Equatable):
+* WebGPUShadingLanguageRI/StandardLibraryPrologue.js: Added.
+(operator.T.T):
+
+2017-09-06  Myles C. Maxfield  
+
 WSL should correctly handle the interaction between casting operators and complex types
 https://bugs.webkit.org/show_bug.cgi?id=176316
 


Added: trunk/Tools/WebGPUShadingLanguageRI/StandardLibraryEpilogue.js (0 => 221690)

--- trunk/Tools/WebGPUShadingLanguageRI/StandardLibraryEpilogue.js	(rev 0)
+++ trunk/Tools/WebGPUShadingLanguageRI/StandardLibraryEpilogue.js	2017-09-06 19:34:29 UTC (rev 221690)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+"use strict";
+
+// NOTE: The next line is line 28, and we rely on this in Prepare.js.
+const standardLibraryEpilogue = `
+operator bool<>(T x) {
+T defaultValue;
+return x != defaultValue;
+}
+`;


Added: trunk/Tools/WebGPUShadingLanguageRI/StandardLibraryPrologue.js (0 => 221690)

--- trunk/Tools/WebGPUShadingLanguageRI/StandardLibraryPrologue.js	(rev 0)
+++ trunk/Tools/WebGPUShadingLanguageRI/StandardLibraryPrologue.js	2017-09-06 19:34:29 UTC (rev 221690)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 

[webkit-changes] [221686] trunk/Tools

2017-09-06 Thread mmaxfield
Title: [221686] trunk/Tools








Revision 221686
Author mmaxfi...@apple.com
Date 2017-09-06 11:25:55 -0700 (Wed, 06 Sep 2017)


Log Message
WSL should correctly handle the interaction between casting operators and complex types
https://bugs.webkit.org/show_bug.cgi?id=176316

Reviewed by Filip Pizlo.

This allows the standard library to include all identity cast operators for all exsting
and yet-to-exist types. The standard library now has a function with the signature:
operator T<>(T). This means "for all T, define a cast operator from T to T<>." The
duplicate <>s lets us say things like operator OutputVector(InputVector x).

For testing, this patch also adds the ability to cast an arbitrary Equatable type to bool,
by comparing the value to the default value for that type.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/CastExpression.js: Copied from Tools/WebGPUShadingLanguageRI/NativeFuncInstance.js.
(CastExpression):
(CastExpression.prototype.get functionName):
(CastExpression.prototype.get returnType):
(CastExpression.prototype.toString):
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/Func.js:
(Func.prototype.toDeclString):
* WebGPUShadingLanguageRI/FuncInstantiator.js:
(FuncInstantiator.prototype.getUnique.Instantiate.prototype.visitNativeFunc):
(FuncInstantiator.prototype.getUnique.Instantiate):
(FuncInstantiator.prototype.getUnique):
(FuncInstantiator):
* WebGPUShadingLanguageRI/Inliner.js:
(Inliner.prototype.visitCastExpression):
(Inliner):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/NativeFunc.js:
* WebGPUShadingLanguageRI/NativeFuncInstance.js:
(NativeFuncInstance):
* WebGPUShadingLanguageRI/Parse.js:
(parsePossiblePrefix):
(parseFuncDecl):
(parseOperatorFuncDefValues): Deleted.
(parseNonOperatorFuncDefValues): Deleted.
(parseGenericFuncDefValues): Deleted.
* WebGPUShadingLanguageRI/Prepare.js:
(prepare):
* WebGPUShadingLanguageRI/Program.js:
(Program.prototype.resolveFuncOverload):
* WebGPUShadingLanguageRI/ResolveOverloadImpl.js:
(resolveOverloadImpl):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.processDerivedCallData):
(Rewriter.prototype.visitCastExpression):
(Rewriter.prototype.visitCallExpression):
* WebGPUShadingLanguageRI/StandardLibrary.js: Removed.
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
* WebGPUShadingLanguageRI/TypeDefResolver.js:
(TypeDefResolver):
(TypeDefResolver.prototype.visitFuncDef): Deleted.
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitCastExpression):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/WebGPUShadingLanguageRI/All.js
trunk/Tools/WebGPUShadingLanguageRI/Checker.js
trunk/Tools/WebGPUShadingLanguageRI/Func.js
trunk/Tools/WebGPUShadingLanguageRI/FuncInstantiator.js
trunk/Tools/WebGPUShadingLanguageRI/Inliner.js
trunk/Tools/WebGPUShadingLanguageRI/Intrinsics.js
trunk/Tools/WebGPUShadingLanguageRI/NativeFunc.js
trunk/Tools/WebGPUShadingLanguageRI/NativeFuncInstance.js
trunk/Tools/WebGPUShadingLanguageRI/Parse.js
trunk/Tools/WebGPUShadingLanguageRI/Prepare.js
trunk/Tools/WebGPUShadingLanguageRI/Program.js
trunk/Tools/WebGPUShadingLanguageRI/ResolveOverloadImpl.js
trunk/Tools/WebGPUShadingLanguageRI/Rewriter.js
trunk/Tools/WebGPUShadingLanguageRI/Test.html
trunk/Tools/WebGPUShadingLanguageRI/Test.js
trunk/Tools/WebGPUShadingLanguageRI/TypeDefResolver.js
trunk/Tools/WebGPUShadingLanguageRI/Visitor.js


Added Paths

trunk/Tools/WebGPUShadingLanguageRI/CastExpression.js


Removed Paths

trunk/Tools/WebGPUShadingLanguageRI/StandardLibrary.js




Diff

Modified: trunk/Tools/ChangeLog (221685 => 221686)

--- trunk/Tools/ChangeLog	2017-09-06 18:16:56 UTC (rev 221685)
+++ trunk/Tools/ChangeLog	2017-09-06 18:25:55 UTC (rev 221686)
@@ -1,3 +1,65 @@
+2017-09-06  Myles C. Maxfield  
+
+WSL should correctly handle the interaction between casting operators and complex types
+https://bugs.webkit.org/show_bug.cgi?id=176316
+
+Reviewed by Filip Pizlo.
+
+This allows the standard library to include all identity cast operators for all exsting
+and yet-to-exist types. The standard library now has a function with the signature:
+operator T<>(T). This means "for all T, define a cast operator from T to T<>." The
+duplicate <>s lets us say things like operator OutputVector(InputVector x).
+
+For testing, this patch also adds the ability to cast an arbitrary Equatable type to bool,
+by comparing the value to the default value for that type.
+
+* WebGPUShadingLanguageRI/All.js:
+* WebGPUShadingLanguageRI/CastExpression.js: Copied from Tools/WebGPUShadingLanguageRI/NativeFuncInstance.js.
+(CastExpression):
+(CastExpression.prototype.get functionName):
+(CastExpression.prototype.get returnType):
+(CastExpression.prototype.toString):
+* WebGPUShadingLanguageRI/Checker.js:
+* WebGPUShadingLanguageRI/Func.js:
+   

[webkit-changes] [221634] trunk/Tools

2017-09-05 Thread mmaxfield
Title: [221634] trunk/Tools








Revision 221634
Author mmaxfi...@apple.com
Date 2017-09-05 14:11:59 -0700 (Tue, 05 Sep 2017)


Log Message
WSL should support the bool type
https://bugs.webkit.org/show_bug.cgi?id=176285

Reviewed by Filip Pizlo.

Very similar to the int and uint types. This patch also adds support for a logical negation _expression_ "!x".
This patch also reverts the ability of the program author to create their own "operator!()", and instead
adds the ability of the program author to create their own "operator bool()". The code is generic, so
programmers can make two arbitrary types Foo and Bar, and implement a "operator Bar(Foo)." The logical
negation _expression_ is a built-in, and requires its argument be a bool.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/BoolLiteral.js: Copied from Tools/WebGPUShadingLanguageRI/NativeFunc.js.
(BoolLiteral):
(BoolLiteral.prototype.get value):
(BoolLiteral.prototype.get isConstexpr):
(BoolLiteral.prototype.toString):
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitBoolLiteral):
(Evaluator.prototype.visitLogicalNot):
* WebGPUShadingLanguageRI/Func.js:
(Func):
(Func.prototype.get isCast):
(Func.prototype.toDeclString):
* WebGPUShadingLanguageRI/FuncDef.js:
(FuncDef):
(FuncDef.prototype.get body):
(FuncDef.prototype.rewrite):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/LogicalNot.js: Copied from Tools/WebGPUShadingLanguageRI/NativeFunc.js.
(LogicalNot):
(LogicalNot.prototype.get operand):
(LogicalNot.prototype.toString):
* WebGPUShadingLanguageRI/NativeFunc.js:
(NativeFunc):
* WebGPUShadingLanguageRI/Parse.js:
(parseTerm):
(parsePossiblePrefix):
(parsePossibleRelationalEquality):
(parseFuncName):
(parseOperatorFuncDefValues):
(parseNonOperatorFuncDefValues):
(parseGenericFuncDefValues):
(parseFuncDecl):
(parseProtocolFuncDecl):
(parseFuncDef):
(parseNative):
(parse):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitBoolLiteral):
(Rewriter.prototype.visitLogicalNot):
(Rewriter):
* WebGPUShadingLanguageRI/StandardLibrary.js:
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(makeUInt):
(makeBool):
(checkUInt):
(checkBool):
(TEST_literalBool):
(TEST_identityBool):
(TEST_intSimpleMath):
(TEST_uintSimpleMath):
(TEST_equality):
(TEST_logicalNegation):
(TEST_notEquality):
(TEST_equalityTypeFailure):
(TEST_add1): Deleted.
* WebGPUShadingLanguageRI/TypeDefResolver.js:
(TypeDefResolver.prototype.visitFuncDef):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitBoolLiteral):
(Visitor.prototype.visitLogicalNot):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/WebGPUShadingLanguageRI/All.js
trunk/Tools/WebGPUShadingLanguageRI/Checker.js
trunk/Tools/WebGPUShadingLanguageRI/Evaluator.js
trunk/Tools/WebGPUShadingLanguageRI/Func.js
trunk/Tools/WebGPUShadingLanguageRI/FuncDef.js
trunk/Tools/WebGPUShadingLanguageRI/Intrinsics.js
trunk/Tools/WebGPUShadingLanguageRI/Lexer.js
trunk/Tools/WebGPUShadingLanguageRI/NativeFunc.js
trunk/Tools/WebGPUShadingLanguageRI/Parse.js
trunk/Tools/WebGPUShadingLanguageRI/Rewriter.js
trunk/Tools/WebGPUShadingLanguageRI/StandardLibrary.js
trunk/Tools/WebGPUShadingLanguageRI/Test.html
trunk/Tools/WebGPUShadingLanguageRI/Test.js
trunk/Tools/WebGPUShadingLanguageRI/TypeDefResolver.js
trunk/Tools/WebGPUShadingLanguageRI/Visitor.js


Added Paths

trunk/Tools/WebGPUShadingLanguageRI/BoolLiteral.js
trunk/Tools/WebGPUShadingLanguageRI/LogicalNot.js




Diff

Modified: trunk/Tools/ChangeLog (221633 => 221634)

--- trunk/Tools/ChangeLog	2017-09-05 21:00:23 UTC (rev 221633)
+++ trunk/Tools/ChangeLog	2017-09-05 21:11:59 UTC (rev 221634)
@@ -1,3 +1,84 @@
+2017-09-05  Myles C. Maxfield  
+
+WSL should support the bool type
+https://bugs.webkit.org/show_bug.cgi?id=176285
+
+Reviewed by Filip Pizlo.
+
+Very similar to the int and uint types. This patch also adds support for a logical negation _expression_ "!x".
+This patch also reverts the ability of the program author to create their own "operator!()", and instead
+adds the ability of the program author to create their own "operator bool()". The code is generic, so
+programmers can make two arbitrary types Foo and Bar, and implement a "operator Bar(Foo)." The logical
+negation _expression_ is a built-in, and requires its argument be a bool.
+
+* WebGPUShadingLanguageRI/All.js:
+* WebGPUShadingLanguageRI/BoolLiteral.js: Copied from Tools/WebGPUShadingLanguageRI/NativeFunc.js.
+(BoolLiteral):
+(BoolLiteral.prototype.get value):
+(BoolLiteral.prototype.get isConstexpr):
+(BoolLiteral.prototype.toString):
+* WebGPUShadingLanguageRI/Checker.js:
+* WebGPUShadingLanguageRI/Evaluator.js:
+(Evaluator.prototype.visitBoolLiteral):
+

[webkit-changes] [221630] trunk

2017-09-05 Thread mmaxfield
Title: [221630] trunk








Revision 221630
Author mmaxfi...@apple.com
Date 2017-09-05 12:57:08 -0700 (Tue, 05 Sep 2017)


Log Message
Update font selection algorithm to match latest CSS spec
https://bugs.webkit.org/show_bug.cgi?id=175236

Reviewed by Darin Adler.

Source/WebCore:

The CSS WG tweaked the generalization of the font selection
algorithm between levels 3 and 4. In particular, the behavior
of weights between 400 and 500 works a little differently.

https://github.com/w3c/csswg-drafts/commit/f6973a21847f1c200ed38bff05dc543cebe1c827

Test: fast/text/variations/font-selection-font-weight.html

* platform/graphics/FontSelectionAlgorithm.cpp:
(WebCore::FontSelectionAlgorithm::weightDistance const):
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::lowerWeightSearchThreshold):
(WebCore::upperWeightSearchThreshold):
(WebCore::weightSearchThreshold): Deleted.

LayoutTests:

* fast/text/variations/font-selection-font-weight-expected.html: Added.
* fast/text/variations/font-selection-font-weight.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp
trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h


Added Paths

trunk/LayoutTests/fast/text/variations/font-selection-font-weight-expected.html
trunk/LayoutTests/fast/text/variations/font-selection-font-weight.html




Diff

Modified: trunk/LayoutTests/ChangeLog (221629 => 221630)

--- trunk/LayoutTests/ChangeLog	2017-09-05 19:56:07 UTC (rev 221629)
+++ trunk/LayoutTests/ChangeLog	2017-09-05 19:57:08 UTC (rev 221630)
@@ -1,3 +1,13 @@
+2017-09-05  Myles C. Maxfield  
+
+Update font selection algorithm to match latest CSS spec
+https://bugs.webkit.org/show_bug.cgi?id=175236
+
+Reviewed by Darin Adler.
+
+* fast/text/variations/font-selection-font-weight-expected.html: Added.
+* fast/text/variations/font-selection-font-weight.html: Added.
+
 2017-09-05  Matt Lewis  
 
 Marked media/W3C/video/events/event_progress.html as flaky.


Added: trunk/LayoutTests/fast/text/variations/font-selection-font-weight-expected.html (0 => 221630)

--- trunk/LayoutTests/fast/text/variations/font-selection-font-weight-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/variations/font-selection-font-weight-expected.html	2017-09-05 19:57:08 UTC (rev 221630)
@@ -0,0 +1,554 @@
+
+
+
+
+.namespace {
+display: inline-block;
+height: 48px;
+width: 48px;
+border: 0px;
+}
+#container {
+line-height: 48px;
+}
+
+
+
+This test makes sure that that font selection distance function is correctly honored when selecting for font-weight. The test passes if you only see black rectangles below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


Added: trunk/LayoutTests/fast/text/variations/font-selection-font-weight.html (0 => 221630)

--- trunk/LayoutTests/fast/text/variations/font-selection-font-weight.html	(rev 0)
+++ trunk/LayoutTests/fast/text/variations/font-selection-font-weight.html	2017-09-05 19:57:08 UTC (rev 221630)
@@ -0,0 +1,1067 @@
+
+
+
+
+.namespace {
+display: inline-block;
+height: 48px;
+width: 48px;
+border: 0px;
+}
+#container {
+line-height: 48px;
+}
+
+
+
+This test makes sure that that font selection distance function is correctly honored when selecting for font-weight. The test passes if you only see black rectangles below.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


Modified: trunk/Source/WebCore/ChangeLog (221629 => 221630)

--- trunk/Source/WebCore/ChangeLog	2017-09-05 19:56:07 UTC (rev 221629)
+++ trunk/Source/WebCore/ChangeLog	2017-09-05 19:57:08 UTC (rev 221630)
@@ -1,3 +1,25 @@
+2017-09-05  Myles C. Maxfield  
+
+Update font selection algorithm to match latest CSS spec
+https://bugs.webkit.org/show_bug.cgi?id=175236
+
+Reviewed by Darin Adler.
+
+The CSS WG tweaked the generalization of the font selection
+algorithm between levels 3 and 4. In particular, the behavior
+of weights between 400 and 500 works a little differently.
+
+https://github.com/w3c/csswg-drafts/commit/f6973a21847f1c200ed38bff05dc543cebe1c827
+
+Test: fast/text/variations/font-selection-font-weight.html
+
+* platform/graphics/FontSelectionAlgorithm.cpp:
+(WebCore::FontSelectionAlgorithm::weightDistance const):
+* platform/graphics/FontSelectionAlgorithm.h:
+(WebCore::lowerWeightSearchThreshold):
+(WebCore::upperWeightSearchThreshold):
+(WebCore::weightSearchThreshold): Deleted.
+
 2017-09-05  Per Arne Vollan  

[webkit-changes] [221508] trunk/Tools

2017-09-01 Thread mmaxfield
Title: [221508] trunk/Tools








Revision 221508
Author mmaxfi...@apple.com
Date 2017-09-01 16:54:23 -0700 (Fri, 01 Sep 2017)


Log Message
WSL's lexer will never emit keyword tokens
https://bugs.webkit.org/show_bug.cgi?id=176248

Reviewed by Filip Pizlo.

Because all tokens are also identified as idents, we need to handle them together.

* WebGPUShadingLanguageRI/Lexer.js:
(Lexer.prototype.next):
(Lexer):
* WebGPUShadingLanguageRI/Test.js:
(doLex):
(checkLexerToken):
(TEST_lexerKeyword):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/WebGPUShadingLanguageRI/Lexer.js
trunk/Tools/WebGPUShadingLanguageRI/Test.js




Diff

Modified: trunk/Tools/ChangeLog (221507 => 221508)

--- trunk/Tools/ChangeLog	2017-09-01 23:43:42 UTC (rev 221507)
+++ trunk/Tools/ChangeLog	2017-09-01 23:54:23 UTC (rev 221508)
@@ -1,3 +1,20 @@
+2017-09-01  Myles C. Maxfield  
+
+WSL's lexer will never emit keyword tokens
+https://bugs.webkit.org/show_bug.cgi?id=176248
+
+Reviewed by Filip Pizlo.
+
+Because all tokens are also identified as idents, we need to handle them together.
+
+* WebGPUShadingLanguageRI/Lexer.js:
+(Lexer.prototype.next):
+(Lexer):
+* WebGPUShadingLanguageRI/Test.js:
+(doLex):
+(checkLexerToken):
+(TEST_lexerKeyword):
+
 2017-09-01  Alex Christensen  
 
 Rename WebKit2 API tests after directory rename


Modified: trunk/Tools/WebGPUShadingLanguageRI/Lexer.js (221507 => 221508)

--- trunk/Tools/WebGPUShadingLanguageRI/Lexer.js	2017-09-01 23:43:42 UTC (rev 221507)
+++ trunk/Tools/WebGPUShadingLanguageRI/Lexer.js	2017-09-01 23:54:23 UTC (rev 221508)
@@ -102,8 +102,11 @@
 return null;
 
 // FIXME: Make this do Unicode.
-if (/^[^\d\W]\w*/.test(relevantText))
+if (/^[^\d\W]\w*/.test(relevantText)) {
+if (["struct", "protocol", "typedef", "if", "else", "enum", "continue", "break", "switch", "case", "default", "for", "while", "do", "return", "sizeof", "constant", "device", "threadgroup", "thread", "operator", "null"].includes(RegExp.lastMatch))
+return result("keyword");
 return result("identifier");
+}
 
 if (/^[0-9]+u/.test(relevantText))
 return result("uintLiteral");
@@ -115,9 +118,6 @@
 if (/^([0-9]*\.[0-9]+)|([0-9]+\.[0-9]*)/.test(relevantText))
 return result("doubleLiteral");
 
-if (/^(struct|protocol|typedef|if|else|enum|continue|break|switch|case|default|for|while|do|return|sizeof|constant|device|threadgroup|thread|operator|null)/.test(relevantText))
-return result("keyword");
-
 if (/^([{}()\[\]?:=+*\/,.%!~^&|<>\\;-]|->|=>|<=|==|!=|\+=|-=|\*=|\/=|%=|^=|\|=|&=)/.test(relevantText))
 return result("punctuation");
 


Modified: trunk/Tools/WebGPUShadingLanguageRI/Test.js (221507 => 221508)

--- trunk/Tools/WebGPUShadingLanguageRI/Test.js	2017-09-01 23:43:42 UTC (rev 221507)
+++ trunk/Tools/WebGPUShadingLanguageRI/Test.js	2017-09-01 23:54:23 UTC (rev 221508)
@@ -31,6 +31,19 @@
 return prepare("", 0, code);
 }
 
+function doLex(code)
+{
+let lexer = new Lexer("", 0, code);
+var result = [];
+for (;;) {
+let next = lexer.next();
+if (!next)
+return result;
+result.push(next);
+}
+return result;
+}
+
 function makeInt(program, value)
 {
 return TypedValue.box(program.intrinsics.int32, value);
@@ -43,6 +56,15 @@
 if (result.value != expected)
 throw new Error("Wrong result: " + result + " (expected " + expected + ")");
 }
+function checkLexerToken(result, expectedIndex, expectedKind, expectedText)
+{
+if (result._index != expectedIndex)
+throw new Error("Wrong lexer index; result: " + result._index + " (expected " + expectedIndex + ")");
+if (result._kind != expectedKind)
+throw new Error("Wrong lexer kind; result: " + result._kind + " (expected " + expectedKind + ")");
+if (result._text != expectedText)
+throw new Error("Wrong lexer text; result: " + result._text + " (expected " + expectedText + ")");
+}
 
 function checkFail(callback, predicate)
 {
@@ -314,6 +336,26 @@
 (e) => e instanceof WTypeError && e.message.indexOf("native int32 operator+<>(int32,int32)") != -1);
 }
 
+function TEST_lexerKeyword()
+{
+let result = doLex("ident for while 123 123u { } {asd asd{ 1a3");
+if (result.length != 13)
+throw new Error("Lexer emitted an incorrect number of tokens (expected 12): " + result.length);
+checkLexerToken(result[0],  0,  "identifier", "ident");
+checkLexerToken(result[1],  6,  "keyword", "for");
+checkLexerToken(result[2],  10, "keyword", "while");
+checkLexerToken(result[3],  16, "intLiteral",  "123");
+checkLexerToken(result[4],  20, "uintLiteral", "123u");
+checkLexerToken(result[5],  25, "punctuation", "{");
+ 

[webkit-changes] [221408] trunk

2017-08-30 Thread mmaxfield
Title: [221408] trunk








Revision 221408
Author mmaxfi...@apple.com
Date 2017-08-30 16:46:39 -0700 (Wed, 30 Aug 2017)


Log Message
Previous elements with lang= can affect fonts selected for subsequent elements
https://bugs.webkit.org/show_bug.cgi?id=175959


Reviewed by Zalan Bujtas.

Source/WebCore:

FontCascade::update() was erroneously getting a cache hit. Elements with different lang=
should be distinct inside the FontCascadeCache. We should be keying off of the locale
string instead of the script enum because the string is the thing we actually pass to the
platform APIs when performing font selection. This is a regression because we only
recently (within the past few years) started making font selection sensitive to lang= at
all.

Test: fast/text/lang-font-selection-cache.html

* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::FontDescriptionKey):
(WebCore::FontDescriptionKey::operator== const):
(WebCore::FontDescriptionKey::computeHash const):

LayoutTests:

* fast/text/lang-font-selection-cache-expected.html: Added.
* fast/text/lang-font-selection-cache.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCache.h


Added Paths

trunk/LayoutTests/fast/text/lang-font-selection-cache-expected.html
trunk/LayoutTests/fast/text/lang-font-selection-cache.html




Diff

Modified: trunk/LayoutTests/ChangeLog (221407 => 221408)

--- trunk/LayoutTests/ChangeLog	2017-08-30 23:43:39 UTC (rev 221407)
+++ trunk/LayoutTests/ChangeLog	2017-08-30 23:46:39 UTC (rev 221408)
@@ -1,3 +1,14 @@
+2017-08-30  Myles C. Maxfield  
+
+Previous elements with lang= can affect fonts selected for subsequent elements
+https://bugs.webkit.org/show_bug.cgi?id=175959
+
+
+Reviewed by Zalan Bujtas.
+
+* fast/text/lang-font-selection-cache-expected.html: Added.
+* fast/text/lang-font-selection-cache.html: Added.
+
 2017-08-30  Ryan Haddad  
 
 Unreviewed, rolling out r221327.


Added: trunk/LayoutTests/fast/text/lang-font-selection-cache-expected.html (0 => 221408)

--- trunk/LayoutTests/fast/text/lang-font-selection-cache-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/lang-font-selection-cache-expected.html	2017-08-30 23:46:39 UTC (rev 221408)
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+This test makes sure that a previous element rendered with the same font but different lang doesn't affect the fonts chosen to render a subsequent element.
+
+
+
+
+
+
+


Added: trunk/LayoutTests/fast/text/lang-font-selection-cache.html (0 => 221408)

--- trunk/LayoutTests/fast/text/lang-font-selection-cache.html	(rev 0)
+++ trunk/LayoutTests/fast/text/lang-font-selection-cache.html	2017-08-30 23:46:39 UTC (rev 221408)
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+This test makes sure that a previous element rendered with the same font but different lang doesn't affect the fonts chosen to render a subsequent element.
+
+
+
+
+
+
+
+


Modified: trunk/Source/WebCore/ChangeLog (221407 => 221408)

--- trunk/Source/WebCore/ChangeLog	2017-08-30 23:43:39 UTC (rev 221407)
+++ trunk/Source/WebCore/ChangeLog	2017-08-30 23:46:39 UTC (rev 221408)
@@ -1,3 +1,25 @@
+2017-08-30  Myles C. Maxfield  
+
+Previous elements with lang= can affect fonts selected for subsequent elements
+https://bugs.webkit.org/show_bug.cgi?id=175959
+
+
+Reviewed by Zalan Bujtas.
+
+FontCascade::update() was erroneously getting a cache hit. Elements with different lang=
+should be distinct inside the FontCascadeCache. We should be keying off of the locale
+string instead of the script enum because the string is the thing we actually pass to the
+platform APIs when performing font selection. This is a regression because we only
+recently (within the past few years) started making font selection sensitive to lang= at
+all.
+
+Test: fast/text/lang-font-selection-cache.html
+
+* platform/graphics/FontCache.h:
+(WebCore::FontDescriptionKey::FontDescriptionKey):
+(WebCore::FontDescriptionKey::operator== const):
+(WebCore::FontDescriptionKey::computeHash const):
+
 2017-08-30  Ryan Haddad  
 
 Unreviewed, rolling out r221327.


Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (221407 => 221408)

--- trunk/Source/WebCore/platform/graphics/FontCache.h	2017-08-30 23:43:39 UTC (rev 221407)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h	2017-08-30 23:46:39 UTC (rev 221408)
@@ -74,6 +74,7 @@
 : m_size(description.computedPixelSize())
 , m_fontSelectionRequest(description.fontSelectionRequest())
 , m_flags(makeFlagsKey(description))
+, m_locale(description.locale())
 , m_featureSettings(description.featureSettings())
 #if ENABLE(VARIATION_FONTS)
 

[webkit-changes] [220997] trunk

2017-08-21 Thread mmaxfield
Title: [220997] trunk








Revision 220997
Author mmaxfi...@apple.com
Date 2017-08-21 18:50:34 -0700 (Mon, 21 Aug 2017)


Log Message
DataInteractionTests.ExternalSourceAttributedStringToContentEditable hits a debug assertion
https://bugs.webkit.org/show_bug.cgi?id=175787


Reviewed by Wenson Hsieh.

Source/WebCore:

The variation axis values of San Francisco changed from the GX-style scale to the CSS-style
scale. Previously, we were normalizing the values we got from Core Text to fit the CSS scale;
however, this is no longer necessary since the font now does this itself.

The assertion was getting hit because the normalized values were huge and were overflowing
a single FontSelectionValue (and going negative). This patch adds handling for this
situation.

Test: DataInteractionTests.ExternalSourceBoldSystemAttributedStringToContentEditable

* platform/graphics/FontSelectionAlgorithm.h: Typedef the backing type for a FontSelectionValue.
(WebCore::FontSelectionValue::rawValue const):
(WebCore::FontSelectionValue::maximumValue):
(WebCore::FontSelectionValue::minimumValue):
(WebCore::FontSelectionValue::FontSelectionValue):
* platform/graphics/cocoa/FontCacheCoreText.cpp: Opt-out of normalization for San Francisco.
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::capabilitiesForFontDescriptor):

Tools:

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (220996 => 220997)

--- trunk/Source/WebCore/ChangeLog	2017-08-22 01:32:24 UTC (rev 220996)
+++ trunk/Source/WebCore/ChangeLog	2017-08-22 01:50:34 UTC (rev 220997)
@@ -1,3 +1,30 @@
+2017-08-21  Myles C. Maxfield  
+
+DataInteractionTests.ExternalSourceAttributedStringToContentEditable hits a debug assertion
+https://bugs.webkit.org/show_bug.cgi?id=175787
+
+
+Reviewed by Wenson Hsieh.
+
+The variation axis values of San Francisco changed from the GX-style scale to the CSS-style
+scale. Previously, we were normalizing the values we got from Core Text to fit the CSS scale;
+however, this is no longer necessary since the font now does this itself.
+
+The assertion was getting hit because the normalized values were huge and were overflowing
+a single FontSelectionValue (and going negative). This patch adds handling for this
+situation.
+
+Test: DataInteractionTests.ExternalSourceBoldSystemAttributedStringToContentEditable
+
+* platform/graphics/FontSelectionAlgorithm.h: Typedef the backing type for a FontSelectionValue.
+(WebCore::FontSelectionValue::rawValue const):
+(WebCore::FontSelectionValue::maximumValue):
+(WebCore::FontSelectionValue::minimumValue):
+(WebCore::FontSelectionValue::FontSelectionValue):
+* platform/graphics/cocoa/FontCacheCoreText.cpp: Opt-out of normalization for San Francisco.
+(WebCore::variationCapabilitiesForFontDescriptor):
+(WebCore::capabilitiesForFontDescriptor):
+
 2017-08-21  Chris Dumez  
 
 [Beacon] Content extensions should be able to intercept Beacon / Ping redirects


Modified: trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h (220996 => 220997)

--- trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h	2017-08-22 01:32:24 UTC (rev 220996)
+++ trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h	2017-08-22 01:50:34 UTC (rev 220997)
@@ -40,6 +40,8 @@
 // the maximum representable value is 8191.75, and the minimum representable value is -8192.
 class FontSelectionValue {
 public:
+typedef int16_t BackingType;
+
 FontSelectionValue() = default;
 
 // Explicit because it is lossy.
@@ -72,7 +74,7 @@
 bool operator>(const FontSelectionValue other) const;
 bool operator>=(const FontSelectionValue other) const;
 
-int16_t rawValue() const
+BackingType rawValue() const
 {
 return m_backing;
 }
@@ -79,13 +81,13 @@
 
 static FontSelectionValue maximumValue()
 {
-static NeverDestroyed result = FontSelectionValue(std::numeric_limits::max(), RawTag::RawTag);
+static NeverDestroyed result = FontSelectionValue(std::numeric_limits::max(), RawTag::RawTag);
 return result.get();
 }
 
 static FontSelectionValue minimumValue()
 {
-static NeverDestroyed result = FontSelectionValue(std::numeric_limits::min(), RawTag::RawTag);
+static NeverDestroyed result = FontSelectionValue(std::numeric_limits::min(), RawTag::RawTag);
 return result.get();
 }
 
@@ -101,13 +103,13 @@
 private:
 enum class RawTag { RawTag };
 
-FontSelectionValue(int16_t rawValue, RawTag)

[webkit-changes] [220991] trunk/Tools

2017-08-21 Thread mmaxfield
Title: [220991] trunk/Tools








Revision 220991
Author mmaxfi...@apple.com
Date 2017-08-21 16:39:53 -0700 (Mon, 21 Aug 2017)


Log Message
Typo in "webkit-patch land"
https://bugs.webkit.org/show_bug.cgi?id=175788

Reviewed by Tim Horton.

* Scripts/webkitpy/tool/steps/commit.py:
(Commit._commit_warning):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/Scripts/webkitpy/tool/steps/commit.py




Diff

Modified: trunk/Tools/ChangeLog (220990 => 220991)

--- trunk/Tools/ChangeLog	2017-08-21 23:31:44 UTC (rev 220990)
+++ trunk/Tools/ChangeLog	2017-08-21 23:39:53 UTC (rev 220991)
@@ -1,3 +1,13 @@
+2017-08-21  Myles C. Maxfield  
+
+Typo in "webkit-patch land"
+https://bugs.webkit.org/show_bug.cgi?id=175788
+
+Reviewed by Tim Horton.
+
+* Scripts/webkitpy/tool/steps/commit.py:
+(Commit._commit_warning):
+
 2017-08-20  Sam Weinig  
 
 StringView could use a function to strip leading/trailing characters without allocation


Modified: trunk/Tools/Scripts/webkitpy/tool/steps/commit.py (220990 => 220991)

--- trunk/Tools/Scripts/webkitpy/tool/steps/commit.py	2017-08-21 23:31:44 UTC (rev 220990)
+++ trunk/Tools/Scripts/webkitpy/tool/steps/commit.py	2017-08-21 23:39:53 UTC (rev 220991)
@@ -47,7 +47,7 @@
 ]
 
 def _commit_warning(self, error):
-return ('There are %s local commits (and possibly changes in the working directory. '
+return ('There are %s local commits (and possibly changes in the working directory). '
 'Everything will be committed as a single commit. '
 'To avoid this prompt, set "git config webkit-patch.commit-should-always-squash true".' % (
 error.num_local_commits))






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [220986] trunk/Source/WebCore

2017-08-21 Thread mmaxfield
Title: [220986] trunk/Source/WebCore








Revision 220986
Author mmaxfi...@apple.com
Date 2017-08-21 16:04:28 -0700 (Mon, 21 Aug 2017)


Log Message
Addressing post-review comments after r220725
https://bugs.webkit.org/show_bug.cgi?id=175382

Reviewed by Darin Adler.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setUnicodeRange):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSFontFace.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (220985 => 220986)

--- trunk/Source/WebCore/ChangeLog	2017-08-21 22:17:24 UTC (rev 220985)
+++ trunk/Source/WebCore/ChangeLog	2017-08-21 23:04:28 UTC (rev 220986)
@@ -1,3 +1,13 @@
+2017-08-21  Myles C. Maxfield  
+
+Addressing post-review comments after r220725
+https://bugs.webkit.org/show_bug.cgi?id=175382
+
+Reviewed by Darin Adler.
+
+* css/CSSFontFace.cpp:
+(WebCore::CSSFontFace::setUnicodeRange):
+
 2017-08-21  Youenn Fablet  
 
 [Cache API] Add support for CacheStorage.match


Modified: trunk/Source/WebCore/css/CSSFontFace.cpp (220985 => 220986)

--- trunk/Source/WebCore/css/CSSFontFace.cpp	2017-08-21 22:17:24 UTC (rev 220985)
+++ trunk/Source/WebCore/css/CSSFontFace.cpp	2017-08-21 23:04:28 UTC (rev 220986)
@@ -260,17 +260,8 @@
 ranges.append({ range.from(), range.to() });
 }
 
-if (ranges.size() == m_ranges.size()) {
-bool same = true;
-for (size_t i = 0; i < ranges.size(); ++i) {
-if (ranges[i] != m_ranges[i]) {
-same = false;
-break;
-}
-}
-if (same)
-return true;
-}
+if (ranges == m_ranges)
+return true;
 
 m_ranges = WTFMove(ranges);
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [220725] trunk

2017-08-14 Thread mmaxfield
Title: [220725] trunk








Revision 220725
Author mmaxfi...@apple.com
Date 2017-08-14 17:03:56 -0700 (Mon, 14 Aug 2017)


Log Message
Parse font-display
https://bugs.webkit.org/show_bug.cgi?id=175382

Reviewed by Simon Fraser.

Source/WebCore:

The syntax is very simple: font-display: auto | block | swap | fallback | optional.
So, parsing support is quite straightfoward.

Test: fast/text/font-display/parse.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setLoadingBehavior):
* css/CSSFontFace.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontLoadingBehavior const):
* css/CSSProperties.json:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isDescriptorOnly):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFaceFontDisplay):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

* fast/text/font-display/parse-expected.txt: Added.
* fast/text/font-display/parse.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
trunk/Source/WebCore/css/CSSFontFace.cpp
trunk/Source/WebCore/css/CSSFontFace.h
trunk/Source/WebCore/css/CSSFontSelector.cpp
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
trunk/Source/WebCore/css/CSSProperties.json
trunk/Source/WebCore/css/CSSProperty.cpp
trunk/Source/WebCore/css/CSSValueKeywords.in
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h


Added Paths

trunk/LayoutTests/fast/text/font-display/
trunk/LayoutTests/fast/text/font-display/parse-expected.txt
trunk/LayoutTests/fast/text/font-display/parse.html




Diff

Modified: trunk/LayoutTests/ChangeLog (220724 => 220725)

--- trunk/LayoutTests/ChangeLog	2017-08-14 23:37:06 UTC (rev 220724)
+++ trunk/LayoutTests/ChangeLog	2017-08-15 00:03:56 UTC (rev 220725)
@@ -1,3 +1,13 @@
+2017-08-14  Myles C. Maxfield  
+
+Parse font-display
+https://bugs.webkit.org/show_bug.cgi?id=175382
+
+Reviewed by Simon Fraser.
+
+* fast/text/font-display/parse-expected.txt: Added.
+* fast/text/font-display/parse.html: Added.
+
 2017-08-14  Andy Estes  
 
 [Apple Pay] Add support for phonetic contact names


Added: trunk/LayoutTests/fast/text/font-display/parse-expected.txt (0 => 220725)

--- trunk/LayoutTests/fast/text/font-display/parse-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/text/font-display/parse-expected.txt	2017-08-15 00:03:56 UTC (rev 220725)
@@ -0,0 +1,19 @@
+This test makes sure that the font-display descriptor in @font-face is appropriately parsed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS sheet.rules[0].style.getPropertyValue('font-display') is ""
+PASS sheet.rules[1].style.getPropertyValue('font-display') is ""
+PASS sheet.rules[2].style.getPropertyValue('font-display') is ""
+PASS sheet.rules[3].style.getPropertyValue('font-display') is "auto"
+PASS sheet.rules[4].style.getPropertyValue('font-display') is "block"
+PASS sheet.rules[5].style.getPropertyValue('font-display') is "swap"
+PASS sheet.rules[6].style.getPropertyValue('font-display') is "fallback"
+PASS sheet.rules[7].style.getPropertyValue('font-display') is "optional"
+PASS sheet.rules[8].style.getPropertyValue('font-display') is ""
+PASS window.getComputedStyle(document.getElementById('test9')).getPropertyValue('font-display') is ""
+PASS successfullyParsed is true
+
+TEST COMPLETE
+


Added: trunk/LayoutTests/fast/text/font-display/parse.html (0 => 220725)

--- trunk/LayoutTests/fast/text/font-display/parse.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-display/parse.html	2017-08-15 00:03:56 UTC (rev 220725)
@@ -0,0 +1,71 @@
+
+
+
+
+@font-face {
+font-family: "Test0";
+src: local("Times");
+font-display: garbage;
+}
+@font-face {
+font-family: "Test1";
+src: local("Times");
+}
+@font-face {
+font-family: "Test2";
+src: local("Times");
+font-display: block swap;
+}
+@font-face {
+font-family: "Test3";
+src: local("Times");
+font-display: auto;
+}
+@font-face {
+font-family: "Test4";
+src: local("Times");
+font-display: block;
+}
+@font-face {
+font-family: "Test5";
+src: local("Times");
+font-display: swap;
+}
+@font-face {
+font-family: "Test6";
+src: local("Times");
+font-display: fallback;
+}
+@font-face {
+font-family: "Test7";
+src: local("Times");
+font-display: optional;
+}
+@font-face {
+font-family: "Test8";
+src: local("Times");
+font-display: ;
+}
+
+
+
+

[webkit-changes] [220531] trunk/Source/WebCore

2017-08-10 Thread mmaxfield
Title: [220531] trunk/Source/WebCore








Revision 220531
Author mmaxfi...@apple.com
Date 2017-08-10 09:59:28 -0700 (Thu, 10 Aug 2017)


Log Message
Addressing post-review comments after r219173.
https://bugs.webkit.org/show_bug.cgi?id=174149

Unreviewed.

* css/CSSFontStyleValue.h:
* editing/EditingStyle.cpp:
(WebCore::identifierForStyleProperty):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSFontStyleValue.h
trunk/Source/WebCore/editing/EditingStyle.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (220530 => 220531)

--- trunk/Source/WebCore/ChangeLog	2017-08-10 16:53:08 UTC (rev 220530)
+++ trunk/Source/WebCore/ChangeLog	2017-08-10 16:59:28 UTC (rev 220531)
@@ -1,3 +1,14 @@
+2017-08-10  Myles C. Maxfield  
+
+Addressing post-review comments after r219173.
+https://bugs.webkit.org/show_bug.cgi?id=174149
+
+Unreviewed.
+
+* css/CSSFontStyleValue.h:
+* editing/EditingStyle.cpp:
+(WebCore::identifierForStyleProperty):
+
 2017-08-10  Antti Koivisto  
 
 Try to fix windows build.


Modified: trunk/Source/WebCore/css/CSSFontStyleValue.h (220530 => 220531)

--- trunk/Source/WebCore/css/CSSFontStyleValue.h	2017-08-10 16:53:08 UTC (rev 220530)
+++ trunk/Source/WebCore/css/CSSFontStyleValue.h	2017-08-10 16:59:28 UTC (rev 220531)
@@ -46,7 +46,7 @@
 
 bool equals(const CSSFontStyleValue&) const;
 
-bool isItalic() const
+bool isItalicOrOblique() const
 {
 if (!obliqueValue) {
 auto valueID = fontStyleValue->valueID();


Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (220530 => 220531)

--- trunk/Source/WebCore/editing/EditingStyle.cpp	2017-08-10 16:53:08 UTC (rev 220530)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp	2017-08-10 16:59:28 UTC (rev 220531)
@@ -142,7 +142,7 @@
 int identifierForStyleProperty(T& style, CSSPropertyID propertyID)
 {
 RefPtr value = extractPropertyValue(style, propertyID);
-if (propertyID == CSSPropertyFontStyle && is(value.get()) && downcast(value.get())->isItalic())
+if (propertyID == CSSPropertyFontStyle && is(value.get()) && downcast(value.get())->isItalicOrOblique())
 return CSSValueItalic;
 if (!is(value.get()))
 return 0;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [220502] trunk/PerformanceTests

2017-08-09 Thread mmaxfield
Title: [220502] trunk/PerformanceTests








Revision 220502
Author mmaxfi...@apple.com
Date 2017-08-09 18:12:07 -0700 (Wed, 09 Aug 2017)


Log Message
font-fallback-font-family.html is failing on perf bots
https://bugs.webkit.org/show_bug.cgi?id=174989

Unreviewed.

* Layout/resources/font-fallback-font-family.html:

Modified Paths

trunk/PerformanceTests/ChangeLog
trunk/PerformanceTests/Layout/resources/font-fallback-font-family.html




Diff

Modified: trunk/PerformanceTests/ChangeLog (220501 => 220502)

--- trunk/PerformanceTests/ChangeLog	2017-08-10 01:07:09 UTC (rev 220501)
+++ trunk/PerformanceTests/ChangeLog	2017-08-10 01:12:07 UTC (rev 220502)
@@ -1,3 +1,12 @@
+2017-08-09  Myles C. Maxfield  
+
+font-fallback-font-family.html is failing on perf bots
+https://bugs.webkit.org/show_bug.cgi?id=174989
+
+Unreviewed.
+
+* Layout/resources/font-fallback-font-family.html:
+
 2017-08-09  Michael Saboff  
 
 Unreviewed build fix.


Modified: trunk/PerformanceTests/Layout/resources/font-fallback-font-family.html (220501 => 220502)

--- trunk/PerformanceTests/Layout/resources/font-fallback-font-family.html	2017-08-10 01:07:09 UTC (rev 220501)
+++ trunk/PerformanceTests/Layout/resources/font-fallback-font-family.html	2017-08-10 01:12:07 UTC (rev 220502)
@@ -1,6 +1,7 @@
 
 
 
+
 
 

[webkit-changes] [220488] trunk/Source/WebCore

2017-08-09 Thread mmaxfield
Title: [220488] trunk/Source/WebCore








Revision 220488
Author mmaxfi...@apple.com
Date 2017-08-09 15:42:59 -0700 (Wed, 09 Aug 2017)


Log Message
Mark font-display as in development
https://bugs.webkit.org/show_bug.cgi?id=175387

Unreviewed.

* features.json:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/features.json




Diff

Modified: trunk/Source/WebCore/ChangeLog (220487 => 220488)

--- trunk/Source/WebCore/ChangeLog	2017-08-09 22:40:53 UTC (rev 220487)
+++ trunk/Source/WebCore/ChangeLog	2017-08-09 22:42:59 UTC (rev 220488)
@@ -1,3 +1,12 @@
+2017-08-09  Myles C. Maxfield  
+
+Mark font-display as in development
+https://bugs.webkit.org/show_bug.cgi?id=175387
+
+Unreviewed.
+
+* features.json:
+
 2017-08-09  Commit Queue  
 
 Unreviewed, rolling out r219334.


Modified: trunk/Source/WebCore/features.json (220487 => 220488)

--- trunk/Source/WebCore/features.json	2017-08-09 22:40:53 UTC (rev 220487)
+++ trunk/Source/WebCore/features.json	2017-08-09 22:42:59 UTC (rev 220488)
@@ -42,10 +42,10 @@
 {
 "name": "CSS Font Display",
 "status": {
-"status": "Under Consideration",
+"status": "In Development",
 "enabled-by-default": false
 },
-"url": "https://tabatkins.github.io/specs/css-font-display/",
+"url": "https://drafts.csswg.org/css-fonts-4/#font-display-desc",
 "keywords": ["css font display", "font display", "font-display", "css font rendering controls", "font rendering controls"],
 "category": "css",
 "description": "Allows content to specify what is shown during font loading.",






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [220009] trunk

2017-07-28 Thread mmaxfield
Title: [220009] trunk








Revision 220009
Author mmaxfi...@apple.com
Date 2017-07-28 11:36:37 -0700 (Fri, 28 Jul 2017)


Log Message
[macOS] Reeder's defaults font is Times instead of San Francisco
https://bugs.webkit.org/show_bug.cgi?id=174885


Reviewed by Simon Fraser.

Source/WebCore:

Reeder uses explicit dot-prefixed names in its source code. Within Core Text,
dot-prefixed names cannot be matched case insensitively. The solution is to
not case-fold these family names, and to make our caches case sensitive for
these special names.

Tests: fast/text/font-lookup-dot-prefix-case-sensitive-2.html
   fast/text/font-lookup-dot-prefix-case-sensitive.html

* platform/graphics/FontCache.cpp:
(WebCore::FontPlatformDataCacheKey::operator==):
(WebCore::FontPlatformDataCacheKeyHash::hash):
* platform/graphics/FontCascade.cpp:
(WebCore::keysMatch):
(WebCore::computeFontCascadeCacheHash):
* platform/graphics/FontDescription.cpp:
(WebCore::FontCascadeDescription::familyNamesAreEqual):
(WebCore::FontCascadeDescription::familyNameHash):
(WebCore::FontCascadeDescription::foldedFamilyName):
* platform/graphics/FontDescription.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::fontForPostScriptName):

LayoutTests:

* fast/text/font-lookup-dot-prefix-case-sensitive-2-expected.html: Added.
* fast/text/font-lookup-dot-prefix-case-sensitive-2.html: Added.
* fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html: Added.
* fast/text/font-lookup-dot-prefix-case-sensitive.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCache.cpp
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
trunk/Source/WebCore/platform/graphics/FontDescription.cpp
trunk/Source/WebCore/platform/graphics/FontDescription.h
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp


Added Paths

trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-2-expected.html
trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-2.html
trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html
trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive.html




Diff

Modified: trunk/LayoutTests/ChangeLog (220008 => 220009)

--- trunk/LayoutTests/ChangeLog	2017-07-28 18:22:17 UTC (rev 220008)
+++ trunk/LayoutTests/ChangeLog	2017-07-28 18:36:37 UTC (rev 220009)
@@ -1,3 +1,16 @@
+2017-07-28  Myles C. Maxfield  
+
+[macOS] Reeder's defaults font is Times instead of San Francisco
+https://bugs.webkit.org/show_bug.cgi?id=174885
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/font-lookup-dot-prefix-case-sensitive-2-expected.html: Added.
+* fast/text/font-lookup-dot-prefix-case-sensitive-2.html: Added.
+* fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html: Added.
+* fast/text/font-lookup-dot-prefix-case-sensitive.html: Added.
+
 2017-07-28  Devin Rousso  
 
 Web Inspector: Record actions performed on CanvasRenderingContext2D


Added: trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-2-expected.html (0 => 220009)

--- trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-2-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-2-expected.html	2017-07-28 18:36:37 UTC (rev 220009)
@@ -0,0 +1,14 @@
+
+
+
+
+if (window.internals) {
+internals.invalidateFontCache();
+
+
+
+Hello
+Hello
+
+
+


Added: trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-2.html (0 => 220009)

--- trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-2.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-2.html	2017-07-28 18:36:37 UTC (rev 220009)
@@ -0,0 +1,14 @@
+
+
+
+
+if (window.internals) {
+internals.invalidateFontCache();
+
+
+
+Hello
+Hello
+
+
+


Added: trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html (0 => 220009)

--- trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive-expected-mismatch.html	2017-07-28 18:36:37 UTC (rev 220009)
@@ -0,0 +1,13 @@
+
+
+
+
+if (window.internals) {
+internals.invalidateFontCache();
+
+
+
+Hello
+
+
+


Added: trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive.html (0 => 220009)

--- trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-lookup-dot-prefix-case-sensitive.html	2017-07-28 18:36:37 UTC (rev 220009)
@@ -0,0 +1,13 @@
+
+
+
+
+if (window.internals) {
+internals.invalidateFontCache();
+
+
+
+Hello
+
+
+


Modified: trunk/Source/WebCore/ChangeLog (220008 => 220009)

--- 

[webkit-changes] [220003] trunk

2017-07-28 Thread mmaxfield
Title: [220003] trunk








Revision 220003
Author mmaxfi...@apple.com
Date 2017-07-28 10:06:29 -0700 (Fri, 28 Jul 2017)


Log Message
REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
https://bugs.webkit.org/show_bug.cgi?id=174772


Reviewed by Simon Fraser.

Source/WebCore:

During a font load, we try pretty hard to find a font to use that isn't the
last resort font (which happens to be Times). We do this by iterating through
all the fonts in the font-family list, as well as through all the relevant
@font-face blocks which share the requested font family name.

Unfortunately, if we find one of these fallback fonts, we were simply using it
directly, which means that it was being drawn as visible (because the
visibility setting lives inside the Font object). Instead, we should carry the
invisibility setting from the interstitial font to this used fallback font.

This patch is an extension of r219221, which fixed the problem only for system
fallback fonts. This patch adopts the same methodology to all fallback fonts.

Test: http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html

* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForVariant):
(WebCore::glyphPageFromFontRanges):
* platform/graphics/FontRanges.cpp:
(WebCore::FontRanges::glyphDataForCharacter):

LayoutTests:

* http/tests/webfont/font-loading-system-fallback-visibility-FontRanges-expected.html: Added.
* http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp
trunk/Source/WebCore/platform/graphics/FontRanges.cpp


Added Paths

trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-FontRanges-expected.html
trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html




Diff

Modified: trunk/LayoutTests/ChangeLog (220002 => 220003)

--- trunk/LayoutTests/ChangeLog	2017-07-28 16:52:35 UTC (rev 220002)
+++ trunk/LayoutTests/ChangeLog	2017-07-28 17:06:29 UTC (rev 220003)
@@ -1,3 +1,14 @@
+2017-07-28  Myles C. Maxfield  
+
+REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
+https://bugs.webkit.org/show_bug.cgi?id=174772
+
+
+Reviewed by Simon Fraser.
+
+* http/tests/webfont/font-loading-system-fallback-visibility-FontRanges-expected.html: Added.
+* http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html: Added.
+
 2017-07-28  Per Arne Vollan  
 
 REGRESSION(r125147): Layout Test svg/dom/SVGScriptElement/script-change-externalResourcesRequired-while-loading.svg is failing


Added: trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-FontRanges-expected.html (0 => 220003)

--- trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-FontRanges-expected.html	(rev 0)
+++ trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-FontRanges-expected.html	2017-07-28 17:06:29 UTC (rev 220003)
@@ -0,0 +1,8 @@
+
+
+
+
+
+This test makes sure that system fallback fonts during loading are invisible when the loading font is invisible. The test passes if this text is the only text on the page.
+
+


Added: trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html (0 => 220003)

--- trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html	(rev 0)
+++ trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-FontRanges.html	2017-07-28 17:06:29 UTC (rev 220003)
@@ -0,0 +1,26 @@
+
+
+
+
+if (window.internals) {
+internals.clearMemoryCache();
+internals.invalidateFontCache();
+}
+
+
+@font-face {
+font-family: "WebFont";
+src: url("slow-ahem-loading.cgi");
+}
+
+@font-face {
+font-family: "WebFont";
+src: url("../resources/Ahem.woff");
+}
+
+
+
+This test makes sure that system fallback fonts during loading are invisible when the loading font is invisible. The test passes if this text is the only text on the page.
+
+
+


Modified: trunk/Source/WebCore/ChangeLog (220002 => 220003)

--- trunk/Source/WebCore/ChangeLog	2017-07-28 16:52:35 UTC (rev 220002)
+++ trunk/Source/WebCore/ChangeLog	2017-07-28 17:06:29 UTC (rev 220003)
@@ -1,3 +1,32 @@
+2017-07-28  Myles C. Maxfield  
+
+REGRESSION(r216944): Fallback fonts erroneously visible when the primary font is loading
+https://bugs.webkit.org/show_bug.cgi?id=174772
+
+
+Reviewed by Simon Fraser.
+
+During a font load, we try pretty hard to find a font to use that isn't the
+last resort font (which happens to be Times). We do this by iterating through
+all the fonts in the 

[webkit-changes] [219665] trunk

2017-07-19 Thread mmaxfield
Title: [219665] trunk








Revision 219665
Author mmaxfi...@apple.com
Date 2017-07-19 16:38:06 -0700 (Wed, 19 Jul 2017)


Log Message
Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
https://bugs.webkit.org/show_bug.cgi?id=174406
Source/WebCore:

Reviewed by Simon Fraser.


Reviewed by NOBODY.

When the minimumFontSize API preference is set, we will increase the font size without increasing
the line height. If the content specifies line-height as an absolute value, there can be two
unfortunate results:

- Adjacent lines in a paragraph can overlap
- If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
can be cut off and potentially indecipherable.

Instead, we should use the minimum font size preference as a signal that we should increase the
line-height as well as the font-size. Eventually, we will want to increase it by an amount
proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
a behavior change on many webpages which use small text, so such a change would be too risky right now.
Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
only signal to boost the corresponding line-height.

Tests: fast/text/line-height-minimumFontSize-text-zoom.html
   fast/text/line-height-minimumFontSize-visual.html
   fast/text/line-height-minimumFontSize-zoom.html
   fast/text/line-height-minimumFontSize.html
   fast/text/line-height-minimumFontSize-autosize.html

* css/StyleBuilderCustom.h:
(WebCore::computeBaseSpecifiedFontSize):
(WebCore::computeLineHeightMultiplierDueToFontSize):
(WebCore::StyleBuilderCustom::applyValueLineHeight):
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
(WebCore::StyleBuilderCustom::applyValueContent):
* rendering/TextAutoSizing.cpp:

LayoutTests:



Reviewed by Simon Fraser.

* fast/text/line-height-minimumFontSize-autosize-expected.text: Added.
* fast/text/line-height-minimumFontSize-autosize.html: Added.
* fast/text/line-height-minimumFontSize-expected.txt: Added.
* fast/text/line-height-minimumFontSize-text-zoom-expected.html: Added.
* fast/text/line-height-minimumFontSize-text-zoom.html: Added.
* fast/text/line-height-minimumFontSize-visual-expected.html: Added.
* fast/text/line-height-minimumFontSize-visual.html: Added.
* fast/text/line-height-minimumFontSize-zoom-expected.html: Added.
* fast/text/line-height-minimumFontSize-zoom.html: Added.
* fast/text/line-height-minimumFontSize.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/StyleBuilderCustom.h
trunk/Source/WebCore/rendering/TextAutoSizing.cpp


Added Paths

trunk/LayoutTests/fast/text/line-height-minimumFontSize-autosize-expected.txt
trunk/LayoutTests/fast/text/line-height-minimumFontSize-autosize.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-expected.txt
trunk/LayoutTests/fast/text/line-height-minimumFontSize-text-zoom-expected.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-text-zoom.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-visual-expected.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-visual.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-zoom-expected.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-zoom.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize.html




Diff

Modified: trunk/LayoutTests/ChangeLog (219664 => 219665)

--- trunk/LayoutTests/ChangeLog	2017-07-19 20:42:21 UTC (rev 219664)
+++ trunk/LayoutTests/ChangeLog	2017-07-19 23:38:06 UTC (rev 219665)
@@ -1,3 +1,41 @@
+2017-07-19  Myles C. Maxfield  
+
+Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
+https://bugs.webkit.org/show_bug.cgi?id=174406
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/line-height-minimumFontSize-autosize-expected.text: Added.
+* fast/text/line-height-minimumFontSize-autosize.html: Added.
+* fast/text/line-height-minimumFontSize-expected.txt: Added.
+* fast/text/line-height-minimumFontSize-text-zoom-expected.html: Added.
+* fast/text/line-height-minimumFontSize-text-zoom.html: Added.
+* fast/text/line-height-minimumFontSize-visual-expected.html: Added.
+* fast/text/line-height-minimumFontSize-visual.html: Added.
+* fast/text/line-height-minimumFontSize-zoom-expected.html: Added.
+* fast/text/line-height-minimumFontSize-zoom.html: Added.
+* fast/text/line-height-minimumFontSize.html: Added.
+
+2017-07-18  Myles C. Maxfield  
+
+Setting the minimum font size preference doesn’t affect absolute line-height values, 

[webkit-changes] [219646] trunk

2017-07-18 Thread mmaxfield
Title: [219646] trunk








Revision 219646
Author mmaxfi...@apple.com
Date 2017-07-18 20:54:38 -0700 (Tue, 18 Jul 2017)


Log Message
Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
https://bugs.webkit.org/show_bug.cgi?id=174406


Reviewed by Simon Fraser.

Source/WebCore:

When the minimumFontSize API preference is set, we will increase the font size without increasing
the line height. If the content specifies line-height as an absolute value, there can be two
unfortunate results:

- Adjacent lines in a paragraph can overlap
- If the paragraph (or containin block or whatever) uses overflow: hidden, the first and last lines
can be cut off and potentially indecipherable.

Instead, we should use the minimum font size preference as a signal that we should increase the
line-height as well as the font-size. Eventually, we will want to increase it by an amount
proportional to the increase in font-size (which can be due to minimumFontSize, minimumLogicalFontSize,
text autosizing, etc.). However, because minimumLogicalFontSize is on by default, this would cause
a behavior change on many webpages which use small text, so such a change would be too risky right now.
Instead, we can pretend that minimumFontSize is the only cause that text increases, and use this as the
only signal to boost the corresponding line-height.

Tests: fast/text/line-height-minimumFontSize-text-zoom.html
   fast/text/line-height-minimumFontSize-visual.html
   fast/text/line-height-minimumFontSize-zoom.html
   fast/text/line-height-minimumFontSize.html
   fast/text/line-height-minimumFontSize-autosize.html

* css/StyleBuilderCustom.h:
(WebCore::computeBaseSpecifiedFontSize):
(WebCore::computeLineHeightMultiplierDueToFontSize):
(WebCore::StyleBuilderCustom::applyValueLineHeight):
(WebCore::StyleBuilderCustom::applyValueFill):
(WebCore::StyleBuilderCustom::applyValueStroke):
(WebCore::StyleBuilderCustom::applyValueContent):
* rendering/TextAutoSizing.cpp:

LayoutTests:

* fast/text/line-height-minimumFontSize-autosize-expected.text: Added.
* fast/text/line-height-minimumFontSize-autosize.html: Added.
* fast/text/line-height-minimumFontSize-expected.txt: Added.
* fast/text/line-height-minimumFontSize-text-zoom-expected.html: Added.
* fast/text/line-height-minimumFontSize-text-zoom.html: Added.
* fast/text/line-height-minimumFontSize-visual-expected.html: Added.
* fast/text/line-height-minimumFontSize-visual.html: Added.
* fast/text/line-height-minimumFontSize-zoom-expected.html: Added.
* fast/text/line-height-minimumFontSize-zoom.html: Added.
* fast/text/line-height-minimumFontSize.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/StyleBuilderCustom.h
trunk/Source/WebCore/rendering/TextAutoSizing.cpp


Added Paths

trunk/LayoutTests/fast/text/line-height-minimumFontSize-autosize-expected.txt
trunk/LayoutTests/fast/text/line-height-minimumFontSize-autosize.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-expected.txt
trunk/LayoutTests/fast/text/line-height-minimumFontSize-text-zoom-expected.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-text-zoom.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-visual-expected.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-visual.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-zoom-expected.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize-zoom.html
trunk/LayoutTests/fast/text/line-height-minimumFontSize.html




Diff

Modified: trunk/LayoutTests/ChangeLog (219645 => 219646)

--- trunk/LayoutTests/ChangeLog	2017-07-19 01:13:11 UTC (rev 219645)
+++ trunk/LayoutTests/ChangeLog	2017-07-19 03:54:38 UTC (rev 219646)
@@ -1,3 +1,22 @@
+2017-07-18  Myles C. Maxfield  
+
+Setting the minimum font size preference doesn’t affect absolute line-height values, so lines overlap
+https://bugs.webkit.org/show_bug.cgi?id=174406
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/line-height-minimumFontSize-autosize-expected.text: Added.
+* fast/text/line-height-minimumFontSize-autosize.html: Added.
+* fast/text/line-height-minimumFontSize-expected.txt: Added.
+* fast/text/line-height-minimumFontSize-text-zoom-expected.html: Added.
+* fast/text/line-height-minimumFontSize-text-zoom.html: Added.
+* fast/text/line-height-minimumFontSize-visual-expected.html: Added.
+* fast/text/line-height-minimumFontSize-visual.html: Added.
+* fast/text/line-height-minimumFontSize-zoom-expected.html: Added.
+* fast/text/line-height-minimumFontSize-zoom.html: Added.
+* fast/text/line-height-minimumFontSize.html: Added.
+
 2017-07-18  Ali Juma  
 
 Align quirky number parsing with other browsers


Added: trunk/LayoutTests/fast/text/line-height-minimumFontSize-autosize-expected.txt (0 => 

[webkit-changes] [219544] trunk/Source/WebCore

2017-07-16 Thread mmaxfield
Title: [219544] trunk/Source/WebCore








Revision 219544
Author mmaxfi...@apple.com
Date 2017-07-15 23:08:41 -0700 (Sat, 15 Jul 2017)


Log Message
Rename RenderStyle::fontSize() to RenderStyle::computedFontPixelSize()
https://bugs.webkit.org/show_bug.cgi?id=174509

Reviewed by Simon Fraser.

We have three font size functions:
- computedFontSize(): returns a float
- specifiedFontSize(): also returns a float
- fontSize(): returns the rounded computedFontSize()

FontDescription uses the convention of labelling rounded values as "pixel",
so a better name font fontSize() is computedFontPixelSize().

Also, because font sizes can never be negative, switch the type from an int
to an unsigned.

No new tests because there is no behavior change.

* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::computedPixelSize):
(WebCore::FontDescription::fontSelectionRequest):
* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter):
* rendering/RenderRubyRun.cpp:
(WebCore::shouldOverhang):
(WebCore::RenderRubyRun::getOverhang):
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::adjustInlineDirectionLineBounds):
* rendering/RenderThemeGtk.cpp:
(WebCore::adjustSearchFieldIconStyle):
(WebCore::paintSearchFieldIcon):
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustCheckboxStyle):
(WebCore::RenderThemeIOS::adjustRadioStyle):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::controlSizeForFont):
(WebCore::RenderThemeMac::controlSizeForSystemFont):
(WebCore::RenderThemeMac::paintMenuListButtonDecorations):
(WebCore::RenderThemeMac::popupInternalPaddingBox):
(WebCore::RenderThemeMac::adjustMenuListButtonStyle):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
(WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
(WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computeLineVerticalStretch):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::computedFontPixelSize):
(WebCore::RenderStyle::computedLineHeight):
(WebCore::RenderStyle::fontSize): Deleted.
* rendering/style/RenderStyle.h:
* style/InlineTextBoxStyle.cpp:
(WebCore::visualOverflowForDecorations):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS):
(WebCore::SVGLengthContext::convertValueFromEMSToUserUnits):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
trunk/Source/WebCore/css/StyleResolver.cpp
trunk/Source/WebCore/platform/graphics/FontDescription.h
trunk/Source/WebCore/rendering/RenderBlock.cpp
trunk/Source/WebCore/rendering/RenderRubyRun.cpp
trunk/Source/WebCore/rendering/RenderRubyText.cpp
trunk/Source/WebCore/rendering/RenderThemeGtk.cpp
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
trunk/Source/WebCore/rendering/RenderThemeMac.mm
trunk/Source/WebCore/rendering/RenderThemeWin.cpp
trunk/Source/WebCore/rendering/TextDecorationPainter.cpp
trunk/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
trunk/Source/WebCore/rendering/style/RenderStyle.h
trunk/Source/WebCore/style/InlineTextBoxStyle.cpp
trunk/Source/WebCore/style/StyleTreeResolver.cpp
trunk/Source/WebCore/svg/SVGLengthContext.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (219543 => 219544)

--- trunk/Source/WebCore/ChangeLog	2017-07-16 05:52:30 UTC (rev 219543)
+++ trunk/Source/WebCore/ChangeLog	2017-07-16 06:08:41 UTC (rev 219544)
@@ -1,5 +1,72 @@
 2017-07-15  Myles C. Maxfield  
 
+Rename RenderStyle::fontSize() to RenderStyle::computedFontPixelSize()
+https://bugs.webkit.org/show_bug.cgi?id=174509
+
+Reviewed by Simon Fraser.
+
+We have three font size functions:
+- computedFontSize(): returns a float
+- specifiedFontSize(): also returns a float
+- fontSize(): returns the rounded computedFontSize()
+
+FontDescription uses the convention of labelling rounded values as "pixel",
+so a better name font fontSize() is computedFontPixelSize().
+
+Also, because font sizes can never be negative, switch the type from an int
+to an unsigned.
+
+No new tests because there is no behavior change.
+
+* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
+(getAttributeSetForAccessibilityObject):
+* css/StyleResolver.cpp:
+(WebCore::StyleResolver::adjustRenderStyle):
+* platform/graphics/FontDescription.h:
+(WebCore::FontDescription::computedPixelSize):
+

[webkit-changes] [219543] trunk

2017-07-15 Thread mmaxfield
Title: [219543] trunk








Revision 219543
Author mmaxfi...@apple.com
Date 2017-07-15 22:52:30 -0700 (Sat, 15 Jul 2017)


Log Message
line-height:  gets visually applied twice when text autosizing is in effect
https://bugs.webkit.org/show_bug.cgi?id=174536


Reviewed by Simon Fraser.

Source/WebCore:

StyleBuilderConverter::convertLineHeight() converts line-height:  into a
"percentage" length. Then, when layout needs to know what the computed value of
line-height is, RenderStyle::computedLineHeight() multiplies this percentage by
the computed font size.

With autosizing, the computed font size already incorporates the autosizing
multiplier, so we shouldn't also incorporate this multiplier into the percentage
value itself. getComputedStyle()'s lineHeightFromStyle() was compensating for
this double application by multiplying the percentage by the font-size's specified
value instead of its computed value, which is incorrect.

Test: fast/text-autosizing/line-height-number.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::lineHeightFromStyle):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLineHeight):

LayoutTests:

* fast/text-autosizing/line-height-number-expected.html: Added.
* fast/text-autosizing/line-height-number.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
trunk/Source/WebCore/css/StyleBuilderConverter.h


Added Paths

trunk/LayoutTests/fast/text-autosizing/line-height-number-expected.html
trunk/LayoutTests/fast/text-autosizing/line-height-number.html




Diff

Modified: trunk/LayoutTests/ChangeLog (219542 => 219543)

--- trunk/LayoutTests/ChangeLog	2017-07-16 04:47:03 UTC (rev 219542)
+++ trunk/LayoutTests/ChangeLog	2017-07-16 05:52:30 UTC (rev 219543)
@@ -1,3 +1,14 @@
+2017-07-15  Myles C. Maxfield  
+
+line-height:  gets visually applied twice when text autosizing is in effect
+https://bugs.webkit.org/show_bug.cgi?id=174536
+
+
+Reviewed by Simon Fraser.
+
+* fast/text-autosizing/line-height-number-expected.html: Added.
+* fast/text-autosizing/line-height-number.html: Added.
+
 2017-07-14  Zan Dobersek  
 
 [GCrypt] Implement CryptoKeyRSA PKCS#8 exports


Added: trunk/LayoutTests/fast/text-autosizing/line-height-number-expected.html (0 => 219543)

--- trunk/LayoutTests/fast/text-autosizing/line-height-number-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text-autosizing/line-height-number-expected.html	2017-07-16 05:52:30 UTC (rev 219543)
@@ -0,0 +1,9 @@
+
+
+
+
+
+This test makes sure that text-size-adjust only gets applied once to line-height.
+asdf asdf
+
+


Added: trunk/LayoutTests/fast/text-autosizing/line-height-number.html (0 => 219543)

--- trunk/LayoutTests/fast/text-autosizing/line-height-number.html	(rev 0)
+++ trunk/LayoutTests/fast/text-autosizing/line-height-number.html	2017-07-16 05:52:30 UTC (rev 219543)
@@ -0,0 +1,15 @@
+
+
+
+
+if (window.internals) {
+internals.settings.setTextAutosizingEnabled(true);
+internals.settings.setTextAutosizingWindowSizeOverride(320, 480);
+}
+
+
+
+This test makes sure that text-size-adjust only gets applied once to line-height.
+asdf asdf
+
+


Modified: trunk/Source/WebCore/ChangeLog (219542 => 219543)

--- trunk/Source/WebCore/ChangeLog	2017-07-16 04:47:03 UTC (rev 219542)
+++ trunk/Source/WebCore/ChangeLog	2017-07-16 05:52:30 UTC (rev 219543)
@@ -1,3 +1,29 @@
+2017-07-15  Myles C. Maxfield  
+
+line-height:  gets visually applied twice when text autosizing is in effect
+https://bugs.webkit.org/show_bug.cgi?id=174536
+
+
+Reviewed by Simon Fraser.
+
+StyleBuilderConverter::convertLineHeight() converts line-height:  into a
+"percentage" length. Then, when layout needs to know what the computed value of
+line-height is, RenderStyle::computedLineHeight() multiplies this percentage by
+the computed font size.
+
+With autosizing, the computed font size already incorporates the autosizing
+multiplier, so we shouldn't also incorporate this multiplier into the percentage
+value itself. getComputedStyle()'s lineHeightFromStyle() was compensating for
+this double application by multiplying the percentage by the font-size's specified
+value instead of its computed value, which is incorrect.
+
+Test: fast/text-autosizing/line-height-number.html
+
+* css/CSSComputedStyleDeclaration.cpp:
+(WebCore::lineHeightFromStyle):
+* css/StyleBuilderConverter.h:
+(WebCore::StyleBuilderConverter::convertLineHeight):
+
 2017-07-15  Wenson Hsieh  
 
 [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating


Modified: 

[webkit-changes] [219539] trunk/Source/WebCore

2017-07-15 Thread mmaxfield
Title: [219539] trunk/Source/WebCore








Revision 219539
Author mmaxfi...@apple.com
Date 2017-07-15 15:03:23 -0700 (Sat, 15 Jul 2017)


Log Message
Clean up line-height and minimumFontSize functions
https://bugs.webkit.org/show_bug.cgi?id=174535

Reviewed by Simon Fraser.

No behavior change.

No new tests because there is no behavior change.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLineHeight):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::StyleResolver::pseudoStyleRulesForElement):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::cascadedPropertiesForRollback):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::checkForZoomChange):
(WebCore::StyleResolver::createFilterOperations):
(WebCore::StyleResolver::CascadedProperties::set):
(WebCore::StyleResolver::applyCascadedProperties):
* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::computedFontSizeFromSpecifiedSize):
(WebCore::Style::computedFontSizeFromSpecifiedSizeForSVGInlineText):
(): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/StyleBuilderConverter.h
trunk/Source/WebCore/css/StyleResolver.cpp
trunk/Source/WebCore/style/StyleFontSizeFunctions.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (219538 => 219539)

--- trunk/Source/WebCore/ChangeLog	2017-07-15 21:47:16 UTC (rev 219538)
+++ trunk/Source/WebCore/ChangeLog	2017-07-15 22:03:23 UTC (rev 219539)
@@ -1,3 +1,32 @@
+2017-07-15  Myles C. Maxfield  
+
+Clean up line-height and minimumFontSize functions
+https://bugs.webkit.org/show_bug.cgi?id=174535
+
+Reviewed by Simon Fraser.
+
+No behavior change.
+
+No new tests because there is no behavior change.
+
+* css/StyleBuilderConverter.h:
+(WebCore::StyleBuilderConverter::convertLineHeight):
+* css/StyleResolver.cpp:
+(WebCore::StyleResolver::styleForKeyframe):
+(WebCore::StyleResolver::adjustRenderStyle):
+(WebCore::StyleResolver::pseudoStyleRulesForElement):
+(WebCore::StyleResolver::applyMatchedProperties):
+(WebCore::StyleResolver::cascadedPropertiesForRollback):
+(WebCore::StyleResolver::applyProperty):
+(WebCore::StyleResolver::checkForZoomChange):
+(WebCore::StyleResolver::createFilterOperations):
+(WebCore::StyleResolver::CascadedProperties::set):
+(WebCore::StyleResolver::applyCascadedProperties):
+* style/StyleFontSizeFunctions.cpp:
+(WebCore::Style::computedFontSizeFromSpecifiedSize):
+(WebCore::Style::computedFontSizeFromSpecifiedSizeForSVGInlineText):
+(): Deleted.
+
 2017-07-14  Jonathan Bedard  
 
 Add iOS 11 SPI


Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (219538 => 219539)

--- trunk/Source/WebCore/css/StyleBuilderConverter.h	2017-07-15 21:47:16 UTC (rev 219538)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h	2017-07-15 22:03:23 UTC (rev 219539)
@@ -1434,14 +1434,22 @@
 length = Length(length.value() * multiplier, Fixed);
 return length;
 }
+
+// Line-height percentages need to inherit as if they were Fixed pixel values. In the example:
+// 
+// the inner element should have line-height of 15px. However, in this example:
+// 
+// the inner element should have a line-height of 150px. Therefore, we map percentages to Fixed
+// values and raw numbers to percentages.
 if (primitiveValue.isPercentage()) {
 // FIXME: percentage should not be restricted to an integer here.
 return Length((styleResolver.style()->computedFontSize() * primitiveValue.intValue()) / 100, Fixed);
 }
-if (primitiveValue.isNumber()) {
-// FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
+if (primitiveValue.isNumber())
 return Length(primitiveValue.doubleValue() * multiplier * 100.0, Percent);
-}
+
+// FIXME: The parser should only emit the above types, so this should never be reached. We should change the
+// type of this function to return just a Length (and not an Optional).
 return std::nullopt;
 }
 


Modified: trunk/Source/WebCore/css/StyleResolver.cpp (219538 => 219539)

--- trunk/Source/WebCore/css/StyleResolver.cpp	2017-07-15 21:47:16 UTC (rev 219538)
+++ trunk/Source/WebCore/css/StyleResolver.cpp	2017-07-15 22:03:23 UTC (rev 219539)
@@ -425,7 +425,7 @@
 // decl, there's nothing to override. So just add the first properties.
 CascadedProperties cascade(direction, writingMode);
 cascade.addNormalMatches(result, 0, result.matchedProperties().size() - 1);
-
+
 // Resolve custom properties first.
 applyCascadedProperties(cascade, CSSPropertyCustom, CSSPropertyCustom, );
 
@@ -1048,7 +1048,7 @@
 if 

[webkit-changes] [219313] trunk/LayoutTests

2017-07-10 Thread mmaxfield
Title: [219313] trunk/LayoutTests








Revision 219313
Author mmaxfi...@apple.com
Date 2017-07-10 16:25:19 -0700 (Mon, 10 Jul 2017)


Log Message
fast/text/trak-optimizeLegibility.html is failing on macOS High Sierra
https://bugs.webkit.org/show_bug.cgi?id=174325


Reviewed by Zalan Bujtas.

The name of the font changed.

* fast/text/trak-optimizeLegibility.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/fast/text/trak-optimizeLegibility.html




Diff

Modified: trunk/LayoutTests/ChangeLog (219312 => 219313)

--- trunk/LayoutTests/ChangeLog	2017-07-10 23:00:42 UTC (rev 219312)
+++ trunk/LayoutTests/ChangeLog	2017-07-10 23:25:19 UTC (rev 219313)
@@ -1,3 +1,15 @@
+2017-07-10  Myles C. Maxfield  
+
+fast/text/trak-optimizeLegibility.html is failing on macOS High Sierra
+https://bugs.webkit.org/show_bug.cgi?id=174325
+
+
+Reviewed by Zalan Bujtas.
+
+The name of the font changed.
+
+* fast/text/trak-optimizeLegibility.html:
+
 2017-07-10  Youenn Fablet  
 
 Update webrtc expectations


Modified: trunk/LayoutTests/fast/text/trak-optimizeLegibility.html (219312 => 219313)

--- trunk/LayoutTests/fast/text/trak-optimizeLegibility.html	2017-07-10 23:00:42 UTC (rev 219312)
+++ trunk/LayoutTests/fast/text/trak-optimizeLegibility.html	2017-07-10 23:25:19 UTC (rev 219313)
@@ -7,8 +7,8 @@
 This test makes sure that you can opt-in to honoring the 'trak' table by specifying text-rendering: optimizeLegibility.
 The first and third lines below should have the same width. The middle one can (but doesn't have to) have a different width.
 hamburgefonstiv
-hamburgefonstiv
-hamburgefonstiv
+hamburgefonstiv
+hamburgefonstiv
 

[webkit-changes] [219293] trunk/Source/WebKit2

2017-07-10 Thread mmaxfield
Title: [219293] trunk/Source/WebKit2








Revision 219293
Author mmaxfi...@apple.com
Date 2017-07-10 09:17:00 -0700 (Mon, 10 Jul 2017)


Log Message
REGRESSION(r213590): UI process updates the visible content rects more often than it did in iOS 10
https://bugs.webkit.org/show_bug.cgi?id=174282


Reviewed by Simon Fraser.

In r213590, we accidentally refactored -[WKWebView _didCommitLayerTree:] to call _scheduleVisibleContentRectUpdate
more often. Instead, this should be triggered from inside the "if" statements.

No tests because there is no behavior change. Performance change is tested in MotionMark.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isShowingVideoPictureInPicture]):
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView goBack]):
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
(-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
(-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(-[WKWebView scrollViewDidScroll:]):
(-[WKWebView _visibleContentRect]):
(-[WKWebView _frameOrBoundsChanged]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _navigationGestureDidBegin]):
(-[WKWebView _reloadWithoutContentBlockers]):
(-[WKWebView _reloadExpiredOnly]):
(-[WKWebView _setObscuredInsets:]):
(-[WKWebView _setUnobscuredSafeAreaInsets:]):
(-[WKWebView _endAnimatedResize]):
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
(-[WKWebView _clearOverrideLayoutParameters]):
(-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
(-[WKWebView _propertiesOfLayerWithID:]):

Modified Paths

trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm




Diff

Modified: trunk/Source/WebKit2/ChangeLog (219292 => 219293)

--- trunk/Source/WebKit2/ChangeLog	2017-07-10 16:10:18 UTC (rev 219292)
+++ trunk/Source/WebKit2/ChangeLog	2017-07-10 16:17:00 UTC (rev 219293)
@@ -1,3 +1,40 @@
+2017-07-10  Myles C. Maxfield  
+
+REGRESSION(r213590): UI process updates the visible content rects more often than it did in iOS 10
+https://bugs.webkit.org/show_bug.cgi?id=174282
+
+
+Reviewed by Simon Fraser.
+
+In r213590, we accidentally refactored -[WKWebView _didCommitLayerTree:] to call _scheduleVisibleContentRectUpdate
+more often. Instead, this should be triggered from inside the "if" statements. 
+
+No tests because there is no behavior change. Performance change is tested in MotionMark.
+
+* UIProcess/API/Cocoa/WKWebView.mm:
+(-[WKWebView _isShowingVideoPictureInPicture]):
+(-[WKWebView _initializeWithConfiguration:]):
+(-[WKWebView goBack]):
+(-[WKWebView _didCommitLayerTree:]):
+(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
+(-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
+(-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
+(-[WKWebView scrollViewDidScroll:]):
+(-[WKWebView _visibleContentRect]):
+(-[WKWebView _frameOrBoundsChanged]):
+(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
+(-[WKWebView _updateVisibleContentRects]):
+(-[WKWebView _navigationGestureDidBegin]):
+(-[WKWebView _reloadWithoutContentBlockers]):
+(-[WKWebView _reloadExpiredOnly]):
+(-[WKWebView _setObscuredInsets:]):
+(-[WKWebView _setUnobscuredSafeAreaInsets:]):
+(-[WKWebView _endAnimatedResize]):
+(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
+(-[WKWebView _clearOverrideLayoutParameters]):
+(-[WKWebView _requestActivatedElementAtPosition:completionBlock:]):
+(-[WKWebView _propertiesOfLayerWithID:]):
+
 2017-07-10  Carlos Garcia Campos  
 
 [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)


Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (219292 => 219293)

--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-07-10 16:10:18 UTC (rev 219292)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-07-10 16:17:00 UTC (rev 219293)
@@ -251,7 +251,7 @@
 
 UIInterfaceOrientation _interfaceOrientationOverride;
 BOOL _overridesInterfaceOrientation;
-
+
 BOOL _allowsViewportShrinkToFit;
 
 BOOL _hasCommittedLoadForMainFrame;
@@ -292,7 +292,7 @@
 
 BOOL _delayUpdateVisibleContentRects;
 BOOL _hadDelayedUpdateVisibleContentRects;
-
+
 int _activeAnimatedResizeCount;
 
 Vector _snapshotsDeferredDuringResize;
@@ -348,7 +348,7 @@
 #else
 if (!_page || !_page->videoFullscreenManager())
 return false;
-
+
 return 

[webkit-changes] [219223] trunk

2017-07-06 Thread mmaxfield
Title: [219223] trunk








Revision 219223
Author mmaxfi...@apple.com
Date 2017-07-06 16:04:18 -0700 (Thu, 06 Jul 2017)


Log Message
[Cocoa] Improve performance of font lookups
https://bugs.webkit.org/show_bug.cgi?id=173960


Reviewed by Darin Adler.

PerformanceTests:

* Layout/font-fallback-font-family.html: Added.
* Layout/resources/font-fallback-font-family.html: Added.

Source/WebCore:

Looking up kCTFontPostScriptNameAttribute is faster than kCTFontNameAttribute.

No new tests because there is no behavior change.

* platform/spi/cocoa/CoreTextSPI.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::fontForPostScriptName):

Modified Paths

trunk/PerformanceTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h


Added Paths

trunk/PerformanceTests/Layout/font-fallback-font-family.html
trunk/PerformanceTests/Layout/resources/font-fallback-font-family.html




Diff

Modified: trunk/PerformanceTests/ChangeLog (219222 => 219223)

--- trunk/PerformanceTests/ChangeLog	2017-07-06 22:50:30 UTC (rev 219222)
+++ trunk/PerformanceTests/ChangeLog	2017-07-06 23:04:18 UTC (rev 219223)
@@ -1,3 +1,14 @@
+2017-07-06  Myles C. Maxfield  
+
+[Cocoa] Improve performance of font lookups
+https://bugs.webkit.org/show_bug.cgi?id=173960
+
+
+Reviewed by Darin Adler.
+
+* Layout/font-fallback-font-family.html: Added.
+* Layout/resources/font-fallback-font-family.html: Added.
+
 2017-06-10  Dan Bernstein  
 
 Reverted r218056 because it made the IDE reindex constantly.


Added: trunk/PerformanceTests/Layout/font-fallback-font-family.html (0 => 219223)

--- trunk/PerformanceTests/Layout/font-fallback-font-family.html	(rev 0)
+++ trunk/PerformanceTests/Layout/font-fallback-font-family.html	2017-07-06 23:04:18 UTC (rev 219223)
@@ -0,0 +1,9 @@
+
+
+
+window._onload_ = function() {
+PerfTestRunner.measurePageLoadTime({path: "resources/font-fallback-font-family.html"});
+}
+
+


Added: trunk/PerformanceTests/Layout/resources/font-fallback-font-family.html (0 => 219223)

--- trunk/PerformanceTests/Layout/resources/font-fallback-font-family.html	(rev 0)
+++ trunk/PerformanceTests/Layout/resources/font-fallback-font-family.html	2017-07-06 23:04:18 UTC (rev 219223)
@@ -0,0 +1,20 @@
+
+
+
+
+
+if (window.internals)
+window.internals.invalidateFontCache();
+const fonts="Times New Roman CYR;Arial CYR;Courier New CYR;\u5b8b\u4f53;Arial Cyr;Times New Roman Cyr;Courier New Cyr;\u534e\u6587\u7ec6\u9ed1;\u5137\u9ed1 Pro;WP CyrillicB;WP CyrillicA;\uad81\uc11c\uccb4;\u7d30\u660e\u9ad4;\u5c0f\u585a\u660e\u671d Pr6N B;\u5b8b\u4f53-PUA;\u65b9\u6b63\u6d41\u884c\u4f53\u7e41\u4f53;\u6c49\u4eea\u5a03\u5a03\u7bc6\u7b80;\ub3cb\uc6c0;GaramondNo4CyrTCYLig;HelveticaInseratCyr Upright;HelveticaCyr Upright;TL Help Cyrillic;\uac00\ub294\uc548\uc0c1\uc218\uccb4;TLCyrillic2;AGRevueCyr-Roman;AGOptimaCyr;HelveticaInseratCyrillicUpright;HelveticaCyrillicUpright;HelveticaCyrillic;CyrillicRibbon;CyrillicHover;\u6587\u9f0e\uff30\uff2f\uff30\uff0d\uff14;\u65b9\u6b63\u4e2d\u5029\u7b80\u4f53;\u521b\u827a\u7b80\u4e2d\u5706;Zrnic Cyr;Zipper1 Cyr;Xorx_windy Cyr;Xorx_Toothy Cyr;\uc18c\uc57c\uc1949;\u0426\u0432\u0435\u0442\u043d\u044b\u0435 \u044d\u043c\u043e\u0434\u0437\u0438 Apple;Chinese Generic1;Korean Generic1;Bullets 5(Korean);UkrainianFuturisExtra;VNI-Viettay;Uk
 rainianCompact;UkrainianBrushScript;TiffanyUkraine;Baltica_Russian-ITV;Vietnamese font;Unicorn Ukrainian;UkrainianTimesET;UkrainianCourier;Tiff-HeavyUkraine;\u4875\u6e67\u4c61\u6e20\u4172\u7464\u6573\u6967\u6e20\u3230\u3032\u202d\u2041\u6c6c\u2072\u6967\u6874\u7320\u7265\u7365\u7276\u6564\u2e54\u6875\u2070\u6861\u7020\u564e\u5468\u7566\u6170\u3032\u2020\u4e6f\u726d\u616c\u312e\u3020\u436f\u6465\u2056\u4e49\u2066\u6f72\u2057\u696e\u646f\u7773\u5468\u7566\u6170\u3032\u4e6f\u726d\u616cHungLan Artdesign - http://www.vietcomic.comVNI-Thufap2  Normalv2.0 Code VNI for WindowsVNI-Thufap2 Normal\u0002;Vietnam;Bwviet;Soviet;Soviet Expanded;Soviet Bold;Russian;UVN Han Viet;UkrainianAcademy;Symbol;Verdana;Webdings;Arial;Georgia;Courier New;Trebuchet MS;Times New Roman;Impact;Comic Sans MS;Wingdings;Tahoma;Microsoft Sans Serif;Arial Black;Plantagenet Cherokee;Arial Narrow;Wingdings 2;Wingdings 3;Arial Unicode MS;Papyrus;Calibri;Cambria;Consolas;Candara;Franklin Gothic Medium;Corbel;Constantia;Ma
 rlett;Lucida Console;Lucida Sans Unicode;MS Mincho;Arial Rounded MT Bold;Palatino Linotype;Batang;MS Gothic;PMingLiU;SimSun;MS PGothic;MS PMincho;Gulim;Cambria Math;Garamond;Bookman Old Style;Book Antiqua;Century Gothic;Monotype Corsiva;Courier;Meiryo;Century;MT Extra;MS Reference Sans Serif;MS Reference Specialty;Mistral;Bookshelf Symbol 7;Lucida Bright;Cooper Black;Modern No. 20;Bernard MT Condensed;Bell MT;Baskerville Old Face;Bauhaus 

[webkit-changes] [219221] trunk

2017-07-06 Thread mmaxfield
Title: [219221] trunk








Revision 219221
Author mmaxfi...@apple.com
Date 2017-07-06 15:09:11 -0700 (Thu, 06 Jul 2017)


Log Message
REGRESSION(r216944): Font loads can cause Chinese characters to draw as .notdef
https://bugs.webkit.org/show_bug.cgi?id=173962


Reviewed by Simon Fraser.

Source/WebCore:

Previously, there was no signalling between our font loading code
which determined whether or not a font should be invisible (because
its in the middle of loading) and our system fallback code which
created fonts when we fall off the end of the fallback list. Because
of this, we were doing two things wrong:

1. When we started downloading a font, we would try to use a fallback
font. However, if the fallback font didn't suppor the character we're
trying to render, we would just bail and draw .notdef
2. Even if we continued down the fallback list, and fell of the end,
we wouldn't realize that the system fallback font should also be drawn
as invisible.

This patch solves these two problems by:
1. Performing a search to find the best (local) fallback font with
which to fall systemFallbackFontForCharacter(). This way, if you say
"font-family: 'RemoteFont', 'Helvetica'" we will use Helvetica as
the lookup to ask the system to search for.
2. Give the Font class an accessor which can create a duplicate, but
invisible font. Give FontCascadeFonts::glyphDataForVariant() the
correct tracking to know when to use this invisible duplicate.

Tests: fast/text/font-loading-system-fallback.html
   http/tests/webfont/font-loading-system-fallback-visibility.html

* platform/graphics/Font.cpp:
(WebCore::Font::invisibleFont):
* platform/graphics/Font.h:
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::findBestFallbackFont):
(WebCore::FontCascadeFonts::glyphDataForSystemFallback):
(WebCore::FontCascadeFonts::glyphDataForVariant):
* platform/graphics/FontCascadeFonts.h:

LayoutTests:

* fast/text/font-loading-system-fallback-expected.html: Added.
* fast/text/font-loading-system-fallback.html: Added.
* http/tests/webfont/font-loading-system-fallback-visibility-expected.html: Added.
* http/tests/webfont/font-loading-system-fallback-visibility.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/Font.cpp
trunk/Source/WebCore/platform/graphics/Font.h
trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp
trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h


Added Paths

trunk/LayoutTests/fast/text/font-loading-system-fallback-expected.html
trunk/LayoutTests/fast/text/font-loading-system-fallback.html
trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility-expected.html
trunk/LayoutTests/http/tests/webfont/font-loading-system-fallback-visibility.html




Diff

Modified: trunk/LayoutTests/ChangeLog (219220 => 219221)

--- trunk/LayoutTests/ChangeLog	2017-07-06 21:59:33 UTC (rev 219220)
+++ trunk/LayoutTests/ChangeLog	2017-07-06 22:09:11 UTC (rev 219221)
@@ -1,3 +1,16 @@
+2017-07-06  Myles C. Maxfield  
+
+REGRESSION(r216944): Font loads can cause Chinese characters to draw as .notdef
+https://bugs.webkit.org/show_bug.cgi?id=173962
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/font-loading-system-fallback-expected.html: Added.
+* fast/text/font-loading-system-fallback.html: Added.
+* http/tests/webfont/font-loading-system-fallback-visibility-expected.html: Added.
+* http/tests/webfont/font-loading-system-fallback-visibility.html: Added.
+
 2017-07-06  Matt Lewis  
 
 Unreviewed, rolling out r219193.


Added: trunk/LayoutTests/fast/text/font-loading-system-fallback-expected.html (0 => 219221)

--- trunk/LayoutTests/fast/text/font-loading-system-fallback-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-loading-system-fallback-expected.html	2017-07-06 22:09:11 UTC (rev 219221)
@@ -0,0 +1,9 @@
+
+
+
+
+
+This test makes sure that system fallback fonts (occuring when falling off the end of the fallback list) during loading are chosen from the best local font possible. The test passes if the Japanese character below is drawn in a font which matches with Helvetica's design.
+
+
+


Added: trunk/LayoutTests/fast/text/font-loading-system-fallback.html (0 => 219221)

--- trunk/LayoutTests/fast/text/font-loading-system-fallback.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-loading-system-fallback.html	2017-07-06 22:09:11 UTC (rev 219221)
@@ -0,0 +1,22 @@
+
+
+
+
+if (window.internals) {
+internals.settings.setWebFontsAlwaysFallBack(true);
+internals.clearMemoryCache();
+internals.invalidateFontCache();
+}
+
+
+@font-face {
+font-family: "WebFont";
+src: url("../../resources/Ahem.ttf") format("truetype");
+}
+
+
+
+This test makes sure that system fallback fonts (occuring when falling off the end of the fallback list) during loading are 

[webkit-changes] [219215] trunk/Source/WebCore

2017-07-06 Thread mmaxfield
Title: [219215] trunk/Source/WebCore








Revision 219215
Author mmaxfi...@apple.com
Date 2017-07-06 14:07:19 -0700 (Thu, 06 Jul 2017)


Log Message
Unify FontCascadeFonts::glyphDataForVariant() and FontCascadeFonts::glyphDataForNormalVariant()
https://bugs.webkit.org/show_bug.cgi?id=174213

Reviewed by Zalan Bujtas.

They have almost identical code. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=173962

No new tests because there is no behavior change.

* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForVariant):
(WebCore::FontCascadeFonts::glyphDataForCharacter):
(WebCore::FontCascadeFonts::glyphDataForNormalVariant): Deleted.
* platform/graphics/FontCascadeFonts.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp
trunk/Source/WebCore/platform/graphics/FontCascadeFonts.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (219214 => 219215)

--- trunk/Source/WebCore/ChangeLog	2017-07-06 20:51:20 UTC (rev 219214)
+++ trunk/Source/WebCore/ChangeLog	2017-07-06 21:07:19 UTC (rev 219215)
@@ -1,3 +1,20 @@
+2017-07-06  Myles C. Maxfield  
+
+Unify FontCascadeFonts::glyphDataForVariant() and FontCascadeFonts::glyphDataForNormalVariant()
+https://bugs.webkit.org/show_bug.cgi?id=174213
+
+Reviewed by Zalan Bujtas.
+
+They have almost identical code. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=173962
+
+No new tests because there is no behavior change.
+
+* platform/graphics/FontCascadeFonts.cpp:
+(WebCore::FontCascadeFonts::glyphDataForVariant):
+(WebCore::FontCascadeFonts::glyphDataForCharacter):
+(WebCore::FontCascadeFonts::glyphDataForNormalVariant): Deleted.
+* platform/graphics/FontCascadeFonts.h:
+
 2017-07-06  Don Olmstead  
 
 [PAL] Move KillRing into PAL


Modified: trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp (219214 => 219215)

--- trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp	2017-07-06 20:51:20 UTC (rev 219214)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp	2017-07-06 21:07:19 UTC (rev 219215)
@@ -356,17 +356,19 @@
 return fallbackGlyphData;
 }
 
-GlyphData FontCascadeFonts::glyphDataForVariant(UChar32 c, const FontCascadeDescription& description, FontVariant variant, unsigned fallbackIndex)
+GlyphData FontCascadeFonts::glyphDataForVariant(UChar32 character, const FontCascadeDescription& description, FontVariant variant, unsigned fallbackIndex)
 {
 ExternalResourceDownloadPolicy policy = ExternalResourceDownloadPolicy::Allow;
 GlyphData loadingResult;
-while (true) {
-auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex++);
+for (; ; ++fallbackIndex) {
+auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex);
 if (fontRanges.isNull())
 break;
-GlyphData data = "" policy);
+
+GlyphData data = "" policy);
 if (!data.font)
 continue;
+
 if (data.font->isInterstitial()) {
 policy = ExternalResourceDownloadPolicy::Forbid;
 if (!loadingResult.font)
@@ -373,51 +375,31 @@
 loadingResult = data;
 continue;
 }
-// The variantFont function should not normally return 0.
-// But if it does, we will just render the capital letter big.
-if (const Font* variantFont = data.font->variantFont(description, variant))
-return variantFont->glyphDataForCharacter(c);
-return data;
-}
 
-if (loadingResult.font)
-return loadingResult;
-return glyphDataForSystemFallback(c, description, variant);
-}
+if (variant == NormalVariant) {
+if (data.font->platformData().orientation() == Vertical && !data.font->isTextOrientationFallback()) {
+if (!FontCascade::isCJKIdeographOrSymbol(character))
+return glyphDataForNonCJKCharacterWithGlyphOrientation(character, description.nonCJKGlyphOrientation(), data);
 
-GlyphData FontCascadeFonts::glyphDataForNormalVariant(UChar32 c, const FontCascadeDescription& description)
-{
-ExternalResourceDownloadPolicy policy = ExternalResourceDownloadPolicy::Allow;
-GlyphData loadingResult;
-for (unsigned fallbackIndex = 0; ; ++fallbackIndex) {
-auto& fontRanges = realizeFallbackRangesAt(description, fallbackIndex);
-if (fontRanges.isNull())
-break;
-GlyphData data = "" policy);
-if (!data.font)
-continue;
-if (data.font->isInterstitial()) {
-policy = ExternalResourceDownloadPolicy::Forbid;
-if (!loadingResult.font)
-loadingResult = data;
-continue;
+if (!data.font->hasVerticalGlyphs()) {
+// Use the broken ideograph font data. The 

[webkit-changes] [219173] trunk

2017-07-05 Thread mmaxfield
Title: [219173] trunk








Revision 219173
Author mmaxfi...@apple.com
Date 2017-07-05 17:26:31 -0700 (Wed, 05 Jul 2017)


Log Message
CSSFontStyleValue::isItalic seems a bit bogus.
https://bugs.webkit.org/show_bug.cgi?id=174149

Reviewed by Tim Horton.

Source/WebCore:

Simple typo.

Test: editing/execCommand/italicizeByCharacter-normal.html

* css/CSSFontStyleValue.h:

LayoutTests:

* editing/execCommand/italicizeByCharacter-normal-expected.txt: Added.
* editing/execCommand/italicizeByCharacter-normal.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSFontStyleValue.h


Added Paths

trunk/LayoutTests/editing/execCommand/italicizeByCharacter-normal-expected.txt
trunk/LayoutTests/editing/execCommand/italicizeByCharacter-normal.html




Diff

Modified: trunk/LayoutTests/ChangeLog (219172 => 219173)

--- trunk/LayoutTests/ChangeLog	2017-07-06 00:05:36 UTC (rev 219172)
+++ trunk/LayoutTests/ChangeLog	2017-07-06 00:26:31 UTC (rev 219173)
@@ -1,3 +1,13 @@
+2017-07-05  Myles C. Maxfield  
+
+CSSFontStyleValue::isItalic seems a bit bogus.
+https://bugs.webkit.org/show_bug.cgi?id=174149
+
+Reviewed by Tim Horton.
+
+* editing/execCommand/italicizeByCharacter-normal-expected.txt: Added.
+* editing/execCommand/italicizeByCharacter-normal.html: Added.
+
 2017-07-05  Matt Lewis  
 
 Skipped webgl/1.0.2/conformance/glsl/misc/shader-with-non-reserved-words.html.


Added: trunk/LayoutTests/editing/execCommand/italicizeByCharacter-normal-expected.txt (0 => 219173)

--- trunk/LayoutTests/editing/execCommand/italicizeByCharacter-normal-expected.txt	(rev 0)
+++ trunk/LayoutTests/editing/execCommand/italicizeByCharacter-normal-expected.txt	2017-07-06 00:26:31 UTC (rev 219173)
@@ -0,0 +1,4 @@
+This tests italicizing the first character. The double quotation at the beginning must be italicized.
+
+"The quick brown fox jumps over the lazy dog" uses every letter in the english language.
+execItalicCommand: "The quick brown fox jumps over the lazy dog" uses every letter in the english language. 


Added: trunk/LayoutTests/editing/execCommand/italicizeByCharacter-normal.html (0 => 219173)

--- trunk/LayoutTests/editing/execCommand/italicizeByCharacter-normal.html	(rev 0)
+++ trunk/LayoutTests/editing/execCommand/italicizeByCharacter-normal.html	2017-07-06 00:26:31 UTC (rev 219173)
@@ -0,0 +1,38 @@
+ 
+
+
+
+.editing { 
+border: 2px solid red; 
+padding: 12px; 
+font-size: 24px; 
+}
+
+
+
+
+
+function editingTest() {
+execExtendSelectionForwardByCharacterCommand();
+italicCommand();
+}
+
+
+
+Editing Test 
+ 
+
+This tests italicizing the first character.  The double quotation at the beginning must be italicized.
+
+"The quick brown fox jumps over the lazy dog" uses every
+letter in the english language.
+
+
+
+
+runDumpAsTextEditingTest();
+
+
+
+
+


Modified: trunk/Source/WebCore/ChangeLog (219172 => 219173)

--- trunk/Source/WebCore/ChangeLog	2017-07-06 00:05:36 UTC (rev 219172)
+++ trunk/Source/WebCore/ChangeLog	2017-07-06 00:26:31 UTC (rev 219173)
@@ -1,3 +1,16 @@
+2017-07-05  Myles C. Maxfield  
+
+CSSFontStyleValue::isItalic seems a bit bogus.
+https://bugs.webkit.org/show_bug.cgi?id=174149
+
+Reviewed by Tim Horton.
+
+Simple typo.
+
+Test: editing/execCommand/italicizeByCharacter-normal.html
+
+* css/CSSFontStyleValue.h:
+
 2017-07-05  Brady Eidson  
 
 Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".


Modified: trunk/Source/WebCore/css/CSSFontStyleValue.h (219172 => 219173)

--- trunk/Source/WebCore/css/CSSFontStyleValue.h	2017-07-06 00:05:36 UTC (rev 219172)
+++ trunk/Source/WebCore/css/CSSFontStyleValue.h	2017-07-06 00:26:31 UTC (rev 219173)
@@ -50,7 +50,7 @@
 {
 if (!obliqueValue) {
 auto valueID = fontStyleValue->valueID();
-return valueID == CSSValueItalic || CSSValueOblique;
+return valueID == CSSValueItalic || valueID == CSSValueOblique;
 }
 return obliqueValue->value(CSSPrimitiveValue::CSS_DEG) >= static_cast(italicValue());
 }






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [219102] trunk

2017-07-03 Thread mmaxfield
Title: [219102] trunk








Revision 219102
Author mmaxfi...@apple.com
Date 2017-07-03 15:46:29 -0700 (Mon, 03 Jul 2017)


Log Message
REGRESSION(Variation Fonts): Specifying Skia by PostScript name does not yield the expected result
https://bugs.webkit.org/show_bug.cgi?id=174079


Reviewed by Alex Christensen.

Source/WebCore:

Because Skia is a variation font, its PostScript name contains values to apply to its variation
axes. However, WebKit's variation code was overwriting these intrinsive values with ones specified
by CSS. Therefore, the intrinsic ones were being ignored. The solution is just to pass a flag from
the lookup code to the variations code describing if the font was created via a PostScript name,
and to not apply the CSS properties to it if it was.

Test: fast/text/variations/skia-postscript-name.html

* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::platformFontLookupWithFamily):
(WebCore::fontWithFamily):

LayoutTests:

* fast/text/variations/skia-postscript-name-expected-mismatch.html: Added.
* fast/text/variations/skia-postscript-name.html: Added.
* platform/ios-simulator/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/ios-simulator/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCache.h
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp


Added Paths

trunk/LayoutTests/fast/text/variations/skia-postscript-name-expected-mismatch.html
trunk/LayoutTests/fast/text/variations/skia-postscript-name.html




Diff

Modified: trunk/LayoutTests/ChangeLog (219101 => 219102)

--- trunk/LayoutTests/ChangeLog	2017-07-03 22:29:17 UTC (rev 219101)
+++ trunk/LayoutTests/ChangeLog	2017-07-03 22:46:29 UTC (rev 219102)
@@ -1,3 +1,15 @@
+2017-07-03  Myles C. Maxfield  
+
+REGRESSION(Variation Fonts): Specifying Skia by PostScript name does not yield the expected result
+https://bugs.webkit.org/show_bug.cgi?id=174079
+
+
+Reviewed by Alex Christensen.
+
+* fast/text/variations/skia-postscript-name-expected-mismatch.html: Added.
+* fast/text/variations/skia-postscript-name.html: Added.
+* platform/ios-simulator/TestExpectations:
+
 2017-07-03  Per Arne Vollan  
 
 [Win] Update expectations for layout tests.


Added: trunk/LayoutTests/fast/text/variations/skia-postscript-name-expected-mismatch.html (0 => 219102)

--- trunk/LayoutTests/fast/text/variations/skia-postscript-name-expected-mismatch.html	(rev 0)
+++ trunk/LayoutTests/fast/text/variations/skia-postscript-name-expected-mismatch.html	2017-07-03 22:46:29 UTC (rev 219102)
@@ -0,0 +1,9 @@
+
+
+
+
+
+e
+
+
+


Added: trunk/LayoutTests/fast/text/variations/skia-postscript-name.html (0 => 219102)

--- trunk/LayoutTests/fast/text/variations/skia-postscript-name.html	(rev 0)
+++ trunk/LayoutTests/fast/text/variations/skia-postscript-name.html	2017-07-03 22:46:29 UTC (rev 219102)
@@ -0,0 +1,8 @@
+
+
+
+
+
+e
+
+


Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (219101 => 219102)

--- trunk/LayoutTests/platform/ios-simulator/TestExpectations	2017-07-03 22:29:17 UTC (rev 219101)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations	2017-07-03 22:46:29 UTC (rev 219102)
@@ -141,4 +141,7 @@
 http/tests/security/contentSecurityPolicy/WebAssembly-blocked.html [ Failure ]
 
 # WebGL tests which need triaging https://bugs.webkit.org/b/174100
-webgl/1.0.2/conformance/uniforms/uniform-default-values.html [ Failure ]
\ No newline at end of file
+webgl/1.0.2/conformance/uniforms/uniform-default-values.html [ Failure ]
+
+# This test requires Skia, which isn't available on iOS.
+webkit.org/b/174079 fast/text/variations/skia-postscript-name.html [ ImageOnlyFailure ]


Modified: trunk/Source/WebCore/ChangeLog (219101 => 219102)

--- trunk/Source/WebCore/ChangeLog	2017-07-03 22:29:17 UTC (rev 219101)
+++ trunk/Source/WebCore/ChangeLog	2017-07-03 22:46:29 UTC (rev 219102)
@@ -1,3 +1,25 @@
+2017-07-03  Myles C. Maxfield  
+
+REGRESSION(Variation Fonts): Specifying Skia by PostScript name does not yield the expected result
+https://bugs.webkit.org/show_bug.cgi?id=174079
+
+
+Reviewed by Alex Christensen.
+
+Because Skia is a variation font, its PostScript name contains values to apply to its variation
+axes. However, WebKit's variation code was overwriting these intrinsive values with ones specified
+by CSS. Therefore, the intrinsic ones were being ignored. The solution is just to pass a flag from
+the lookup code to the variations code describing if the font was created via a PostScript name,
+and to not apply the CSS properties to it if it was.
+
+Test: fast/text/variations/skia-postscript-name.html
+
+* 

[webkit-changes] [219054] trunk

2017-07-01 Thread mmaxfield
Title: [219054] trunk








Revision 219054
Author mmaxfi...@apple.com
Date 2017-07-01 16:29:07 -0700 (Sat, 01 Jul 2017)


Log Message
REGRESSION(r218371): Reeder's default font is Times instead of San Francisco
https://bugs.webkit.org/show_bug.cgi?id=173617


Reviewed by Simon Fraser.

Source/WebCore:

On systems where USE_PLATFORM_SYSTEM_FALLBACK_LIST is set to true, the code in
platformFontWithFamilySpecialCase() is still used when @font-face blocks specify
src:local(system-ui), which made the assertion erroneously fire.

Unfortunately, our architecture is such that an @font-face block represents a
single entry in the font-family fallback list, which means it would be quite
difficult to make local(system-ui) in an @font-face block expand at the level
of the font cascade. So, this patch simply reverts to the previous behavior for
local(system-ui) (which doesn't include the entire Core Text cascade list).
This means that "font-family: system-ui" and "src: local(system-ui)" have
different behavior, which is undesirable, but architecturally difficult to
solve. I've added some FIXMEs to the code in the relevant places and filed
https://bugs.webkit.org/show_bug.cgi?id=174023.

Test: fast/text/font-face-local-system.html

* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontCascadeDescription::effectiveFamilyAt):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::systemFontDescriptor):
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):

LayoutTests:

* fast/text/font-face-local-system-expected.html: Added.
* fast/text/font-face-local-system.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp
trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm


Added Paths

trunk/LayoutTests/fast/text/font-face-local-system-expected.html
trunk/LayoutTests/fast/text/font-face-local-system.html




Diff

Modified: trunk/LayoutTests/ChangeLog (219053 => 219054)

--- trunk/LayoutTests/ChangeLog	2017-07-01 21:42:43 UTC (rev 219053)
+++ trunk/LayoutTests/ChangeLog	2017-07-01 23:29:07 UTC (rev 219054)
@@ -1,3 +1,14 @@
+2017-07-01  Myles C. Maxfield  
+
+REGRESSION(r218371): Reeder's default font is Times instead of San Francisco
+https://bugs.webkit.org/show_bug.cgi?id=173617
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/font-face-local-system-expected.html: Added.
+* fast/text/font-face-local-system.html: Added.
+
 2017-06-30  Said Abou-Hallawa  
 
 If an image appears more than once on a page, decoding for painting one instance repaints them all


Added: trunk/LayoutTests/fast/text/font-face-local-system-expected.html (0 => 219054)

--- trunk/LayoutTests/fast/text/font-face-local-system-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-face-local-system-expected.html	2017-07-01 23:29:07 UTC (rev 219054)
@@ -0,0 +1,10 @@
+
+
+
+
+
+This test makes sure that local("system-ui") works in @font-face blocks. The test passes if the text below is drawn in the system font.
+Hello
+
+
+


Added: trunk/LayoutTests/fast/text/font-face-local-system.html (0 => 219054)

--- trunk/LayoutTests/fast/text/font-face-local-system.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-face-local-system.html	2017-07-01 23:29:07 UTC (rev 219054)
@@ -0,0 +1,15 @@
+
+
+
+
+@font-face {
+font-family: "WebFont";
+src: local("system-ui");
+}
+
+
+
+This test makes sure that local("system-ui") works in @font-face blocks. The test passes if the text below is drawn in the system font.
+Hello
+
+


Modified: trunk/Source/WebCore/ChangeLog (219053 => 219054)

--- trunk/Source/WebCore/ChangeLog	2017-07-01 21:42:43 UTC (rev 219053)
+++ trunk/Source/WebCore/ChangeLog	2017-07-01 23:29:07 UTC (rev 219054)
@@ -1,3 +1,35 @@
+2017-07-01  Myles C. Maxfield  
+
+REGRESSION(r218371): Reeder's default font is Times instead of San Francisco
+https://bugs.webkit.org/show_bug.cgi?id=173617
+
+
+Reviewed by Simon Fraser.
+
+On systems where USE_PLATFORM_SYSTEM_FALLBACK_LIST is set to true, the code in
+platformFontWithFamilySpecialCase() is still used when @font-face blocks specify
+src:local(system-ui), which made the assertion erroneously fire.
+
+Unfortunately, our architecture is such that an @font-face block represents a
+single entry in the font-family fallback list, which means it would be quite
+difficult to make local(system-ui) in an @font-face block expand at the level
+of the font cascade. So, this patch simply reverts to the previous behavior for
+local(system-ui) (which doesn't include the entire Core Text cascade list).
+   

[webkit-changes] [218919] trunk/Source/WebCore

2017-06-28 Thread mmaxfield
Title: [218919] trunk/Source/WebCore








Revision 218919
Author mmaxfi...@apple.com
Date 2017-06-28 22:45:44 -0700 (Wed, 28 Jun 2017)


Log Message
Only apply font features for the particular type of font they are being applied to
https://bugs.webkit.org/show_bug.cgi?id=172661



Reviewed by Simon Fraser.

There are two types of font formats which support features: AAT and OTF. Each of them has
a different idea about what the identity of a feature is. We were specifying both types
of feature identities to Core Text; however, this is causing Core Text to get confused.
Instead, we should only apply AAT features to AAT fonts and OTF features to OTF fonts.

Test: Un-marking these tests as failure on High Sierra:
  css3/font-variant-petite-caps-synthesis-coverage.html
  css3/font-variant-small-caps-synthesis-coverage.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontType::FontType):
(WebCore::preparePlatformFont):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::isGXVariableFont): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (218918 => 218919)

--- trunk/Source/WebCore/ChangeLog	2017-06-29 05:43:04 UTC (rev 218918)
+++ trunk/Source/WebCore/ChangeLog	2017-06-29 05:45:44 UTC (rev 218919)
@@ -1,3 +1,27 @@
+2017-06-28  Myles C. Maxfield  
+
+Only apply font features for the particular type of font they are being applied to
+https://bugs.webkit.org/show_bug.cgi?id=172661
+
+
+
+Reviewed by Simon Fraser.
+
+There are two types of font formats which support features: AAT and OTF. Each of them has
+a different idea about what the identity of a feature is. We were specifying both types
+of feature identities to Core Text; however, this is causing Core Text to get confused.
+Instead, we should only apply AAT features to AAT fonts and OTF features to OTF fonts.
+
+Test: Un-marking these tests as failure on High Sierra:
+  css3/font-variant-petite-caps-synthesis-coverage.html
+  css3/font-variant-small-caps-synthesis-coverage.html
+
+* platform/graphics/cocoa/FontCacheCoreText.cpp:
+(WebCore::FontType::FontType):
+(WebCore::preparePlatformFont):
+(WebCore::variationCapabilitiesForFontDescriptor):
+(WebCore::isGXVariableFont): Deleted.
+
 2017-06-28  Chris Dumez  
 
 [ResourceLoadStatistics] Simplify PrevalentResourceTelemetry struct


Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (218918 => 218919)

--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2017-06-29 05:43:04 UTC (rev 218918)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2017-06-29 05:45:44 UTC (rev 218919)
@@ -420,24 +420,6 @@
 return CFStringGetLength(name.get()) > 0 && CFStringGetCharacterAtIndex(name.get(), 0) == '.';
 }
 
-static inline bool isGXVariableFont(CTFontRef font)
-{
-auto tables = adoptCF(CTFontCopyAvailableTables(font, kCTFontTableOptionNoOptions));
-if (!tables)
-return false;
-auto size = CFArrayGetCount(tables.get());
-for (CFIndex i = 0; i < size; ++i) {
-// This is so yucky.
-// https://developer.apple.com/reference/coretext/1510774-ctfontcopyavailabletables
-// "The returned set will contain unboxed values, which can be extracted like so:"
-// "CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tags, index);"
-CTFontTableTag tableTag = static_cast(reinterpret_cast(CFArrayGetValueAtIndex(tables.get(), i)));
-if (tableTag == 'STAT')
-return false;
-}
-return true;
-}
-
 // These values were calculated by performing a linear regression on the CSS weights/widths/slopes and Core Text weights/widths/slopes of San Francisco.
 // FIXME:  Get the real values from Core Text.
 static inline float normalizeWeight(float value)
@@ -488,6 +470,49 @@
 }
 #endif
 
+struct FontType {
+FontType(CTFontRef font)
+{
+auto tables = adoptCF(CTFontCopyAvailableTables(font, kCTFontTableOptionNoOptions));
+if (!tables)
+return;
+auto size = CFArrayGetCount(tables.get());
+for (CFIndex i = 0; i < size; ++i) {
+// This is so yucky.
+// https://developer.apple.com/reference/coretext/1510774-ctfontcopyavailabletables
+// "The returned set will contain unboxed values, which can be extracted like so:"
+// "CTFontTableTag tag = (CTFontTableTag)(uintptr_t)CFArrayGetValueAtIndex(tags, index);"
+CTFontTableTag tableTag = static_cast(reinterpret_cast(CFArrayGetValueAtIndex(tables.get(), i)));
+switch (tableTag) {
+case 'fvar':
+if (variationType == VariationType::NotVariable)
+  

[webkit-changes] [218909] trunk

2017-06-28 Thread mmaxfield
Title: [218909] trunk








Revision 218909
Author mmaxfi...@apple.com
Date 2017-06-28 19:46:11 -0700 (Wed, 28 Jun 2017)


Log Message
[iOS] Cannot italicize or bold text rendered with text styles
https://bugs.webkit.org/show_bug.cgi?id=173634

Reviewed by Darin Adler.

Source/WebCore:

r218616 enabled the new cascade list codepath for "system-ui," but didn't do it for the named
text styles (like "font: -apple-system-tall-body;"). This new codepath is better because it
correctly specifies weights and italics (using kCTFontWeightTrait and kCTFontSlantTrait) instead
of using symbolic traits, and because it correctly handles fonts in the Core Text fallback chain.
This patch migrates the named text styles to this new codepath.

Test: fast/text/ipad/bold-tall-body-text-style.html

* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal):
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::convertArray):
(WebCore::convertArray):
(WebCore::makeNeverDestroyed):
(WebCore::isUIFontTextStyle):
(WebCore::systemFontParameters):
(WebCore::FontCascadeDescription::effectiveFamilyCount):
(WebCore::FontCascadeDescription::effectiveFamilyAt):
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal): Deleted.
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):

LayoutTests:

* fast/text/ipad/bold-tall-body-text-style-expected-mismatch.html: Added.
* fast/text/ipad/bold-tall-body-text-style.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp
trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm


Added Paths

trunk/LayoutTests/fast/text/ipad/
trunk/LayoutTests/fast/text/ipad/bold-tall-body-text-style-expected-mismatch.html
trunk/LayoutTests/fast/text/ipad/bold-tall-body-text-style.html




Diff

Modified: trunk/LayoutTests/ChangeLog (218908 => 218909)

--- trunk/LayoutTests/ChangeLog	2017-06-29 01:34:51 UTC (rev 218908)
+++ trunk/LayoutTests/ChangeLog	2017-06-29 02:46:11 UTC (rev 218909)
@@ -1,3 +1,13 @@
+2017-06-27  Myles C. Maxfield  
+
+[iOS] Cannot italicize or bold text rendered with text styles
+https://bugs.webkit.org/show_bug.cgi?id=173634
+
+Reviewed by Darin Adler.
+
+* fast/text/ipad/bold-tall-body-text-style-expected-mismatch.html: Added.
+* fast/text/ipad/bold-tall-body-text-style.html: Added.
+
 2017-06-28  Devin Rousso  
 
 Web Inspector: Instrument active pixel memory used by canvases


Added: trunk/LayoutTests/fast/text/ipad/bold-tall-body-text-style-expected-mismatch.html (0 => 218909)

--- trunk/LayoutTests/fast/text/ipad/bold-tall-body-text-style-expected-mismatch.html	(rev 0)
+++ trunk/LayoutTests/fast/text/ipad/bold-tall-body-text-style-expected-mismatch.html	2017-06-29 02:46:11 UTC (rev 218909)
@@ -0,0 +1,8 @@
+
+
+
+
+
+Hello
+
+


Added: trunk/LayoutTests/fast/text/ipad/bold-tall-body-text-style.html (0 => 218909)

--- trunk/LayoutTests/fast/text/ipad/bold-tall-body-text-style.html	(rev 0)
+++ trunk/LayoutTests/fast/text/ipad/bold-tall-body-text-style.html	2017-06-29 02:46:11 UTC (rev 218909)
@@ -0,0 +1,8 @@
+
+
+
+
+
+Hello
+
+


Modified: trunk/Source/WebCore/ChangeLog (218908 => 218909)

--- trunk/Source/WebCore/ChangeLog	2017-06-29 01:34:51 UTC (rev 218908)
+++ trunk/Source/WebCore/ChangeLog	2017-06-29 02:46:11 UTC (rev 218909)
@@ -1,3 +1,38 @@
+2017-06-27  Myles C. Maxfield  
+
+[iOS] Cannot italicize or bold text rendered with text styles
+https://bugs.webkit.org/show_bug.cgi?id=173634
+
+Reviewed by Darin Adler.
+
+r218616 enabled the new cascade list codepath for "system-ui," but didn't do it for the named
+text styles (like "font: -apple-system-tall-body;"). This new codepath is better because it
+correctly specifies weights and italics (using kCTFontWeightTrait and kCTFontSlantTrait) instead
+of using symbolic traits, and because it correctly handles fonts in the Core Text fallback chain.
+This patch migrates the named text styles to this new codepath.
+
+Test: fast/text/ipad/bold-tall-body-text-style.html
+
+* 

[webkit-changes] [218733] trunk

2017-06-22 Thread mmaxfield
Title: [218733] trunk








Revision 218733
Author mmaxfi...@apple.com
Date 2017-06-22 19:17:21 -0700 (Thu, 22 Jun 2017)


Log Message
@font-face rules with invalid primary fonts never download their secondary fonts
https://bugs.webkit.org/show_bug.cgi?id=173138


Reviewed by Simon Fraser.

Source/WebCore:

We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
try to download the next item in the src: list because the CSSFontFace is succeeded.

This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.

This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
only be resolved if the fonts are actually parsed and understood by our text system.

Test: fast/text/font-fallback-invalid-load.html

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
data. This is the crux of this patch.
(WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
state, which means now we know we should always be able to understand the bytes of the file. Therefore,
we can change some if statements into ASSERT()s.
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::createFont): Ditto.
(WebCore::CachedSVGFont::ensureCustomFontData): Similarly to CSSFontFaceSource::fontLoaded(), this
adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
later we will always be able to create the font object.

LayoutTests:

* fast/text/font-fallback-invalid-load-expected.html: Added.
* fast/text/font-fallback-invalid-load.html: Added.
* fast/text/resources/bogus.svg: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSFontFaceSource.cpp
trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp


Added Paths

trunk/LayoutTests/fast/text/font-fallback-invalid-load-expected.html
trunk/LayoutTests/fast/text/font-fallback-invalid-load.html
trunk/LayoutTests/fast/text/resources/bogus.svg




Diff

Modified: trunk/LayoutTests/ChangeLog (218732 => 218733)

--- trunk/LayoutTests/ChangeLog	2017-06-23 02:13:42 UTC (rev 218732)
+++ trunk/LayoutTests/ChangeLog	2017-06-23 02:17:21 UTC (rev 218733)
@@ -1,3 +1,15 @@
+2017-06-22  Myles C. Maxfield  
+
+@font-face rules with invalid primary fonts never download their secondary fonts
+https://bugs.webkit.org/show_bug.cgi?id=173138
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/font-fallback-invalid-load-expected.html: Added.
+* fast/text/font-fallback-invalid-load.html: Added.
+* fast/text/resources/bogus.svg: Added.
+
 2017-06-22  Youenn Fablet  
 
 Add a test for multi data channel peer connection


Added: trunk/LayoutTests/fast/text/font-fallback-invalid-load-expected.html (0 => 218733)

--- trunk/LayoutTests/fast/text/font-fallback-invalid-load-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-fallback-invalid-load-expected.html	2017-06-23 02:17:21 UTC (rev 218733)
@@ -0,0 +1,15 @@
+
+
+
+
+@font-face {
+font-family: "WebFont";
+src: url("../../resources/Ahem.ttf") format("truetype");
+}
+
+
+
+This test makes sure that an @font-face with an invalid primary font file is rendered. The test passes if you see something other than this text on the page.
+Hello
+
+


Added: trunk/LayoutTests/fast/text/font-fallback-invalid-load.html (0 => 218733)

--- trunk/LayoutTests/fast/text/font-fallback-invalid-load.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-fallback-invalid-load.html	2017-06-23 02:17:21 UTC (rev 218733)
@@ -0,0 +1,33 @@
+
+
+
+
+if (window.testRunner)
+testRunner.waitUntilDone();
+
+
+@font-face {
+font-family: "WebFont";
+src: url("resources/bogus.svg") format("svg"), url("../../resources/Ahem.ttf") format("truetype");
+}
+
+
+
+This test makes sure that an @font-face with an invalid primary font file is rendered. The test passes if you see something other than this text on the page.
+Hello
+
+
+// We're waiting for Ahem to be loaded. Unfortunately, the WK API says that the load is complete when the number of concurrent in-flight subresources
+// hits 0, which occurs 

[webkit-changes] [218616] trunk

2017-06-20 Thread mmaxfield
Title: [218616] trunk








Revision 218616
Author mmaxfi...@apple.com
Date 2017-06-20 16:52:22 -0700 (Tue, 20 Jun 2017)


Log Message
[Cocoa] The system Japanese font cannot be italicized
https://bugs.webkit.org/show_bug.cgi?id=173300


Reviewed by Ryosuke Niwa.

Source/WebCore:

Items in the system font cascade list may lie about whether or not they support italics.
In order to get the truth, we need to use the physical font underlying the font in question,
because this one won't lie. Then, we can interrogate this physical font about its traits
in order to synthesize italics correctly.

Test: fast/text/system-font-japanese-synthetic-italic.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::lookupFallbackFont):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges):

LayoutTests:

* fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html: Added.
* fast/text/system-font-japanese-synthetic-italic.html: Added.
* platform/mac/TestExpectations: This codepath doesn't work in El Capitan.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp


Added Paths

trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html
trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic.html




Diff

Modified: trunk/LayoutTests/ChangeLog (218615 => 218616)

--- trunk/LayoutTests/ChangeLog	2017-06-20 23:42:18 UTC (rev 218615)
+++ trunk/LayoutTests/ChangeLog	2017-06-20 23:52:22 UTC (rev 218616)
@@ -1,3 +1,15 @@
+2017-06-20  Myles C. Maxfield  
+
+[Cocoa] The system Japanese font cannot be italicized
+https://bugs.webkit.org/show_bug.cgi?id=173300
+
+
+Reviewed by Ryosuke Niwa.
+
+* fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html: Added.
+* fast/text/system-font-japanese-synthetic-italic.html: Added.
+* platform/mac/TestExpectations: This codepath doesn't work in El Capitan.
+
 2017-06-20  Ryan Haddad  
 
 Unreviewed, rolling out r218524.


Added: trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html (0 => 218616)

--- trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html	(rev 0)
+++ trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html	2017-06-20 23:52:22 UTC (rev 218616)
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+This test makes sure that the Japanese system font can be italicized. The test passes if the character below is oblique (either because the font supports it or because WebKit synthesizes the oblique).
+の
+
+


Added: trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic.html (0 => 218616)

--- trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic.html	(rev 0)
+++ trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic.html	2017-06-20 23:52:22 UTC (rev 218616)
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+This test makes sure that the Japanese system font can be italicized. The test passes if the character below is oblique (either because the font supports it or because WebKit synthesizes the oblique).
+の
+
+


Modified: trunk/LayoutTests/platform/mac/TestExpectations (218615 => 218616)

--- trunk/LayoutTests/platform/mac/TestExpectations	2017-06-20 23:42:18 UTC (rev 218615)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2017-06-20 23:52:22 UTC (rev 218616)
@@ -1605,3 +1605,4 @@
 
 webkit.org/b/173487 imported/w3c/web-platform-tests/IndexedDB/large-nested-cloning.html [ Pass Failure ]
 
+webkit.org/b/313156 [ ElCapitan ] fast/text/system-font-japanese-synthetic-italic.html [ ImageOnlyFailure ]


Modified: trunk/Source/WebCore/ChangeLog (218615 => 218616)

--- trunk/Source/WebCore/ChangeLog	2017-06-20 23:42:18 UTC (rev 218615)
+++ trunk/Source/WebCore/ChangeLog	2017-06-20 23:52:22 UTC (rev 218616)
@@ -1,3 +1,23 @@
+2017-06-20  Myles C. Maxfield  
+
+[Cocoa] The system Japanese font cannot be italicized
+https://bugs.webkit.org/show_bug.cgi?id=173300
+
+
+Reviewed by Ryosuke Niwa.
+
+Items in the system font cascade list may lie about whether or not they support italics.
+In order to get the truth, we need to use the physical font underlying the font in question,
+because this one won't lie. Then, we can interrogate this physical font about its traits
+in order to synthesize italics correctly.
+
+Test: fast/text/system-font-japanese-synthetic-italic.html
+
+* platform/graphics/cocoa/FontCacheCoreText.cpp:
+(WebCore::lookupFallbackFont):
+* 

[webkit-changes] [218524] trunk

2017-06-19 Thread mmaxfield
Title: [218524] trunk








Revision 218524
Author mmaxfi...@apple.com
Date 2017-06-19 19:28:18 -0700 (Mon, 19 Jun 2017)


Log Message
[Cocoa] The system Japanese font cannot be italicized
https://bugs.webkit.org/show_bug.cgi?id=173300


Reviewed by Ryosuke Niwa.

Source/WebCore:

Items in the system font cascade list may lie about whether or not they support italics.
In order to get the truth, we need to use the physical font underlying the font in question,
because this one won't lie. Then, we can interrogate this physical font about its traits
in order to synthesize italics correctly.

Test: fast/text/system-font-japanese-synthetic-italic.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::lookupFallbackFont):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges):

LayoutTests:

* fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html: Added.
* fast/text/system-font-japanese-synthetic-italic.html: Added.
* platform/mac/TestExpectations: This codepath doesn't work in El Capitan.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp


Added Paths

trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html
trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic.html




Diff

Modified: trunk/LayoutTests/ChangeLog (218523 => 218524)

--- trunk/LayoutTests/ChangeLog	2017-06-20 01:47:00 UTC (rev 218523)
+++ trunk/LayoutTests/ChangeLog	2017-06-20 02:28:18 UTC (rev 218524)
@@ -1,3 +1,15 @@
+2017-06-19  Myles C. Maxfield  
+
+[Cocoa] The system Japanese font cannot be italicized
+https://bugs.webkit.org/show_bug.cgi?id=173300
+
+
+Reviewed by Ryosuke Niwa.
+
+* fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html: Added.
+* fast/text/system-font-japanese-synthetic-italic.html: Added.
+* platform/mac/TestExpectations: This codepath doesn't work in El Capitan.
+
 2017-06-19  Youenn Fablet  
 
 Improve debugging ability of some webrtc tests


Added: trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html (0 => 218524)

--- trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html	(rev 0)
+++ trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic-expected-mismatch.html	2017-06-20 02:28:18 UTC (rev 218524)
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+This test makes sure that the Japanese system font can be italicized. The test passes if the character below is oblique (either because the font supports it or because WebKit synthesizes the oblique).
+の
+
+


Added: trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic.html (0 => 218524)

--- trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic.html	(rev 0)
+++ trunk/LayoutTests/fast/text/system-font-japanese-synthetic-italic.html	2017-06-20 02:28:18 UTC (rev 218524)
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+This test makes sure that the Japanese system font can be italicized. The test passes if the character below is oblique (either because the font supports it or because WebKit synthesizes the oblique).
+の
+
+


Modified: trunk/LayoutTests/platform/mac/TestExpectations (218523 => 218524)

--- trunk/LayoutTests/platform/mac/TestExpectations	2017-06-20 01:47:00 UTC (rev 218523)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2017-06-20 02:28:18 UTC (rev 218524)
@@ -1605,3 +1605,4 @@
 
 webkit.org/b/173487 imported/w3c/web-platform-tests/IndexedDB/large-nested-cloning.html [ Pass Failure ]
 
+webkit.org/b/313156 [ ElCapitan ] fast/text/system-font-japanese-synthetic-italic.html [ ImageOnlyFailure ]


Modified: trunk/Source/WebCore/ChangeLog (218523 => 218524)

--- trunk/Source/WebCore/ChangeLog	2017-06-20 01:47:00 UTC (rev 218523)
+++ trunk/Source/WebCore/ChangeLog	2017-06-20 02:28:18 UTC (rev 218524)
@@ -1,3 +1,23 @@
+2017-06-19  Myles C. Maxfield  
+
+[Cocoa] The system Japanese font cannot be italicized
+https://bugs.webkit.org/show_bug.cgi?id=173300
+
+
+Reviewed by Ryosuke Niwa.
+
+Items in the system font cascade list may lie about whether or not they support italics.
+In order to get the truth, we need to use the physical font underlying the font in question,
+because this one won't lie. Then, we can interrogate this physical font about its traits
+in order to synthesize italics correctly.
+
+Test: fast/text/system-font-japanese-synthetic-italic.html
+
+* platform/graphics/cocoa/FontCacheCoreText.cpp:
+(WebCore::lookupFallbackFont):
+* 

[webkit-changes] [218421] trunk/Source/WebCore

2017-06-16 Thread mmaxfield
Title: [218421] trunk/Source/WebCore








Revision 218421
Author mmaxfi...@apple.com
Date 2017-06-16 15:46:21 -0700 (Fri, 16 Jun 2017)


Log Message
Make builds faster after r218371
https://bugs.webkit.org/show_bug.cgi?id=173453

Reviewed by Tim Horton.

Remove #includes from .h files.

No new tests because there is no behavior change.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj: Add new .cpp file, and sort the project file
* platform/graphics/FontFamilySpecificationNull.cpp: Copied from Source/WebCore/platform/graphics/FontFamilySpecificationNull.h.
(WebCore::FontFamilySpecificationNull::fontRanges):
* platform/graphics/FontFamilySpecificationNull.h:
(WebCore::FontFamilySpecificationNull::fontRanges): Deleted.
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
(WebCore::FontFamilySpecificationCoreText::~FontFamilySpecificationCoreText):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
(WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText): Deleted.

Modified Paths

trunk/Source/WebCore/CMakeLists.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/platform/graphics/FontFamilySpecificationNull.h
trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h


Added Paths

trunk/Source/WebCore/platform/graphics/FontFamilySpecificationNull.cpp




Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (218420 => 218421)

--- trunk/Source/WebCore/CMakeLists.txt	2017-06-16 22:35:07 UTC (rev 218420)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-06-16 22:46:21 UTC (rev 218421)
@@ -2272,6 +2272,7 @@
 platform/graphics/FontCascade.cpp
 platform/graphics/FontCascadeFonts.cpp
 platform/graphics/FontDescription.cpp
+platform/graphics/FontFamilySpecificationNull.cpp
 platform/graphics/FontSelectionAlgorithm.cpp
 platform/graphics/FontTaggedSettings.cpp
 platform/graphics/FontGenericFamilies.cpp


Modified: trunk/Source/WebCore/ChangeLog (218420 => 218421)

--- trunk/Source/WebCore/ChangeLog	2017-06-16 22:35:07 UTC (rev 218420)
+++ trunk/Source/WebCore/ChangeLog	2017-06-16 22:46:21 UTC (rev 218421)
@@ -1,3 +1,26 @@
+2017-06-16  Myles C. Maxfield  
+
+Make builds faster after r218371
+https://bugs.webkit.org/show_bug.cgi?id=173453
+
+Reviewed by Tim Horton.
+
+Remove #includes from .h files.
+
+No new tests because there is no behavior change.
+
+* CMakeLists.txt:
+* WebCore.xcodeproj/project.pbxproj: Add new .cpp file, and sort the project file
+* platform/graphics/FontFamilySpecificationNull.cpp: Copied from Source/WebCore/platform/graphics/FontFamilySpecificationNull.h.
+(WebCore::FontFamilySpecificationNull::fontRanges):
+* platform/graphics/FontFamilySpecificationNull.h:
+(WebCore::FontFamilySpecificationNull::fontRanges): Deleted.
+* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
+(WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText):
+(WebCore::FontFamilySpecificationCoreText::~FontFamilySpecificationCoreText):
+* platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
+(WebCore::FontFamilySpecificationCoreText::FontFamilySpecificationCoreText): Deleted.
+
 2017-06-16  Chris Dumez  
 
 [WK2] Add WKProcessPool SPI to efficiently reset all plugin load client policies


Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (218420 => 218421)

--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-06-16 22:35:07 UTC (rev 218420)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-06-16 22:46:21 UTC (rev 218421)
@@ -2869,6 +2869,8 @@
 		65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; };
 		69A6CBAC1C6BE42C00B836E9 /* AccessibilitySVGElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 697101071C6BE1550018C7F1 /* AccessibilitySVGElement.cpp */; };
 		69A6CBAD1C6BE42C00B836E9 /* AccessibilitySVGElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */; };
+		6A32D7CE1A16D8C000412F0B /* InspectorCanvasAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6A4B6D6619D225D8006F11D3 /* InspectorCanvasAgent.cpp */; };
+		6A4B6D6519D22519006F11D3 /* InspectorCanvasAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A4B6D6419D22519006F11D3 /* InspectorCanvasAgent.h */; };
 		6B3480940EEF50D400AC1B41 /* NativeImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6B693A2E1C51A82E00B03BEF /* ResourceLoadObserver.h in Headers */ = {isa = 

[webkit-changes] [218372] trunk/Source/WebCore

2017-06-15 Thread mmaxfield
Title: [218372] trunk/Source/WebCore








Revision 218372
Author mmaxfi...@apple.com
Date 2017-06-15 18:07:59 -0700 (Thu, 15 Jun 2017)


Log Message
Removing stray whitespace after r218371
https://bugs.webkit.org/show_bug.cgi?id=173043

Unreviewed.

No new tests because there is no behavior change.

* platform/graphics/FontCascadeFonts.cpp:
(WebCore::shouldIgnoreRotation):
(WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
* platform/graphics/FontDescription.cpp:
* platform/graphics/FontDescription.h:
* platform/graphics/FontFamilySpecificationNull.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::systemFontParameters):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationCoreText::fontRanges):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp
trunk/Source/WebCore/platform/graphics/FontDescription.cpp
trunk/Source/WebCore/platform/graphics/FontDescription.h
trunk/Source/WebCore/platform/graphics/FontFamilySpecificationNull.h
trunk/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (218371 => 218372)

--- trunk/Source/WebCore/ChangeLog	2017-06-16 00:56:44 UTC (rev 218371)
+++ trunk/Source/WebCore/ChangeLog	2017-06-16 01:07:59 UTC (rev 218372)
@@ -1,5 +1,27 @@
 2017-06-15  Myles C. Maxfield  
 
+Removing stray whitespace after r218371
+https://bugs.webkit.org/show_bug.cgi?id=173043
+
+Unreviewed.
+
+No new tests because there is no behavior change.
+
+* platform/graphics/FontCascadeFonts.cpp:
+(WebCore::shouldIgnoreRotation):
+(WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
+* platform/graphics/FontDescription.cpp:
+* platform/graphics/FontDescription.h:
+* platform/graphics/FontFamilySpecificationNull.h:
+* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
+(WebCore::SystemFontDatabase::systemFontCascadeList):
+(WebCore::systemFontParameters):
+* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
+(WebCore::FontFamilySpecificationCoreText::fontRanges):
+* platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
+
+2017-06-15  Myles C. Maxfield  
+
 [Cocoa] Expand system-ui to include every item in the Core Text cascade list
 https://bugs.webkit.org/show_bug.cgi?id=173043
 


Modified: trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp (218371 => 218372)

--- trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp	2017-06-16 00:56:44 UTC (rev 218371)
+++ trunk/Source/WebCore/platform/graphics/FontCascadeFonts.cpp	2017-06-16 01:07:59 UTC (rev 218372)
@@ -222,7 +222,7 @@
 
 if (isInRange(character, 0x002E5, 0x002EB))
 return true;
-
+
 if (isInRange(character, 0x01100, 0x011FF) || isInRange(character, 0x01401, 0x0167F) || isInRange(character, 0x01800, 0x018FF))
 return true;
 
@@ -283,13 +283,13 @@
 || isInRange(character, 0x1D000, 0x1D1FF) || isInRange(character, 0x1D300, 0x1D37F)
 || isInRange(character, 0x1F000, 0x1F64F) || isInRange(character, 0x1F680, 0x1F77F))
 return true;
-
+
 if (isInRange(character, 0x2, 0x2FFFD) || isInRange(character, 0x3, 0x3FFFD))
 return true;
 
 return false;
 }
-
+
 static GlyphData glyphDataForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, const GlyphData& data)
 {
 bool syntheticOblique = data.font->platformData().syntheticOblique();
@@ -308,7 +308,7 @@
 return uprightData;
 } else if (orientation == NonCJKGlyphOrientation::Mixed) {
 GlyphData verticalRightData = data.font->verticalRightOrientationFont().glyphDataForCharacter(character);
-
+
 // If there is a baked-in rotated glyph, we will use it unless syntheticOblique is set. If
 // synthetic oblique is set, we fall back to the horizontal glyph. This guarantees that vertical
 // fonts without isTextOrientationFallback() set contain CJK characters only and thus we can get


Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (218371 => 218372)

--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2017-06-16 00:56:44 UTC (rev 218371)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp	2017-06-16 01:07:59 UTC (rev 218372)
@@ -101,7 +101,7 @@
 void FontDescription::invalidateCaches()
 {
 }
-
+
 unsigned FontCascadeDescription::effectiveFamilyCount() const
 {
 return familyCount();


Modified: 

[webkit-changes] [218371] trunk

2017-06-15 Thread mmaxfield
Title: [218371] trunk








Revision 218371
Author mmaxfi...@apple.com
Date 2017-06-15 17:56:44 -0700 (Thu, 15 Jun 2017)


Log Message
[Cocoa] Expand system-ui to include every item in the Core Text cascade list
https://bugs.webkit.org/show_bug.cgi?id=173043


Reviewed by Simon Fraser.

Source/WebCore:

The concept of the system font on Cocoa platforms represents the entire Core Text cascade list.
However, previously, WebKit only represented system-ui by pulling out the first item in the Core
Text cascade list. Instead, we should make all text rendered with "system-ui" match what the
platform would natively render.

Previously, we walked through the strings in the font-family property and looked them up one by
one. However, now we want to abstract this idea of a font family to possibly hold a
CTFontDescriptorRef instead of a string. This way, we expand a font-family list of ["fontA",
"system-ui", "fontB"] to ["fontA", ... a bunch of CTFontDescriptorRefs ..., "FontB"]. We can
then modify the consumer of this object to have two codepaths: the old string-based codepath,
and a new, platform-specific codepath which simply embeds the CTFontDesriptorRefs inside a Font
object.

We don't want to simply pull out the family name from each item in the Core Text fallback list
because that is a lossy translation. There is more information in these font descriptors which
cannot be represented by CSS. Therefore, we must keep the descriptors alive and add the new
codepath for them.

We also don't want to run the CSS font matching algorithm on each member of the Core Text
fallback list because it may yield different results from Core Text's font matching algorithm.
Our goal is to draw text as closely as possible to the system APIs. If we ran it, we may find
a font which is closer to the requested traits, but it would look out of place on the system.

This new codepath is only enabled on macOS High Sierra and iOS 11, because enabling it on all
operating systems would make fixing https://bugs.webkit.org/show_bug.cgi?id=173300 impossible.

Tests: fast/text/system-font-fallback-emoji.html
   fast/text/system-font-fallback.html
   fast/text/system-font-zero-size.html

* WebCore.xcodeproj/project.pbxproj:
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::realizeNextFallback): The consumer of our new data type. Now uses WTF::visit().
(WebCore::FontCascadeFonts::realizeFallbackRangesAt): Now that the number of items to test
against the current character is larger than the number of strings in the font-family list,
we need to update the existing code to use the correct value.
* platform/graphics/FontDescription.cpp: Default implementation for non-Cocoa ports.
(WebCore::FontDescription::invalidateCaches):
(WebCore::FontCascadeDescription::effectiveFamilyCount):
(WebCore::FontCascadeDescription::effectiveFamilyAt):
* platform/graphics/FontDescription.h: Our new data type is a Variant of AtomicString and a
platform-specific class. Cocoa uses a class that holds a CTFontDescriptorRef and other ports
use an empty non-constructable class.
* platform/graphics/FontFamilySpecificationNull.h: Added. The empty non-constructable
class.
(WebCore::FontFamilySpecificationNull::fontRanges):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
(WebCore::FontCache::platformInit): Changing the system language will change the system font
fallback list, so we need to listen to this notification. This also matters for
FontCache::systemFallbackForCharacters(), so we should build off the same callback we are
already using for font installation.
(WebCore::invalidateFontCache):
* platform/graphics/cocoa/FontDescriptionCocoa.cpp: Added. The platform-specific creation of
our CTFontDescriptorRefs. We hold them cached in a SystemFontDatabase.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
(WebCore::SystemFontDatabase::singleton):
(WebCore::SystemFontDatabase::systemFontCascadeList):
(WebCore::SystemFontDatabase::clear):
(WebCore::SystemFontDatabase::SystemFontDatabase):
(WebCore::SystemFontDatabase::applyWeightAndItalics):
(WebCore::SystemFontDatabase::removeCascadeList):
(WebCore::SystemFontDatabase::computeCascadeList):
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash):
(WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal):
(WebCore::isSystemFontString):
(WebCore::systemFontParameters):
(WebCore::FontDescription::invalidateCaches):
(WebCore::FontCascadeDescription::effectiveFamilyCount): We don't store the result of this
because it would probably be a bad idea to increase the size of every single FontCascade just
in 

[webkit-changes] [218163] trunk/Source/WebCore

2017-06-12 Thread mmaxfield
Title: [218163] trunk/Source/WebCore








Revision 218163
Author mmaxfi...@apple.com
Date 2017-06-12 20:14:21 -0700 (Mon, 12 Jun 2017)


Log Message
[iOS] [macOS] Stop soft-linking Core Text function in iOS 11 and macOS High Sierra
https://bugs.webkit.org/show_bug.cgi?id=173289

Reviewed by Lucas Forschler.

No new tests because there is no behavior change.

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (218162 => 218163)

--- trunk/Source/WebCore/ChangeLog	2017-06-13 03:10:24 UTC (rev 218162)
+++ trunk/Source/WebCore/ChangeLog	2017-06-13 03:14:21 UTC (rev 218163)
@@ -1,5 +1,19 @@
 2017-06-12  Myles C. Maxfield  
 
+[iOS] [macOS] Stop soft-linking Core Text function in iOS 11 and macOS High Sierra
+https://bugs.webkit.org/show_bug.cgi?id=173289
+
+Reviewed by Lucas Forschler.
+
+No new tests because there is no behavior change.
+
+* platform/graphics/ios/FontCacheIOS.mm:
+(WebCore::platformFontWithFamilySpecialCase):
+* platform/graphics/mac/FontCacheMac.mm:
+(WebCore::platformFontWithFamilySpecialCase):
+
+2017-06-12  Myles C. Maxfield  
+
 [Cocoa] Expand system-ui to include every item in the Core Text cascade list
 https://bugs.webkit.org/show_bug.cgi?id=173043
 


Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (218162 => 218163)

--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2017-06-13 03:10:24 UTC (rev 218162)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2017-06-13 03:14:21 UTC (rev 218163)
@@ -39,11 +39,6 @@
 #import 
 #import 
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 11
-SOFT_LINK_FRAMEWORK(CoreText);
-SOFT_LINK_MAY_FAIL(CoreText, CTFontDescriptorCreateLastResort, CTFontDescriptorRef, (), ());
-#endif
-
 namespace WebCore {
 
 bool requiresCustomFallbackFont(UChar32 character)
@@ -105,14 +100,13 @@
 
 if (equalLettersIgnoringASCIICase(family, "lastresort")) {
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 11
-if (canLoadCTFontDescriptorCreateLastResort()) {
-static NeverDestroyed lastResort = adoptCF(CTFontDescriptorCreateLastResort());
-return adoptCF(CTFontCreateWithFontDescriptor(lastResort.get().get(), size, nullptr));
-}
-#endif
+static NeverDestroyed lastResort = adoptCF(CTFontDescriptorCreateLastResort());
+return adoptCF(CTFontCreateWithFontDescriptor(lastResort.get().get(), size, nullptr));
+#else
 // LastResort is special, so it's important to look this exact string up, and not some case-folded version.
 // We handle this here so any caching and case folding we do in our general text codepath is bypassed.
 return adoptCF(CTFontCreateWithName(CFSTR("LastResort"), size, nullptr));
+#endif
 }
 
 return nullptr;


Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (218162 => 218163)

--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2017-06-13 03:10:24 UTC (rev 218162)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2017-06-13 03:14:21 UTC (rev 218163)
@@ -50,11 +50,6 @@
 
 #import "SoftLinking.h"
 
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
-SOFT_LINK_FRAMEWORK(CoreText);
-SOFT_LINK_MAY_FAIL(CoreText, CTFontDescriptorCreateLastResort, CTFontDescriptorRef, (), ());
-#endif
-
 namespace WebCore {
 
 #if PLATFORM(MAC)
@@ -87,14 +82,13 @@
 
 if (equalLettersIgnoringASCIICase(family, "lastresort")) {
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
-if (canLoadCTFontDescriptorCreateLastResort()) {
-static NeverDestroyed lastResort = adoptCF(CTFontDescriptorCreateLastResort());
-return adoptCF(CTFontCreateWithFontDescriptor(lastResort.get().get(), size, nullptr));
-}
-#endif
+static NeverDestroyed lastResort = adoptCF(CTFontDescriptorCreateLastResort());
+return adoptCF(CTFontCreateWithFontDescriptor(lastResort.get().get(), size, nullptr));
+#else
 // LastResort is special, so it's important to look this exact string up, and not some case-folded version.
 // We handle this here so any caching and case folding we do in our general text codepath is bypassed.
 return adoptCF(CTFontCreateWithName(CFSTR("LastResort"), size, nullptr));
+#endif
 }
 
 return nullptr;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [218157] trunk

2017-06-12 Thread mmaxfield
Title: [218157] trunk








Revision 218157
Author mmaxfi...@apple.com
Date 2017-06-12 17:05:55 -0700 (Mon, 12 Jun 2017)


Log Message
@font-face rules with invalid primary fonts never download their secondary fonts
https://bugs.webkit.org/show_bug.cgi?id=173138


Reviewed by Simon Fraser.

Source/WebCore:

We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
try to download the next item in the src: list because the CSSFontFace is succeeded.

This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.

This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
only be resolved if the fonts are actually parsed and understood by our text system.

Test: fast/text/font-fallback-invalid-load.html

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
data. This is the crux of this patch.
(WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
state, which means now we know we should always be able to understand the bytes of the file. Therefore,
we can change some if statements into ASSERT()s.
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::createFont): Ditto.
(WebCore::CachedSVGFont::platformDataFromCustomData): Similarly to CSSFontFaceSource::fontLoaded(), this
adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
later we will always be able to create the font object.

LayoutTests:

* fast/text/font-fallback-invalid-load-expected.html: Added.
* fast/text/font-fallback-invalid-load.html: Added.
* fast/text/resources/bogus.svg: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSFontFaceSource.cpp
trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp


Added Paths

trunk/LayoutTests/fast/text/font-fallback-invalid-load-expected.html
trunk/LayoutTests/fast/text/font-fallback-invalid-load.html
trunk/LayoutTests/fast/text/resources/bogus.svg




Diff

Modified: trunk/LayoutTests/ChangeLog (218156 => 218157)

--- trunk/LayoutTests/ChangeLog	2017-06-13 00:04:33 UTC (rev 218156)
+++ trunk/LayoutTests/ChangeLog	2017-06-13 00:05:55 UTC (rev 218157)
@@ -1,3 +1,15 @@
+2017-06-12  Myles C. Maxfield  
+
+@font-face rules with invalid primary fonts never download their secondary fonts
+https://bugs.webkit.org/show_bug.cgi?id=173138
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/font-fallback-invalid-load-expected.html: Added.
+* fast/text/font-fallback-invalid-load.html: Added.
+* fast/text/resources/bogus.svg: Added.
+
 2017-06-12  Daniel Bates  
 
 Implement W3C Secure Contexts Draft Specification


Added: trunk/LayoutTests/fast/text/font-fallback-invalid-load-expected.html (0 => 218157)

--- trunk/LayoutTests/fast/text/font-fallback-invalid-load-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-fallback-invalid-load-expected.html	2017-06-13 00:05:55 UTC (rev 218157)
@@ -0,0 +1,15 @@
+
+
+
+
+@font-face {
+font-family: "WebFont";
+src: url("../../resources/Ahem.ttf") format("truetype");
+}
+
+
+
+This test makes sure that an @font-face with an invalid primary font file is rendered. The test passes if you see something other than this text on the page.
+Hello
+
+


Added: trunk/LayoutTests/fast/text/font-fallback-invalid-load.html (0 => 218157)

--- trunk/LayoutTests/fast/text/font-fallback-invalid-load.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-fallback-invalid-load.html	2017-06-13 00:05:55 UTC (rev 218157)
@@ -0,0 +1,33 @@
+
+
+
+
+if (window.testRunner)
+testRunner.waitUntilDone();
+
+
+@font-face {
+font-family: "WebFont";
+src: url("resources/bogus.svg") format("svg"), url("../../resources/Ahem.ttf") format("truetype");
+}
+
+
+
+This test makes sure that an @font-face with an invalid primary font file is rendered. The test passes if you see something other than this text on the page.
+Hello
+
+
+// We're waiting for Ahem to be loaded. Unfortunately, the WK API says that the load is complete when the number of concurrent in-flight subresources
+// hits 0, which occurs 

[webkit-changes] [218086] trunk/LayoutTests

2017-06-11 Thread mmaxfield
Title: [218086] trunk/LayoutTests








Revision 218086
Author mmaxfi...@apple.com
Date 2017-06-11 22:03:53 -0700 (Sun, 11 Jun 2017)


Log Message
[iOS 11] fast/text/international/system-language/arabic-glyph-cache-fill-combine.html hardcodes the system UI Arabic font
https://bugs.webkit.org/show_bug.cgi?id=173244


Reviewed by Ryosuke Niwa.

iOS 11 changed this font, so we shouldn't hardcode it. Instead,
we can simply change this to an -expected-mismatch.html test to
specifically test against the ".notdef" glyph.

* fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected-mismatch.html: Renamed from LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected.html.

Modified Paths

trunk/LayoutTests/ChangeLog


Added Paths

trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected-mismatch.html


Removed Paths

trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected.html




Diff

Modified: trunk/LayoutTests/ChangeLog (218085 => 218086)

--- trunk/LayoutTests/ChangeLog	2017-06-12 05:02:38 UTC (rev 218085)
+++ trunk/LayoutTests/ChangeLog	2017-06-12 05:03:53 UTC (rev 218086)
@@ -1,5 +1,19 @@
 2017-06-11  Myles C. Maxfield  
 
+[iOS 11] fast/text/international/system-language/arabic-glyph-cache-fill-combine.html hardcodes the system UI Arabic font
+https://bugs.webkit.org/show_bug.cgi?id=173244
+
+
+Reviewed by Ryosuke Niwa.
+
+iOS 11 changed this font, so we shouldn't hardcode it. Instead,
+we can simply change this to an -expected-mismatch.html test to
+specifically test against the ".notdef" glyph.
+
+* fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected-mismatch.html: Renamed from LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected.html.
+
+2017-06-11  Myles C. Maxfield  
+
 fast/text/variations/getComputedStyle.html does not need to be asynchronous
 https://bugs.webkit.org/show_bug.cgi?id=173246
 


Copied: trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected-mismatch.html (from rev 218085, trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected.html) (0 => 218086)

--- trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected-mismatch.html	(rev 0)
+++ trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected-mismatch.html	2017-06-12 05:03:53 UTC (rev 218086)
@@ -0,0 +1,10 @@
+
+
+
+This test hits a codepath where codepoints were being combined before they were being input into our glyph cache.
+This character occurs just before combining marks in Unicode, and therefore was being erroneously combined. The test
+passes if the glyph is drawn in a font other than LastResort (if the test fails, the character looks like a box or like
+three horizontal lines).
+
+
+


Deleted: trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected.html (218085 => 218086)

--- trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected.html	2017-06-12 05:02:38 UTC (rev 218085)
+++ trunk/LayoutTests/fast/text/international/system-language/arabic-glyph-cache-fill-combine-expected.html	2017-06-12 05:03:53 UTC (rev 218086)
@@ -1,10 +0,0 @@
-
-
-
-This test hits a codepath where codepoints were being combined before they were being input into our glyph cache.
-This character occurs just before combining marks in Unicode, and therefore was being erroneously combined. The test
-passes if the glyph is drawn in a font other than LastResort (if the test fails, the character looks like a box or like
-three horizontal lines).
-
-
-






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [218085] trunk/LayoutTests

2017-06-11 Thread mmaxfield
Title: [218085] trunk/LayoutTests








Revision 218085
Author mmaxfi...@apple.com
Date 2017-06-11 22:02:38 -0700 (Sun, 11 Jun 2017)


Log Message
fast/text/variations/getComputedStyle.html does not need to be asynchronous
https://bugs.webkit.org/show_bug.cgi?id=173246


Reviewed by Sam Weinig.

I dont know why I made it asynchronous in the first place.

* fast/text/variations/getComputedStyle.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/fast/text/variations/getComputedStyle.html




Diff

Modified: trunk/LayoutTests/ChangeLog (218084 => 218085)

--- trunk/LayoutTests/ChangeLog	2017-06-12 03:58:23 UTC (rev 218084)
+++ trunk/LayoutTests/ChangeLog	2017-06-12 05:02:38 UTC (rev 218085)
@@ -1,3 +1,15 @@
+2017-06-11  Myles C. Maxfield  
+
+fast/text/variations/getComputedStyle.html does not need to be asynchronous
+https://bugs.webkit.org/show_bug.cgi?id=173246
+
+
+Reviewed by Sam Weinig.
+
+I dont know why I made it asynchronous in the first place.
+
+* fast/text/variations/getComputedStyle.html:
+
 2017-06-09  Ryosuke Niwa  
 
 didMoveToNewDocument doesn't get called on an Attr inside a shadow tree


Modified: trunk/LayoutTests/fast/text/variations/getComputedStyle.html (218084 => 218085)

--- trunk/LayoutTests/fast/text/variations/getComputedStyle.html	2017-06-12 03:58:23 UTC (rev 218084)
+++ trunk/LayoutTests/fast/text/variations/getComputedStyle.html	2017-06-12 05:02:38 UTC (rev 218085)
@@ -20,25 +20,14 @@
 a
 a
 
-window.jsTestIsAsync = true;
-
-var promises = [];
-
-document.fonts.forEach(function(f) {
-	promises.push(f.loaded);
-});
-
-Promise.all(promises).then(function() {
-	shouldBeEqualToString("window.getComputedStyle(document.getElementById('test0')).getPropertyValue('font-variation-settings')", "'hght' 400");
-	shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).getPropertyValue('font-variation-settings')", "'hght' 500");
-	shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')", "'wdth' 500, 'hght' 400");
-	shouldBe("window.getComputedStyle(document.getElementById('test3')).getPropertyValue('font-variation-settings')", "window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')");
-	shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).getPropertyValue('font-variation-settings')", "normal");
-	shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).getPropertyValue('font-variation-settings')", "normal");
-	shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).getPropertyValue('font-variation-settings')", "normal");
-	shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).getPropertyValue('font-variation-settings')", "'hght' 99");
-	finishJSTest();
-});
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test0')).getPropertyValue('font-variation-settings')", "'hght' 400");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).getPropertyValue('font-variation-settings')", "'hght' 500");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')", "'wdth' 500, 'hght' 400");
+shouldBe("window.getComputedStyle(document.getElementById('test3')).getPropertyValue('font-variation-settings')", "window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).getPropertyValue('font-variation-settings')", "normal");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).getPropertyValue('font-variation-settings')", "normal");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).getPropertyValue('font-variation-settings')", "normal");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).getPropertyValue('font-variation-settings')", "'hght' 99");
 
 

[webkit-changes] [217762] trunk/Source/WebCore

2017-06-03 Thread mmaxfield
Title: [217762] trunk/Source/WebCore








Revision 217762
Author mmaxfi...@apple.com
Date 2017-06-03 11:07:17 -0700 (Sat, 03 Jun 2017)


Log Message
Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
https://bugs.webkit.org/show_bug.cgi?id=172886

Reviewed by Simon Fraser.

The number of arguments is getting out of control.

No new tests because there is no behavior change.

* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/spi/cocoa/CoreTextSPI.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCache.h
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (217761 => 217762)

--- trunk/Source/WebCore/ChangeLog	2017-06-03 17:58:06 UTC (rev 217761)
+++ trunk/Source/WebCore/ChangeLog	2017-06-03 18:07:17 UTC (rev 217762)
@@ -1,3 +1,26 @@
+2017-06-03  Myles C. Maxfield  
+
+Cleanup arguments to preparePlatformFont() and fontWithFamily() in FontCacheCoreText.cpp
+https://bugs.webkit.org/show_bug.cgi?id=172886
+
+Reviewed by Simon Fraser.
+
+The number of arguments is getting out of control.
+
+No new tests because there is no behavior change.
+
+* platform/graphics/FontCache.h:
+* platform/graphics/cocoa/FontCacheCoreText.cpp:
+(WebCore::preparePlatformFont):
+(WebCore::fontWithFamily):
+(WebCore::FontCache::createFontPlatformData):
+(WebCore::FontCache::systemFallbackForCharacters):
+* platform/graphics/mac/FontCacheMac.mm:
+(WebCore::platformFontWithFamilySpecialCase):
+* platform/graphics/mac/FontCustomPlatformData.cpp:
+(WebCore::FontCustomPlatformData::fontPlatformData):
+* platform/spi/cocoa/CoreTextSPI.h:
+
 2017-06-03  Yusuke Suzuki  
 
 Script modules should be able to import data urls


Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (217761 => 217762)

--- trunk/Source/WebCore/platform/graphics/FontCache.h	2017-06-03 17:58:06 UTC (rev 217761)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h	2017-06-03 18:07:17 UTC (rev 217762)
@@ -281,7 +281,7 @@
 bool needsSyntheticOblique;
 };
 
-RetainPtr preparePlatformFont(CTFontRef, TextRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, const FontFeatureSettings& features, const FontVariantSettings&, FontSelectionRequest, const FontVariationSettings&, FontOpticalSizing, float size, FontStyleAxis);
+RetainPtr preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, float size);
 SynthesisPair computeNecessarySynthesis(CTFontRef, const FontDescription&, bool isPlatformFont = false);
 RetainPtr platformFontWithFamilySpecialCase(const AtomicString& family, FontSelectionRequest, float size);
 RetainPtr platformFontWithFamily(const AtomicString& family, FontSelectionRequest, TextRenderingMode, float size);


Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (217761 => 217762)

--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2017-06-03 17:58:06 UTC (rev 217761)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2017-06-03 18:07:17 UTC (rev 217762)
@@ -497,7 +497,7 @@
 }
 #endif
 
-RetainPtr preparePlatformFont(CTFontRef originalFont, TextRenderingMode textRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, const FontFeatureSettings& features, const FontVariantSettings& variantSettings, FontSelectionRequest fontSelectionRequest, const FontVariationSettings& variations, FontOpticalSizing fontOpticalSizing, float size, FontStyleAxis axis)
+RetainPtr preparePlatformFont(CTFontRef originalFont, const FontDescription& fontDescription, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, FontSelectionSpecifiedCapabilities fontFaceCapabilities, float size)
 {
 bool alwaysAddVariations = false;
 
@@ -505,14 +505,20 @@
 #if ENABLE(VARIATION_FONTS)
 auto defaultValues = defaultVariationValues(originalFont);
 alwaysAddVariations = !defaultValues.isEmpty();
+
+auto 

[webkit-changes] [217742] trunk

2017-06-02 Thread mmaxfield
Title: [217742] trunk








Revision 217742
Author mmaxfi...@apple.com
Date 2017-06-02 16:40:07 -0700 (Fri, 02 Jun 2017)


Log Message
REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
https://bugs.webkit.org/show_bug.cgi?id=172737
Source/WebCore:

Reviewed by Simon Fraser.

Revert the part of r213464 which changed how we calculate the weights of system fonts.

Add an InternalSetting to trigger our mock of the accessbility "Bold Text" setting. We can't
use the real setting, so instead we just ask for bold fonts instead of regular fonts when this
setting is true.

Tests: fast/text/accessibility-bold-system-font.html
   fast/text/accessibility-bold-system-font-2.html

* platform/graphics/FontCache.h:
(WebCore::FontCache::shouldMockBoldSystemFontForAccessibility):
(WebCore::FontCache::setShouldMockBoldSystemFontForAccessibility):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::shouldMockBoldSystemFontForAccessibility):
(WebCore::RenderTheme::setShouldMockBoldSystemFontForAccessibility):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::cssWeightOfSystemFont):
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldMockBoldSystemFontForAccessibility):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests:



Reviewed by Simon Fraser.

* fast/text/accessibility-bold-system-font-2-expected.html: Added.
* fast/text/accessibility-bold-system-font-2.html: Added.
* fast/text/accessibility-bold-system-font-expected.txt: Added.
* fast/text/accessibility-bold-system-font.html: Added.
* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCache.h
trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
trunk/Source/WebCore/rendering/RenderTheme.h
trunk/Source/WebCore/rendering/RenderThemeIOS.h
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
trunk/Source/WebCore/testing/InternalSettings.cpp
trunk/Source/WebCore/testing/InternalSettings.h
trunk/Source/WebCore/testing/InternalSettings.idl


Added Paths

trunk/LayoutTests/fast/text/accessibility-bold-system-font-2-expected.html
trunk/LayoutTests/fast/text/accessibility-bold-system-font-2.html
trunk/LayoutTests/fast/text/accessibility-bold-system-font-expected.txt
trunk/LayoutTests/fast/text/accessibility-bold-system-font.html




Diff

Modified: trunk/LayoutTests/ChangeLog (217741 => 217742)

--- trunk/LayoutTests/ChangeLog	2017-06-02 23:11:44 UTC (rev 217741)
+++ trunk/LayoutTests/ChangeLog	2017-06-02 23:40:07 UTC (rev 217742)
@@ -1,3 +1,17 @@
+2017-06-02  Myles C. Maxfield  
+
+REGRESSION(r213464): [iOS] Fonts get too bold when the "Bold Text" accessibility setting is enabled
+https://bugs.webkit.org/show_bug.cgi?id=172737
+
+
+Reviewed by Simon Fraser.
+
+* fast/text/accessibility-bold-system-font-2-expected.html: Added.
+* fast/text/accessibility-bold-system-font-2.html: Added.
+* fast/text/accessibility-bold-system-font-expected.txt: Added.
+* fast/text/accessibility-bold-system-font.html: Added.
+* platform/mac/TestExpectations:
+
 2017-06-02  Ryan Haddad  
 
 Mark webrtc/captureCanvas-webrtc.html as flaky on iOS.


Added: trunk/LayoutTests/fast/text/accessibility-bold-system-font-2-expected.html (0 => 217742)

--- trunk/LayoutTests/fast/text/accessibility-bold-system-font-2-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/accessibility-bold-system-font-2-expected.html	2017-06-02 23:40:07 UTC (rev 217742)
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+Hello
+
+


Added: trunk/LayoutTests/fast/text/accessibility-bold-system-font-2.html (0 => 217742)

--- trunk/LayoutTests/fast/text/accessibility-bold-system-font-2.html	(rev 0)
+++ trunk/LayoutTests/fast/text/accessibility-bold-system-font-2.html	2017-06-02 23:40:07 UTC (rev 217742)
@@ -0,0 +1,13 @@
+
+
+
+
+if (window.internals)
+internals.settings.setShouldMockBoldSystemFontForAccessibility(true);
+
+
+
+
+Hello
+
+


Added: trunk/LayoutTests/fast/text/accessibility-bold-system-font-expected.txt (0 => 217742)

--- trunk/LayoutTests/fast/text/accessibility-bold-system-font-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/text/accessibility-bold-system-font-expected.txt	2017-06-02 23:40:07 UTC (rev 217742)
@@ -0,0 +1,10 @@
+This test makes sure that text using the accessibility bold functionality has the correct weight.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 

[webkit-changes] [217461] trunk

2017-05-25 Thread mmaxfield
Title: [217461] trunk








Revision 217461
Author mmaxfi...@apple.com
Date 2017-05-25 17:42:58 -0700 (Thu, 25 May 2017)


Log Message
[WK1] iframes in layer-backed NSViews are not cleared between successive draws
https://bugs.webkit.org/show_bug.cgi?id=172554


Reviewed by Simon Fraser.

Source/WebKit/mac:

Update an overridden internal AppKit function to the new signature.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inContext:topView:]):
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]):
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inContext:topView:]): Deleted.
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]): Deleted.

Tools:

Previously, there was no way to make DumpRenderTree's views layer-backed. Unfortunately,
simply setting [WebView setWantsLayer:] is insufficient; turning it on and then off again
leaves some state around inside the NSWindow which isn't easily cleaned up. Instead,
we should just tear down and rebuild the window whenever we need a layer-backed WebView.
We can also use the "webkit-test-runner" header comment to trigger this new layer-backed
codepath.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
(TestOptions::webViewIsCompatibleWithOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(shouldIgnoreWebCoreNodeLeaks):
(allowedFontFamilySet):
(-[DRTMockScroller rectForPart:]):
(-[DRTMockScroller drawKnob]):
(-[DRTMockScroller drawRect:]):
(createWebViewAndOffscreenWindow):
(initializeGlobalsFromCommandLineOptions):
(prepareConsistentTestingEnvironment):
(dumpRenderTree):
(dumpAudio):
(dumpHistoryItem):
(dumpBackForwardListForWebView):
(resetWebViewToConsistentStateBeforeTesting):
(WebThreadLockAfterDelegateCallbacksHaveCompleted):
(runTest):

LayoutTests:

Cause two successive paints, and compare it against 0 paints.

* fast/frames/iframe-translucent-background-expected.html: Added.
* fast/frames/iframe-translucent-background.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
trunk/Tools/ChangeLog
trunk/Tools/DumpRenderTree/TestOptions.h
trunk/Tools/DumpRenderTree/TestOptions.mm
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm


Added Paths

trunk/LayoutTests/fast/frames/iframe-translucent-background-expected.html
trunk/LayoutTests/fast/frames/iframe-translucent-background.html




Diff

Modified: trunk/LayoutTests/ChangeLog (217460 => 217461)

--- trunk/LayoutTests/ChangeLog	2017-05-26 00:29:58 UTC (rev 217460)
+++ trunk/LayoutTests/ChangeLog	2017-05-26 00:42:58 UTC (rev 217461)
@@ -1,3 +1,16 @@
+2017-05-25  Myles C. Maxfield  
+
+[WK1] iframes in layer-backed NSViews are not cleared between successive draws
+https://bugs.webkit.org/show_bug.cgi?id=172554
+
+
+Reviewed by Simon Fraser.
+
+Cause two successive paints, and compare it against 0 paints.
+
+* fast/frames/iframe-translucent-background-expected.html: Added.
+* fast/frames/iframe-translucent-background.html: Added.
+
 2017-05-25  Keith Miller  
 
 Date should use historical data if it's available.


Added: trunk/LayoutTests/fast/frames/iframe-translucent-background-expected.html (0 => 217461)

--- trunk/LayoutTests/fast/frames/iframe-translucent-background-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/frames/iframe-translucent-background-expected.html	2017-05-26 00:42:58 UTC (rev 217461)
@@ -0,0 +1,10 @@
+
+
+
+
+
+This test makes sure that iframes with translucent backgrounds are drawn with those background (and not just as black). The test passes if you don't see any black boxes below and the text has correct antialiasing.
+Hello World link here.
+
+
+


Added: trunk/LayoutTests/fast/frames/iframe-translucent-background.html (0 => 217461)

--- trunk/LayoutTests/fast/frames/iframe-translucent-background.html	(rev 0)
+++ trunk/LayoutTests/fast/frames/iframe-translucent-background.html	2017-05-26 00:42:58 UTC (rev 217461)
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+This test makes sure that iframes with translucent backgrounds are drawn with those background (and not just as black). The test passes if you don't see any black boxes below and the text has correct antialiasing.
+
+if (window.testRunner)
+testRunner.waitUntilDone();
+function b() {
+if (window.testRunner)
+testRunner.notifyDone();
+}
+
+
+
+Hello, World
+
+
+
+


Modified: trunk/Source/WebKit/mac/ChangeLog (217460 => 217461)

--- trunk/Source/WebKit/mac/ChangeLog	2017-05-26 00:29:58 UTC (rev 217460)
+++ 

[webkit-changes] [217293] trunk

2017-05-23 Thread mmaxfield
Title: [217293] trunk








Revision 217293
Author mmaxfi...@apple.com
Date 2017-05-23 13:24:38 -0700 (Tue, 23 May 2017)


Log Message
Remove dead ENABLE(FONT_LOAD_EVENTS) code
https://bugs.webkit.org/show_bug.cgi?id=172517

Rubber-stamped by Simon Fraser.

.:

* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/_javascript_Core:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests because there is no behavior change.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAllInOne.cpp:
* css/CSSFontFaceLoadEvent.cpp: Removed.
* css/CSSFontFaceLoadEvent.h: Removed.
* css/CSSFontFaceLoadEvent.idl: Removed.
* dom/EventNames.in:
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setFontLoadEventsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::fontLoadEventsEnabled): Deleted.

Source/WebCore/PAL:

No new tests because there is no behavior change.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

Modified Paths

trunk/ChangeLog
trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/FeatureDefines.h
trunk/Source/WebCore/CMakeLists.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Configurations/FeatureDefines.xcconfig
trunk/Source/WebCore/DerivedSources.cpp
trunk/Source/WebCore/DerivedSources.make
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
trunk/Source/WebCore/css/CSSAllInOne.cpp
trunk/Source/WebCore/dom/EventNames.in
trunk/Source/WebCore/page/FrameView.cpp
trunk/Source/WebCore/page/RuntimeEnabledFeatures.h
trunk/Source/WebKit/mac/ChangeLog
trunk/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
trunk/Source/WebKit2/ChangeLog
trunk/Source/WebKit2/Configurations/FeatureDefines.xcconfig
trunk/Source/cmake/OptionsMac.cmake
trunk/Source/cmake/WebKitFeatures.cmake
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig


Removed Paths

trunk/Source/WebCore/css/CSSFontFaceLoadEvent.cpp
trunk/Source/WebCore/css/CSSFontFaceLoadEvent.h
trunk/Source/WebCore/css/CSSFontFaceLoadEvent.idl




Diff

Modified: trunk/ChangeLog (217292 => 217293)

--- trunk/ChangeLog	2017-05-23 20:23:23 UTC (rev 217292)
+++ trunk/ChangeLog	2017-05-23 20:24:38 UTC (rev 217293)
@@ -1,3 +1,13 @@
+2017-05-23  Myles C. Maxfield  
+
+Remove dead ENABLE(FONT_LOAD_EVENTS) code
+https://bugs.webkit.org/show_bug.cgi?id=172517
+
+Rubber-stamped by Simon Fraser.
+
+* Source/cmake/OptionsMac.cmake:
+* Source/cmake/WebKitFeatures.cmake:
+
 2017-05-22  Gwang Yoon Hwang  
 
 [CMake] Do not use a --no-keep-memory linker flag in 64bit system


Modified: trunk/Source/_javascript_Core/ChangeLog (217292 => 217293)

--- trunk/Source/_javascript_Core/ChangeLog	2017-05-23 20:23:23 UTC (rev 217292)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-05-23 20:24:38 UTC (rev 217293)
@@ -1,3 +1,12 @@
+2017-05-23  Myles C. Maxfield  
+
+Remove dead ENABLE(FONT_LOAD_EVENTS) code
+https://bugs.webkit.org/show_bug.cgi?id=172517
+
+Rubber-stamped by Simon Fraser.
+
+* Configurations/FeatureDefines.xcconfig:
+
 2017-05-23  Saam Barati  
 
 CFGSimplificationPhase should not merge a block with itself


Modified: trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig (217292 => 217293)

--- trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2017-05-23 20:23:23 UTC (rev 217292)
+++ trunk/Source/_javascript_Core/Configurations/FeatureDefines.xcconfig	2017-05-23 20:24:38 UTC (rev 217293)
@@ -95,7 +95,6 @@
 ENABLE_DEVICE_ORIENTATION[sdk=iphone*] = ENABLE_DEVICE_ORIENTATION;
 ENABLE_FETCH_API = ENABLE_FETCH_API;
 ENABLE_FILTERS_LEVEL_2 = ENABLE_FILTERS_LEVEL_2;
-ENABLE_FONT_LOAD_EVENTS = ;
 ENABLE_FULLSCREEN_API[sdk=macosx*] = ENABLE_FULLSCREEN_API;
 ENABLE_GAMEPAD = ENABLE_GAMEPAD;
 ENABLE_GAMEPAD[sdk=watch*] = ;
@@ -254,4 +253,4 @@
 ENABLE_VARIATION_FONTS_IF_NOT_NO = ENABLE_VARIATION_FONTS;
 ENABLE_VARIATION_FONTS_IF_NOT_YES = ;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_DELEGATE) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) 

[webkit-changes] [217272] trunk

2017-05-23 Thread mmaxfield
Title: [217272] trunk








Revision 217272
Author mmaxfi...@apple.com
Date 2017-05-23 00:37:42 -0700 (Tue, 23 May 2017)


Log Message
Update font-style's implementation in the font selection algorithm
https://bugs.webkit.org/show_bug.cgi?id=169453

Reviewed by Simon Fraser.

Source/WebCore:

Previously, we were treating "font-style: oblique" exactly the same as "font-style: italic".
These values were parsed to the same internal data type. However, variation fonts may have two
distinct axes: 'slnt' and 'ital'. Therefore, we need to keep a bool of state which represents
which of these two axes we should be setting when we apply font variations. We can do this by
making the "font-style" parser a "custom" parser. The implementation of these custom functions
will set both the italic value on the FontDescription as well as this extra bool.

We don't, however, want to treat these values as distinct for the purposese of font selection.
The fact that we treat oblique fonts the same as italic fonts is a feature, not a bug. Therefore,
the font selection algorithm is not made aware of this distinction. This is why we don't want to
package up the bool and FontSelectionValue into a class: font selection only cares about the
FontSelectionValue, so conceptually they shouldn't be joined. (The FontSelectionValue already
exists within a collection of all the things font selection needs to know about.)

Now that there is this extra bit of state on the FontDescription, we can do a little better when
computing the result of getComputedStyle(). Previously, we were always returning "italic" even
when "oblique" was specified. Now, we can return the correct one. However, this extra bit of
state is not kept on the CSSFontFace (because it doesn't need to be), which means we can only
improve the computed style of an element, rather than the cssText of an @font-face rule.

Test: fast/text/font-style-parse.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::fontStyleFromStyleValue):
(WebCore::fontStyleFromStyle):
(WebCore::fontShorthandValueForSelectionProperties):
* css/CSSComputedStyleDeclaration.h:
* css/CSSFontFaceSet.h:
* css/CSSProperties.json:
* css/FontFace.cpp:
(WebCore::FontFace::style):
* css/FontSelectionValueInlines.h:
(WebCore::fontStyleKeyword):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontStyle): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialFontStyle):
(WebCore::StyleBuilderCustom::applyInheritFontStyle):
(WebCore::StyleBuilderCustom::applyValueFontStyle):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::FontDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::shouldUseItalicVariationAxis):
(WebCore::FontDescription::setShouldUseItalicVariationAxis):
(WebCore::FontDescription::operator==):
(WebCore::FontCascadeDescription::initialShouldUseItalicVariationAxis):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

LayoutTests:

* fast/text/font-style-parse-expected.txt:
* fast/text/font-style-parse.html:
* platform/mac-elcapitan/fast/text/font-style-parse-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/fast/text/font-style-parse-expected.txt
trunk/LayoutTests/fast/text/font-style-parse.html
trunk/LayoutTests/platform/mac-elcapitan/fast/text/font-style-parse-expected.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h
trunk/Source/WebCore/css/CSSFontFaceSet.h
trunk/Source/WebCore/css/CSSProperties.json
trunk/Source/WebCore/css/FontFace.cpp
trunk/Source/WebCore/css/FontSelectionValueInlines.h
trunk/Source/WebCore/css/StyleBuilderConverter.h
trunk/Source/WebCore/css/StyleBuilderCustom.h
trunk/Source/WebCore/platform/graphics/FontCache.h
trunk/Source/WebCore/platform/graphics/FontDescription.cpp
trunk/Source/WebCore/platform/graphics/FontDescription.h
trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
trunk/Source/WebCore/platform/text/TextFlags.h




Diff

Modified: trunk/LayoutTests/ChangeLog (217271 => 217272)

--- trunk/LayoutTests/ChangeLog	2017-05-23 07:21:21 UTC (rev 217271)
+++ trunk/LayoutTests/ChangeLog	2017-05-23 07:37:42 UTC (rev 217272)
@@ -1,3 +1,14 @@
+2017-05-22  Myles C. Maxfield  
+
+Update font-style's implementation in the font selection algorithm
+https://bugs.webkit.org/show_bug.cgi?id=169453
+
+Reviewed by Simon Fraser.
+
+* fast/text/font-style-parse-expected.txt:
+* 

[webkit-changes] [217267] trunk

2017-05-23 Thread mmaxfield
Title: [217267] trunk








Revision 217267
Author mmaxfi...@apple.com
Date 2017-05-22 23:03:24 -0700 (Mon, 22 May 2017)


Log Message
Support calc() in font-variation-settings and font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=171032

Reviewed by David Hyatt.

Source/WebCore:

Tests: css3/font-feature-settings-calc.html
   fast/text/variations/calc.html

We can use the convenience functions in CSSPropertyParserHelpers.cpp.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFeatureTag):
(WebCore::consumeFontVariationTag):

LayoutTests:

* css3/font-feature-settings-calc-expected.html: Added.
* css3/font-feature-settings-calc.html: Added.
* fast/text/variations/calc-expected.html: Added.
* fast/text/variations/calc.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp


Added Paths

trunk/LayoutTests/css3/font-feature-settings-calc-expected.html
trunk/LayoutTests/css3/font-feature-settings-calc.html
trunk/LayoutTests/fast/text/variations/calc-expected.html
trunk/LayoutTests/fast/text/variations/calc.html




Diff

Modified: trunk/LayoutTests/ChangeLog (217266 => 217267)

--- trunk/LayoutTests/ChangeLog	2017-05-23 04:59:53 UTC (rev 217266)
+++ trunk/LayoutTests/ChangeLog	2017-05-23 06:03:24 UTC (rev 217267)
@@ -1,3 +1,15 @@
+2017-05-22  Myles C. Maxfield  
+
+Support calc() in font-variation-settings and font-feature-settings
+https://bugs.webkit.org/show_bug.cgi?id=171032
+
+Reviewed by David Hyatt.
+
+* css3/font-feature-settings-calc-expected.html: Added.
+* css3/font-feature-settings-calc.html: Added.
+* fast/text/variations/calc-expected.html: Added.
+* fast/text/variations/calc.html: Added.
+
 2017-05-22  Ryan Haddad  
 
 Mark to imported/w3c/web-platform-tests/webrtc tests as failing on ios-wk2.


Added: trunk/LayoutTests/css3/font-feature-settings-calc-expected.html (0 => 217267)

--- trunk/LayoutTests/css3/font-feature-settings-calc-expected.html	(rev 0)
+++ trunk/LayoutTests/css3/font-feature-settings-calc-expected.html	2017-05-23 06:03:24 UTC (rev 217267)
@@ -0,0 +1,17 @@
+
+
+
+
+@font-face {
+font-family: "FontFeaturesTestOTF";
+src: url("resources/FontWithFeatures.otf") format("opentype");
+}
+
+
+
+This test makes sure that calc() can be used in font-feature-settings.
+
+W
+
+
+


Added: trunk/LayoutTests/css3/font-feature-settings-calc.html (0 => 217267)

--- trunk/LayoutTests/css3/font-feature-settings-calc.html	(rev 0)
+++ trunk/LayoutTests/css3/font-feature-settings-calc.html	2017-05-23 06:03:24 UTC (rev 217267)
@@ -0,0 +1,17 @@
+
+
+
+
+@font-face {
+font-family: "FontFeaturesTestOTF";
+src: url("resources/FontWithFeatures.otf") format("opentype");
+}
+
+
+
+This test makes sure that calc() can be used in font-feature-settings.
+
+W
+
+
+


Added: trunk/LayoutTests/fast/text/variations/calc-expected.html (0 => 217267)

--- trunk/LayoutTests/fast/text/variations/calc-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/variations/calc-expected.html	2017-05-23 06:03:24 UTC (rev 217267)
@@ -0,0 +1,15 @@
+
+
+
+
+@font-face {
+font-family: "Boxis";
+src: url("resources/Boxis-VF.ttf");
+}
+
+
+
+This test makes sure that calc() works in font-variation-settings.
+Hi
+
+


Added: trunk/LayoutTests/fast/text/variations/calc.html (0 => 217267)

--- trunk/LayoutTests/fast/text/variations/calc.html	(rev 0)
+++ trunk/LayoutTests/fast/text/variations/calc.html	2017-05-23 06:03:24 UTC (rev 217267)
@@ -0,0 +1,15 @@
+
+
+
+
+@font-face {
+font-family: "Boxis";
+src: url("resources/Boxis-VF.ttf");
+}
+
+
+
+This test makes sure that calc() works in font-variation-settings.
+Hi
+
+


Modified: trunk/Source/WebCore/ChangeLog (217266 => 217267)

--- trunk/Source/WebCore/ChangeLog	2017-05-23 04:59:53 UTC (rev 217266)
+++ trunk/Source/WebCore/ChangeLog	2017-05-23 06:03:24 UTC (rev 217267)
@@ -1,3 +1,19 @@
+2017-05-22  Myles C. Maxfield  
+
+Support calc() in font-variation-settings and font-feature-settings
+https://bugs.webkit.org/show_bug.cgi?id=171032
+
+Reviewed by David Hyatt.
+
+Tests: css3/font-feature-settings-calc.html
+   fast/text/variations/calc.html
+
+We can use the convenience functions in CSSPropertyParserHelpers.cpp.
+
+* css/parser/CSSPropertyParser.cpp:
+(WebCore::consumeFontFeatureTag):
+(WebCore::consumeFontVariationTag):
+
 2017-05-22  Michael Catanzaro  
 
 Unreviewed, attempt to fix test runner by removing Unicode character from stderr output


Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (217266 => 217267)

--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2017-05-23 04:59:53 UTC (rev 

[webkit-changes] [217241] trunk

2017-05-22 Thread mmaxfield
Title: [217241] trunk








Revision 217241
Author mmaxfi...@apple.com
Date 2017-05-22 13:12:43 -0700 (Mon, 22 May 2017)


Log Message
Enable the woff2-variations @font-face format identifier
https://bugs.webkit.org/show_bug.cgi?id=172425

Reviewed by Andreas Kling.

Source/WebCore:

We support woff2, and woff-variations, but not woff2-variations.
https://github.com/w3c/csswg-drafts/commit/5c914a8a0382734bd420090a89bc19b32e6c302d

Test: fast/text/variations/font-face-format-woff2.html

* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):

LayoutTests:

* fast/text/variations/font-face-format-woff2-expected.html: Added.
* fast/text/variations/font-face-format-woff2.html: Added.
* platform/mac/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp


Added Paths

trunk/LayoutTests/fast/text/variations/font-face-format-woff2-expected.html
trunk/LayoutTests/fast/text/variations/font-face-format-woff2.html




Diff

Modified: trunk/LayoutTests/ChangeLog (217240 => 217241)

--- trunk/LayoutTests/ChangeLog	2017-05-22 19:48:38 UTC (rev 217240)
+++ trunk/LayoutTests/ChangeLog	2017-05-22 20:12:43 UTC (rev 217241)
@@ -1,3 +1,14 @@
+2017-05-22  Myles C. Maxfield  
+
+Enable the woff2-variations @font-face format identifier
+https://bugs.webkit.org/show_bug.cgi?id=172425
+
+Reviewed by Andreas Kling.
+
+* fast/text/variations/font-face-format-woff2-expected.html: Added.
+* fast/text/variations/font-face-format-woff2.html: Added.
+* platform/mac/TestExpectations:
+
 2017-05-22  Simon Fraser  
 
 Support transform-box to switch sizing box in SVG


Added: trunk/LayoutTests/fast/text/variations/font-face-format-woff2-expected.html (0 => 217241)

--- trunk/LayoutTests/fast/text/variations/font-face-format-woff2-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/variations/font-face-format-woff2-expected.html	2017-05-22 20:12:43 UTC (rev 217241)
@@ -0,0 +1,17 @@
+
+
+
+
+@font-face {
+	font-family: "WebFont";
+	src: url("../../../resources/Ahem.otf") format("woff");
+}
+
+
+
+This test passes of you see a black rectangle below.
+
+Hello
+
+
+


Added: trunk/LayoutTests/fast/text/variations/font-face-format-woff2.html (0 => 217241)

--- trunk/LayoutTests/fast/text/variations/font-face-format-woff2.html	(rev 0)
+++ trunk/LayoutTests/fast/text/variations/font-face-format-woff2.html	2017-05-22 20:12:43 UTC (rev 217241)
@@ -0,0 +1,17 @@
+
+
+
+
+@font-face {
+	font-family: "WebFont";
+	src: url("../../../resources/Ahem.otf") format("woff2-variations"), local("Helvetica");
+}
+
+
+
+This test passes of you see a black rectangle below.
+
+Hello
+
+
+


Modified: trunk/LayoutTests/platform/mac/TestExpectations (217240 => 217241)

--- trunk/LayoutTests/platform/mac/TestExpectations	2017-05-22 19:48:38 UTC (rev 217240)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2017-05-22 20:12:43 UTC (rev 217241)
@@ -1237,6 +1237,7 @@
 
 # WOFF2 is only supported on certain Operating Systems.
 webkit.org/b/150830 [ Yosemite ElCapitan ] fast/text/woff2.html [ ImageOnlyFailure ]
+webkit.org/b/150830 [ Yosemite ElCapitan ] fast/text/variations/font-face-format-woff2.html [ ImageOnlyFailure ]
 
 webkit.org/b/162668 fast/text/woff2-totalsfntsize.html [ ImageOnlyFailure ]
 


Modified: trunk/Source/WebCore/ChangeLog (217240 => 217241)

--- trunk/Source/WebCore/ChangeLog	2017-05-22 19:48:38 UTC (rev 217240)
+++ trunk/Source/WebCore/ChangeLog	2017-05-22 20:12:43 UTC (rev 217241)
@@ -1,3 +1,18 @@
+2017-05-22  Myles C. Maxfield  
+
+Enable the woff2-variations @font-face format identifier
+https://bugs.webkit.org/show_bug.cgi?id=172425
+
+Reviewed by Andreas Kling.
+
+We support woff2, and woff-variations, but not woff2-variations.
+https://github.com/w3c/csswg-drafts/commit/5c914a8a0382734bd420090a89bc19b32e6c302d
+
+Test: fast/text/variations/font-face-format-woff2.html
+
+* platform/graphics/mac/FontCustomPlatformData.cpp:
+(WebCore::FontCustomPlatformData::supportsFormat):
+
 2017-05-22  Antoine Quint  
 
 [mac-wk1] LayoutTest media/modern-media-controls/airplay-button/airplay-button.html is a flaky timeout


Modified: trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp (217240 => 217241)

--- trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp	2017-05-22 19:48:38 UTC (rev 217240)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp	2017-05-22 20:12:43 UTC (rev 217241)
@@ -62,7 +62,10 @@
 || equalLettersIgnoringASCIICase(format, "opentype")
 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 10) || 

[webkit-changes] [216944] trunk

2017-05-16 Thread mmaxfield
Title: [216944] trunk








Revision 216944
Author mmaxfi...@apple.com
Date 2017-05-16 13:26:39 -0700 (Tue, 16 May 2017)


Log Message
REGRESSION(r212513): LastResort is platform-dependent, so its semantics should not be required to perform font loading correctly.
https://bugs.webkit.org/show_bug.cgi?id=168487

Reviewed by Antti Koivisto.

Source/WebCore:

There are three ways a Web author can chain multiple font files together:
1. Multiple entries in the "src" descriptor in an @font-face rule
2. Multiple @font-face rules with the same "font-family" descriptor
3. Multiple entries in the "font-family" property on an element

Before r212513, the code which iterated across #2 and #3 above could have
triggered each item in the chain to download. r212513 tried to solve this
by using LastResort as the interstitial font used during downloads, because
LastResort supports every character and therefore solves #3 above. However,
this change had a few problems:

1. Previously, our code would try to avoid using the interstitial font for
layout or rendering whenever possible (because one of the chains above may
have named a local font which would be better to use). In order to use the
benefits of LastResort, I had to remove this avoidance logic and make
WebKit try to use the interstitial font as often as possible. However, due
to the large metrics of LastResort, this means that offsetWidth queries
during font loading would be wildly inaccurate, causing Google Docs to break.
2. It also means that canvas drawing during font loading would actually draw
LastResort, causing Bing maps to break.
3. LastResort is platform-specific, so only platforms which have it would
actually be able to load fonts correctly.

Instead, we should keep the older logic about avoiding using the
interstitial font so that loading has a better experience for the user.
We solve the unnecessary download problem by giving our loading code a
downloading policy enum, which has two values: allow downloads or forbid
downloads. Whenever our loading code returns the interstitial font, we
continue our search, but we change the policy to forbid downloads.

There is one piece of subtlety, though: It is more common for web authors
to put good fallbacks in the "font-family" property than in the "src"
descriptor inside @font-face. This means that we shouldn't exhaustively
search through the @font-face src list first. Instead, we should look
through the src list until we hit a non-local font, and then immediately
start looking through the other other chains.

Tests: fast/text/font-download-font-face-src-list.html
   fast/text/font-download-font-family-property.html
   fast/text/font-download-remote-fallback-all.html
   fast/text/font-interstitial-invisible-width-while-loading.html
   fast/text/font-weight-download-3.html
   fast/text/web-font-load-fallback-during-loading-2.html
   fast/text/web-font-load-invisible-during-loading.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::fontLoadEventOccurred): Implement support for
the font download policy.
(WebCore::CSSFontFace::setStatus): After 3 seconds of loading, we
will start drawing the fallback font. However, for testing, we have an
internal setting to make this switch happen immediately. This patch now
requires that this internal switch happen synchronously.
(WebCore::CSSFontFace::pump): Implement support for the font download
policy.
(WebCore::CSSFontFace::load): Ditto.
(WebCore::CSSFontFace::font): Ditto.
* css/CSSFontFace.h: Ditto.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::beginLoadingFontSoon): Implement support for
synchronous font download timeouts.
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::fontRanges): Implement support for the
font download policy.
* platform/graphics/Font.cpp: Add new flag which represents if the
interstitial font was created after the 3 second timeout or before.
Previously, we would distinguish between these two cases by knowing
that one font was LastResort and the other font was a fallback. Now that
we're using fallback fonts on both sides of the 3 second timeout, we
now no longer know which one should be invisible. This new enum solves
this problem.
(WebCore::Font::Font):
(WebCore::Font::verticalRightOrientationFont):
(WebCore::Font::uprightOrientationFont):
* platform/graphics/Font.h: Ditto.
(WebCore::Font::create):
(WebCore::Font::origin):
(WebCore::Font::visibility):
* platform/graphics/FontCache.h:
* platform/graphics/FontCascade.cpp: We try to fall back to a local() font
during downloads, but there might not be one that we can use. Therefore, we
can't use the presence of the interstitial font to detect if we should paint
invisibly. Instead, we can move this logic into the font-specific part of
painting, and consult with the specific font to know if it was created from
a timed-out @font-face rule or not.
(WebCore::FontCascade::drawText):
(WebCore::shouldDrawIfLoading):
(WebCore::FontCascade::drawGlyphBuffer):

[webkit-changes] [216896] trunk/Source/WebCore

2017-05-15 Thread mmaxfield
Title: [216896] trunk/Source/WebCore








Revision 216896
Author mmaxfi...@apple.com
Date 2017-05-15 18:37:43 -0700 (Mon, 15 May 2017)


Log Message
Migrate Font constructor from bools to enums
https://bugs.webkit.org/show_bug.cgi?id=172140

Reviewed by Tim Horton.

In https://bugs.webkit.org/show_bug.cgi?id=168487, I'm adding a new flag to Font. We can't
keep having just a pile of bools in this class. Instead, we should be using enums.

No new tests because there is no behavior change.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::font):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* css/CSSSegmentedFontFace.cpp:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::createFont):
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::Font::verticalRightOrientationFont):
(WebCore::Font::uprightOrientationFont):
(WebCore::Font::brokenIdeographFont):
(WebCore::Font::description):
(WebCore::Font::mathData):
* platform/graphics/Font.h:
(WebCore::Font::create):
(WebCore::Font::origin):
(WebCore::Font::isInterstitial):
(WebCore::Font::widthForGlyph):
(WebCore::Font::isCustomFont): Deleted.
(WebCore::Font::isLoading): Deleted.
* platform/graphics/FontRanges.cpp:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformCreateScaledFont):
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::Font::platformInit):
* platform/graphics/win/SimpleFontDataDirect2D.cpp:
(WebCore::Font::platformInit):
* platform/graphics/win/SimpleFontDataWin.cpp:
(WebCore::Font::platformCreateScaledFont):
(WebCore::Font::determinePitch):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForFontAndText):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSFontFace.cpp
trunk/Source/WebCore/css/CSSFontFaceSource.cpp
trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp
trunk/Source/WebCore/loader/cache/CachedFont.cpp
trunk/Source/WebCore/platform/graphics/Font.cpp
trunk/Source/WebCore/platform/graphics/Font.h
trunk/Source/WebCore/platform/graphics/FontRanges.cpp
trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataCGWin.cpp
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataDirect2D.cpp
trunk/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
trunk/Source/WebCore/rendering/SimpleLineLayout.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (216895 => 216896)

--- trunk/Source/WebCore/ChangeLog	2017-05-16 01:29:39 UTC (rev 216895)
+++ trunk/Source/WebCore/ChangeLog	2017-05-16 01:37:43 UTC (rev 216896)
@@ -1,3 +1,51 @@
+2017-05-15  Myles C. Maxfield  
+
+Migrate Font constructor from bools to enums
+https://bugs.webkit.org/show_bug.cgi?id=172140
+
+Reviewed by Tim Horton.
+
+In https://bugs.webkit.org/show_bug.cgi?id=168487, I'm adding a new flag to Font. We can't
+keep having just a pile of bools in this class. Instead, we should be using enums.
+
+No new tests because there is no behavior change.
+
+* css/CSSFontFace.cpp:
+(WebCore::CSSFontFace::font):
+* css/CSSFontFaceSource.cpp:
+(WebCore::CSSFontFaceSource::font):
+* css/CSSSegmentedFontFace.cpp:
+* loader/cache/CachedFont.cpp:
+(WebCore::CachedFont::createFont):
+* platform/graphics/Font.cpp:
+(WebCore::Font::Font):
+(WebCore::Font::verticalRightOrientationFont):
+(WebCore::Font::uprightOrientationFont):
+(WebCore::Font::brokenIdeographFont):
+(WebCore::Font::description):
+(WebCore::Font::mathData):
+* platform/graphics/Font.h:
+(WebCore::Font::create):
+(WebCore::Font::origin):
+(WebCore::Font::isInterstitial):
+(WebCore::Font::widthForGlyph):
+(WebCore::Font::isCustomFont): Deleted.
+(WebCore::Font::isLoading): Deleted.
+* platform/graphics/FontRanges.cpp:
+* platform/graphics/cocoa/FontCocoa.mm:
+(WebCore::Font::platformInit):
+* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
+(WebCore::Font::platformCreateScaledFont):
+* platform/graphics/win/SimpleFontDataCGWin.cpp:
+(WebCore::Font::platformInit):
+* platform/graphics/win/SimpleFontDataDirect2D.cpp:
+(WebCore::Font::platformInit):
+* platform/graphics/win/SimpleFontDataWin.cpp:
+(WebCore::Font::platformCreateScaledFont):
+(WebCore::Font::determinePitch):
+* rendering/SimpleLineLayout.cpp:
+(WebCore::SimpleLineLayout::canUseForFontAndText):
+
 2017-05-15  Youenn Fablet  
 
 WebRTC outgoing muted video sources should send black frames


Modified: trunk/Source/WebCore/css/CSSFontFace.cpp (216895 => 216896)

--- 

[webkit-changes] [216874] trunk

2017-05-15 Thread mmaxfield
Title: [216874] trunk








Revision 216874
Author mmaxfi...@apple.com
Date 2017-05-15 13:16:51 -0700 (Mon, 15 May 2017)


Log Message
Unicode characters which can't be rendered in any font are invisible
https://bugs.webkit.org/show_bug.cgi?id=171942


Reviewed by Tim Horton.

Source/WebCore:

There are some Unicode characters which don't have any font on the system which can render them.
These characters should be drawn as the .notdef "tofu." This is for security and usability, as
well as what Firefox and Chrome do. However, we still shouldn't draw characters with the
Default_Ignorable_Code_Point property, because this is what CoreText does.

This behavior is also what the Unicode spec recommends: In UTR #36 Unicode Security Considerations:
http://www.unicode.org/reports/tr36/#Recommendations_General
"If there is no available glyph for a character, never show a simple "?" or omit the character."

Also relevant is the Unicode Standard section 5.3 Unknown and MIssing Characters, starting at page
marked 203 in the following: http://www.unicode.org/versions/Unicode9.0.0/ch05.pdf

Tests: fast/text/default-ignorable.html
   fast/text/unknown-char-notdef.html

* platform/graphics/WidthIterator.cpp:
(WebCore::characterMustDrawSomething):

LayoutTests:

* fast/text/default-ignorable-expected.html: Added.
* fast/text/default-ignorable.html: Added.
* fast/text/unknown-char-notdef-expected-mismatch.html: Added.
* fast/text/unknown-char-notdef.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/mac/fast/text/softbank-emoji-expected.txt
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp


Added Paths

trunk/LayoutTests/fast/text/default-ignorable-expected.html
trunk/LayoutTests/fast/text/default-ignorable.html
trunk/LayoutTests/fast/text/unknown-char-notdef-expected-mismatch.html
trunk/LayoutTests/fast/text/unknown-char-notdef.html




Diff

Modified: trunk/LayoutTests/ChangeLog (216873 => 216874)

--- trunk/LayoutTests/ChangeLog	2017-05-15 19:54:27 UTC (rev 216873)
+++ trunk/LayoutTests/ChangeLog	2017-05-15 20:16:51 UTC (rev 216874)
@@ -1,3 +1,16 @@
+2017-05-15  Myles C. Maxfield  
+
+Unicode characters which can't be rendered in any font are invisible
+https://bugs.webkit.org/show_bug.cgi?id=171942
+
+
+Reviewed by Tim Horton.
+
+* fast/text/default-ignorable-expected.html: Added.
+* fast/text/default-ignorable.html: Added.
+* fast/text/unknown-char-notdef-expected-mismatch.html: Added.
+* fast/text/unknown-char-notdef.html: Added.
+
 2017-05-15  Zalan Bujtas  
 
 Simple line layout: Leading whitespace followed by a  produces an extra linebreak.


Added: trunk/LayoutTests/fast/text/default-ignorable-expected.html (0 => 216874)

--- trunk/LayoutTests/fast/text/default-ignorable-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/default-ignorable-expected.html	2017-05-15 20:16:51 UTC (rev 216874)
@@ -0,0 +1,8 @@
+
+
+
+
+
+This test makes sure that code points which have the Default_Ignorable_Code_Point property are not rendered. The test passes if you don't see anything below.
+
+


Added: trunk/LayoutTests/fast/text/default-ignorable.html (0 => 216874)

--- trunk/LayoutTests/fast/text/default-ignorable.html	(rev 0)
+++ trunk/LayoutTests/fast/text/default-ignorable.html	2017-05-15 20:16:51 UTC (rev 216874)
@@ -0,0 +1,9 @@
+
+
+
+
+
+This test makes sure that code points which have the Default_Ignorable_Code_Point property are not rendered. The test passes if you don't see anything below.
+
+
+


Added: trunk/LayoutTests/fast/text/unknown-char-notdef-expected-mismatch.html (0 => 216874)

--- trunk/LayoutTests/fast/text/unknown-char-notdef-expected-mismatch.html	(rev 0)
+++ trunk/LayoutTests/fast/text/unknown-char-notdef-expected-mismatch.html	2017-05-15 20:16:51 UTC (rev 216874)
@@ -0,0 +1,8 @@
+
+
+
+
+
+This test makes sure that code points which have no fonts to render them are drawn visibly. The test passes if you see something below.
+
+


Added: trunk/LayoutTests/fast/text/unknown-char-notdef.html (0 => 216874)

--- trunk/LayoutTests/fast/text/unknown-char-notdef.html	(rev 0)
+++ trunk/LayoutTests/fast/text/unknown-char-notdef.html	2017-05-15 20:16:51 UTC (rev 216874)
@@ -0,0 +1,9 @@
+
+
+
+
+
+This test makes sure that code points which have no fonts to render them are drawn visibly. The test passes if you see something below.
+
+
+


Modified: trunk/LayoutTests/platform/mac/fast/text/softbank-emoji-expected.txt (216873 => 216874)

--- trunk/LayoutTests/platform/mac/fast/text/softbank-emoji-expected.txt	2017-05-15 19:54:27 UTC (rev 216873)
+++ trunk/LayoutTests/platform/mac/fast/text/softbank-emoji-expected.txt	2017-05-15 20:16:51 UTC (rev 216874)
@@ -5,8 +5,8 @@
 RenderBody {BODY} at (8,8) size 784x230
   RenderBlock {DIV} 

[webkit-changes] [216586] trunk/Source/WebCore

2017-05-10 Thread mmaxfield
Title: [216586] trunk/Source/WebCore








Revision 216586
Author mmaxfi...@apple.com
Date 2017-05-10 09:06:35 -0700 (Wed, 10 May 2017)


Log Message
Tiny cleanup in Font::DerivedFonts
https://bugs.webkit.org/show_bug.cgi?id=171893

Reviewed by Jon Lee.

This variable was written to but never read.

No new tests because there is no behavior change.

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* platform/graphics/Font.cpp:
(WebCore::Font::verticalRightOrientationFont):
(WebCore::Font::uprightOrientationFont):
(WebCore::Font::smallCapsFont):
(WebCore::Font::noSynthesizableFeaturesFont):
(WebCore::Font::emphasisMarkFont):
(WebCore::Font::brokenIdeographFont):
(WebCore::Font::DerivedFonts::~DerivedFonts): Deleted.
* platform/graphics/Font.h:
(WebCore::Font::DerivedFonts::DerivedFonts): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSFontFaceSource.cpp
trunk/Source/WebCore/platform/graphics/Font.cpp
trunk/Source/WebCore/platform/graphics/Font.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (216585 => 216586)

--- trunk/Source/WebCore/ChangeLog	2017-05-10 14:50:02 UTC (rev 216585)
+++ trunk/Source/WebCore/ChangeLog	2017-05-10 16:06:35 UTC (rev 216586)
@@ -1,3 +1,27 @@
+2017-05-10  Myles C. Maxfield  
+
+Tiny cleanup in Font::DerivedFonts
+https://bugs.webkit.org/show_bug.cgi?id=171893
+
+Reviewed by Jon Lee.
+
+This variable was written to but never read.
+
+No new tests because there is no behavior change.
+
+* css/CSSFontFaceSource.cpp:
+(WebCore::CSSFontFaceSource::font):
+* platform/graphics/Font.cpp:
+(WebCore::Font::verticalRightOrientationFont):
+(WebCore::Font::uprightOrientationFont):
+(WebCore::Font::smallCapsFont):
+(WebCore::Font::noSynthesizableFeaturesFont):
+(WebCore::Font::emphasisMarkFont):
+(WebCore::Font::brokenIdeographFont):
+(WebCore::Font::DerivedFonts::~DerivedFonts): Deleted.
+* platform/graphics/Font.h:
+(WebCore::Font::DerivedFonts::DerivedFonts): Deleted.
+
 2017-05-10  Michael Catanzaro  
 
 Remove user agent quirk for Slack


Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (216585 => 216586)

--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2017-05-10 14:50:02 UTC (rev 216585)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2017-05-10 16:06:35 UTC (rev 216586)
@@ -206,9 +206,9 @@
 if (!m_inDocumentCustomPlatformData)
 return nullptr;
 #if PLATFORM(COCOA)
-return Font::create(m_inDocumentCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities), true, false);
+return Font::create(m_inDocumentCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings, fontFaceCapabilities), true);
 #else
-return Font::create(m_inDocumentCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic), true, false);
+return Font::create(m_inDocumentCustomPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic), true);
 #endif
 #endif
 


Modified: trunk/Source/WebCore/platform/graphics/Font.cpp (216585 => 216586)

--- trunk/Source/WebCore/platform/graphics/Font.cpp	2017-05-10 14:50:02 UTC (rev 216585)
+++ trunk/Source/WebCore/platform/graphics/Font.cpp	2017-05-10 16:06:35 UTC (rev 216586)
@@ -263,7 +263,7 @@
 const Font& Font::verticalRightOrientationFont() const
 {
 if (!m_derivedFontData)
-m_derivedFontData = std::make_unique(isCustomFont());
+m_derivedFontData = std::make_unique();
 if (!m_derivedFontData->verticalRightOrientation) {
 auto verticalRightPlatformData = FontPlatformData::cloneWithOrientation(m_platformData, Horizontal);
 m_derivedFontData->verticalRightOrientation = create(verticalRightPlatformData, isCustomFont(), false, true);
@@ -275,7 +275,7 @@
 const Font& Font::uprightOrientationFont() const
 {
 if (!m_derivedFontData)
-m_derivedFontData = std::make_unique(isCustomFont());
+m_derivedFontData = std::make_unique();
 if (!m_derivedFontData->uprightOrientation)
 m_derivedFontData->uprightOrientation = create(m_platformData, isCustomFont(), false, true);
 ASSERT(m_derivedFontData->uprightOrientation != this);
@@ -285,7 +285,7 @@
 const Font* Font::smallCapsFont(const FontDescription& fontDescription) const
 {
 if (!m_derivedFontData)
-m_derivedFontData = std::make_unique(isCustomFont());
+m_derivedFontData = std::make_unique();
 if (!m_derivedFontData->smallCaps)
 m_derivedFontData->smallCaps = createScaledFont(fontDescription, smallCapsFontSizeMultiplier);
 ASSERT(m_derivedFontData->smallCaps != this);
@@ -296,7 +296,7 @@
 {
 #if PLATFORM(COCOA)
 if (!m_derivedFontData)
-   

[webkit-changes] [216517] trunk

2017-05-09 Thread mmaxfield
Title: [216517] trunk








Revision 216517
Author mmaxfi...@apple.com
Date 2017-05-09 11:02:12 -0700 (Tue, 09 May 2017)


Log Message
font-stretch: normal selects expanded fonts instead of condensed fonts
https://bugs.webkit.org/show_bug.cgi?id=171838


Reviewed by Jon Lee.

Source/WebCore:

CSS Fonts level 3 says: "If the value of ‘font-stretch’ is ‘normal’ or one of the condensed
values, narrower width values are checked first, then wider values."

CSS Fonts level 4 erroneously was incompatible with this, but was updated in
https://github.com/w3c/csswg-drafts/commit/4559389d183bbaaf3321af5ba1c924caa7c488bb
to be consistent with this.

Now, CSS Fonts level 4 states: "If the desired stretch value is less than or equal to100,
stretch values below the desired stretch value are checked in descending order followed by
stretch values above the desired stretch value in ascending order"

Test: fast/text/font-width-100.html

* platform/graphics/FontSelectionAlgorithm.cpp:

LayoutTests:

* fast/text/font-width-100-expected.html: Added.
* fast/text/font-width-100.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp


Added Paths

trunk/LayoutTests/fast/text/font-width-100-expected.html
trunk/LayoutTests/fast/text/font-width-100.html




Diff

Modified: trunk/LayoutTests/ChangeLog (216516 => 216517)

--- trunk/LayoutTests/ChangeLog	2017-05-09 17:56:29 UTC (rev 216516)
+++ trunk/LayoutTests/ChangeLog	2017-05-09 18:02:12 UTC (rev 216517)
@@ -1,3 +1,14 @@
+2017-05-09  Myles C. Maxfield  
+
+font-stretch: normal selects expanded fonts instead of condensed fonts
+https://bugs.webkit.org/show_bug.cgi?id=171838
+
+
+Reviewed by Jon Lee.
+
+* fast/text/font-width-100-expected.html: Added.
+* fast/text/font-width-100.html: Added.
+
 2017-05-09  Matt Lewis  
 
 Mark storage/indexeddb/modern/idbtransaction-objectstore-failures.html as flaky.


Added: trunk/LayoutTests/fast/text/font-width-100-expected.html (0 => 216517)

--- trunk/LayoutTests/fast/text/font-width-100-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-width-100-expected.html	2017-05-09 18:02:12 UTC (rev 216517)
@@ -0,0 +1,10 @@
+
+
+
+
+
+This test makes sure that "font-stretch: 100%" selects fonts which are condensed
+rather than expanded. The test passes if the text below is in Times.
+Hello
+
+


Added: trunk/LayoutTests/fast/text/font-width-100.html (0 => 216517)

--- trunk/LayoutTests/fast/text/font-width-100.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-width-100.html	2017-05-09 18:02:12 UTC (rev 216517)
@@ -0,0 +1,22 @@
+
+
+
+
+@font-face {
+font-family: "MyFont";
+src: local("Helvetica");
+font-stretch: 120%;
+}
+@font-face {
+font-family: "MyFont";
+src: local("Times");
+font-stretch: 80%;
+}
+
+
+
+This test makes sure that "font-stretch: 100%" selects fonts which are condensed
+rather than expanded. The test passes if the text below is in Times.
+Hello
+
+


Modified: trunk/Source/WebCore/ChangeLog (216516 => 216517)

--- trunk/Source/WebCore/ChangeLog	2017-05-09 17:56:29 UTC (rev 216516)
+++ trunk/Source/WebCore/ChangeLog	2017-05-09 18:02:12 UTC (rev 216517)
@@ -1,3 +1,26 @@
+2017-05-09  Myles C. Maxfield  
+
+font-stretch: normal selects expanded fonts instead of condensed fonts
+https://bugs.webkit.org/show_bug.cgi?id=171838
+
+
+Reviewed by Jon Lee.
+
+CSS Fonts level 3 says: "If the value of ‘font-stretch’ is ‘normal’ or one of the condensed
+values, narrower width values are checked first, then wider values."
+
+CSS Fonts level 4 erroneously was incompatible with this, but was updated in
+https://github.com/w3c/csswg-drafts/commit/4559389d183bbaaf3321af5ba1c924caa7c488bb
+to be consistent with this.
+
+Now, CSS Fonts level 4 states: "If the desired stretch value is less than or equal to100,
+stretch values below the desired stretch value are checked in descending order followed by
+stretch values above the desired stretch value in ascending order"
+
+Test: fast/text/font-width-100.html
+
+* platform/graphics/FontSelectionAlgorithm.cpp:
+
 2017-05-09  Romain Bellessort  
 
 [Readable Streams API] Enable creation of ReadableStreamBYOBReader


Modified: trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp (216516 => 216517)

--- trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp	2017-05-09 17:56:29 UTC (rev 216516)
+++ trunk/Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp	2017-05-09 18:02:12 UTC (rev 216517)
@@ -35,7 +35,7 @@
 if (width.includes(m_request.width))
 return { FontSelectionValue(), m_request.width };
 
-if (m_request.width >= 

[webkit-changes] [216342] trunk

2017-05-06 Thread mmaxfield
Title: [216342] trunk








Revision 216342
Author mmaxfi...@apple.com
Date 2017-05-06 22:43:29 -0700 (Sat, 06 May 2017)


Log Message
[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
https://bugs.webkit.org/show_bug.cgi?id=171636


Reviewed by Dean Jackson.

Source/WebCore:

LastResort is the only name which needs to be looked up case-sensitively. We can handle
this in our existing function which handles special font names (like -apple-system) to
make sure that we always do the right thing.

Test: fast/text/lastResort.html

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/spi/cocoa/CoreTextSPI.h:

LayoutTests:

* fast/text/lastResort-expected.html: Added.
* fast/text/lastResort.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm
trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h


Added Paths

trunk/LayoutTests/fast/text/lastResort-expected.html
trunk/LayoutTests/fast/text/lastResort.html




Diff

Modified: trunk/LayoutTests/ChangeLog (216341 => 216342)

--- trunk/LayoutTests/ChangeLog	2017-05-07 05:18:34 UTC (rev 216341)
+++ trunk/LayoutTests/ChangeLog	2017-05-07 05:43:29 UTC (rev 216342)
@@ -1,3 +1,14 @@
+2017-05-06  Myles C. Maxfield  
+
+[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
+https://bugs.webkit.org/show_bug.cgi?id=171636
+
+
+Reviewed by Dean Jackson.
+
+* fast/text/lastResort-expected.html: Added.
+* fast/text/lastResort.html: Added.
+
 2017-05-06  Chris Dumez  
 
 Implement the concept of cookie-averse document


Added: trunk/LayoutTests/fast/text/lastResort-expected.html (0 => 216342)

--- trunk/LayoutTests/fast/text/lastResort-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/lastResort-expected.html	2017-05-07 05:43:29 UTC (rev 216342)
@@ -0,0 +1,9 @@
+
+
+
+
+
+This test makes sure that Last Resort is always looked up correctly.
+hi
+
+


Added: trunk/LayoutTests/fast/text/lastResort.html (0 => 216342)

--- trunk/LayoutTests/fast/text/lastResort.html	(rev 0)
+++ trunk/LayoutTests/fast/text/lastResort.html	2017-05-07 05:43:29 UTC (rev 216342)
@@ -0,0 +1,9 @@
+
+
+
+
+
+This test makes sure that Last Resort is always looked up correctly.
+hi
+
+


Modified: trunk/Source/WebCore/ChangeLog (216341 => 216342)

--- trunk/Source/WebCore/ChangeLog	2017-05-07 05:18:34 UTC (rev 216341)
+++ trunk/Source/WebCore/ChangeLog	2017-05-07 05:43:29 UTC (rev 216342)
@@ -1,3 +1,23 @@
+2017-05-06  Myles C. Maxfield  
+
+[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
+https://bugs.webkit.org/show_bug.cgi?id=171636
+
+
+Reviewed by Dean Jackson.
+
+LastResort is the only name which needs to be looked up case-sensitively. We can handle
+this in our existing function which handles special font names (like -apple-system) to
+make sure that we always do the right thing.
+
+Test: fast/text/lastResort.html
+
+* platform/graphics/ios/FontCacheIOS.mm:
+(WebCore::platformFontWithFamilySpecialCase):
+* platform/graphics/mac/FontCacheMac.mm:
+(WebCore::platformFontWithFamilySpecialCase):
+* platform/spi/cocoa/CoreTextSPI.h:
+
 2017-05-06  Chris Dumez  
 
 Implement the concept of cookie-averse document


Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (216341 => 216342)

--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2017-05-07 05:18:34 UTC (rev 216341)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2017-05-07 05:43:29 UTC (rev 216342)
@@ -33,11 +33,17 @@
 #import "CoreTextSPI.h"
 #import "FontCascade.h"
 #import "RenderThemeIOS.h"
+#import "SoftLinking.h"
 #import 
 #import 
 #import 
 #import 
 
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 11
+SOFT_LINK_FRAMEWORK(CoreText);
+SOFT_LINK_MAY_FAIL(CoreText, CTFontDescriptorCreateLastResort, CTFontDescriptorRef, (), ());
+#endif
+
 namespace WebCore {
 
 bool requiresCustomFallbackFont(UChar32 character)
@@ -164,6 +170,18 @@
 return adoptCF(CTFontCreateWithFontDescriptor(monospaceFontDescriptor.get(), size, nullptr));
 }
 
+if (equalLettersIgnoringASCIICase(family, "lastresort")) {
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 11
+if (canLoadCTFontDescriptorCreateLastResort()) {
+static NeverDestroyed lastResort = adoptCF(CTFontDescriptorCreateLastResort());
+return adoptCF(CTFontCreateWithFontDescriptor(lastResort.get().get(), size, nullptr));
+}
+#endif
+// LastResort 

[webkit-changes] [216331] trunk

2017-05-06 Thread mmaxfield
Title: [216331] trunk








Revision 216331
Author mmaxfi...@apple.com
Date 2017-05-06 10:54:16 -0700 (Sat, 06 May 2017)


Log Message
REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
https://bugs.webkit.org/show_bug.cgi?id=171750


Reviewed by Zalan Bujtas.

Source/WebCore:

Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through
the string to determine which code path to use, we ask if a particular codepoint is an emoji
group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers,
which means the next "if" statement would never be hit. Instead, we should check that "if"
statement first (because order is not important here). The next checks do not intersect with
any emoji group candidates.

Test: fast/text/fitzpatrick-combination.html

* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::characterRangeCodePath):

LayoutTests:

* fast/text/fitzpatrick-combination-expected.html: Added.
* fast/text/fitzpatrick-combination.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/FontCascade.cpp


Added Paths

trunk/LayoutTests/fast/text/fitzpatrick-combination-expected.html
trunk/LayoutTests/fast/text/fitzpatrick-combination.html




Diff

Modified: trunk/LayoutTests/ChangeLog (216330 => 216331)

--- trunk/LayoutTests/ChangeLog	2017-05-06 17:31:10 UTC (rev 216330)
+++ trunk/LayoutTests/ChangeLog	2017-05-06 17:54:16 UTC (rev 216331)
@@ -1,3 +1,14 @@
+2017-05-06  Myles C. Maxfield  
+
+REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
+https://bugs.webkit.org/show_bug.cgi?id=171750
+
+
+Reviewed by Zalan Bujtas.
+
+* fast/text/fitzpatrick-combination-expected.html: Added.
+* fast/text/fitzpatrick-combination.html: Added.
+
 2017-05-05  Zalan Bujtas  
 
 Renderers being destroyed should not be added to AX's deferred list.


Added: trunk/LayoutTests/fast/text/fitzpatrick-combination-expected.html (0 => 216331)

--- trunk/LayoutTests/fast/text/fitzpatrick-combination-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/fitzpatrick-combination-expected.html	2017-05-06 17:54:16 UTC (rev 216331)
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+This test makes sure that emoji with Fitzpatrick modifier are drawn as a single glyph. The test passes if this text you are reading right now is the only text on the page.
+
+


Added: trunk/LayoutTests/fast/text/fitzpatrick-combination.html (0 => 216331)

--- trunk/LayoutTests/fast/text/fitzpatrick-combination.html	(rev 0)
+++ trunk/LayoutTests/fast/text/fitzpatrick-combination.html	2017-05-06 17:54:16 UTC (rev 216331)
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+This test makes sure that emoji with Fitzpatrick modifier are drawn as a single glyph. The test passes if this text you are reading right now is the only text on the page.
+
+var fudge = 6;
+var container = document.getElementById("container");
+var target = document.getElementById("target");
+var cover = document.createElement("div");
+cover.style.position = "absolute";
+cover.style.left = target.offsetLeft.toString() + "px";
+cover.style.top = (target.offsetTop - fudge).toString() + "px";
+cover.style.width = target.offsetWidth.toString() + "px";
+cover.style.height = (target.offsetHeight + fudge).toString() + "px";
+cover.style.backgroundColor = "white";
+container.appendChild(cover);
+
+
+


Modified: trunk/Source/WebCore/ChangeLog (216330 => 216331)

--- trunk/Source/WebCore/ChangeLog	2017-05-06 17:31:10 UTC (rev 216330)
+++ trunk/Source/WebCore/ChangeLog	2017-05-06 17:54:16 UTC (rev 216331)
@@ -1,3 +1,23 @@
+2017-05-06  Myles C. Maxfield  
+
+REGERSSION(r213499): Emoji with Fitzpatrick modifiers are drawn as two separate glyphs
+https://bugs.webkit.org/show_bug.cgi?id=171750
+
+
+Reviewed by Zalan Bujtas.
+
+Emoji with Fitzpatrick modifiers need to take our complex text codepath. When looking through
+the string to determine which code path to use, we ask if a particular codepoint is an emoji
+group candidate. r213499 expanded the set of these candidates to include Fitzpatrick modifiers,
+which means the next "if" statement would never be hit. Instead, we should check that "if"
+statement first (because order is not important here). The next checks do not intersect with
+any emoji group candidates.
+
+Test: fast/text/fitzpatrick-combination.html
+
+* platform/graphics/FontCascade.cpp:
+(WebCore::FontCascade::characterRangeCodePath):
+
 2017-05-06  Youenn Fablet  
 
 RealtimeMediaSourceCenter callbacks should be passed as r-values


Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (216330 => 216331)

--- 

[webkit-changes] [216275] trunk

2017-05-05 Thread mmaxfield
Title: [216275] trunk








Revision 216275
Author mmaxfi...@apple.com
Date 2017-05-05 14:54:59 -0700 (Fri, 05 May 2017)


Log Message
[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
https://bugs.webkit.org/show_bug.cgi?id=171636


Reviewed by Dean Jackson.

Source/WebCore:

LastResort is the only name which needs to be looked up case-sensitively. We can handle
this in our existing function which handles special font names (like -apple-system) to
make sure that we always do the right thing.

Test: fast/text/lastResort.html

* platform/spi/cocoa/CoreTextSPI.h:
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::platformFontWithFamilySpecialCase):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::platformFontWithFamilySpecialCase):

LayoutTests:

* fast/text/lastResort-expected.html: Added.
* fast/text/lastResort.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm
trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm
trunk/Source/WebCore/platform/spi/cocoa/CoreTextSPI.h


Added Paths

trunk/LayoutTests/fast/text/lastResort-expected.html
trunk/LayoutTests/fast/text/lastResort.html




Diff

Modified: trunk/LayoutTests/ChangeLog (216274 => 216275)

--- trunk/LayoutTests/ChangeLog	2017-05-05 21:36:58 UTC (rev 216274)
+++ trunk/LayoutTests/ChangeLog	2017-05-05 21:54:59 UTC (rev 216275)
@@ -1,3 +1,14 @@
+2017-05-05  Myles C. Maxfield  
+
+[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
+https://bugs.webkit.org/show_bug.cgi?id=171636
+
+
+Reviewed by Dean Jackson.
+
+* fast/text/lastResort-expected.html: Added.
+* fast/text/lastResort.html: Added.
+
 2017-05-05  Ryan Haddad  
 
 Unskip media/click-placeholder-not-pausing.html.


Added: trunk/LayoutTests/fast/text/lastResort-expected.html (0 => 216275)

--- trunk/LayoutTests/fast/text/lastResort-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/lastResort-expected.html	2017-05-05 21:54:59 UTC (rev 216275)
@@ -0,0 +1,9 @@
+
+
+
+
+
+This test makes sure that Last Resort is always looked up correctly.
+hi
+
+


Added: trunk/LayoutTests/fast/text/lastResort.html (0 => 216275)

--- trunk/LayoutTests/fast/text/lastResort.html	(rev 0)
+++ trunk/LayoutTests/fast/text/lastResort.html	2017-05-05 21:54:59 UTC (rev 216275)
@@ -0,0 +1,9 @@
+
+
+
+
+
+This test makes sure that Last Resort is always looked up correctly.
+hi
+
+


Modified: trunk/Source/WebCore/ChangeLog (216274 => 216275)

--- trunk/Source/WebCore/ChangeLog	2017-05-05 21:36:58 UTC (rev 216274)
+++ trunk/Source/WebCore/ChangeLog	2017-05-05 21:54:59 UTC (rev 216275)
@@ -1,3 +1,23 @@
+2017-05-05  Myles C. Maxfield  
+
+[Cocoa] CTFontDescriptorCreateMatchingFontDescriptor() is not case insensitive
+https://bugs.webkit.org/show_bug.cgi?id=171636
+
+
+Reviewed by Dean Jackson.
+
+LastResort is the only name which needs to be looked up case-sensitively. We can handle
+this in our existing function which handles special font names (like -apple-system) to
+make sure that we always do the right thing.
+
+Test: fast/text/lastResort.html
+
+* platform/spi/cocoa/CoreTextSPI.h:
+* platform/graphics/ios/FontCacheIOS.mm:
+(WebCore::platformFontWithFamilySpecialCase):
+* platform/graphics/mac/FontCacheMac.mm:
+(WebCore::platformFontWithFamilySpecialCase):
+
 2017-05-05  Said Abou-Hallawa  
 
 Crash in ImageFrameCache::decodedSizeChanged() after image load cancellation


Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (216274 => 216275)

--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2017-05-05 21:36:58 UTC (rev 216274)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2017-05-05 21:54:59 UTC (rev 216275)
@@ -164,6 +164,17 @@
 return adoptCF(CTFontCreateWithFontDescriptor(monospaceFontDescriptor.get(), size, nullptr));
 }
 
+if (equalLettersIgnoringASCIICase(family, "lastresort")) {
+#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 11
+static NeverDestroyed lastResort = adoptCF(CTFontDescriptorCreateLastResort());
+return adoptCF(CTFontCreateWithFontDescriptor(lastResort.get().get(), size, nullptr));
+#else
+// LastResort is special, so it's important to look this exact string up, and not some case-folded version.
+// We handle this here so any caching and case folding we do in our general text codepath is bypassed.
+return adoptCF(CTFontCreateWithName(CFSTR("LastResort"), size, nullptr));
+#endif
+}
+
 return nullptr;
 }
 


Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (216274 => 216275)

--- 

[webkit-changes] [216088] trunk

2017-05-02 Thread mmaxfield
Title: [216088] trunk








Revision 216088
Author mmaxfi...@apple.com
Date 2017-05-02 12:35:25 -0700 (Tue, 02 May 2017)


Log Message
REGRESSION (r211382): Partial right-to-left text runs are painted at an offset (breaks Find indicators, Look Up, and custom ::selection style)
https://bugs.webkit.org/show_bug.cgi?id=169517


Reviewed by Dean Jackson.

Source/WebCore:

FontCascade::getGlyphsAndAdvancesForComplexText() is tasked with calculating paint advances for a
subrange of RTL text. It does this by creating a ComplexTextController, telling it to iterate to
the beginning of the subrange (outputting to a GlyphBuffer), then telling it to iterate to the end
of the subrange (outputting to another GlyphBuffer). Because the text is RTL, the sum of the
advances gathered so far is the distance from the right edge of the text to the left edge of the
subrange (because we advance in logical order). Therefore, the x-coordinate we are at now is the
total width minus the sum of both of the GlyphBuffers. For some reason, when I wrote this code I
forgot to add in the contribution from the first GlyphBuffer. Unfortunately, this particular
codepath is rarely hit in practice and completely untested, which made me miss it when I wrote it.

Test: fast/text/complex-text-selection.html

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):

LayoutTests:

* fast/text/complex-text-selection-expected.html: Added.
* fast/text/complex-text-selection.html: Added.
* platform/ios/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/ios/TestExpectations
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/cocoa/FontCascadeCocoa.mm


Added Paths

trunk/LayoutTests/fast/text/complex-text-selection-expected.html
trunk/LayoutTests/fast/text/complex-text-selection.html




Diff

Modified: trunk/LayoutTests/ChangeLog (216087 => 216088)

--- trunk/LayoutTests/ChangeLog	2017-05-02 19:22:42 UTC (rev 216087)
+++ trunk/LayoutTests/ChangeLog	2017-05-02 19:35:25 UTC (rev 216088)
@@ -1,3 +1,15 @@
+2017-05-02  Myles C. Maxfield  
+
+REGRESSION (r211382): Partial right-to-left text runs are painted at an offset (breaks Find indicators, Look Up, and custom ::selection style)
+https://bugs.webkit.org/show_bug.cgi?id=169517
+
+
+Reviewed by Dean Jackson.
+
+* fast/text/complex-text-selection-expected.html: Added.
+* fast/text/complex-text-selection.html: Added.
+* platform/ios/TestExpectations:
+
 2017-05-02  Joseph Pecoraro  
 
 [Mac] WK1: http/tests/inspector/network/resource-sizes tests are failing


Added: trunk/LayoutTests/fast/text/complex-text-selection-expected.html (0 => 216088)

--- trunk/LayoutTests/fast/text/complex-text-selection-expected.html	(rev 0)
+++ trunk/LayoutTests/fast/text/complex-text-selection-expected.html	2017-05-02 19:35:25 UTC (rev 216088)
@@ -0,0 +1,8 @@
+
+
+
+
+
+Selection is green
+
+


Added: trunk/LayoutTests/fast/text/complex-text-selection.html (0 => 216088)

--- trunk/LayoutTests/fast/text/complex-text-selection.html	(rev 0)
+++ trunk/LayoutTests/fast/text/complex-text-selection.html	2017-05-02 19:35:25 UTC (rev 216088)
@@ -0,0 +1,15 @@
+
+
+
+
+	::selection { color: green; }
+
+
+
+neerg si noitceleS
+
+	let textNode = document.getElementById("target").firstChild;
+	getSelection().setBaseAndExtent(textNode, 0, textNode, 5)
+
+
+


Modified: trunk/LayoutTests/platform/ios/TestExpectations (216087 => 216088)

--- trunk/LayoutTests/platform/ios/TestExpectations	2017-05-02 19:22:42 UTC (rev 216087)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2017-05-02 19:35:25 UTC (rev 216088)
@@ -2946,3 +2946,6 @@
 
 # auto-sizing produces inconsistent image results
 css3/viewport-percentage-lengths/vh-auto-size.html [ ImageOnlyFailure ]
+
+# This test relies on the ::selection pseudoclass which isn't honored on iOS.
+webkit.org/b/169517 fast/text/complex-text-selection.html [ ImageOnlyFailure ]


Modified: trunk/Source/WebCore/ChangeLog (216087 => 216088)

--- trunk/Source/WebCore/ChangeLog	2017-05-02 19:22:42 UTC (rev 216087)
+++ trunk/Source/WebCore/ChangeLog	2017-05-02 19:35:25 UTC (rev 216088)
@@ -1,3 +1,26 @@
+2017-05-02  Myles C. Maxfield  
+
+REGRESSION (r211382): Partial right-to-left text runs are painted at an offset (breaks Find indicators, Look Up, and custom ::selection style)
+https://bugs.webkit.org/show_bug.cgi?id=169517
+
+
+Reviewed by Dean Jackson.
+
+FontCascade::getGlyphsAndAdvancesForComplexText() is tasked with calculating paint advances for a
+subrange of RTL text. It does this by creating a ComplexTextController, telling it to iterate to
+the beginning of the subrange (outputting to a GlyphBuffer), then telling it to iterate to the end
+of the subrange 

[webkit-changes] [216079] trunk

2017-05-02 Thread mmaxfield
Title: [216079] trunk








Revision 216079
Author mmaxfi...@apple.com
Date 2017-05-02 11:02:50 -0700 (Tue, 02 May 2017)


Log Message
Font Loading API specifies font is loaded but sizing of font after load reports inconsistent values
https://bugs.webkit.org/show_bug.cgi?id=168533

Reviewed by Zalan Bujtas.

Source/WebCore:

Previously, we were marking all local() fonts as immediately successful,
regardless of whether or not they were present on the system. Instead, we
should use the load() function to make this determination and mark the font
as failed if it doesn't exist. (This is, after all, the whole point of the
load() function). This brings us in-line with Firefox's and Chrome's
behavior.

Test: fast/text/font-loading-local.html

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::pump): Remote loading requires the FontSelector,
but it isn't available for local fonts. Now that load() is called for both
local and remote fonts, the ASSERT() should be lowered into the load()
function and scoped to just the case where we have a remote font.
(WebCore::CSSFontFace::font): Ditto.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource): Don't immediatley set
the success/failure state for local fonts.
(WebCore::CSSFontFaceSource::load): Move loading logic from font() to
load(). None of this code is new; it just is moved.
(WebCore::CSSFontFaceSource::font): Delete code moved to load().
* css/CSSFontFaceSource.h:
* css/FontFace.cpp:
(WebCore::FontFace::create):

LayoutTests:

* fast/text/font-loading-local-expected.txt: Added.
* fast/text/font-loading-local.html: Added.
* fast/text/web-font-load-fallback-during-loading.html:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/fast/text/web-font-load-fallback-during-loading.html
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/css/CSSFontFace.cpp
trunk/Source/WebCore/css/CSSFontFaceSource.cpp
trunk/Source/WebCore/css/CSSFontFaceSource.h
trunk/Source/WebCore/css/FontFace.cpp


Added Paths

trunk/LayoutTests/fast/text/font-loading-local-expected.txt
trunk/LayoutTests/fast/text/font-loading-local.html




Diff

Modified: trunk/LayoutTests/ChangeLog (216078 => 216079)

--- trunk/LayoutTests/ChangeLog	2017-05-02 18:00:23 UTC (rev 216078)
+++ trunk/LayoutTests/ChangeLog	2017-05-02 18:02:50 UTC (rev 216079)
@@ -1,3 +1,14 @@
+2017-05-02  Myles C. Maxfield  
+
+Font Loading API specifies font is loaded but sizing of font after load reports inconsistent values
+https://bugs.webkit.org/show_bug.cgi?id=168533
+
+Reviewed by Zalan Bujtas.
+
+* fast/text/font-loading-local-expected.txt: Added.
+* fast/text/font-loading-local.html: Added.
+* fast/text/web-font-load-fallback-during-loading.html:
+
 2017-05-02  Youenn Fablet  
 
 Allow media stream based videos with sound autoplay if the page is already playing sound


Added: trunk/LayoutTests/fast/text/font-loading-local-expected.txt (0 => 216079)

--- trunk/LayoutTests/fast/text/font-loading-local-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/text/font-loading-local-expected.txt	2017-05-02 18:02:50 UTC (rev 216079)
@@ -0,0 +1,11 @@
+This test makes sure that the CSS Font Loading API works properly with local() fonts.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Local font loaded correctly
+PASS Garbage local font didn't load
+PASS successfullyParsed is true
+
+TEST COMPLETE
+


Added: trunk/LayoutTests/fast/text/font-loading-local.html (0 => 216079)

--- trunk/LayoutTests/fast/text/font-loading-local.html	(rev 0)
+++ trunk/LayoutTests/fast/text/font-loading-local.html	2017-05-02 18:02:50 UTC (rev 216079)
@@ -0,0 +1,28 @@
+
+
+
+
+
+