Determine used fonts based on the correct font path (issue 1379473005 by drott@chromium.org)

2 views
Skip to first unread message

dr...@chromium.org

unread,
Oct 1, 2015, 11:51:34 AM10/1/15
to e...@chromium.org, lush...@chromium.org, chromium...@chromium.org, dsch...@chromium.org, caseq...@chromium.org, pdr+graphi...@chromium.org, drott+bl...@chromium.org, blink-reviews-p...@chromium.org, dongseo...@intel.com, yurys...@chromium.org, lushnik...@chromium.org, jbr...@chromium.org, dan...@chromium.org, pfeldma...@chromium.org, caba...@adobe.com, apavlo...@chromium.org, ju...@chromium.org, devtools...@chromium.org, blink-...@chromium.org, fma...@chromium.org, sergey...@chromium.org, rob....@samsung.com, sche...@chromium.org, kozyatins...@chromium.org
Reviewers: eae, lushnikov,

Description:
Determine used fonts based on the correct font path

InspectorCSSAgent previously always instantiated a SimpleShaper,
leading to incorrect results when the run was shaped using complex
path.

BUG=538180
R=eae,lushnikov

Please review this at https://codereview.chromium.org/1379473005/

Base URL: https://chromium.googlesource.com/chromium/src.git@master

Affected files (+10, -2 lines):
M third_party/WebKit/LayoutTests/TestExpectations
M third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
M third_party/WebKit/Source/platform/fonts/Font.h


Index: third_party/WebKit/LayoutTests/TestExpectations
diff --git a/third_party/WebKit/LayoutTests/TestExpectations
b/third_party/WebKit/LayoutTests/TestExpectations
index
b4b67556412a5de1e7dd9a2e9404e4c18dfa0f9d..abd34d1ec86db36e18e901eeee8f698ebf5e19c9
100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -1448,6 +1448,8 @@ crbug.com/464736
http/tests/xmlhttprequest/ontimeout-event-override-after-failur
# Unclear semantics of ToString (actually ToPrimitive) across iframes.
crbug.com/532469 http/tests/security/cross-frame-access-custom.html [
NeedsManualRebaseline ]

