Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Issue 133493002: Improve a search logic to find a SVGFontFaceSrcElement (Closed)

Created:
6 years, 11 months ago by gyuyoung-inactive
Modified:
6 years, 11 months ago
Reviewers:
Stephen Chennney, fs
CC:
blink-reviews, pdr, Stephen Chennney, krit, f(malita), rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Improve a search logic to find a SVGFontFaceSrcElement In SVGFontFaceElement::rebuildFontFace(), it tries to find a SVGFontFaceSrcElement. However, current search logic looks inefficient. The search logic starts to find SVGFontFaceSrcElement from a first child node, then it replaces a discovered element whenever finding next SVGFontFaceSrcElement. Thus, it would be good if we find SVGFontFaceSrcElement from a last node. Then, we go out of the searching loop as soon as we find a first SVGFontFaceSrcElement. It will help to reduce iteration number in the search loop. Additionally the search loop is moved to the place which uses a SVGFontFaceSrcElement actually. BUG=N/A Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164881

Patch Set 1 #

Total comments: 5

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -10 lines) Patch
M Source/core/svg/SVGFontFaceElement.cpp View 1 2 chunks +7 lines, -10 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
gyuyoung-inactive
When I run whole layout test with this patch, there wasn't any regression.
6 years, 11 months ago (2014-01-10 10:16:47 UTC) #1
Stephen Chennney
Reasonable change, but some room for improvement. https://codereview.chromium.org/133493002/diff/1/Source/core/svg/SVGFontFaceElement.cpp File Source/core/svg/SVGFontFaceElement.cpp (right): https://codereview.chromium.org/133493002/diff/1/Source/core/svg/SVGFontFaceElement.cpp#newcode286 Source/core/svg/SVGFontFaceElement.cpp:286: // we ...
6 years, 11 months ago (2014-01-10 12:22:34 UTC) #2
gyuyoung-inactive
https://codereview.chromium.org/133493002/diff/1/Source/core/svg/SVGFontFaceElement.cpp File Source/core/svg/SVGFontFaceElement.cpp (right): https://codereview.chromium.org/133493002/diff/1/Source/core/svg/SVGFontFaceElement.cpp#newcode286 Source/core/svg/SVGFontFaceElement.cpp:286: // we currently ignore all but the first src ...
6 years, 11 months ago (2014-01-10 15:46:23 UTC) #3
Stephen Chennney
lgtm
6 years, 11 months ago (2014-01-10 15:57:50 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gyuyoung.kim@samsung.com/133493002/100001
6 years, 11 months ago (2014-01-10 15:58:05 UTC) #5
commit-bot: I haz the power
Change committed as 164881
6 years, 11 months ago (2014-01-10 17:00:38 UTC) #6
fs
6 years, 11 months ago (2014-01-10 17:43:00 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/133493002/diff/1/Source/core/svg/SVGFontFaceE...
File Source/core/svg/SVGFontFaceElement.cpp (right):

https://codereview.chromium.org/133493002/diff/1/Source/core/svg/SVGFontFaceE...
Source/core/svg/SVGFontFaceElement.cpp:286: // we currently ignore all but the
first src element, alternatively we could concat them
On 2014/01/10 12:22:34, Stephen Chenney wrote:
> The comment was wrong before and it's still wrong now. You now ignore all but
> the last.

Friendly note: The comment was actually correct - maybe the iteration condition
was a tad too non-obvious: child && !srcElement
Meaning that the semantics just changed. No worries though since it's seems
quite unlikely that you'd ever encounter such a species - of the dying breed
that is SVG fonts - in the wild.

Powered by Google App Engine
This is Rietveld 408576698