+crbug.com/538180 [ Win7 XP Linux Mac Android ]
inspector-protocol/layout-fonts/languages-emoji-rare-glyphs.html [
NeedsRebaseline ]
+
# Win10 specific failures that still need triaging.
crbug.com/521730 [ Win10 ]
fast/dom/Window/property-access-on-cached-properties-after-frame-navigated.html
[ Failure ]
crbug.com/521730 [ Win10 ]
fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced.html
[ Failure ]
Index: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index
ae0346ac52cb820480b22e85061f3bb905b9bd67..ccabca73f8025629b7aead76fc05749f2ed7e002
100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -69,6 +69,7 @@
#include "core/loader/DocumentLoader.h"
#include "core/page/Page.h"
#include "platform/fonts/Font.h"
+#include "platform/fonts/FontCache.h"
#include "platform/fonts/GlyphBuffer.h"
#include "platform/fonts/shaping/SimpleShaper.h"
#include "platform/text/TextRun.h"
@@ -817,14 +818,16 @@ void
InspectorCSSAgent::collectPlatformFontsForLayoutObject(LayoutObject* layout
{
if (!layoutObject->isText())
return;
+
+ FontCachePurgePreventer preventer;
LayoutText* layoutText = toLayoutText(layoutObject);
for (InlineTextBox* box = layoutText->firstTextBox(); box; box =
box->nextTextBox()) {
const ComputedStyle& style =
layoutText->styleRef(box->isFirstLineStyle());
const Font& font = style.font();
TextRun run = box->constructTextRunForInspector(style, font);
- SimpleShaper shaper(&font, run);
+ TextRunPaintInfo paintInfo(run);
GlyphBuffer glyphBuffer;
- shaper.advance(run.length(), &glyphBuffer);
+ font.buildGlyphBuffer(paintInfo, glyphBuffer);
for (unsigned i = 0; i < glyphBuffer.size(); ++i) {
String familyName =
glyphBuffer.fontDataAt(i)->platformData().fontFamilyName();
if (familyName.isNull())
Index: third_party/WebKit/Source/platform/fonts/Font.h
diff --git a/third_party/WebKit/Source/platform/fonts/Font.h
b/third_party/WebKit/Source/platform/fonts/Font.h
index
3054f03887baebba5a6dce7cbe526df9fc129258..1ccaf525b07fcd3b7883d16e039997515dc09d04
100644
--- a/third_party/WebKit/Source/platform/fonts/Font.h
+++ b/third_party/WebKit/Source/platform/fonts/Font.h
@@ -162,6 +162,9 @@ private:
mutable RefPtr<FontFallbackList> m_fontFallbackList;
mutable unsigned m_canShapeWordByWord : 1;
mutable unsigned m_shapeWordByWordComputed : 1;
+
+ // For accessing buildGlyphbuffer and retrieving fonts used in
rendering a node.
+ friend class InspectorCSSAgent;
};

inline Font::~Font()


e...@chromium.org

unread,
Oct 1, 2015, 12:02:50 PM10/1/15
to drott...@chromium.org, lush...@chromium.org, chromium...@chromium.org, dsch...@chromium.org, caseq...@chromium.org, pdr+graphi...@chromium.org, drott+bl...@chromium.org, blink-reviews-p...@chromium.org, dongseo...@intel.com, yurys...@chromium.org, lushnik...@chromium.org, jbr...@chromium.org, dan...@chromium.org, pfeldma...@chromium.org, caba...@adobe.com, apavlo...@chromium.org, ju...@chromium.org, devtools...@chromium.org, blink-...@chromium.org, fma...@chromium.org, sergey...@chromium.org, rob....@samsung.com, sche...@chromium.org, kozyatins...@chromium.org

lush...@chromium.org

unread,
Oct 1, 2015, 1:41:26 PM10/1/15
to drott...@chromium.org, e...@chromium.org, chromium...@chromium.org, dsch...@chromium.org, caseq...@chromium.org, pdr+graphi...@chromium.org, drott+bl...@chromium.org, blink-reviews-p...@chromium.org, dongseo...@intel.com, yurys...@chromium.org, lushnik...@chromium.org, jbr...@chromium.org, dan...@chromium.org, pfeldma...@chromium.org, caba...@adobe.com, apavlo...@chromium.org, ju...@chromium.org, devtools...@chromium.org, blink-...@chromium.org, fma...@chromium.org, sergey...@chromium.org, rob....@samsung.com, sche...@chromium.org, kozyatins...@chromium.org

wko...@chromium.org

unread,
Oct 1, 2015, 1:53:04 PM10/1/15
to drott...@chromium.org, e...@chromium.org, lush...@chromium.org, apavlo...@chromium.org, blink-...@chromium.org, blink-reviews-p...@chromium.org, caba...@adobe.com, caseq...@chromium.org, chromium...@chromium.org, dan...@chromium.org, devtools...@chromium.org, dongseo...@intel.com, drott+bl...@chromium.org, dsch...@chromium.org, fma...@chromium.org, jbr...@chromium.org, ju...@chromium.org, kozyatins...@chromium.org, lushnik...@chromium.org, pdr+graphi...@chromium.org, pfeldma...@chromium.org, rob....@samsung.com, sche...@chromium.org, sergey...@chromium.org, yurys...@chromium.org

https://codereview.chromium.org/1379473005/diff/1/third_party/WebKit/Source/platform/fonts/Font.h
File third_party/WebKit/Source/platform/fonts/Font.h (right):

https://codereview.chromium.org/1379473005/diff/1/third_party/WebKit/Source/platform/fonts/Font.h#newcode166
third_party/WebKit/Source/platform/fonts/Font.h:166: // For accessing
buildGlyphbuffer and retrieving fonts used in rendering a node.
buildGlyphBuffer (caps on buffer)

https://codereview.chromium.org/1379473005/

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 2, 2015, 2:56:07 AM10/2/15
to drott...@chromium.org, e...@chromium.org, lush...@chromium.org, wko...@chromium.org, commi...@chromium.org, apavlo...@chromium.org, blink-...@chromium.org, blink-reviews-p...@chromium.org, caba...@adobe.com, caseq...@chromium.org, chromium...@chromium.org, dan...@chromium.org, devtools...@chromium.org, dongseo...@intel.com, drott+bl...@chromium.org, dsch...@chromium.org, fma...@chromium.org, jbr...@chromium.org, ju...@chromium.org, kozyatins...@chromium.org, lushnik...@chromium.org, pdr+graphi...@chromium.org, pfeldma...@chromium.org, rob....@samsung.com, sche...@chromium.org, sergey...@chromium.org, yurys...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 2, 2015, 5:34:46 AM10/2/15
to drott...@chromium.org, e...@chromium.org, lush...@chromium.org, wko...@chromium.org, commi...@chromium.org, apavlo...@chromium.org, blink-...@chromium.org, blink-reviews-p...@chromium.org, caba...@adobe.com, caseq...@chromium.org, chromium...@chromium.org, dan...@chromium.org, devtools...@chromium.org, dongseo...@intel.com, drott+bl...@chromium.org, dsch...@chromium.org, fma...@chromium.org, jbr...@chromium.org, ju...@chromium.org, kozyatins...@chromium.org, lushnik...@chromium.org, pdr+graphi...@chromium.org, pfeldma...@chromium.org, rob....@samsung.com, sche...@chromium.org, sergey...@chromium.org, yurys...@chromium.org
Try jobs failed on following builders:
linux_android_rel_ng on tryserver.chromium.linux (JOB_FAILED,
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_android_rel_ng/builds/76937)

https://codereview.chromium.org/1379473005/

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 4:33:40 AM10/5/15
to drott...@chromium.org, e...@chromium.org, lush...@chromium.org, wko...@chromium.org, commi...@chromium.org, apavlo...@chromium.org, blink-...@chromium.org, blink-reviews-p...@chromium.org, caba...@adobe.com, caseq...@chromium.org, chromium...@chromium.org, dan...@chromium.org, devtools...@chromium.org, dongseo...@intel.com, drott+bl...@chromium.org, dsch...@chromium.org, fma...@chromium.org, jbr...@chromium.org, ju...@chromium.org, kozyatins...@chromium.org, lushnik...@chromium.org, pdr+graphi...@chromium.org, pfeldma...@chromium.org, rob....@samsung.com, sche...@chromium.org, sergey...@chromium.org, yurys...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 4:34:53 AM10/5/15
to drott...@chromium.org, e...@chromium.org, lush...@chromium.org, wko...@chromium.org, commi...@chromium.org, apavlo...@chromium.org, blink-...@chromium.org, blink-reviews-p...@chromium.org, caba...@adobe.com, caseq...@chromium.org, chromium...@chromium.org, dan...@chromium.org, devtools...@chromium.org, dongseo...@intel.com, drott+bl...@chromium.org, dsch...@chromium.org, fma...@chromium.org, jbr...@chromium.org, ju...@chromium.org, kozyatins...@chromium.org, lushnik...@chromium.org, pdr+graphi...@chromium.org, pfeldma...@chromium.org, rob....@samsung.com, sche...@chromium.org, sergey...@chromium.org, yurys...@chromium.org
Try jobs failed on following builders:
mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED,
http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/106001)
mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED,
http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/12600)
mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED,
http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/122000)

https://codereview.chromium.org/1379473005/

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 4:39:41 AM10/5/15
to drott...@chromium.org, e...@chromium.org, lush...@chromium.org, wko...@chromium.org, commi...@chromium.org, apavlo...@chromium.org, blink-...@chromium.org, blink-reviews-p...@chromium.org, caba...@adobe.com, caseq...@chromium.org, chromium...@chromium.org, dan...@chromium.org, devtools...@chromium.org, dongseo...@intel.com, drott+bl...@chromium.org, dsch...@chromium.org, fma...@chromium.org, jbr...@chromium.org, ju...@chromium.org, kozyatins...@chromium.org, lushnik...@chromium.org, pdr+graphi...@chromium.org, pfeldma...@chromium.org, rob....@samsung.com, sche...@chromium.org, sergey...@chromium.org, yurys...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 6:09:31 AM10/5/15
to drott...@chromium.org, e...@chromium.org, lush...@chromium.org, wko...@chromium.org, commi...@chromium.org, apavlo...@chromium.org, blink-...@chromium.org, blink-reviews-p...@chromium.org, caba...@adobe.com, caseq...@chromium.org, chromium...@chromium.org, dan...@chromium.org, devtools...@chromium.org, dongseo...@intel.com, drott+bl...@chromium.org, dsch...@chromium.org, fma...@chromium.org, jbr...@chromium.org, ju...@chromium.org, kozyatins...@chromium.org, lushnik...@chromium.org, pdr+graphi...@chromium.org, pfeldma...@chromium.org, rob....@samsung.com, sche...@chromium.org, sergey...@chromium.org, yurys...@chromium.org
Committed patchset #3 (id:40001)

https://codereview.chromium.org/1379473005/

commit-bot@chromium.org via codereview.chromium.org

unread,
Oct 5, 2015, 6:10:36 AM10/5/15
to drott...@chromium.org, e...@chromium.org, lush...@chromium.org, wko...@chromium.org, commi...@chromium.org, apavlo...@chromium.org, blink-...@chromium.org, blink-reviews-p...@chromium.org, caba...@adobe.com, caseq...@chromium.org, chromium...@chromium.org, dan...@chromium.org, devtools...@chromium.org, dongseo...@intel.com, drott+bl...@chromium.org, dsch...@chromium.org, fma...@chromium.org, jbr...@chromium.org, ju...@chromium.org, kozyatins...@chromium.org, lushnik...@chromium.org, pdr+graphi...@chromium.org, pfeldma...@chromium.org, rob....@samsung.com, sche...@chromium.org, sergey...@chromium.org, yurys...@chromium.org
Patchset 3 (id:??) landed as
https://crrev.com/30fdec9333e9baef6be4826f52bf7ab0f7ba72d7
Cr-Commit-Position: refs/heads/master@{#352311}

https://codereview.chromium.org/1379473005/
Reply all
Reply to author
Forward
0 new messages