Opera Software upstreamed commits

Upstreamed commits in Chromium: 8178, V8: 72, Skia: 12, BoringSSL: 16.

Click message to expand

Chromium

Author Message When
mpawlowski
Avoid member access within null pointer in PersistentMemoryAllocator
Create temporary objects for the assertions instead of doing UB.

Bug: 966850
Change-Id: I344622fcf0e616be313a510345e0d6cf65d22113
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628723
Reviewed-by: Brian White <bcwhite@chromium.org>
Commit-Queue: Maciej Pawlowski <mpawlowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#663524}
bratell
Revert "[BrowserSwitcher] Build BHO for both bitnesses"
This reverts commit 6c3a34bfc2030ffd304c54f5cb96d234622ef389.

Reason for revert: It broke some builds with:
The file:
  //out/Release_x64/win_clang_x86/browser_switcher_bho.dll.pdb
is listed as an input or source for the target:
  //chrome/browser/browser_switcher/bho:copy_browser_switcher_binaries
but no targets in the build generate that file.
See for instance https://ci.chromium.org/p/chromium/builders/ci/Jumbo%20Win%20x64/35757

and the comment in the bug.

Original change's description:
> [BrowserSwitcher] Build BHO for both bitnesses
> 
> To do so, this CL also adds support for the x86 toolchain in an x64
> build.
> 
> Instead of generating one DLL, we now generate 2 DLLs in the root
> out-dir:
> 
> - browser_switcher_bho.dll (x86)
> - browser_switcher_bho_64.dll (x64)
> 
> The one that is cross-built (i.e. bitness doesn't match the host) is
> built in a sub-directory, and then copied to the root out-dir.
> 
> Bug: 952897
> Change-Id: Ie96ff95556dbe41c8d8eb2fb5ce748964705e096
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1589457
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#663196}

TBR=thakis@chromium.org,dpranke@chromium.org,brucedawson@chromium.org,nicolaso@chromium.org

Change-Id: I2f1929a4e2ea2f9408273c5f04b52ee79580b4cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 952897
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1630427
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#663392}
mpawlowski
Introduce a more generic version of IdType for opaque aliases
This one works with strings and other complex types in addition to
integrals.

Bug: 954080
Change-Id: Ic9961e0ccffdce89d160a5b4d8cab9b7d94a100b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617481
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Maciej Pawlowski <mpawlowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#662532}
bratell
Avoid having two kImageFetcherUmaClientName in chrome/browser/search
In some extreme (non default) jumbo builds, the two
kImageFetcherUmaClientName would end up in the same translation unit and
break those builds. Since they represent two different strings, this
patch gives them unique names.

Bug: 874325
Change-Id: I4f69d78b7ce9f15a9907f6356f21affd506579a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1621177
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kyle Milka <kmilka@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#662285}
bratell
[jumbo] Differentiate constants in usb_chooser and hid_chooser
hid_chooser is based on usb_choose so naturally some constant
names became the same, but in some (non-default; extreme) jumbo build
configurations the hid chooser and the usb chooser compile in the
same translation unit, and share the same anonymous namespace,
and then the constant names clash.

Bug: 890096
Change-Id: I1d10de81c09634af3c2dfffd95e02fe41a56e591
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1624195
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Ovidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#662284}
bratell
Sort Win SDK versions by version sorting rules (reland)
This should have no practical effect on current data but version
numbers need to be sorted so that 1.12 is higher than 1.9 and
the current code didn't do that.

This is a reland of https://crrev.com/c/1605980 with a typo fixed.
The initial patch tried to sort |vc_component_msvc_root| (a string)
instead of the list |vc_component_msvc_contents|.

Change-Id: I961a4e0d11c9e626e2890682f6bf416c8e7e9d28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1609831
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#662138}
bratell
Move operator<< for base::ThreadLocalBoolean to namespace base
ADL only works properly if functions that depend on ADL are
defined in the same namespace as the argument type.

The operator<< function for ::base::ThreadLocalBoolean was in the
namespace ::base::{anonymous} which prevented ADL from finding
the function. Instead it was found through the normal scope
lookup as long as there was no other operator<< in base::internal.

In jumbo builds the translation unit included base/safe_conversions.h
which has an ::base::internal::operator<< and suddenly nothing
could find the real operator<< for ThreadLocalBoolean.

Thanks to Slack #cxx for explaining all the gory details about
function/operator lookup.

Bug: 965038
Change-Id: I1d8303eec24996f742ca3362e79f65e83bf53384
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1619904
Commit-Queue: Daniel Bratell <bratell@opera.com>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661645}
bratell
Avoid having two GetSyncedFaviconForPageURL in chrome/browser/ui
In certain non-default extreme jumbo build the
GetSyncedFaviconForPageURL in recent_tabs_sub_menu_model.cc
ended up in the same translation unit as the
GetSyncedFaviconForPageURL in favicon_source.cc and then it did not
compile. The methods are similar but not identical so they
cannot be shared as is.

This renames one of the functions
GetSyncedFaviconForPageURL -> RecentTabsGetSyncedFaviconForPageURL

Bug: 955475
Change-Id: I48c9ac701b0071b71f719afffb19c65687258410
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617458
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661416}
bratell
Avoid having two GetWebContents and GetBrowserClient in content/browser
There are currently two GetWebContents and two GetBrowserClient in
content/browser. In certain non-default extreme jumbo builds
GetWebContents in storage_partition_impl.cc and GetWebContents in
network_service_client.cc could end up in the same
translation unit and it would not compile. There were also
one GetBrowserClient in storage_partition_impl.cc and one in
clear_site_data_throttle.cc

This renames one of the functions
GetWebContents -> GetWebContentsForStoragePartition
and one
GetBrowserContext -> GetBrowserContextFromStoragePartition

Bug: 952723
Change-Id: I85207edde5fcb85eaa6f32cf22ca05a6e324237b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617837
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661348}
fs
Remove unnecessary conversion to/from WebString
Change-Id: Ibed70c17d5ba2bb9a9073e5b6174896744064a80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1619689
Commit-Queue: Daniel Bratell <bratell@opera.com>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#661325}
bratell
Guard some accessibility code that requires a newer atk lib
On some development platforms (like Ubuntu 16.04 LTS), newer
atk libraries are not available so code need to be optional.

For production builds a sysroot with all the required libraries
must be used.

This adds checks for Atk 2.30 to some places, and changes the
ifdef style to be the same in all checks.

Change-Id: Iec48dd31774a5ba148a71ecb545befe4339d860c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614205
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Martin Robinson <mrobinson@igalia.com>
Reviewed-by: Martin Robinson <mrobinson@igalia.com>
Cr-Commit-Position: refs/heads/master@{#660750}
gzyszkiewicz
Notify WebContentsObservers of lost webcontents focus on MAC
Seems the mechanism implemented for aura web contents view was
not moved correctly to mac web contents view. This change applies
the needed changes to make web contents observers to be notified
of lost focus on MAC.

This omission on Mac seems to only affect UMA histograms.

BUG=680809

Change-Id: I47d8063d3258b9e6c684899f763198b5f9f8ffff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611821
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#660312}
mpawlowski
Rename build/util/type-safety to build/util/type_safety
This is for consistency, most other code uses underscores to separate words
rather than dashes.

Bug: 954080
Change-Id: I3b0d1e0a33e5196344fbd7d52f187f87607bbcb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1608742
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Maciej Pawlowski <mpawlowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#660307}
wdzierzanowski
Handle sync loads with DRP's URLLoaderThrottle
After https://chromium-review.googlesource.com/c/chromium/src/+/1565873,
another interesting sequencing scenario is a synchronous load (as in
blink::ResourceLoader::RequestSynchronously() triggered by a synchronous
XMLHttpRequest() or WorkerGlobalScope.importScripts()).  In this case,
the URLLoaderThrottle is not used on the sequence where it was created
(see https://chromium-review.googlesource.com/c/chromium/src/+/631040/).
If it calls back to the throttle manager
(manager_->MarkProxiesAsBad()), we're trying to make a mojo call on the
wrong sequence again.

The solution is similar to safe_browsing::RendererURLLoaderThrottle:
"private" mojo pipes to mojom::DataReductionProxy.  We take care to make
them private in the synchronous load case only: it's not unusual for a
single renderer to create tens of throttles, but only a small percentage
of those is for a synchronous load (and there should be fewer and fewer
of them given that synchronous XHR is deprecated).

Bug: 963353
Change-Id: Ie502b881e946d188d6613119de02b1f6c0874a30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1609834
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659873}
bratell
Restrict to one AddressField type in autofill
In autofill, AddressField is both a locally defined type
and an imported type from i18n::addressinput. In some non-default
jumbo builds they end up in the same translation unit,
causing compilation problems.

This renames the imported classes so they have distinct names.

This appeared May 13-14 but I don't know why. No change looks
relevant.

Change-Id: I77885ce1f8f2a120570cd281868682637a3f79b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611609
Commit-Queue: Tommy Martino <tmartino@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Tommy Martino <tmartino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659620}
bratell
[jumbo] Avoid having two OnProfileCreated in chrome/browser
In some extreme (non-default) jumbo builds, both OnProfileCreated
ended up in the same translation unit. This renames one of them
DownloadOnProfileCreated to avoid that build problem.

Bug: 959208
Change-Id: I31686fc741c1365de0ef6fdc9101ce960e2fe6ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1602649
Reviewed-by: Xing Liu <xingliu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#659427}
bratell
Sort Win SDK versions by version sorting rules
This should have no practical effect on current data but version
numbers need to be sorted so that 1.12 is higher than 1.9 and
the current code didn't do that.

Change-Id: Ie993d2c103b6f16453c8b03336484c3b05a0097b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1605980
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#659016}
wdzierzanowski
Add 'custom_proxy' watchlist
Change-Id: I42d7b6974fb31a661b1bd02142c4755758609a05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604278
Auto-Submit: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#658709}
fs
Clean up image fallback content configuration
Put the setup of the broken image and placeholder elements in a helper
class to make it easier to decipher what is being done, and also what
depends on the ComputedStyle object and not.

Bug: 953707
Change-Id: I675539611e5160e4e31523a1dbcea830fe5c7f18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1604267
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658662}
mpawlowski
Move id_type.h from gpu/command_buffer/common to base/util
Changed only the namespace, header guards, BUILD.gn etc., the entire
implementation was left untouched. Further alignments and generalization
to come.

Bug: 954080
Change-Id: I6cb5388fefb606e04b5be1463e86a792a75c4bf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1571695
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658153}
the_jk
Avoid never-ending loop in FrameEvictionManager::CullUnlockedFrames
If enable surface synchronization is disabled and the frame is
visible then DelegatedFrameHostAndroid::EvictDelegatedFrame()
will only reset content_layer_ to null but not evict the
surface as that causes https://crbug.com/933374.

Trouble is that if the frame is then hidden without any new
content_layer being created the next call to
DelegatedFrameHostAndroid::EvictDelegatedFrame() will do nothing
as content_layer_ is null but the frame is still in the list of
unlocked frames in FrameEvicitionManager causing the next
call to FrameEvictionManager::CullUnlockedFrames that tries to evict
the frame to do nothing and loop forever (or hit a DCHECK if those
are enabled).

Fix this by not doing early exit if content_layer_ is null as this
is not directly connected to if there is a frame to evict.

Bug: 959914
Change-Id: I3f83036d9a5ae2c734dfca720115d1faf4278c87
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1596571
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: Joel Klinghed <the_jk@opera.com>
Cr-Commit-Position: refs/heads/master@{#657483}
tmoniuszko
Remove base::subtle::MemoryBarrier
It clashes with MemoryBarrier macro defined in windows.h.

TBR=fdoray@chromium.org
(for updating callers outside of //base)

Bug: 952820
Change-Id: I68c742ed21cea6eb5b10127dea92100fd29d3b3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1565986
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657167}
fs
Check pres. attrs vs. kSVGGeometryPropertyHasNonZeroUnitlessValue
Test that presentation attributes ('x', 'y', 'rx', 'ry', 'cx', 'cy' and
'r') does not affect the use counter mentioned above.

Bug: 899074
Change-Id: Ifbc8f3c5fdc323a87cb68e4a10d1e85ff1d86b71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1596565
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#656769}
the_jk
Avoid calling a removed observer in PersonalDataManager
PersonalDataManager::NotifyPersonalDataObserver will call
OnPersonalDataChanged and often OnPersonalDataFinishedProfileTasks
on PersonalDataManagerObserver.

Trouble is that it does this in the same ObserverList loop.

So if PersonalDataManagerObserver implementation of OnPersonalDataChanged
calls PersonalDataManager::RemoveObserver(this) then it will still
be called on OnPersonalDataFinishedProfileTasks.

Worse, if PersonalDataManagerObserver deleted itself after removing
itself as an observer you now have a use-after-free calling a virtual
method on a destroyed object.

There are not currently any PersonalDataManagerObserver implementations
that I can find that has this problem.

Bug: 959172
Change-Id: I2bb0a625f5c3a847c5d035ccc57b5fdb349366b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594529
Commit-Queue: Joel Klinghed <the_jk@opera.com>
Reviewed-by: Parastoo Geranmayeh <parastoog@google.com>
Cr-Commit-Position: refs/heads/master@{#656489}
bratell
[jumbo] Rename one of the HasAlpha functions in DXGI code
In jumbo builds many files are compiled together in the same
translation unit, and there share the same anonymous namespace.
By copying functions from gl_image_dxgi.cc into
gl_image_gxgi_swap_chain.cc without changing the function names
jumbo builds got collisions between two HasAlpha and two
SupportedBindFormat. Since they are also slightly modified,
reusing the function is not a direction option so this renames
the new set of functions by adding a SwapChain prefix.

TBR=piman@chromium.org,ashithasantosh@google.com

Bug: 939655
Change-Id: I3190aa8cbb3c87b0be8be821298a67906be0abd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1594581
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#656372}
fs
Clean up SetSrc on HTMLImageElement and HTMLSourceElement
The SetSrc() methods with a USVStringOrTrustedURL argument appears to be
unused. Likewise the Src() getter on HTMLImageElement.

Since the SetSrc() method which takes a String doesn't offer much over
just using setAttribute(kSrcAttr, ...), convert users of that and remove
that too.

Change-Id: I3fa3621f030321442ee01b752b7e5ea4b04e9cac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1593259
Reviewed-by: Daniel Vogelheim <vogelheim@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#656344}
bratell
Block files >20MB in presubmit check
To avoid bloating the chromium/src git repo with large binary
files, this adds a check that files are not too large and suggests
to use cloud storage otherwise.

Now without trying to check the size of deleted files and with the
limit increased to 20MB.

R=dpranke@chromium.org

Bug: 956017
Change-Id: Ieeb2e1a37017a375f9da7a48c7713077c4929ff3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1581971
Commit-Queue: Daniel Bratell <bratell@opera.com>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#655002}
bratell
Too many top level Status aliases again
Both leveldb::Status and inspector_protocol_encoding::Status
are pulled into the global namespace as aliases. In certain
non-default jumbo builds that causes problems. Since there
are many-many usages of leveldb::Status as Status but only one
usage of inspector_protocol_encoding::Status as Status, this
changes only inspector_protocol_encoding::Status to not use
an alias.

Change-Id: Iac7522e2a7f480960bc2afb01af8a469a6d51fef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1583736
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Johannes Henkel <johannes@chromium.org>
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654901}
wdzierzanowski
Postpone binding of mojom::DataReductionProxy
Each Web Worker runs on a separate worker thread, and each worker has an
associated URLLoaderThrottleProvider.  When spawning a nested worker,
the outer worker's throttle provider is cloned on the outer worker's
thread and then used on the inner worker's thread.

To accomodate this scenario:

 - Postpone the creation of DataReductionProxyThrottleManager until a
   moment when we are running on the target thread.  This makes sure
   the DataReductionProxyThrottleConfigObserver binding is used on the
   same thread that it's created on.

 - Postpone the binding of DataReductionProxy until a moment when we
   are running on the target thread.  DataReductionProxyPtrInfo
   serves as a holder of the interface request that can move between
   threads.

Bug: 942011
Change-Id: Ieed17fb499bbcb0545e3e0323f751c1ea55a33d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1565873
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#654846}
bratell
Give two RemoveStaleEntries functions unique names
chrome/browser/previews have two distinct (but similar)
RemoveStaleEntries functions and in some extreme jumbo builds
they compile in the same translation unit and clash.

This CL renames them RemoveStaleBlacklistEntries and
RemoveStaleOfflinePageEntries.

Bug: 914577
Change-Id: I69a837393d0586194bcd85f66eadfe85522418e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584261
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654453}
bratell
Avoid using the symbol name |interface| since it's a Win macro
In some Windows SDK headers |interface| is declared to be a macro
so it's always a bit risky using that name in normal code. There
are reports that the instance in
BackgroundFetchRegistrationServiceImpl caused problems in some
jumbo builds so let's just rename it mojo_interface.

Bug: 956486
Change-Id: Ic261cdd76ce2f6b30e449c0a25000a8542ef0f53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584281
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654032}
bratell
Block files >10MB in a presubmit check
To avoid bloating the chromium/src git repo with large binary
files, this adds a check that files are not too large and suggests
to use cloud storage otherwise.

Bug: 956017
Change-Id: Idf6e816a50030551fc6003b0f83b2071f685c9b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1581803
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#653733}
bratell
Remove unnecessary include and dependency in ui/latency/mojo
gn check --check-generated reported a missing build
dependency and this fixes that. An example of a reported error is:

ERROR at //out/Default/gen/ui/latency/mojo/latency_info.mojom-forward.h:44:11: Can't include this header from here.
          ^----------------------
The target:
  //ui/latency/mojo:interfaces
is including a file from the target:
  //ipc:ipc

Since the header isn't actually used, the simple fix is to remove it, though that revealed some
other code that was missing includes of their own.

Bug: 938893
Change-Id: I8e2648d5e681ee9640282eab31028a102cdc96eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1550467
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: kylechar <kylechar@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#653575}
bratell
Avoid adding more than one root cbor namespace
There is already a ::cbor so creating a global ::cbor alias
to ::inspector_protocol::cbor caused problems in some non-default
jumbo builds. The code also uses variables named cbor so there
are many meanings of cbor.

Change-Id: I9a469d179b60783776510cea7167a63d873caaf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1578599
Commit-Queue: Daniel Bratell <bratell@opera.com>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653281}
bratell
Fixing and enabling dependency checks for chromedriver
Since we had a bug because of this missing check, let's not
repeat it.

Bug: 949535
Change-Id: Ic3ef619403dfcc3ecb8ffecd5f1e2cc80681dc94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552830
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: John Chen <johnchen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#653249}
bratell
Too many top level Status aliases
Both leveldb::Status and inspector_protocol_encoding::Status
are pulled into the global namespace as aliases. In certain
non-default jumbo builds that causes problems. Since there
are many-many usages of leveldb::Status as Status but only one
usage of inspector_protocol_encoding::Status as Status, this
changes only inspector_protocol_encoding::Status to not use
an alias.

This also touches an inspector_protocol_encoding::cbor to not
conflict with another patch.

Change-Id: If663fa8c7d14ab1cb11a88a037a588b0c4b2d5b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1578559
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653215}
bratell
Avoid shadowing variabels in new font code
I'm trying to remove variable shadowing in some Chromium
code to maybe make the code a bit more robust, and two functions
in blink/platform/fonts/shaping used several instances of |i|.

Bug: 925310
Change-Id: I3e09f7772a7865ec7f73976a57af355070b6ad4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1578538
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653164}
bratell
Find #include "foo.cc" with a presubmit check
An #include "foo.cc" will often compile, until it causes linking
problems later, for instance in jumbo builds. The error messages are
then not good at pointing out what is wrong.

Change-Id: Ic155dc5542e22b54d13c213230d6df4977263642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566344
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653105}
bratell
Include headers, not cc files
A test included a cc file which results in duplicate symbols
in the build which then broke certain builds. Most builds
were ok because linkers have the optimization to ignore
obj files which are not referenced by anything else. If anything
in the obj file is referenced everything changes though, and
everything in the obj file is considered.

Change-Id: I2ce961e341952847b20410746b58094ea9d7a3da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566309
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#651277}
bratell
Added missing deps for screen_orientation_lock_types
The mojo types using screen_orientation_lock_types.typemap were
missing a build dependency which made gn check --check-generated
report the error below:

ERROR at //out/Default/gen/services/device/public/mojom/screen_orientation_lock_types.mojom-forward.h:37:11: Include not allowed.
          ^------------------------------------------------------------------------------------
It is not in any dependency of
  //services/device/public/mojom:mojom
The include file is in the target(s):
  //third_party/blink/public/common:headers
which should somehow be reachable.

Since code in //services use this, //services/* must also be added
to the list of targets that can use blinks public/common:headers
target. (Or should the whitelist just be deleted since it seems
to list most of Chromium).

Bug: 938893
Change-Id: I5bee9574edf1ae5bb288924f52a113f855f33a92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538507
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#650703}
bratell
Move FakeDisplay* from display/manager to their own component
Ozone platforms should not depend on ui/display/manager
since that is a high level build target that ultimately
can depend on ozone again, creating a dependency cycle.

This is a followup to previous "fix one instance" that fixes
all the instances, which I hope will be enough to break
the cycle blocking
https://chromium-review.googlesource.com/c/chromium/src/+/1538507

For path changes in ash:
TBR=jamescook@chromium.org

Change-Id: Ice1d8b21e9bc1709c07bd37943857b07c6093798
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553424
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#650472}
bratell
Make blink/core expose blink/core/* in gn
Since nobody is allowed to depend on core's sub targets
it's necessary to have blink/core expose them.

This has no immediately visible impact since the private dependency
will have ensured build order and gn's dependency checks are
disabled in blink/core (because it's a mess and kind of works
anyway).

Bug: 800764
Change-Id: I31c326f893f1c2c90a27fdfa195ff719784ab8ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552847
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#648088}
bratell
Make it legal for everything in blink/modules to use modules:modules
Code in blink/modules/foo/*.cc often use code in modules:modules
which in the build system is not an allowed include. This makes
it legal.

This has no visible impact since the build order is already ok
and gn check errors are disabled for blink, but long term we'd
like to enable gn check and this is a small step on that route.

Bug: 800764

Change-Id: I083ec02f5190b5ee17e0394e1f5add940d1f4172
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552808
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647778}
bratell
Fix random chromedriver build failure
A missing dependency made chromedriver builds flaky.

This was reported as a dependency error by
gn check --check-generated after enabling dependency checks
of chrome/test/* in .gn so having those dependency checks
enabled would have prevented this.

Bug: 949518
Change-Id: I3be5864d27e8258be193e67dc9f05f303b7c00fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552849
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: John Chen <johnchen@chromium.org>
Reviewed-by: John Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647757}
bratell
Jumbo compile fix: Too many LoggingEnabled and DebugLogging
The temporary logging methods were copied to several
files and in jumbo builds, where those files are compiled
into the same translation unit, they clashed and
compilation broke.

This patch deletes the extra copies and exposes the one
in direct_manipulation_helper_win.cpp. The name
is not great for an exposed function but since this is
just very temporary code (right?), it should be fine and
we need the build to get going and I don't want to
revert anything.

Bug: 914914

TBR=chaopeng@chromium.org,sky@chromium.org

Change-Id: I35d96a655bbaeede01d081e96426bd7b8358f295
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552799
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#647677}
bratell
Added missing dependencies in ui/base/ime/mojo
The mojo types in ui/base/ime/mojo uses code in ui/base/ime so
there should be a build dependency between the two.

This was reported as an error by gn check --check-generated

ERROR at //out/Default/gen/ui/base/ime/mojo/ime_types.mojom.h:49:11: Include not allowed.
          ^------------------------------
It is not in any dependency of
  //ui/base/ime/mojo:mojo
The include file is in the target(s):
  //ui/base/ime:ime
which should somehow be reachable.

Bug: 938893
Change-Id: I568861a9eee801a76d77af6188f06293b8e9259e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1550447
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#647621}
bratell
Fix deps for some mojo tests
gn check --check-generated revealed a hidden dependency not
expressed in the build scripts which is fixed by this.
The exact error was like the one below (and a couple like it):

ERROR at //out/Default/gen/mojo/public/interfaces/bindings/tests/test_import.mojom-blink-test-utils.cc:23:11: Can't include this header from here.
          ^--------------------------------------------------------------
The target:
  //mojo/public/interfaces/bindings/tests:test_exported_import_blink
is including a file from the target:
  //mojo/public/interfaces/bindings/tests:test_export_blink__generator

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //mojo/public/interfaces/bindings/tests:test_exported_import_blink -->
  //mojo/public/interfaces/bindings/tests:test_export_blink_component --[private]-->
  //mojo/public/interfaces/bindings/tests:test_export_blink -->
  //mojo/public/interfaces/bindings/tests:test_export_blink__generator


Bug: 938893
Change-Id: Id7d4be31ef01e37054c381a7fce7eca43ac1b753
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1545914
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Commit-Queue: Ken Rockot <rockot@google.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#647342}
fs
Use pre-resolved resource in SVGPatternElement::ReferencedElement
SVGPatternElement::BuildPendingResource() resolves a resource reference
for 'href' on the <pattern> element using the TreeScope-based "resource
store". SVGPatternElement::ReferencedElement() (re-)resolves the same
reference on its own. Because of this inconsistency we could end up
having a reference to a LayoutObject in the associated SVGResources
object, but not have hooked up a client reference for the (originating)
<pattern> element.

Use the SVGResource to resolve the target element in ReferencedElement()
too so that there's only one source of truth.

Bug: 949015
Change-Id: I001c4f9260bdc4599843cd53833b749fd320daa5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1550426
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#647295}
bratell
Revert "Fixing mojo dependencies for blink/modules/indexeddb"
This reverts commit 41516e5f08b986042d5a5f92063c67fa1c750d8d.

Reason for revert: At least one build failed with a missing header file so this may have made the build flaky. Reverting while investigating/fixing.

Original change's description:
> Fixing mojo dependencies for blink/modules/indexeddb
> 
> This splits the mojo code in two. Once small chunk of helper classes that
> are mojo wrapped, and some high level code that is allowed to use mojo
> itself.
> 
> This CL also makes it allowed and possible to use modules_export.h in
> mojo types that map to code in blink/modules.
> 
> Without this patch gn check --check-generated reports errors like
> the ones below:
> 
> ERROR at //out/Default/gen/third_party/blink/public/mojom/indexeddb/indexeddb.mojom-blink-forward.h:24:11: Include not allowed.
> -#include "third_party/blink/renderer/modules/modules_export.h"
>           ^--------------------------------------------------
> It is not in any dependency of
>   //third_party/blink/public/mojom:mojom_modules_blink
> The include file is in the target(s):
>   //third_party/blink/renderer/modules:modules
> which should somehow be reachable.
> ------------------------------------------------
> ERROR at //out/Default/gen/third_party/blink/public/mojom/indexeddb/indexeddb.mojom-blink.h:55:11: Include not allowed.
> #include "third_party/blink/renderer/modules/indexeddb/idb_key_path.h"
>           ^----------------------------------------------------------
> It is not in any dependency of
>   //third_party/blink/public/mojom:mojom_modules_blink
> The include file is in the target(s):
>   //third_party/blink/renderer/modules/indexeddb:indexeddb
> which should somehow be reachable.
> 
> Bug: 938893
> Change-Id: I0cd9bfb502fa4290a21e61f686b6095455eb4e86
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1547696
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Daniel Bratell <bratell@opera.com>
> Cr-Commit-Position: refs/heads/master@{#647200}

TBR=cmp@chromium.org,dcheng@chromium.org,bratell@opera.com

Change-Id: I72b84bd4aa18648a13311bef1a9a44a3780eeed3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 938893
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1550445
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#647249}
bratell
[ozone/wayland] Drop dependency wayland -> ui/display/manager
The dependency wayland -> ui/display/manager created a
dependency loop since ui/display/manager depends on chromeos
which depends on a lot of stuff, and with some upcoming dep
fixes, eventually back on ozone and wayland.

Change-Id: I675047cd724818c9a26c7160c62ea4d4d3fc4749
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549071
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Maksim Sisov <msisov@igalia.com>
Cr-Commit-Position: refs/heads/master@{#647209}
bratell
Fixing mojo dependencies for blink/modules/indexeddb
This splits the mojo code in two. Once small chunk of helper classes that
are mojo wrapped, and some high level code that is allowed to use mojo
itself.

This CL also makes it allowed and possible to use modules_export.h in
mojo types that map to code in blink/modules.

Without this patch gn check --check-generated reports errors like
the ones below:

ERROR at //out/Default/gen/third_party/blink/public/mojom/indexeddb/indexeddb.mojom-blink-forward.h:24:11: Include not allowed.
-#include "third_party/blink/renderer/modules/modules_export.h"
          ^--------------------------------------------------
It is not in any dependency of
  //third_party/blink/public/mojom:mojom_modules_blink
The include file is in the target(s):
  //third_party/blink/renderer/modules:modules
which should somehow be reachable.
------------------------------------------------
ERROR at //out/Default/gen/third_party/blink/public/mojom/indexeddb/indexeddb.mojom-blink.h:55:11: Include not allowed.
#include "third_party/blink/renderer/modules/indexeddb/idb_key_path.h"
          ^----------------------------------------------------------
It is not in any dependency of
  //third_party/blink/public/mojom:mojom_modules_blink
The include file is in the target(s):
  //third_party/blink/renderer/modules/indexeddb:indexeddb
which should somehow be reachable.

Bug: 938893
Change-Id: I0cd9bfb502fa4290a21e61f686b6095455eb4e86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1547696
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#647200}
bratell
Include headers, not cc files, to fix duplicate symbols
Some builds failed with duplicate symbols because
code was compiled twice. Most builds were ok because of the
linker optimization to ignore object files that are
completely unused. In jumbo builds there were no object
files that were completely unused so the linker complained
loudly.

Also, since some code is used outside the accessibility
component, in unittests, that code needs to be exported.

TBR=almaher@microsoft.com,dmazzoni@chromium.org

Bug: 928948
Change-Id: I77aeb8beff451be16b0d5f8fe4d62e70f7c66eae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549127
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#647198}
bratell
Adding missing dependencies for dom_distiller_js
Generated files did not have their dependencies checked so
a missing dependency had gone unnoticed. Now they can
be checked with "gn check --check-generated" and then you got these
errors (fixed by this patch):

ERROR at //out/Default/gen/third_party/dom_distiller_js/dom_distiller_json_converter.h:6:11: Include not allowed.
#include "base/values.h"
          ^------------
It is not in any dependency of
  //third_party/dom_distiller_js:dom_distiller_proto
The include file is in the target(s):
  //base:base
which should somehow be reachable.
___________________
ERROR at //out/Default/gen/third_party/dom_distiller_js/test_sample_json_converter.h:6:11: Include not allowed.
#include "base/values.h"
          ^------------
It is not in any dependency of
  //third_party/dom_distiller_js:json_values_converter_test_proto
The include file is in the target(s):
  //base:base
which should somehow be reachable.

Bug: 939782
Change-Id: I8faab4de02ae547c4449c752174e018fe84a6441
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1547831
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#647183}
bratell
[jumbo] Too many kMaxWidth in chrome/browser/ui
In jumbo builds many cc files are compiled together in the same
translation unit and they share the same anonymous namespace
so all symbol names need to be unique within that build target.

Due to a recently enabled kMaxWidth, there were now two kMaxWidth
which made certain, non-default, jumbo builds fail. This renames
the constants to include what they are max width of.

Bug: 939205
Change-Id: I1e441ee095223c4a6a6ce1f2bf18f6ede96acb50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1547987
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646916}
wdzierzanowski
Set did_use_http_auth flag for tunneled requests
Proxied requests already had the did_use_http_auth set correctly for
http:// URLs (the non-tunnel case).  The flag was never set for the
tunnel case.

Change-Id: I477693755e6dd90a5b4318f2c4d0bc0bb307479d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549082
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#646914}
bratell
Dropping dependency from ui/ozone to ui/display/manager
ui/ozone is a low level lib and should not depend on high level
targets.

Change-Id: Iddf627e46c05273d9a07f40559975bc114669980
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549065
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Michael Spang <spang@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Michael Spang <spang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646848}
bratell
Corrected dependency for mojo type Clipboard
The header used was not publically reachable via ui/base
so the dependency needs to be a bit more precise.

The exact error message from gn check --check-generated:

ERROR at //out/Default/gen/third_party/blink/public/mojom/clipboard/clipboard.mojom.h:48:11: Can't include this header from here.
- #include "ui/base/clipboard/clipboard_types.h"
          ^----------------------------------
The target:
  //third_party/blink/public/mojom:mojom_platform
is including a file from the target:
  //ui/base/clipboard:clipboard_types

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //third_party/blink/public/mojom:mojom_platform -->
  //ui/base:base --[private]-->
  //ui/base/clipboard:clipboard_types

Bug: 938893
Change-Id: Ica45c5a6710f55f5ee4394a1b2c82fd3a6536531
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1547729
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646680}
wdzierzanowski
Set ProxyServer in URLRequest on failure to connect to proxy
The following errors:

  ERR_PROXY_CERTIFICATE_INVALID,
  ERR_PROXY_AUTH_UNSUPPORTED,
  ERR_PROXY_CONNECTION_FAILED

indicate failure to connect to the proxy (there's also the QUIC-specific
ERR_NO_SUPPORTED_PROXIES). Before this CL, when a URLRequest completed
with one of these errors, |URLRequest::proxy_server_| was not set.

While there's some inherent ambiguity as to which proxy server is set in
this case (ProxyInfo can store multiple proxies), we already report the
net::Error we got for the last proxy we tried, even though previous
proxies might have failed with a different error.

BUG=940428

Change-Id: I900d7be7ea4761cc81bd08d21ca1abfbe8e824ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1541164
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#646481}
bratell
Correct builds deps for the mojo types in services/network
Some types in services/network causes generated code elsewhere to
include a file in services/network/public/cpp:cpp_base. To make
this permissible by gn check --check-generated, make the deps
to services/network/public/cpp:cpp_base a public dep.

An example of the kind of error this fixes:

ERROR at //out/Default/gen/services/content/public/mojom/navigable_contents.mojom-test-utils.cc:33:11: Can't include this header from here.
#include "services/network/public/cpp/net_ipc_param_traits.h"
          ^-------------------------------------------------
The target:
  //services/content/public/mojom:mojom
is including a file from the target:
  //services/network/public/cpp:cpp_base

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //services/content/public/mojom:mojom -->
  //services/network/public/mojom:websocket_mojom --[private]-->
  //services/network/public/cpp:cpp_base

Bug: 938893
Change-Id: I6446eea5b0fb6aeb03d24d0dc771c4f65e02002c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538410
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#646314}
bratell
Missing deps for mojo type RenderPass
A missing dependency for the mojo type RenderPass triggered this
warning from git check --check-generated:

___________________
ERROR at //out/Default/gen/services/viz/public/interfaces/compositing/render_pass.mojom-forward.h:40:11: Can't include this header from here.
#include "ui/gl/dc_renderer_layer_params.h"
          ^-------------------------------
The target:
  //services/viz/public/interfaces:interfaces
is including a file from the target:
  //ui/gl:gl

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //services/viz/public/interfaces:interfaces -->
  //components/viz/common:common --[private]-->
  //ui/gl:gl

Bug: 938893
Change-Id: I79d10875dd308dd37c72efa29bd925ea4f511237
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538411
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#646310}
fs
Remove dead 'sizes' parsing code in chrome/renderer/web_apps.cc
It looks like the code in question uses WebIconSizesParser - which
provide the same functionality. Remove the code and transplant relevant
(non-duplicate) tests to WebIconSizesParserTest.

Change-Id: I7b7c4e0140268eddccf858174ee6fd78395a0010
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1545051
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#646010}
wdzierzanowski
Remove net::URLRequest::was_fetched_via_proxy()
There are currently no non-test users of this function.

BUG=653354,940428

Change-Id: Ie48431eea38047971a149c52a35a1cd88c3207c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1545875
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#645851}
wdzierzanowski
Fix Vim clang-format shortcut for insert mode
BUG=932670

Change-Id: I5633b6c21a6e8a733dc7a4e6189b782c1586b038
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539585
Reviewed-by: Asanka Herath <asanka@chromium.org>
Commit-Queue: Asanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#645833}
bratell
Resolve ambiguity between ::features and ::printing::features
There is both a ::features namespace and a ::printing::features
namespace (which is kind of against the coding style), so
if you write just "features" inside the printing namespace,
the compiler will resolve "features" differently depending on
if it is aware ::printing::features exists.

In certain jumbo builds, the compiler will be aware that
::printing::features exists when compiling the code and
will resolve it incorrectly. This patch removes the ambiguity
by adding a :: prefix.

Bug: 945619
Change-Id: I569878be26debb77dea69679dd37414f602ec1a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1541226
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#645422}
bratell
More checks in presubmit for usage of banned C++ features
To avoid banned functions and features in C++ from being used
accidentally, add more presubmit checks.

This tests most of what is currently banned from C++11/14 except
for threads and thread_local. Those were excluded because
of a difficulty in expressing when they were ok and when not
and because of too many false positives.

This change follows a discussion on the cxx mailing list about how
to avoid that people use banned functions from pure ignorance.

Change-Id: I585c05efd72e62d2148be90a3088aa99c6279646
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1539040
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#644978}
tmoniuszko
Fix memory leak in StrikeDatabaseIntegratorTestStrikeDatabaseTest
Leak is reported in ASAN builds.

Change-Id: I1c56755a7c7fb38e795faa00e0ca6923e4ff21aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1541184
Reviewed-by: Jared Saul <jsaul@google.com>
Commit-Queue: Jared Saul <jsaul@google.com>
Cr-Commit-Position: refs/heads/master@{#644858}
bratell
Allow the dep cycle chrome/browser/extensions <-> api_registration
The generated api_registration files use a lot of headers
in chrome/browser/extensions, creating a dependency cycle.
I see no obvious way to break the cycle so this just makes
it official.

There were also a couple of files in chrome/browser/accessibility
which were used from api registration, creating an unpleasant
dependency. That was fixed by putting those files in extensions
instead of in chrome/browser.

The missing dependencies triggered a lot of gn errors with a gn fixed
to look at generated files (gn:57).

The list is about 60 reports like:

ERROR at //out/Default/gen/chrome/browser/extensions/api/generated_api_registration.cc:7:11: Include not allowed.
          ^--------------------------------------------------------------------------------
It is not in any dependency of
  //chrome/browser/extensions/api:api_registration
The include file is in the target(s):
  //chrome/browser/extensions:extensions
which should somehow be reachable.

Bug: 655123
Change-Id: Ifc7809de17c9a426d2a6abdb41ecc42996b0d01f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1529095
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#644715}
tmoniuszko
Add support for direct lookup resolver in NetworkServiceTest
While content::TestHostResolver simulates failure for non-local DNS
queries, some tests explicitly allow external DNS lookup using
net::RuleBasedHostResolverProc::AllowDirectLookup().

With kNetworkService feature enabled, appropriate host resolver rule
must be propagated to network process.

Change-Id: Icc6eb96a8ea346d408d04d23feb363789a1c5c97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533954
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#644706}
bratell
Structuring GpuPreferences dependencies
The mojo type GpuPreferences did not depend on the implementation
classes. Since the implementation classes in turn depends on
the mojo bindings, there is a dependency cycle. This patch
describes that in the build system in a way that is accepted
by gn check --check-generated

An example of an error:

ERROR at //out/Default/gen/gpu/ipc/common/gpu_preferences.mojom-forward.h:40:11: Include not allowed.
#include "gpu/config/gpu_preferences.h"
          ^---------------------------
It is not in any dependency of
  //gpu/ipc/common:gpu_preferences_interface
The include file is in the target(s):
  //gpu/config:config_sources
which should somehow be reachable.
___________________


Bug: 938893
Change-Id: I18a9c0c8684ffbbdbe5d47573150434de397061f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538423
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644620}
bratell
Fixing build dependency for the MailboxHolder type
MailboxHolder uses and exposes
gpu/ipc/common/mailbox_holder_struct_traits.h so it needs to
be a public dependency (as it already is in
mailbox_holder_for_blink.typemap).

One example of many resulting dependency errors:

ERROR at //out/Default/gen/device/vr/public/mojom/isolated_xr_service.mojom-test-utils.cc:29:11: Can't include this header from here.
          ^--------------------------------------------
The target:
  //device/vr/public/mojom:mojom
is including a file from the target:
  //gpu/ipc/common:struct_traits

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //device/vr/public/mojom:mojom -->
  //gpu/ipc/common:interfaces --[private]-->
  //gpu/ipc/common:struct_traits


Bug: 938893
Change-Id: I598db331d43cff5212d7d739da96e0648552b7a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1535859
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#644424}
bratell
Fixing dependency problem for the mojo Range class
The mojo Range class needs range_struct_traits.h and the build
system wasn't setup to allow that. Simplest for everyone is to integrate
the struct_traits target into the mojom target and let the mojo system
figure out dependencies. This made everything simpler.

Without this fix you got errors like the one below:

ERROR at //out/Default/gen/content/common/input/input_handler.mojom-test-utils.cc:49:11: Can't include this header from here.
          ^--------------------------------------
The target:
  //content/common:mojo_bindings
is including a file from the target:
  //ui/gfx/range/mojo:struct_traits

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //content/common:mojo_bindings -->
  //services/ws/public/mojom/ime:ime --[private]-->
  //ui/gfx/range/mojo:struct_traits

Bug: 938893
Change-Id: If01554d38ca3d5f4280d32c658d1f7044f14c29e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1536056
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#644390}
bratell
Add missing components/policy build dependencies
Generated files in components/policy used header files that
they didn't depend on. This oversight caused errors when running
gn check --check-generated (brand new gn feature!)

For instance:
ERROR at //out/Default/gen/components/policy/policy_constants.h:14:11: Include not allowed.
#include "components/policy/core/common/policy_details.h"
          ^---------------------------------------------
It is not in any dependency of
  //components/policy:generated
The include file is in the target(s):
  //components/policy/core/common:internal
which should somehow be reachable.

This CL fixes those errors by listing/allowing necessary dependencies.

An alternative would be to extract policy_details.h and policy_map.h
into a new build target, including everything they depend on.
I didn't investigate how much work that is because of time
constraints.

Bug: 938893
Change-Id: I69775047ae70f15138ad0754f4c4d51bd02c7530
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1527534
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644380}
bratell
Make a ColorSpace dep public to avoid include errors
Since mojom will put headers from ui/gfx/ipc/color into
code in other targets, the dependency need to be public so
that other code get the right dependency.

Without the fix gn check --check-generated reports this:

ERROR at //out/Default/gen/services/viz/public/interfaces/compositing/compositor_frame.mojom-test-utils.cc:51:11: Can't include this header from here.
#include "ui/gfx/ipc/color/gfx_param_traits.h"
          ^----------------------------------
The target:
  //services/viz/public/interfaces:interfaces
is including a file from the target:
  //ui/gfx/ipc/color:color

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //services/viz/public/interfaces:interfaces -->
  //ui/gfx/mojo:mojo --[private]-->
  //ui/gfx/ipc/color:color

Bug: 938893
Change-Id: I5ab887bc137223c74e7b84ffc75a9fee0b3c01cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538412
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644370}
bratell
Make a media type deps public to make includes allowed
Since mojo will insert
#include "media/base/ipc/media_param_traits_macros.h"
in code using the media types mojo types, the dependency
on media/base/ipc, where that header lives, need to be
public.

The error reported otherwise (by gn check --check-generated) was:

ERROR at //out/Default/gen/media/mojo/interfaces/traits_test_service.mojom-test-utils.cc:30:11: Can't include this header from here.
#include "media/base/ipc/media_param_traits_macros.h"
          ^-----------------------------------------
The target:
  //media/mojo/interfaces:test_interfaces
is including a file from the target:
  //media/base/ipc:ipc

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //media/mojo/interfaces:test_interfaces -->
  //media/mojo/interfaces:interfaces --[private]-->
  //media/base/ipc:ipc

Bug: 938893
Change-Id: I7781ced5305ace65654da9ee4cf1a7f82ecac1a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538434
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644368}
bratell
Fix net's build deps so that protos can use net_export.h
proto targets use net_export.h without depending on the target where
that header lives. That made gn check --check-generated report errors
like this one:
___________________
ERROR at //out/Default/gen/net/nqe/proto/network_id_proto.pb.h:33:11: Include not allowed.
#include "net/base/net_export.h"
          ^--------------------
It is not in any dependency of
  //net:net_nqe_proto
The include file is in the target(s):
  //net:net
which should somehow be reachable.
___________________

This fixes that problem by moving net_export.h to a separate
build target that other targets can depend on.

Bug: 655123
Change-Id: If7953e007f500adae4fe10b78e86f1a4afaecf17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538506
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#644359}
bratell
Fixing ResourceType build dependencies
The mojo type ResourceType used the public resource_type.h
header without depending on the build target where that header
was declared. Depending directly on that target would
create a dependency cycle so a new "resource_type_header" target
was created.

The dependency cycle would have been:
//content/public/common:resource_type_bindings ->
//content/public/common:common ->
//content:content
//content/public/app:both_sources ->
//content/public/common:common_sources ->
//content/public/common:interfaces ->
//content/public/common:resource_type_bindings ->

The exact error this fixes is:

ERROR at //out/Default/gen/content/public/common/resource_type.mojom-forward.h:35:11: Include not allowed.
          ^------------------------------------
It is not in any dependency of
  //content/public/common:resource_type_bindings
The include file is in the target(s):
  //content/public/common:common_sources
which should somehow be reachable.
___________________

Bug 938893

Change-Id: I350bff6a53a5be72f992e1226f7a3adce46f709d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1535856
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#644358}
bratell
Presubmit warning for std::to_string and error for std::shared_ptr
std::to_string is one of the banned functions but people are
not aware of that so a presubmit warning is needed.

It is only a warning for std::string since it's already used
and I don't want to trigger presubmit errors when someone
changes something on the same line as an std::to_string().

std::shared_ptr has been banned for a while (use scoped_refptr)
but it was brought to my attention because of std::weak_ptr from
C++11 which builds on std::shared_ptr.

These updates comes as most of the rest of C++11 is removed from
the ban list and only some very few functions/types remain banned. See:

https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFDHbjTfGH0wktnDryONBEEyG2O9o-CCMVWuTYFokjrSUw%40mail.gmail.com

Change-Id: I9fb1450ee76046cb842cd5a64a55d2cc977492b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1535872
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#644250}
fs
Expand/ceil default object size in SVGImagePainter
Ceil the default object size passed to LayoutImageResource::GetImage, to
increase the chances of the (container) size round-tripping through
Image::Size() (which we use as the source rect).
SVGImageForContainer::Size uses RoundedIntSize(), so depending on the
fractional part of the default object size it could end up either
smaller or larger.

Bug: 944739
Change-Id: Ifc62ddfad760ade87135b356ce6f6e07ed8e5dc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538421
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#644238}
bratell
Make the video_capture_types dep on media/base/ipc explicit
Core using video_capture_types (like components/mirroring) today
get includes not supported by dependencies (see below for an example).

This patch makes the dependency on media/base/ipc public so that
type users get the correct dependencies. This was found with
a new gn than can also check generated files.

In total, this change fixes 16 dependency errors similar to:

ERROR at //out/Default/gen/components/mirroring/mojom/resource_provider.mojom-test-utils.cc:32:11: Can't include this header from here.
          ^----------------------------------
The target:
  //components/mirroring/mojom:service
is including a file from the target:
  //media/base/ipc:ipc

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //components/mirroring/mojom:service -->
  //media/capture/mojom:video_capture --[private]-->
  //media/base/ipc:ipc


Bug: 938893
Change-Id: I82864323534f32a9e5ed3e90e7132215267626c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1515534
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#644233}
bratell
Make blink's mojo geometry types depend publicly on the struct_traits
Generated code that use the mojo geometry types will end up
including geometry_struct_traits.h and for that to be allowed
by the build system, the dependency in the typemap needs to
be public.

An example (of about 100) error:

ERROR at //out/Default/gen/device/vr/public/mojom/isolated_xr_service.mojom-blink-test-utils.cc:33:11: Can't include this header from here.
          ^----------------------------------------------------------------
The target:
  //device/vr/public/mojom:mojom_blink
is including a file from the target:
  //third_party/blink/renderer/platform/mojo:geometry_struct_traits

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //device/vr/public/mojom:mojom_blink -->
  //ui/gfx/geometry/mojo:mojo_blink --[private]-->
  //third_party/blink/renderer/platform/mojo:geometry_struct_traits


Bug: 938893
Change-Id: I2114034805ee2e55a8c98e98c22fe8233ac9fd61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538418
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#644225}
bratell
Fix build dependency error in spellcheck mojo
spellcheck/common:interfaces (via typemap) uses some
spellcheck_result.h and spellcheck_struct_traits.h so those
cannot be in a target "above" the mojom build target.

Bug: 938893
Change-Id: Ic3a307248542dfa9b02cb7fb548d88734c6db509
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1528192
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#643831}
bratell
Avoid having two different WriteTransaction in ::syncer
There is a ::syncer::WriteTransaction so importing
::syncer::syncable::WriteTransaction into ::syncer with a "using"
statement causes ambiguity in a jumbo build.

Bug: 869381
Change-Id: Ie8a1130f448a26867d3240d4c6ec46d3cb712346
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524346
Reviewed-by: Tatiana Gornak <melandory@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#643826}
bratell
Always use the "C" number locale (fixing blink tests)
If you run with a non English, non "C", locale, blink tests would
fail since blink uses locale sensitive number to string conversions,
and only in C/English locales is the decimal separator ".".

For non-test code there was already code that forced the number
locale back to "C" but not so for other executables or code
path.

This sets number locale to "C" in all those places where code set it
to something else. Both for renderer processes and other
processes. This should not affect the UI since the C lib
number conversion routines are not good enough so UI code (should)
use icu number to string conversion routines instead.

This patch also adds an assert that the locale is correct to
catch other/future ways the locale end up incorrectly and
deletes some broken test expectations (that hid a symptom of the bug).

Android is partly excluded since its locale system works differently
and probing the current locale only gives strange data back.

Bug: 930701
Change-Id: I15bc0522393d668598d6609dc252aba246ada3f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1466443
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#642917}
bratell
Add missing build dependency between top500_domains and its header
tom500_domains compiles a generated file that uses
the top500_domains_header header so there needs to be
an explicit dependency.

Bug: 655123
Change-Id: I4f22d3eddb637ded8b64f1e9765bdf09fac97cda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526280
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642655}
bratell
Only use ATK_XY_PARENT if atk is new enough
ATK_XY_PARENT was added in atk 2.30 so attempts to use it
with earlier versions will not compile.

Bug: 934274
Change-Id: I27a2f9a72c7977300860b7442d9ee4b53f0c1f62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1530913
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Martin Robinson <mrobinson@igalia.com>
Cr-Commit-Position: refs/heads/master@{#642630}
bratell
Adding missing build dependency in search_engines
Generated code used a header the build target doesn't depend
on. This extracts that file to its own target so that
the "prepopulated_engines" can depend on that target.

This was found with an updated gn that also checks dependencies
for generated files (an understandable limitation in previous gn).

Bug: 655123
Change-Id: I4bee2a906c2e5c925db549e6bfa0be971afa3828
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1527535
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642620}
fs
Preserve explicit dimensions on <use>'d <symbol>
Per [1], 'width' and/or 'height' on a <use> override the corresponding
values on a referenced <svg> or <symbol>. If no 'width' or 'height' is
specified on the <use>, the values set on the referenced elements are
retained.
Previously we would always set 'width' / 'height' on a referenced
<symbol> to '100%' if the <use> did not have any overriding values.
Change this to follow the specification and copy the values from the
original element as needed - much like what was previously done for
referenced <svg> elements.

[1] https://svgwg.org/svg2-draft/struct.html#UseLayout

Bug: 806289
Change-Id: Iaf595ff88af2865a080f95ccc414e283828c195e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1530883
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#642150}
bratell
[jumbo] Restrict it to one content::Status alias
browser/indexed_db pulls leveldb::Status into content with
"using" (i.e. creates a content::Status -> leveldb::Status alias).

When devtools tries to do the same with
inspector_protocol_encoding::Status some extreme jumbo builds
sees the conflict and refuses to compile the code.

Since inspector_protocol_encoding::Status is only used twice,
inlining it seems pretty straightforward.

Change-Id: I8b2fc585bba2f336cd5d910b4505a681ff9d9a39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524355
Reviewed-by: Johannes Henkel <johannes@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#641929}
bratell
Add a missing dependency in content/common/native_types
Some code use ui/events/blink/did_overscroll_params.h and
ui/events/blink/web_input_event_traits.h so there needs to
be a dependency to "//ui/events/blink" which declares those headers.

Missing dependency found with a gn check --check-generated (new
feature just added to gn, see gn:57).

Exact errors:

ERROR at //out/Default/gen/content/common/input/input_handler.mojom.h:78:11: Include not allowed.
          ^--------------------------------------
It is not in any dependency of
  //content/common:mojo_bindings
The include file is in the target(s):
  //ui/events/blink:blink
which should somehow be reachable.
___________________
ERROR at //out/Default/gen/content/common/input/input_handler.mojom.h:79:11: Include not allowed.
          ^---------------------------------------
It is not in any dependency of
  //content/common:mojo_bindings
The include file is in the target(s):
  //ui/events/blink:blink
which should somehow be reachable.
___________________


Bug: 938893
Change-Id: I3c2001e5cfe4d7a5cd6334cb1162b15ca97a6a2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1528185
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#641649}
wdzierzanowski
Change "HTTPS proxy" => "supports QUIC" assumption to be opt-in
The Data Reduction Proxy servers are assumed to also support QUIC if
they are HTTPS proxies. This is currently not true for other custom
proxy config providers like Opera VPN.

Change-Id: I2c63a135ae21639eb98683a4476c9011c740feee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1511460
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640780}
fs
Use the enclosing rect in SVGRootInlineBox::LayoutInlineBoxes
The LayoutRect(const FloatRect&) constructor will round (floor in
practice) the location/size independently. This can cause the resulting
to be smaller than the argument - when the values a small (< 1) this
effect is easily amplified. In cases like the one in this bug, where the
bounding box of <text> is used to determine bounds for a <clipPath>,
this can result in content being clipped when it shouldn't be.

Use EnclosingLayoutRect instead of the "straight" conversion, to make
sure the resulting bounds are not smaller than the original.

Since this changes the bounding box of text, tests that depend on that
directly or indirectly are affected. Mostly without noticeable visual
differences.
For svg/animations/animate-text-nested-transforms.html the location
of the click (that starts the test) is nudged a bit to avoid timing out.

Bug: 820955
Change-Id: I8811de81de0a5dc795218dcdf8a55a79b15e2863
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1520596
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640717}
wdzierzanowski
Allow CustomProxyConfig to override existing config
A CustomProxyConfig provider like Opera VPN will now be able to specify
that the custom config must take priority over all other sources of
proxy configuration.  The default behavior is still the one required by
the Data Reduction Proxy: the DRP config is only effective if nothing
else provided a proxy config.

Change-Id: I4cc0a61375b668ae1806bb6978b3e0893ed941ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1491252
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640707}
fs
Revert "OnionSoup: Move mojom files from public/platform/web to public/mojom folder"
This reverts commit e656908dbda6ced2f4743a9b5c2ed926dc6b5b67.

Reason for revert: Appears to cause build failure on Android

[71296/78273] ACTION //content/public/android:content_java__process_prebuilt__bytecode_rewrite(//build/toolchain/android:android_clang_arm)
FAILED: obj/content/public/android/content_java__process_prebuilt-bytecode-rewritten.jar
python ../../build/android/gyp/bytecode_processor.py --script bin/helper/java_bytecode_rewriter [...removed for brevity, see link...]
Missing 2 classes missing in direct classpath. To fix, add GN deps for:
gen/third_party/blink/public/mojom/android_mojo_bindings_java.javac.jar
Traceback (most recent call last):
File "../../build/android/gyp/bytecode_processor.py", line 76, in <module>
sys.exit(main(sys.argv))
File "../../build/android/gyp/bytecode_processor.py", line 72, in main
subprocess.check_call(cmd)
File "/b/swarming/w/ir/cipd_bin_packages/lib/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)

(https://ci.chromium.org/p/chromium/builders/ci/android-rel/9664)

Original change's description:
> OnionSoup: Move mojom files from public/platform/web to public/mojom folder
> 
> This CL moves window_features.mojom, commit_result.mojom,
> devtools_frontend.mojom, selection_menu_behavior.mojom and
> remote_objects.mojom from public/platform/web to public/mojom/
> to gather mojom files to mojom folder and updates paths for these
> mojom files.
> 
> Bug: 919393
> Change-Id: If6df031ed39d70e700986bd13a40d0598257e009
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1514434
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
> Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
> Commit-Queue: Julie Jeongeun Kim <jkim@igalia.com>
> Cr-Commit-Position: refs/heads/master@{#640633}

TBR=dgozman@chromium.org,sky@chromium.org,kinuko@chromium.org,haraken@chromium.org,jkim@igalia.com

Change-Id: I5744072dbaeffba5706f329838e37d74c065ae27
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 919393
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1523386
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#640688}
wdzierzanowski
Support tunneled requests in NetworkServiceProxyDelegate
With this change, CustomProxyConfig can specify rules for http://,
https://, ws://, and wss:// requests with a single proxy list.

NetworkServiceProxyDelegate will now support proxy resolution not just
for http:// requests, but for any scheme (except ftp://, which isn't
proxied in //net, either).  The delegate will also modify the CONNECT
request headers to include the headers specified in CustomProxyConfig.

The meaning of CustomProxyConfig is modified to let features specify
proxying behavior precisely through net::ProxyConfig::ProxyRules.  In
particular, the proxy rules now determine which schemes are proxied with
no additional assumptions in NetworkServiceProxyDelegate.

Bug: 915659
Change-Id: I2dd2a95ab96bdf4d14cffa5c2541fbb678cd3f94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1417455
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640680}
bratell
Don't emit RevocableInterfacePtr in mojo's blink bindings
The code that we emit in mojo's blink bindings are sometimes
loaded into non-blink code (see bug) and from there you should not
access code inside blink. Since RevocableInterfacePtr lives inside
blink, that causes dependency and layering violations.

Everyone using blink bindings got something similar to.
ERROR at //out/Default/gen/components/content_settings/core/common/content_settings.mojom-blink-forward.h:20:11: Include not allowed.
#include "third_party/blink/renderer/platform/mojo/revocable_interface_ptr.h"
          ^-----------------------------------------------------------------
It is not in any dependency of
  //components/content_settings/core/common:mojo_bindings_blink
The include file is in the target(s):
  //third_party/blink/renderer/platform:platform
which should somehow be reachable.
___________________

In total there were about 1000 reported dependency errors
because of this.

This fixes this by inlining the few uses and removing the includes.

Bug: 938893
Change-Id: If0a682414b27912c8ff55b4bc0e477c9948ba051
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1511415
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#640228}
bratell
Build: generated_types needs to explicitly depend on base
json_scheme_api generated_types template includes generated code
that uses files like base/logging.h and base/values.h so targets
need to depend on //base or gn dependency checks will be unhappy.

Bug: 938893
Change-Id: Ib36220775a03d77dbb5076aa4df9c8291121b967
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1518516
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#640027}
bratell
Explicitly upgrade old packages in install-build-deps.sh
The old code would only sometimes upgrade packages, depending
on whether apt-get had to ask a y/n question before the
upgrade or not. This makes the upgrade more explicit
rather than a side effect of the query command.

This also adds lists libc6-dev as a dependency since it is needed
and without it being listed it might not be upgraded.

Bug: 934256
Change-Id: Iee2aae09374557e77ce9c1ef4b36b9366827015d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1491972
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#639964}
erikj
Make it possible to remove the root layer in the android CompositorImpl
It was only possible to reassign the root layer not remove it.

Change-Id: I6a2eb1cd7040ac6a3c50fba846a19fbb8e2db3a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1503319
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#639932}
bratell
Gave two GetCreateNetworkFactoryCallback unique names
Both content/browser/frame_host and content/browser/worker_host
needed a GetCreateNetworkFactoryCallback and in jumbo builds where
those compiled in the same translation unit, those (identical)
functions clashed.

I see no obvious place to share them and I'm not sure if their
static state should even be merged so this patch just gives
the functions more distinct names. (Improved name suggestions
welcome).

Bug: 927849
Change-Id: Ib6556c42e7bdbba9702fb24a12b7b9c0a1fb93cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1472672
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639683}
bratell
Adding missing dependency from courgette to lzma_sdk
crc.cc in in courgette uses third_party/lzma_sdk/7zCrc.h so
it needs to depend on the build target that lists that file,
i.e. "//third_party/lzma_sdk".

Change-Id: I29f88fee06f1954bc3043eee5e78fbabeebaebee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505945
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: Samuel Huang <huangs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639603}
fs
Clear latched invalidation state for a <marker> when painting
We keep track of invalidations in
LayoutSVGResourceContainer::completed_invalidations_mask_ to reduce the
amount of propagation performed. These flags are then usually cleared on
subsequent accesses later during the lifecycle. For non-layout
invalidations of markers the latched state would however not be cleared.

Clear the latched state when we (try to) paint a marker.

Bug: 939455
Change-Id: Ic2359c301a863e16ef0b466753a4cf06d20126a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1511466
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#639586}
bratell
Use BLINK_PLATFORM_EXPORT instead of PLATFORM_EXPORT macro in media mojo
In Windows the media mojo code used PLATFORM_EXPORT, an internal
blink macro, in some generated code. This "worked" and it compiled
thanks to the blink internal platform_export.h header being
included through some other mistaken code.

As that other mistaken code stops including blink's platform_export.h this
will stop compiling as is.

Switching to the external BLINK_PLATFORM_EXPORT makes everything right.

Change-Id: If0b3de739e4953dfd211d1ffd6d7d44bc7f7d69e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1511411
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#639569}
fs
Don't include bindings/core/v8/script_source_code.h in probe template
This template is used by both core and platform probes - in the latter case
this include would be a layering violation.

---=== GN output: ===---

ERROR at //out/Default/gen/third_party/blink/renderer/platform/platform_probes_inl.h:15:11: Include not allowed.
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
          ^---------------------------------------------------------------
It is not in any dependency of
  //third_party/blink/renderer/platform:platform
The include file is in the target(s):
  //third_party/blink/renderer/core:core_generated
which should somehow be reachable.

---==================---

Specify this include in the 'settings.includes' list in
core/probe/core_probes.json5 instead.

Bug: 939782
Change-Id: Ibd0ee570ae10408163223a49a27c0fd9ff1529d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1511392
Reviewed-by: Alexei Filippov <alph@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#639361}
bratell
Add necessary explicit deps for extension apis
Several missing build dependencies were revealed by an updated
gn check, including a number related to the extension
api registration where code used headers from browser and
browser/extensions.

Since they cannot depend directly on those (would create dependency
cycles) allow_circular_includes must be used instead.

Example problems:

ERROR at //out/Default/gen/chrome/browser/apps/platform_apps/api/generated_api_registration.cc:8:11: Can't include this header from here.
#include "chrome/browser/apps/platform_apps/api/music_manager_private/music_manager_private_api.h"

ERROR at //out/Default/gen/chrome/browser/extensions/api/generated_api_registration.cc:7:11: Include not allowed.
#include "chrome/browser/extensions/api/webrtc_logging_private/webrtc_logging_private_api.h"

ERROR at //out/Default/gen/chrome/browser/extensions/api/generated_api_registration.cc:66:11: Include not allowed.
#include "chrome/browser/accessibility/accessibility_extension_api.h"

Change-Id: I432d44da18b236bf51f9736f58e990dd42a82a15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505449
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#639168}
bratell
[jumbo] Inlined a duplicate function GetWorkerThreadIPCMessageSender
A second GetWorkerThreadIPCMessageSender appeared which caused
some (non default) jumbo builds to fail because they ended up
in the same translation unit.

Since they are mostly there to save writing a long expression,
I just inlined them to get past the clash. Alternatives would have
been to rename one of them, or (better) move them to a shared place
so everyone can take advantage of the code.

Bug: 939096

Change-Id: I25b506fb6306c8e023bb39138b91300a48d2c48c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1511400
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639128}
bratell
Remove variable shadowing in blink/page
In an effort to reduce or even ban variable shadowing, this renames
a couple of variables. I'm interested in prohibiting shadowing because
I think it might prevent potential jumbo problems.

The exact warnings prevented:

third_party/blink/renderer/core/page/drag_controller.cc:806:14: error: declaration shadows a local variable [-Werror,-Wshadow]
  for (Node& node : NodeTraversal::InclusiveAncestorsOf(node)) {
             ^
third_party/blink/renderer/core/page/drag_controller.cc:797:42: note: previous declaration is here
bool SelectTextInsteadOfDrag(const Node& node) {
                                         ^
third_party/blink/renderer/core/page/drag_controller.cc:1270:17: error: declaration shadows a local variable [-Werror,-Wshadow]
      if (Node* node = EnclosingAnchorElement(
                ^
third_party/blink/renderer/core/page/drag_controller.cc:1217:9: note: previous declaration is here
  Node* node = state.drag_src_.Get();
        ^
third_party/blink/renderer/core/page/focus_controller.cc:1050:27: error: declaration shadows a local variable [-Werror,-Wshadow]
    ScopedFocusNavigation scope = ScopedFocusNavigation::CreateForDocument(
                          ^
third_party/blink/renderer/core/page/focus_controller.cc:1022:25: note: previous declaration is here
  ScopedFocusNavigation scope =
                        ^
third_party/blink/renderer/core/page/scrolling/root_scroller_controller.cc:296:28: error: declaration shadows a local variable [-Werror,-Wshadow]
      const ComputedStyle* style = ancestor->Style();
                           ^
third_party/blink/renderer/core/page/scrolling/root_scroller_controller.cc:272:24: note: previous declaration is here
  const ComputedStyle* style = element.GetLayoutObject()->Style();
                       ^

Bug: 923510
Change-Id: I165f94d96f9d847082e09090e65682539279ff17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508260
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#638992}
bratell
Remove variable shadowing in blink/css
In an effort to reduce or even ban variable shadowing, this renames a
couple of variables. I'm interested in prohibiting shadowing
because I think it might prevent potential jumbo problems.

The exact warnings this patch avoids are:

third_party/blink/renderer/core/css/css_selector_list.cc:185:19: error: declaration shadows a local variable [-Werror,-Wshadow]
  for (wtf_size_t i = 0; i < num_args; ++i) {
                  ^
third_party/blink/renderer/core/css/css_selector_list.cc:140:10: note: previous declaration is here
  size_t i = 0;
         ^
third_party/blink/renderer/core/css/properties/css_parsing_utils.cc:2312:21: error: declaration shadows a local variable [-Werror,-Wshadow]
      for (unsigned i = 0; i < 4; ++i)
                    ^
third_party/blink/renderer/core/css/properties/css_parsing_utils.cc:2294:12: note: previous declaration is here
  unsigned i = 0;
           ^
third_party/blink/renderer/core/css/properties/longhands/contain_custom.cc:34:16: error: declaration shadows a local variable [-Werror,-Wshadow]
    CSSValueID id = range.Peek().Id();
               ^
third_party/blink/renderer/core/css/properties/longhands/contain_custom.cc:19:14: note: previous declaration is here
  CSSValueID id = range.Peek().Id();
             ^
third_party/blink/renderer/core/css/properties/longhands/content_custom.cc:191:29: error: declaration shadows a local variable [-Werror,-Wshadow]
        const AtomicString& value = state.GetElement()->getAttribute(attr);
                            ^
third_party/blink/renderer/core/css/properties/longhands/content_custom.cc:135:42: note: previous declaration is here
                         const CSSValue& value) const {
                                         ^
third_party/blink/renderer/core/css/properties/longhands/webkit_text_emphasis_style_custom.cc:105:33: error: declaration shadows a local variable [-Werror,-Wshadow]
      const CSSIdentifierValue& value = ToCSSIdentifierValue(list.Item(i));
                                ^
third_party/blink/renderer/core/css/properties/longhands/webkit_text_emphasis_style_custom.cc:100:58: note: previous declaration is here
                                         const CSSValue& value) const {
                                                         ^
third_party/blink/renderer/core/css/resolver/css_variable_resolver.cc:123:25: error: declaration shadows a local variable [-Werror,-Wshadow]
    CSSParserTokenRange range(result.tokens);
                        ^
third_party/blink/renderer/core/css/resolver/css_variable_resolver.cc:111:25: note: previous declaration is here
    CSSParserTokenRange range,
                        ^
third_party/blink/renderer/core/css/resolver/style_builder_converter.cc:1312:21: error: declaration shadows a local variable [-Werror,-Wshadow]
    const CSSValue& value = value_list.Item(i);
                    ^
third_party/blink/renderer/core/css/resolver/style_builder_converter.cc:1297:70: note: previous declaration is here
                                                     const CSSValue& value) {
                                                                     ^
third_party/blink/renderer/core/css/selector_checker.cc:765:12: error: declaration shadows a local variable [-Werror,-Wshadow]
      bool result = true;
           ^
third_party/blink/renderer/core/css/selector_checker.cc:749:53: note: previous declaration is here
                                       MatchResult& result) const {
                                                    ^
third_party/blink/renderer/core/css/style_property_serializer.cc:96:9: error: declaration shadows a local variable [-Werror,-Wshadow]
    int index = property_set_->FindPropertyIndex(property_id);
        ^
third_party/blink/renderer/core/css/style_property_serializer.cc:87:14: note: previous declaration is here
    unsigned index) const {
             ^

Bug: 923510
Change-Id: I18ff4db537f64e70f37abf2682b19305eaa86f92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508261
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#638991}
bratell
Fix geometry mojo build dependencies
Everything using Rect in mojom files will indirectly need
to include //ui/gfx/geometry/mojo/geometry_struct_traits.h"
and for that to be allowed in gn, its build target
(//ui/gfx/geometry/mojo:struct_traits) needs to be a public
dependency.

This fixes about 200 dependency errors as reported by a gn
that can check dependencies in generated files (gn:57).

Bug: 938893
Change-Id: Ifbe6d0c6a0bc26e158badf751322509e66093252
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508467
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#638746}
bratell
Remove some variable shadowing in blink/core
In an effort to reduce or even ban variable shadowing, this renames
some variables. I'm interested in prohibiting shadowing because
I think it might prevent potential jumbo problems.

The exact warnings this prevents is:

third_party/blink/renderer/core/fileapi/file_reader_loader.cc:358:16: error: declaration shadows a local variable [-Werror,-Wshadow]
    MojoResult result = consumer_handle_->BeginReadData(
               ^
third_party/blink/renderer/core/fileapi/file_reader_loader.cc:346:54: note: previous declaration is here
void FileReaderLoader::OnDataPipeReadable(MojoResult result) {
                                                     ^

third_party/blink/renderer/core/aom/accessible_node.cc:288:16: error: declaration shadows a local variable [-Werror,-Wshadow]
      Element* element = accessible_node->element();
               ^
third_party/blink/renderer/core/aom/accessible_node.cc:278:43: note: previous declaration is here
bool AccessibleNode::GetProperty(Element* element,
                                          ^

third_party/blink/renderer/core/invisible_dom/invisible_dom.cc:43:16: error: declaration shadows a local variable [-Werror,-Wshadow]
    for (Node& node : FlatTreeTraversal::AncestorsOf(node)) {
               ^
third_party/blink/renderer/core/invisible_dom/invisible_dom.cc:40:14: note: previous declaration is here
  for (Node& node : range.Nodes()) {
             ^

third_party/blink/renderer/core/loader/frame_loader.cc:892:10: error: declaration shadows a local variable [-Werror,-Wshadow]
    auto request = mojo::MakeRequest(&navigation_initiator);
         ^
third_party/blink/renderer/core/loader/frame_loader.cc:798:20: note: previous declaration is here
  FrameLoadRequest request(passed_request);
                   ^

third_party/blink/renderer/core/script/modulator.cc:52:20: error: declaration shadows a local variable [-Werror,-Wshadow]
  } else if (auto* scope = DynamicTo<WorkerGlobalScope>(execution_context)) {
                   ^
third_party/blink/renderer/core/script/modulator.cc:45:20: note: previous declaration is here
  } else if (auto* scope = DynamicTo<WorkletGlobalScope>(execution_context)) {
                   ^

Bug: 923510
Change-Id: I82659c403eb15b4f676d24b97414bfbbced9d701
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508517
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#638662}
fs
Improve tainting for filter primitives
This makes tainting for many filter primitives less pessimistic, by
implementing the "Tainted Filter Primitives" section [1] from the
specification.

For feFlood/feDropShadow:

  A value of 'currentcolor' for 'flood-color' taints.

For feSpecularLighting/feDiffuseLighting:

  A value of 'currentcolor' for 'lighting-color' taints.

For the other primitives (which currently lack any specific logic), i.e:

  feBlend, feComponentTransfer, feComposite, feConvolveMatrix,
  feDisplacementMap, feGaussianBlur, feMorphology, feOffset and feTile

no local tainting is performed (the TaintsOrigin() override is returning
false).

The signature/convention of the TaintsOrigin() is changed by removing
the |inputs_taint_origin| argument, and always taint the
primitive if it (the flag returned by FilterEffect::InputsTaintOrigin)
is true. This saves each primitive to have to relate to this flag. (For
primitives that have no inputs this flag would always be false
regardless.) This means that TaintsOrigin() for each primitive is now
essentially computing the "local" tainting state.

[1] https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives

Bug: 792518
Change-Id: Ie2d45eeb1ae8478009b88b8b87b3c4c325ede306
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1503257
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638546}
fs
Fix hit-testing of nested clip-paths with objectBoundingBox units
A nested clip-path should resolve against the original elements
reference box, but it would instead resolve against the referencing
<clipPath>.
Pass the appropriate reference box to SVGLayoutSupport::IntersectsClipPath.

Took the opportunity to export some related tests to WPT.

Bug: 938913
Change-Id: I6d6ad88f0a97028b21b1f1a488afbdd42a96264b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505949
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#638293}
bratell
Add build dependency from the grit template to base
Code generated by grit depends on //base (base/stl_util.h)
so the build target will need to depend on //base as well.

Found when gn check was taught to look at generated files and not
just at files in the source tree.

Bug: 938933
Change-Id: I566d8c1f0c6b8d16ec21eb7cc864f86b4ed08370
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505943
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638191}
fs
Update bug# for external/wpt/css/css-masking/ failures
TBR=schenney@chromium.org

Bug: 843084
Change-Id: I7e9159f16d3c61838e6838cffd40b13c61aa6e22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1503733
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#637694}
fs
Remove TODO in svg_fe_convolve_matrix_element.idl
It was resolved in https://github.com/w3c/fxtf-drafts/issues/114 to keep
this attribute.

Bug: 695977
Change-Id: I77a2cea341483d6ce337b314cd6597ec089c07eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1499565
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#637370}
bratell
Drop crash workaround for scrollbar clicking
An unrelated code change made bokan notice an old crash fix
workaround from 2007[1] that should not be needed anymore.

Save some code complexity by removing that workaround.

[1] https://chromium.googlesource.com/chromium/src/+/eeca720ce09f9b6b22f23041b332a46ab42030a1

Change-Id: Ie6de426e8c0c13c7ce6b90fa3554f4fbf7c03366
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497142
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#637339}
bratell
Remove variable shadowing in blink/animation
In an effort to reduce or even ban variable shadowing, this renames
and removes some variable. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact warning this this avoids is:

third_party/blink/renderer/core/animation/css/css_animations.cc:385:25: error: declaration shadows a local variable [-Werror,-Wshadow]
        for (wtf_size_t i = 0; i < css_animations->running_animations_.size();
                        ^
third_party/blink/renderer/core/animation/css/css_animations.cc:354:21: note: previous declaration is here
    for (wtf_size_t i = 0; i < name_list.size(); ++i) {
                    ^
third_party/blink/renderer/core/animation/effect_input.cc:548:11: error: declaration shadows a local variable [-Werror,-Wshadow]
    auto* keyframe = keyframes.at(keys[i]);
          ^
third_party/blink/renderer/core/animation/effect_input.cc:429:69: note: previous declaration is here
                                       const v8::Local<v8::Object>& keyframe,
                                                                    ^
third_party/blink/renderer/core/animation/list_interpolation_functions.cc:142:26: error: declaration shadows a local variable [-Werror,-Wshadow]
      InterpolationValue start(
                         ^
third_party/blink/renderer/core/animation/list_interpolation_functions.cc:82:26: note: previous declaration is here
    InterpolationValue&& start,
                         ^
third_party/blink/renderer/core/animation/list_interpolation_functions.cc:145:26: error: declaration shadows a local variable [-Werror,-Wshadow]
      InterpolationValue end(end_interpolable_list.Get(i % end_length)->Clone(),
                         ^
third_party/blink/renderer/core/animation/list_interpolation_functions.cc:83:26: note: previous declaration is here
    InterpolationValue&& end,
                         ^
third_party/blink/renderer/core/animation/list_interpolation_functions.cc:147:34: error: declaration shadows a local variable [-Werror,-Wshadow]
      PairwiseInterpolationValue result =
                                 ^
third_party/blink/renderer/core/animation/list_interpolation_functions.cc:138:32: note: previous declaration is here
    PairwiseInterpolationValue result = nullptr;
                               ^

Bug: 923510
Change-Id: I6c7180f8ff481cee78045ae9aa24bd4dd9631d1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1495544
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#637329}
bratell
Remove variable shadowing in blink/input
In an effort to reduce or even ban variable shadowing, this renames
some variables to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact warning this avoids is:
third_party/blink/renderer/core/input/event_handler.cc:757:20: error: declaration shadows a local variable [-Werror,-Wshadow]
    HitTestRequest request(HitTestRequest::kReadOnly | HitTestRequest::kActive);
                   ^
third_party/blink/renderer/core/input/event_handler.cc:636:18: note: previous declaration is here
  HitTestRequest request(HitTestRequest::kActive);
                 ^
third_party/blink/renderer/core/input/event_handler.cc:772:22: error: declaration shadows a local variable [-Werror,-Wshadow]
      HitTestRequest request(HitTestRequest::kReadOnly |
                     ^
third_party/blink/renderer/core/input/event_handler.cc:636:18: note: previous declaration is here
  HitTestRequest request(HitTestRequest::kActive);
                 ^
third_party/blink/renderer/core/input/scroll_manager.cc:254:11: error: declaration shadows a local variable [-Werror,-Wshadow]
    Node* node = DOMNodeIds::NodeForId(scroll_chain.back());
          ^
third_party/blink/renderer/core/input/scroll_manager.cc:228:9: note: previous declaration is here
  Node* node = start_node;
        ^

Bug: 923510
Change-Id: I2bfd6993232654574a11dbfe7ded2b27555d931a
Reviewed-on: https://chromium-review.googlesource.com/c/1494877
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#637296}
bratell
Remove variable shadowing in blink/html
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact warnings this avoids are:

In file included from ./../../third_party/blink/renderer/core/html/forms/base_temporal_input_type.cc:31:
In file included from ../../third_party/blink/renderer/core/html/forms/base_temporal_input_type.h:34:
In file included from ../../third_party/blink/renderer/core/html/forms/date_time_edit_element.h:31:
third_party/blink/renderer/core/html/forms/date_time_field_element.h:43:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kDispatchNoEvent,
    ^
third_party/blink/renderer/core/html/forms/text_control_element.h:46:3: note: previous declaration is here
  kDispatchNoEvent,
  ^
third_party/blink/renderer/core/html/forms/date_time_numeric_field_element.cc:98:9: error: declaration shadows a local variable [-Werror,-Wshadow]
    int value = TypeAheadValue();
        ^
third_party/blink/renderer/core/html/forms/date_time_numeric_field_element.cc:95:51: note: previous declaration is here
void DateTimeNumericFieldElement::SetFocused(bool value,
                                                  ^
third_party/blink/renderer/core/html/forms/html_option_element.cc:348:15: error: declaration shadows a local variable [-Werror,-Wshadow]
    if (auto* select = ToHTMLSelectElementOrNull(insertion_point.parentNode()))
              ^
third_party/blink/renderer/core/html/forms/html_option_element.cc:344:13: note: previous declaration is here
  if (auto* select = ToHTMLSelectElementOrNull(insertion_point)) {
            ^
third_party/blink/renderer/core/html/html_hr_element.cc:138:15: error: declaration shadows a local variable [-Werror,-Wshadow]
    if (auto* select = ToHTMLSelectElementOrNull(parent))
              ^
third_party/blink/renderer/core/html/html_hr_element.cc:133:13: note: previous declaration is here
  if (auto* select = ToHTMLSelectElementOrNull(insertion_point)) {
            ^
third_party/blink/renderer/core/html/html_slot_element.cc:125:17: error: declaration shadows a local variable [-Werror,-Wshadow]
      if (auto* slot = ToHTMLSlotElementIfSupportsAssignmentOrNull(child))
                ^
third_party/blink/renderer/core/html/html_slot_element.cc:115:28: note: previous declaration is here
    const HTMLSlotElement& slot) {
                           ^
third_party/blink/renderer/core/html/html_slot_element.cc:133:17: error: declaration shadows a local variable [-Werror,-Wshadow]
      if (auto* slot = ToHTMLSlotElementIfSupportsAssignmentOrNull(*node))
                ^
third_party/blink/renderer/core/html/html_slot_element.cc:115:28: note: previous declaration is here
    const HTMLSlotElement& slot) {
                           ^
third_party/blink/renderer/core/html/track/vtt/vtt_cue.cc:770:14: error: declaration shadows a local variable [-Werror,-Wshadow]
      double current_timestamp;
             ^
third_party/blink/renderer/core/html/track/vtt/vtt_cue.cc:764:10: note: previous declaration is here
  double current_timestamp = startTime();
         ^
third_party/blink/renderer/core/html/parser/html_tree_builder.cc:1464:14: error: declaration shadows a local variable [-Werror,-Wshadow]
    for (int i = 0; i < kInnerIterationLimit; ++i) {
             ^
third_party/blink/renderer/core/html/parser/html_tree_builder.cc:1415:12: note: previous declaration is here
  for (int i = 0; i < kOuterIterationLimit; ++i) {
           ^
third_party/blink/renderer/core/html/parser/text_resource_decoder.cc:332:9: error: declaration shadows a local variable [-Werror,-Wshadow]
    int len = 0;
        ^
third_party/blink/renderer/core/html/parser/text_resource_decoder.cc:297:57: note: previous declaration is here
                                             wtf_size_t len,

Change-Id: I5ab4a7b99bb5f55cf2f0a97a2691c7aa3c6fd88d
Reviewed-on: https://chromium-review.googlesource.com/c/1478898
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637252}
fs
Pass StringView to SVG path parsing
This allows optimizing away the String creation in
css_parsing_utils::ConsumePath, while also being slightly more generic.

Change-Id: Iba17ca82e45304dd217487cb526cf8ba692c3276
Reviewed-on: https://chromium-review.googlesource.com/c/1497001
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#636919}
bratell
Remove state variable shadowing in blink/paint
In an effort to reduce or even ban variable shadowing, this renames a
variable. I'm interested in prohibiting shadowing because I think it
might prevent potential jumbo problems.

The exact warning this this avoids is:

third_party/blink/renderer/core/paint/paint_property_tree_builder.cc:1762:40: error: declaration shadows a local variable [-Werror,-Wshadow]

        EffectPaintPropertyNode::State state;
                                       ^
third_party/blink/renderer/core/paint/paint_property_tree_builder.cc:1711:38: note: previous declaration is here
      ScrollPaintPropertyNode::State state;
                                     ^
third_party/blink/renderer/core/paint/paint_property_tree_builder.cc:1776:40: error: declaration shadows a local variable [-Werror,-Wshadow]
        EffectPaintPropertyNode::State state;
                                       ^
third_party/blink/renderer/core/paint/paint_property_tree_builder.cc:1711:38: note: previous declaration is here
      ScrollPaintPropertyNode::State state;
                                     ^

Bug: 923510
Change-Id: Ia64158f91a8f07cd238e01b1e1e31b35a6b5ac06
Reviewed-on: https://chromium-review.googlesource.com/c/1496874
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#636803}
bratell
Remove variable shadowing in blink/frame
In an effort to reduce or even ban variable shadowing, this renames a
couple of variables. I'm interested in prohibiting shadowing because I
think it might prevent potential jumbo problems.

The exact error this avoids is:
third_party/blink/renderer/core/frame/frame_serializer.cc:301:12: error: declaration shadows a local variable [-Werror,-Wshadow]
      KURL url =
           ^
third_party/blink/renderer/core/frame/frame_serializer.cc:261:8: note: previous declaration is here
  KURL url = document.Url();
       ^
third_party/blink/renderer/core/frame/frame_serializer.cc:307:14: error: declaration shadows a local variable [-Werror,-Wshadow]
        KURL url = input->Src();
             ^
third_party/blink/renderer/core/frame/frame_serializer.cc:261:8: note: previous declaration is here
  KURL url = document.Url();
       ^
third_party/blink/renderer/core/frame/frame_serializer.cc:313:14: error: declaration shadows a local variable [-Werror,-Wshadow]
        KURL url =
             ^
third_party/blink/renderer/core/frame/frame_serializer.cc:261:8: note: previous declaration is here
  KURL url = document.Url();
       ^
third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc:110:14: error: declaration shadows a local variable [-Werror,-Wshadow]
      String uma_name = uma_percentage_preamble;
             ^
third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.cc:94:10: note: previous declaration is here
    auto uma_name = uma_preamble;
         ^
third_party/blink/renderer/core/frame/rotation_viewport_anchor.cc:52:21: error: declaration shadows a local variable [-Werror,-Wshadow]
    HitTestLocation location(point + point_offset);
                    ^
third_party/blink/renderer/core/frame/rotation_viewport_anchor.cc:30:19: note: previous declaration is here
  HitTestLocation location(point);
                  ^

Bug: 923510
Change-Id: I9bd46559f31e6b3fdb412cf7787b764ae84c775b
Reviewed-on: https://chromium-review.googlesource.com/c/1494659
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#636453}
bratell
Include the header instead of cc file
A unit test includes prefs_names.cc which in some builds
caused duplicate symbol errors in linking.

(I get a feeling we need a presubmit check for this because
it has happened several times recently)

TBR=gayane@chromium.org

Bug: 931806
Change-Id: I942ba67f7570feed59b32694a55402db169e109c
Reviewed-on: https://chromium-review.googlesource.com/c/1494884
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#636444}
fs
Don't trigger paint invalidation for unused properties
The 'buffered-rendering' and 'color-rendering' properties don't actually
do anything, so don't trigger invalidation for them.

Fix up comment about gradient stop properties in the vicinity.

Change-Id: Iaab0717cf7fc0f0c2a7b13dcae73945c556086f9
Reviewed-on: https://chromium-review.googlesource.com/c/1491311
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636115}
fs
Pass const references to SVGComputedStyle methods
Replace const SVGComputedStyle* with const SVGComputedStyle& as the
argument to the Diff*, InheritFrom and CopyNonInheritedFromCached
methods.

Change-Id: I79c14a39c09089882857fcbe61f4578c18cdd5ac
Reviewed-on: https://chromium-review.googlesource.com/c/1491655
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#636062}
fs
Use the stroke approximation for non-scaling-stroke as well
Like for "normal" strokes, this avoids computing the stroke shape during
layout.

Bug: 435097
Change-Id: I4927e11e78fbdb78d3275a5c661027185ef18161
Reviewed-on: https://chromium-review.googlesource.com/c/1491411
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#636042}
fs
Use symbolic Color names for some SVG property initial values
Color(0, 0, 0)       -> Color::kBlack
Color(255, 255, 255) -> Color::kWhite

Change-Id: I480a472ae5622d9ad58ff2abfcfd8d2c536d1491
Reviewed-on: https://chromium-review.googlesource.com/c/1491616
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636030}
fs
Don't trigger re-layout when 'stroke' changes
Layout only checks for existence of 'stroke', using it to determine
whether stroke bounds should be computed or not.

Bug: 435097
Change-Id: I1b25d4da7f2d5215beadaa4f1941c5d9c8243500
Reviewed-on: https://chromium-review.googlesource.com/c/1491254
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#636010}
bratell
[jumbo] Avoid having two TimeTicksFromSecondsD
With the changes to port from wtf/time.h to base/time/time.h
the core test build target ended up with two TimeTicksFromSecondsD
which clashed in some jumbo builds. This patch is a short
term fix that inlines one of them.

A long term fix would imho be to add a TimeTick::FromSecondsD
method.

Bug: 919383
Change-Id: I5ff65f2a8bcfb95fc0163453793f7c290bbd9e52
Reviewed-on: https://chromium-review.googlesource.com/c/1489196
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Sergio Villar <svillar@igalia.com>
Reviewed-by: Sergio Villar <svillar@igalia.com>
Cr-Commit-Position: refs/heads/master@{#635974}
fs
Don't trigger re-layout when stroke-dash{array,offset} changes
Since we no longer include the dash-effect when computing
(appromixating) the stroke bounds, we don't need to trigger (re)layout
when they change.

This can help eliminate layouts for example for "line animations" like
the one on https://jakearchibald.com/2013/animated-line-drawing-svg/

Bug: 435097
Change-Id: Iaf5298620889b6ed0cb10437514bb8af3104cc35
Reviewed-on: https://chromium-review.googlesource.com/c/1489202
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#635931}
bratell
Use the bundled fontconfig for ui/gfx_unittests
The target gfx_unittests used the system's fontconfig which
stopped working on Ubuntu 16.04 without sysroot when the tests
started using FcConfigParseAndLoadFromMemory which is a
newly (2017) added fontconfig function.

The test should have used third_party/fontconfig all the time
but the test didn't have the necessary deps in the build system
for that to happen.

Follow-up to https://chromium-review.googlesource.com/c/1019978

Change-Id: Ie0dab4632aff454b6c33405d3076c87e226b7e18
Reviewed-on: https://chromium-review.googlesource.com/c/1489237
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635569}
fs
Use StyleImage::HasIntrinsicSize in FillLayer invalidation determination
This better matches what BackgroundImageGeometry checks.

Rename the somewhat terse |img| to the ever so slightly less terse
|image|, and mark it const.

Change-Id: I9e3cbe86285bc448c2e79d31c813071191150a11
Reviewed-on: https://chromium-review.googlesource.com/c/1489235
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635566}
bratell
Clarify which mojom namespace to use inside metrics
There is both a ::mojom namespace and a ::metrics::mojom namespace
so inside metrics its best to qualify which is intended or
name lookup will depend on what the compiler happens to be
aware of.

In particular, in some jumbo builds "mojom" resolved to
"::metrics::mojom" while in other builds where the compiler was
unaware of ::metrics::mojom, it instead resolved to "::mojom".

This is probably one of the reasons there is a style guide
instruction to not have sub namespaces with the same name as a
common top level namespace.

Change-Id: I06545d34fac67b5f3f42fa1821eb33d381e04a41
Reviewed-on: https://chromium-review.googlesource.com/c/1485934
Reviewed-by: Jesse Doherty <jwd@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#635562}
fs
Repurpose {Image,}HasRelativeSize and rename to HasIntrinsicSize
This renames:

  Image::HasRelativeSize,
  StyleImage::ImageHasRelativeSize and
  LayoutImageResource::ImageHasRelativeSize

to the common name HasIntrinsicSize.

This flips the meaning of this flag/method, but the new name is using a
term that is more relatable from a spec-perspective.

Change-Id: I2509926a186f8c81534800362becd585fb0bd024
Reviewed-on: https://chromium-review.googlesource.com/c/1488885
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635550}
bratell
Deduplicate some cookie manager code
The two cookie managers in restricted_cookie_manager.cc and
cookie_manager.cc need some shared functionality and rather
than having a duplicate set of helper functions (of which one
clashed in some jumbo builds and cause build breakage), move
the shared helper functions to a new file cookie_managers_shared.cc.

Bug: 729800
Change-Id: I1839bd04e96471569b1b8a53bf1921f182b8bff4
Reviewed-on: https://chromium-review.googlesource.com/c/1482974
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#635522}
fs
Update style for child SVG documents in PerformPreLayoutTasks
Like in LocalFrameView::UpdateStyleAndLayoutIfNeededRecursive,
explicitly update style (and attach the layout tree) before proceeding
to layout. This ensures that the style update/layout tree attachment of
the child document does not mark its frame owner as dirty after layout
has already been performed for the top-level document.

Bug: 933409
Change-Id: I6b2c864aededed7429c63cbd068ec45c58972ae0
Reviewed-on: https://chromium-review.googlesource.com/c/1481331
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#635459}
fs
Remove dead code for EFillSizeType::kSizeNone
This enumeration value is only used during style resolution, and thus
there should be no need to handle it elsewhere.

This allows cleaning up the ShouldFullyInvalidateFillLayersOn*Change
helpers as well, removing the only users of

StyleImage: :UsesImageContainerSize() and in turn also
Image: :UsesContainerSize(), so removing those as well.
Change-Id: I6400ca9acf98359712891fc74e1a232a2cfbc208
Reviewed-on: https://chromium-review.googlesource.com/c/1486354
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#635137}
bratell
Remove shadowing of kMeasure in blink by using enum class
There are several kMeasure in blink and with -Wshadow enabled
there will be warnings about blink::kMeasure being shadowed.
This moves blink::kMeasure to
blink::NGTableCellChildLayoutPhase::kMeasure which avoid that
warning.

I'm interested in making blink -Wshadow clean because I think that
can reduce the risk of certain jumbo problems.

Bug: 923510
Change-Id: Ifac4ce2c9cf61ee7e7d72da4dc5055d4f490a5cc
Reviewed-on: https://chromium-review.googlesource.com/c/1484309
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#635090}
bratell
Make InvalidationType an enum class to clear the blink ns
kInvalidateDescendants was used both in blink/paint and blink/css
and to avoid shadowing, this makes the one in the blink namespace
(InvalidationType::kInvalidateDescendants) into an enum class.

This will make is easier/possible to later turn on the -Wshadow
warning. I'm interested in prohibiting shadowing because I think
it might prevent potential jumbo problems.

The exact warning this avoids is:
In file included from third_party/blink/renderer/core/paint/block_flow_paint_invalidator.cc:5:
third_party/blink/renderer/core/paint/block_flow_paint_invalidator.h:31:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kInvalidateDescendants
    ^
third_party/blink/renderer/core/css/invalidation/invalidation_set.h:52:25: note: previous declaration is here
enum InvalidationType { kInvalidateDescendants, kInvalidateSiblings };
                        ^

Bug: 923510
Change-Id: Ib1ab2720adf1abda4c9ded69d8e086d1e8f3f360
Reviewed-on: https://chromium-review.googlesource.com/c/1483084
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#635069}
fs
Resolve stroke-width 'em' units against unzoomed font size
When resolving style for the 'stroke-width' property we would use
CSSToLengthConversionData::CopyWithAdjustedZoom() with an argument of 1
to get an "unzoomed" length. The FontSizes object was however not
adjusted, so still carried zoomed base font sizes.

Make a new method on StyleResolverState that returns an
CSSToLengthConversionData that uses unzoomed unit bases, basing it on
the existing FontSizeConversionData() method which does roughly the
same thing except it uses the parent style for unit bases.

Bug: 933689
Change-Id: Icfbc59a641f0dc2d94f00ba5f3e9a15b36f8c195
Reviewed-on: https://chromium-review.googlesource.com/c/1481417
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#634750}
fs
Add test for "fully overlapping" radial gradient case
This adds a test for the case where the start and end circles of a
radial gradient fully overlap (while having non-zero radii).

Bug: 933413
Change-Id: Id059cb607f6fc137111d2306dd9c9eef1f55b6bc
Reviewed-on: https://chromium-review.googlesource.com/c/1483023
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634711}
bratell
Remove variable shadowing in blink/svg
In an effort to reduce or even ban symbol shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoids is:
third_party/blink/renderer/core/svg/svg_svg_element.cc:456:28: error: declaration shadows a local variable [-Werror,-Wshadow]
      TransformationMatrix transform;
                           ^
third_party/blink/renderer/core/svg/svg_svg_element.cc:449:19: note: previous declaration is here
  AffineTransform transform;
                  ^

Bug: 923510
Change-Id: I99c001d0eb513d73bfc33d540601479a6fd7280d
Reviewed-on: https://chromium-review.googlesource.com/c/1482975
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#634676}
bratell
Backup includes for PTRACE_GET_THREAD_AREA
PTRACE_GET_THREAD_AREA is not in ptrace.h in Ubuntu 16.04 when
building for Linux without a sysroot so get it from somewhere else,
in this case asm/ptrace-abi.h.

Follow up to https://chromium-review.googlesource.com/c/1479092

Bug: 934238,933418
Change-Id: I3e1ace31a6f5a4ab65bbe712e1516d7b5fa009a5
Reviewed-on: https://chromium-review.googlesource.com/c/1481316
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#634660}
bratell
Avoid variable/type shadowing in blink/dom
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact warnings this avoids are:
third_party/blink/renderer/core/dom/element.cc:3940:35: error: declaration shadows a local variable [-Werror,-Wshadow]
        else if (const Attribute* attribute =
                                  ^
third_party/blink/renderer/core/dom/element.cc:3938:30: note: previous declaration is here
        if (const Attribute* attribute = attributes.Find(xml_names::kLangAttr))
                             ^
third_party/blink/renderer/core/dom/node.cc:2113:17: error: declaration shadows a local variable [-Werror,-Wshadow]
    const Node* node = chain[index - 1];
                ^
third_party/blink/renderer/core/dom/node.cc:2107:15: note: previous declaration is here
  const Node* node = this;
              ^
third_party/blink/renderer/core/dom/range.cc:529:36: error: declaration shadows a type alias in namespace 'blink' [-Werror,-Wshadow]
  typedef HeapVector<Member<Node>> NodeVector;
                                   ^
third_party/blink/renderer/core/dom/container_node.h:84:7: note: previous declaration is here
using NodeVector = HeapVector<Member<Node>, kInitialNodeVectorSize>;
      ^
third_party/blink/renderer/core/dom/range.cc:750:36: error: declaration shadows a type alias in namespace 'blink' [-Werror,-Wshadow]
  typedef HeapVector<Member<Node>> NodeVector;
                                   ^
third_party/blink/renderer/core/dom/container_node.h:84:7: note: previous declaration is here
using NodeVector = HeapVector<Member<Node>, kInitialNodeVectorSize>;
      ^

Bug: 925310

Change-Id: I8bc037dd1cf54baf5f6fe1ed93b1ead391313e8a
Reviewed-on: https://chromium-review.googlesource.com/c/1478876
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#634659}
bratell
Revert "Take scheme in CookieStore::SetCanonicalCookieAsync, not just whether it's secure."
This reverts commit 5760a6f2d7a24ee7e2cfac2c399f8756db91be83.

Reason for revert: Clashed with some other change so all Android builders died with:

[1078/8826] CXX obj/android_webview/common/aw_cookie_manager_wrapper.o
FAILED: obj/android_webview/common/aw_cookie_manager_wrapper.o 
../../android_webview/browser/net_network_service/aw_cookie_manager_wrapper.cc -o obj/android_webview/common/aw_cookie_manager_wrapper.o
../../android_webview/browser/net_network_service/aw_cookie_manager_wrapper.cc:40:43: error: reference to type 'const std::string' (aka 'const basic_string<char, char_traits<char>, allocator<char> >') could not bind to an lvalue of type 'bool'
  cookie_manager_->SetCanonicalCookie(cc, secure_source, modify_http_only,
                                          ^~~~~~~~~~~~~
gen/services/network/public/mojom/cookie_manager.mojom.h:179:82: note: passing argument to parameter 'source_scheme' here
  void SetCanonicalCookie(const net::CanonicalCookie& cookie, const std::string& source_scheme, bool modify_http_only, SetCanonicalCookieCallback callback) final;
                                                                                 ^
1 error generated.


Original change's description:
> Take scheme in CookieStore::SetCanonicalCookieAsync, not just whether it's secure.
> 
> This permits to check it against list of cookieable schemes (fixing #850044), and is
> a prerequisite for getting rid of SetCookieWithOptionsAsync in favor of everything
> using SetCanonicalCookieAsync.
> 
> Bug: 850044
> Change-Id: I890cf266767a124b116fc553932a74b5a97ed943
> Reviewed-on: https://chromium-review.googlesource.com/c/1450420
> Commit-Queue: Maks Orlovich <morlovich@chromium.org>
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
> Reviewed-by: Eugene But <eugenebut@chromium.org>
> Reviewed-by: Mike West <mkwst@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Reviewed-by: Victor Costan <pwnall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#634646}

TBR=jam@chromium.org,caseq@chromium.org,tsepez@chromium.org,eugenebut@chromium.org,pwnall@chromium.org,mkwst@chromium.org,morlovich@chromium.org

Change-Id: I17b82ee596c4cdcebfc8774f06b7e155ead8c514
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 850044
Reviewed-on: https://chromium-review.googlesource.com/c/1482460
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#634658}
bratell
[jumbo] Compile fix, one too many BstrToUTF8, rename BstrToPrettyUTF8
https://chromium-review.googlesource.com/c/chromium/src/+/1474976
introduced a BstrToUTF8 which in jumbo builds collided with an
existing (but different) BstrToUTF and broke Windows builds.

This renames one of the conversions to "BstrToPrettyUTF8" since it
not only converts but also makes the string readable for logs.

If the methods had been indentical it would have been suitable
to move them to
content/browser/accessibility/accessibility_tree_formatter_utils_win.cc
I think.

TBR=dmazzoni@chromium.org,iapres@microsoft.com

Bug: 928949
Change-Id: I33660b867e6a4bcabfd274ba976ef642dd65db3a
Reviewed-on: https://chromium-review.googlesource.com/c/1482452
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#634594}
bratell
Make StdStringCanonOutput non copyable and don't copy it
In some build experiments, the compiler emitted an object assignment
of StdStringCanonOutput which did not link because the operator=
was not exported from the url.dll in component builds.

This makes the class  explicitly not copyable and removes
the copy to avoid that kind of (hard to debug) problems.

Change-Id: I92988b5799e4229d1fb0379f9897727c1bac20de
Reviewed-on: https://chromium-review.googlesource.com/c/1477602
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Ryan Hamilton <rch@chromium.org>
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634383}
fs
Remove "has inline transform" ComputedStyle flag
f6e075c54c8bc6130d49c09ad3df6944376ccba4 removed the only real usage of
this flag. Remove the flag and clean up. Also avoids setting
SetCompositingReasonsChanged when the flag changes.

Bug: 812166
Change-Id: Id4d204db83117feafeb92baa765988952cdb7af3
Reviewed-on: https://chromium-review.googlesource.com/c/1480004
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Mason Freed <masonfreed@chromium.org>
Cr-Commit-Position: refs/heads/master@{#634360}
the_jk
Reland: Add RenderFrameHost as parameter to WebContentsDelegate::HandleContextMenu
This is a reland of the following change:
  commit 5705b913a577759d16b3eca7d5b0e7b5c79421f6
  https://chromium-review.googlesource.com/c/1472696

Reverted in 328cae2c82cb2e079658944f626883df74ed5c5a

Fix for reland:
In HandleContextMenuDelegate unittest, return true
to stop the tested WebContents instance to call
ShowContextMenu().

On some platforms (android) the WebContentsView
implementation assumes that the RenderWidgetHostView
is also a platform specific implementation. The test
for WebContents is using mocked versions.

Anyway, the point was not to test ShowContextMenu
but HandleContextMenu so better to limit the test.

Original description:
To be able to do anything more complicated than block all context
menu handling in HandleContextMenu you need the associated WebContents
object. Current implementation that do something more currently handles
that by either being a WebContentsObserver or keeping the WebContents
object some other way.

After WebContents checks WebContentsDelegate::HandleContextMenu the
next delegate to get a chance is WebContentsViewDelegate::ShowContextMenu
which takes a RenderFrameHost as additional parameter. This is all
you need to get the WebContents object and other related information.

So, to simplify writing WebContentsDelegate:s and override the
context menu handling by actually showing something, include
RenderFrameHost also in the HandleContextMenu call.

I selected RenderFrameHost instead of WebContents that many
other delegate methods use because it matches ShowContextMenu
signature and there are already other delegate methods that
also uses RenderFrameHost instead.

WebContentsDelegate is a very popular interface, so this
modifies a lot of files in different components but the
changes are mechanical.

Bug: 932520
Change-Id: I91ab29e5bbf20ca3743a9b1db7b2c391a573605d
Reviewed-on: https://chromium-review.googlesource.com/c/1478900
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Joel Klinghed <the_jk@opera.com>
Cr-Commit-Position: refs/heads/master@{#633900}
bratell
Remove variable shadowing in blink/modules/webgl
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The warnings this avoids is:
third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc:3688:18: error: declaration shadows a local variable [-Werror,-Wshadow]
        unsigned length;
                 ^
third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc:3658:13: note: previous declaration is here
    GLsizei length = 0;
            ^
third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc:5234:31: error: declaration shadows a local variable [-Werror,-Wshadow]
      ScopedTexture2DRestorer restorer(gl);
                              ^
third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc:5190:27: note: previous declaration is here
  ScopedTexture2DRestorer restorer(this);

Bug: 923510
Change-Id: Idef0b7f4b47aad7c0199d9e11571dc93d1c94429
Reviewed-on: https://chromium-review.googlesource.com/c/1477679
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633750}
bratell
Remove variable shadowing in blink/modules/peerconnection
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The warning this avoids is:
third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc:1200:20: error: declaration shadows a local variable [-Werror,-Wshadow]
  for (auto const& transport_iterator : dtls_transports_by_mid_) {
                   ^
third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc:1187:8: note: previous declaration is here
  auto transport_iterator = dtls_transports_by_mid_.find(mid);
       ^

Bug: 923510
Change-Id: Ia9e1734c1bd1aa42bf4b13f6d2b43fe28b6ed511
Reviewed-on: https://chromium-review.googlesource.com/c/1478872
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633746}
bratell
Remove variable shadowing in blink/modules/notifications
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoids is:
third_party/blink/renderer/modules/notifications/notification_data.cc:93:45: error: declaration shadows a local variable [-Werror,-Wshadow]

    SerializedScriptValue::SerializeOptions options;
                                            ^
./../../third_party/blink/renderer/modules/notifications/notification_data.cc:43:32: note: previous declaration is here
    const NotificationOptions* options,
                               ^

Bug: 923510
Change-Id: Ie49096ef30fbab30567ad45f3f2d8b76a8eab9ed
Reviewed-on: https://chromium-review.googlesource.com/c/1478891
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633744}
bratell
Remove variable shadowing in blink/modules/credentialmanager
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoids is:
third_party/blink/renderer/modules/credentialmanager/credentials_container.cc:180:23: error: declaration shadows a local variable [-Werror,-Wshadow]
    OriginAccessEntry access_entry(
                      ^
third_party/blink/renderer/modules/credentialmanager/credentials_container.cc:166:21: note: previous declaration is here
  OriginAccessEntry access_entry(
                    ^

Bug: 923510
Change-Id: I61b11ecd489ed9842e1a9ebee9293050f7f1cde5
Reviewed-on: https://chromium-review.googlesource.com/c/1478890
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633742}
bratell
Remove variable shadowing in blink/modules/filesystem
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact warnings this avoids is:

third_party/blink/renderer/modules/filesystem/directory_reader.cc:140:21: error: declaration shadows a local variable [-Werror,-Wshadow]
    EntryHeapVector entries;
                    ^
third_party/blink/renderer/modules/filesystem/directory_reader.cc:136:57: note: previous declaration is here
void DirectoryReader::AddEntries(const EntryHeapVector& entries) {
                                                        ^
third_party/blink/renderer/modules/filesystem/dom_window_file_system.cc:248:37: error: declaration shadows a local variable [-Werror,-Wshadow]
              Vector<ScriptPromise> result;
                                    ^
third_party/blink/renderer/modules/filesystem/dom_window_file_system.cc:238:32: note: previous declaration is here

             base::File::Error result,
                               ^

Bug: 923510
Change-Id: Ib907382435b0d1417e9ca2f070bfb68ef591e123
Reviewed-on: https://chromium-review.googlesource.com/c/1478871
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633728}
bratell
Remove variable shadowing in blink/modules/cache_storage
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoid is:

third_party/blink/renderer/modules/cache_storage/inspector_cache_storage_agent.cc:313:22: error: declaration shadows a local variable [-Werror,-Wshadow]
    for (const auto& request_response : responses_) {
                     ^
third_party/blink/renderer/modules/cache_storage/inspector_cache_storage_agent.cc:277:22: note: previous declaration is here
    RequestResponse& request_response =

Bug: 923510
Change-Id: I8f6b6cd11f80a254c2c926e934dacefaa6dfccf8
Reviewed-on: https://chromium-review.googlesource.com/c/1477285
Reviewed-by: Ben Kelly <wanderview@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633715}
mpawlowski
Extract PositionCache to separate file, make it persistent.
PositionCache should be persistent and outlive NetworkLocationProvider,
similarly to how LastPositionCache behaved. This lets us limit the
number of API requests, since WifiData -> Geoposition mappings are
stored longer.
Also, LastPositionCache can now be merged with PositionCache.

Bug: 672760
Change-Id: Ibd4c30c9a58dd26deb5f67448b5e2bac48d634fc
Reviewed-on: https://chromium-review.googlesource.com/c/1273055
Commit-Queue: Maciej Pawlowski <mpawlowski@opera.com>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Matt Reynolds <mattreynolds@chromium.org>
Auto-Submit: Maciej Pawlowski <mpawlowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#633681}
bratell
Crostini: Include header file instead of cc file
Instead of a header file, crostini included
chrome/browser/platform/platform_util_chromeos.cc which kind
of worked but in some builds triggered link failures later
because of duplicate symbols.

This probably works sometimes because nobody else uses the symbols
in platform_util_chromeos.o so that it is discarded before the linker
notices the duplication. Not always though.

Bug: 912638
Change-Id: I9b96a41e20ab5362fe800b502d788c844ac4d7f2
Reviewed-on: https://chromium-review.googlesource.com/c/1477025
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Timothy Loh <timloh@chromium.org>
Reviewed-by: Joel Hockey <joelhockey@chromium.org>
Reviewed-by: Timothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633471}
bratell
Add dependency ipc_fuzzer -> chrome_elf:test_stubs
On Windows, ipc_fuzzer uses chrome/common/child_process_logging_win.cc
which uses the SetMetricsClientId() function from //chrome_elf.
There is intentionally no dependency in chrome/common to allow
different products to select between the sharp chrome_elf code
and the test version of chrome_elf.

In common builds this missing dependency does not cause any build
failures, probably because child_process_logging_win.obj will be
ignored by the linker completely since ipc_fuzzer uses nothing
in that object file. That was not the case in some jumbo build
experiments. The end result will most likely be the same.

Change-Id: I6607423e46270f256d67758b1bad087927de2edf
Reviewed-on: https://chromium-review.googlesource.com/c/1443017
Reviewed-by: Jonathan Metzman <metzman@chromium.org>
Reviewed-by: Martin Barbella <mbarbella@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633447}
bratell
Enable jumbo for two remaining blink build targets
There were two build targets in blink that didn't support jumbo builds
and for completeness, add jumbo for them as well. The effect is for
people building with jumbo is small since they are small targets, but this
way nobody has to investigate that in the future.

Change-Id: Ibd11fc213dc9364222ad40e56ef977c468191ea4
Reviewed-on: https://chromium-review.googlesource.com/c/1477890
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633326}
bratell
Remove the android_webview::crash_reporter namespace
There is already a ::crash_reporter namespace and having
a sub namespace with the same name as a top level namespace
caused lookup complications (and it's banned by the code style
guide). Since there was only a single function in the namespace,
after deleting the unused function, let's just remove the whole
namespace.

This resolves a jumbo compilation problems with symbols being
looked up in the wrong crash_reporter namespace.

Change-Id: Iaf15dbbe6186d479c3768ee88ce7b84442014183
Reviewed-on: https://chromium-review.googlesource.com/c/1477111
Commit-Queue: Richard Coles <torne@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633305}
the_jk
Add RenderFrameHost as parameter to WebContentsDelegate::HandleContextMenu
To be able to do anything more complicated than block all context
menu handling in HandleContextMenu you need the associated WebContents
object. Current implementation that do something more currently handles
that by either being a WebContentsObserver or keeping the WebContents
object some other way.

After WebContents checks WebContentsDelegate::HandleContextMenu the
next delegate to get a chance is WebContentsViewDelegate::ShowContextMenu
which takes a RenderFrameHost as additional parameter. This is all
you need to get the WebContents object and other related information.

So, to simplify writing WebContentsDelegate:s and override the
context menu handling by actually showing something, include
RenderFrameHost also in the HandleContextMenu call.

I selected RenderFrameHost instead of WebContents that many
other delegate methods use because it matches ShowContextMenu
signature and there are already other delegate methods that
also uses RenderFrameHost instead.

WebContentsDelegate is a very popular interface, so this
modifies a lot of files in different components but the
changes are mechanical.

Change-Id: I612202730f9a3badd38062e8284f1d50979e9377
Bug: 932520
Reviewed-on: https://chromium-review.googlesource.com/c/1472696
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Joel Klinghed <the_jk@opera.com>
Cr-Commit-Position: refs/heads/master@{#633300}
bratell
Don't compile ssl_connect_job.cc in nacl builds
net/socket/ssl_connect_job.cc references a lot of classes
that are not compiled in nacl builds, such as SocketParams
and SOCKSConnectJob. In some builds the ssl_socket_connect_job.o
file was discarded before proceeding (just wasting time but
causing no harm), but in some builds it remained and later
caused link errors.

Change-Id: Ic2d9da783259c2a4e24fc00fff44ca36f2d8c51e
Reviewed-on: https://chromium-review.googlesource.com/c/1477118
Auto-Submit: Daniel Bratell <bratell@opera.com>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633276}
bratell
Remove shadowing variables in blink/platform
I'm interested in avoiding and possibly banning shadowed variables since I think that might
possibly prevent jumbo problems. This patch resolves all current issues of shadowed
variables in blink/platform, mostly through natural renamings or refactorings.

The exact warnings this patch avoids are a bit too many to list here but is available at
https://chromium-review.googlesource.com/c/chromium/src/+/1436042/11//COMMIT_MSG

Bug: 925310                                               ^

Change-Id: I9f94b4facb075db6b5860e9e942caddc1c51faee
Reviewed-on: https://chromium-review.googlesource.com/c/1436042
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633235}
bratell
Remove variable shadowing in blink/modules/webaudio
In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoids is:
third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc:347:17: error: declaration shadows a local variable [-Werror,-Wshadow]
  for (uint32_t output_bus_index = 0; output_bus_index < output_buses->size();
                ^
third_party/blink/renderer/modules/webaudio/audio_worklet_global_scope.cc:253:12: note: previous declaration is here
  uint32_t output_bus_index = 0;
           ^
1 error generated.

Bug: 923510
Change-Id: Ic861379f7892eb044b4ab3035bde2271521fd2c1
Reviewed-on: https://chromium-review.googlesource.com/c/1477011
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633129}
bratell
Remove variable shadowing in blink/modules/indexeddb and webdatabase
In an effort to reduce (any possibly ban) shadowed variables in blink, this
renames a couple of variables in modules/indexeddb so that there is no
variable shadowing.

I'm interested in turning on the shadowing warning because I think it might
prevent potential jumbo build problems.

This patch fixes these shadowing warnings:
third_party/blink/renderer/modules/indexeddb/idb_database.cc:201:12: error: declaration shadows a local variable [-Werror,-Wshadow]
      auto it = transactions.find(map_entry.first);
           ^
third_party/blink/renderer/modules/indexeddb/idb_database.cc:196:10: note: previous declaration is here
    auto it = observers_.find(map_entry.first);
         ^
third_party/blink/renderer/modules/indexeddb/inspector_indexed_db_agent.cc:490:11: error: declaration shadows a local variable [-Werror,-Wshadow]
    auto* array = key->getArray(nullptr);
          ^
third_party/blink/renderer/modules/indexeddb/inspector_indexed_db_agent.cc:474:31: note: previous declaration is here
  DEFINE_STATIC_LOCAL(String, array, ("array"));
                              ^
third_party/blink/renderer/modules/webdatabase/database.cc:845:38: error: declaration shadows a local variable [-Werror,-Wshadow]
    SQLTransaction::OnErrorCallback* callback =
                                     ^
third_party/blink/renderer/modules/webdatabase/database.cc:824:40: note: previous declaration is here
    SQLTransaction::OnProcessCallback* callback,
                                       ^
3 errors generated.

Bug: 925310
Change-Id: I5912a18ce0bbfe8bfd15a69110aa396ef216b7d8
Reviewed-on: https://chromium-review.googlesource.com/c/1477051
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633128}
bratell
Rename commonly shadowed kNone + accessibility shadowing fixes
In an effort to reduce or even ban variable shadowing, this renames
the enum blink::kNone and associated enum values since they are often
shadowed by other kNone and kAuto in blink.

The patch also renames a couple of other variables to avoid shadowing
more locally in modules/accessibility. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The exact error this avoids is:

In file included from third_party/blink/renderer/modules/accessibility/ax_image_map_link.cc:29:
In file included from third_party/blink/renderer/modules/accessibility/ax_image_map_link.h:33:
In file included from third_party/blink/renderer/core/html/html_area_element.h:29:
In file included from third_party/blink/renderer/core/html/html_anchor_element.h:28:
In file included from third_party/blink/renderer/core/dom/document.h:43:
In file included from third_party/blink/renderer/core/dom/container_node.h:30:
In file included from third_party/blink/renderer/core/dom/node.h:36:
In file included from third_party/blink/renderer/core/dom/tree_scope.h:33:
third_party/blink/renderer/core/layout/hit_test_request.h:38:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kReadOnly = 1 << 1,
    ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:21:3: note: previous declaration is here
  kReadOnly,
  ^
In file included from third_party/blink/renderer/modules/accessibility/ax_image_map_link.cc:29:
In file included from third_party/blink/renderer/modules/accessibility/ax_image_map_link.h:33:
In file included from third_party/blink/renderer/core/html/html_area_element.h:29:
In file included from third_party/blink/renderer/core/html/html_anchor_element.h:28:
In file included from third_party/blink/renderer/core/dom/document.h:63:
In file included from third_party/blink/renderer/core/html/custom/v0_custom_element.h:35:
In file included from third_party/blink/renderer/core/html/custom/v0_custom_element_definition.h:35:
third_party/blink/renderer/core/html/custom/v0_custom_element_lifecycle_callbacks.h:47:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kNone = 0,
    ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here
  kNone = 0,  // An object that is not disabled.
  ^
In file included from third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc:29:
In file included from third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h:33:
In file included from third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h:37:
In file included from third_party/blink/renderer/core/layout/api/line_layout_text.h:9:
In file included from third_party/blink/renderer/core/frame/local_frame.h:48:
In file included from third_party/blink/renderer/core/frame/local_frame_view.h:38:
In file included from third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h:33:
In file included from third_party/blink/renderer/core/paint/compositing/compositing_reason_finder.h:10:
third_party/blink/renderer/platform/graphics/compositing_reasons.h:107:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kNone = 0,
    ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here
  kNone = 0,  // An object that is not disabled.
  ^
In file included from third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc:29:
In file included from third_party/blink/renderer/modules/accessibility/ax_inline_text_box.h:33:
In file included from third_party/blink/renderer/core/layout/line/abstract_inline_text_box.h:37:
In file included from third_party/blink/renderer/core/layout/api/line_layout_text.h:10:
In file included from third_party/blink/renderer/core/layout/api/line_layout_item.h:10:
In file included from third_party/blink/renderer/core/layout/layout_object_inlines.h:8:
In file included from third_party/blink/renderer/core/css/style_engine.h:45:
In file included from third_party/blink/renderer/core/css/resolver/style_resolver.h:31:
In file included from third_party/blink/renderer/core/css/element_rule_collector.h:30:
In file included from third_party/blink/renderer/core/css/resolver/match_request.h:28:
In file included from third_party/blink/renderer/core/css/rule_set.h:28:
In file included from third_party/blink/renderer/core/css/css_keyframes_rule.h:30:
In file included from third_party/blink/renderer/core/css/style_rule.h:29:
In file included from third_party/blink/renderer/core/css/media_list.h:26:
third_party/blink/renderer/core/css/media_query.h:48:38: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
  enum RestrictorType { kOnly, kNot, kNone };
                                     ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here
  kNone = 0,  // An object that is not disabled.
  ^
In file included from third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:36:
In file included from third_party/blink/renderer/core/editing/editing_utilities.h:32:
In file included from third_party/blink/renderer/core/events/input_event.h:12:
In file included from third_party/blink/renderer/core/events/ui_event.h:28:
third_party/blink/renderer/core/dom/events/event.h:59:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kNone = 0,
    ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here
  kNone = 0,  // An object that is not disabled.
  ^
In file included from third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:59:
In file included from third_party/blink/renderer/core/html/html_image_element.h:40:
third_party/blink/renderer/platform/loader/fetch/fetch_parameters.h:61:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kNone = 0,          // No optimization.
    ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here
  kNone = 0,  // An object that is not disabled.
  ^
In file included from third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:92:
In file included from third_party/blink/renderer/core/paint/paint_layer.h:63:
third_party/blink/renderer/platform/graphics/squashing_disallowed_reasons.h:54:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kNone = 0,
    ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here
  kNone = 0,  // An object that is not disabled.
  ^
In file included from third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:105:
In file included from third_party/blink/renderer/platform/text/platform_locale.h:33:
third_party/blink/renderer/platform/date_components.h:87:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kNone,  // Suppress the second part and the millisecond part if they are 0.
    ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here
  kNone = 0,  // An object that is not disabled.
  ^
third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:1335:19: error: declaration shadows a local variable [-Werror,-Wshadow]
    LayoutObject* layout_object = runner.GetFragment()->GetLayoutObject();
                  ^
third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:1324:23: note: previous declaration is here
  const LayoutObject& layout_object = *ax_object.GetLayoutObject();
                      ^
third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:1408:19: error: declaration shadows a local variable [-Werror,-Wshadow]
    LayoutObject* layout_object = runner.GetFragment()->GetLayoutObject();
                  ^
third_party/blink/renderer/modules/accessibility/ax_layout_object.cc:1397:23: note: previous declaration is here
  const LayoutObject& layout_object = *ax_object.GetLayoutObject();
                      ^
third_party/blink/renderer/modules/accessibility/ax_node_object.cc:1297:28: error: declaration shadows a local variable [-Werror,-Wshadow]
    for (HTMLInputElement* radio_button : html_radio_buttons) {
                           ^
third_party/blink/renderer/modules/accessibility/ax_node_object.cc:1294:13: note: previous declaration is here
  if (auto* radio_button = ToHTMLInputElementOrNull(node_)) {
            ^
third_party/blink/renderer/modules/accessibility/ax_node_object.cc:3120:25: error: declaration shadows a local variable [-Werror,-Wshadow]

    ax::mojom::NameFrom name_from;
                        ^
third_party/blink/renderer/modules/accessibility/ax_node_object.cc:3102:54: note: previous declaration is here
String AXNodeObject::Description(ax::mojom::NameFrom name_from,
                                                     ^
In file included from third_party/blink/renderer/modules/accessibility/ax_object.cc:32:
third_party/blink/public/platform/web_scroll_into_view_params.h:60:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kAuto = 0,
    ^
third_party/blink/renderer/platform/geometry/length.h:35:3: note: previous declaration is here
  kAuto,
  ^
In file included from third_party/blink/renderer/modules/accessibility/ax_object.cc:49:
In file included from third_party/blink/renderer/core/input/event_handler.h:48:
third_party/blink/renderer/platform/cursor.h:82:5: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
    kNone,
    ^
third_party/blink/renderer/modules/accessibility/ax_enums.h:20:3: note: previous declaration is here
  kNone = 0,  // An object that is not disabled.
  ^
14 errors generated.

Bug: 923510
Change-Id: Ibe8c325a39c247b018d92c0c97cd95166a4f74be
Reviewed-on: https://chromium-review.googlesource.com/c/1477053
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633127}
bratell
Revert "[heap profiler] Make use of thread_local instead of base::TLS"
This reverts commit 684f41852a1ac8403b6c2447db684a3ee4002619.

Reason for revert: It broke the ios-simulator-cronet builder: 
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/ios-simulator-cronet

The ios-simulator-cronet compiler says:

../../base/sampling_heap_profiler/poisson_allocation_sampler.cc:101:1: error: thread-local storage is not supported for the current target
thread_local bool g_internal_reentry_guard;
^
../../base/sampling_heap_profiler/poisson_allocation_sampler.cc:104:1: error: thread-local storage is not supported for the current target
thread_local intptr_t g_accumulated_bytes_tls;
^
../../base/sampling_heap_profiler/poisson_allocation_sampler.cc:113:1: error: thread-local storage is not supported for the current target
thread_local bool g_sampling_interval_initialized_tls;
^
3 errors generated.

This blocks CLs that trigger that builder, including 
https://chromium-review.googlesource.com/c/chromium/src/+/1475156
https://chromium-review.googlesource.com/c/chromium/src/+/1430089


Original change's description:
> [heap profiler] Make use of thread_local instead of base::TLS
> 
> The C++ thread_local is slightly faster while making the code clear.
> Besides that calls to TlsGetValue on Windows may alter the result of
> GetLastError, thus changing behavior of the underlying code.
> 
> BUG=920440
> 
> Change-Id: Ic89632f4a54f35d58b93cdecfffc68fc1a94dac1
> Reviewed-on: https://chromium-review.googlesource.com/c/1461681
> Reviewed-by: Vlad Tsyrklevich <vtsyrklevich@chromium.org>
> Reviewed-by: Erik Chen <erikchen@chromium.org>
> Commit-Queue: Alexei Filippov <alph@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#632819}

TBR=alph@chromium.org,erikchen@chromium.org,vtsyrklevich@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 920440
Change-Id: Iad4158b406c1b28d14382a8a711a0304c094389c
Reviewed-on: https://chromium-review.googlesource.com/c/1477076
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633092}
bratell
Make SVGTransformTearOff::SVGElementType not shadow SVGElementType
There are two enums SVGElementType in blink with the same members.
If -Wshadow is used, that triggers warnings because one of them
shadow the other one. This patch renames the values in the outer
one and makes the whole enum an enum class (either fix by itself
would resolve this shadowing).

Bug: 925310
Change-Id: Idd32249dac7fe0e2bce862c634fd89d29fa961a1
Reviewed-on: https://chromium-review.googlesource.com/c/1439079
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#633082}
bratell
Move kAuto and kFixed into a tighter scope than blink::
blink::kAuto and blink::kFixed from the enum LengthType is often
shadowed by other kAuto and other kFixed which triggers a ton of
warnings when trying to enable -Wshadow. This makes enum LengthType
into e class enum in Length, named Type. (So it will be be
Length::kAuto instead of just kAuto)

Bug: 925310
Change-Id: I6da0577c1a52954229297d9e0d81cb93fda60376
Reviewed-on: https://chromium-review.googlesource.com/c/1437282
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632694}
bratell
Replace Length::SetValue with assignment
In an effort to "hide" LengthType constants so that those constants
can be moved without much code churn, I noticed that the five different
Length::SetValue functions were barely used and offered no
substantial improvement over a pure assignment so let's keep the
code simple and just use the assignment.

Depending on the compiler and the optimizer, it may generate the
same code, but Android code size changed by a couple of bytes so
probably not.

Change-Id: I691dd8e0df965a87edcd964021faa6f264aa01e5
Reviewed-on: https://chromium-review.googlesource.com/c/1472692
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#632563}
bratell
[jumbo] Use full namespaces to clarify which GetReferrerChain is needed
There are two namespaces in extensions named GetRefererrChain and
in jumbo builds the identically named namespace aliases create for
them clashed. This just uses the full namespace name instead of
using aliases so that it's always clear (to compiler and humans)
which one is used.

Bug: 914411
Change-Id: I43336e962a82756bf4be7db74417c6a1fc78e889
Reviewed-on: https://chromium-review.googlesource.com/c/1472571
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#632368}
mharanczyk
Do not copy to clipboard query parameters of mailto links via context menu.
The action is called copy "Copy email address".

Bug: 911139
Change-Id: I6e34803749898fedd008024ecba52d0ab1c11f19
Reviewed-on: https://chromium-review.googlesource.com/c/1472691
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632253}
pbaran
Fixed SSLUICaptivePortalListTest tests that doesn't have parameters
Because of 'using SSLUICaptivePortalListTest = SSLUITest;'
SSLUICaptivePortalListTest tests will not be parameterized.
It is necessary to add INSTANTIATE_TEST_CASE_P for these tests

R=rsleevi@chromium.org

Change-Id: Ic5985e6c8629009461ca48101f3fcd4dab31d1b7
Reviewed-on: https://chromium-review.googlesource.com/c/1443117
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Commit-Queue: Ryan Sleevi <rsleevi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632246}
bratell
Clarify which "mojom" is intended for LifecycleUnitDiscardReason
There is an ::extensions::mojom namespace so if you inside
extensions write just "mojom" it may (depending on what the compiler
knows) end up being resolved wrong.

Better would be if there was no ::mojom namespace so that there
could be no confusion.

Introduced in https://chromium-review.googlesource.com/c/1455472

Change-Id: I19c5a7a6da63db2da8e18c718185ff6769d4f939
Reviewed-on: https://chromium-review.googlesource.com/c/1472610
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632170}
bratell
Too many switches namespaces (jumbo win compile fix)
The existance of both a top level ::switches and sub namespace
switches bite again. Inside accessibility code if you just
say "switches" you will resolve to accessibility::switches
if the compiler knows that namespace exists. In jumbo builds
the compiler knows that so this code broke.

The full fix is to either rename the top level |switches| or all
the sub namespace |switches| and that is a messy change (though it
would bring the code closer to style guide conformance).
Same with the |features| namespace.

The fix here is to make the namespace fully qualified by adding
a :: prefix.

TBR=kbabbitt@microsoft.com,sky@chromium.org

Bug: 928811
Change-Id: Ic593a97c1ef653c9e2df411d84ad0dd9d19c2c89
Reviewed-on: https://chromium-review.googlesource.com/c/1472670
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#632163}
mharanczyk
Fix flakes in ExtensionUpdaterTest.TestMultipleExtensionDownloadingUpdates*.
Change-Id: I24d77ca490b1de3bca747cbaaaa97e19be699445
Reviewed-on: https://chromium-review.googlesource.com/c/1470231
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631718}
bratell
Adding helper functions to create and check for Length variants
Instead of Length(123.45, kFixed) -> Length::Fixed(123.45)
Instead of Length(kAuto) -> Length::Auto()
...

I have a plan to make kAuto and kFixed non-blink-globals (by making
their enum an enum class) but that will make code using those
constants more verbose so to reduce the effect, this patch
greatly reduces the use of those constants by wrapping them in helper
functions.

I believe this also makes the code a little bit more readable but
since it is different it will mean learning something new.

The old way still works.

Change-Id: I1e88be433dc5819e62832522ec90e48a8409ebc3
Reviewed-on: https://chromium-review.googlesource.com/c/1460919
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631634}
fs
Optimize SVGSMILElement::AddInstanceTime
Find the proper spot to insert the new instance time at directly and
insert it there rather than adding it to the end and std::sort'ing.
Inline SortTimeList into the one remaining caller.

Bug: 927232
Change-Id: Ic161cf5f1a1007c62103536c9ad77225579714d7
Reviewed-on: https://chromium-review.googlesource.com/c/1460921
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630634}
fs
Use range-for loops in SVGSMILElement::ParseBeginOrEnd
Also drop some unnecessary SMILTime::Value() accessors (we can store
SMILTimes directly in the HashSet nowadays).

Bug: 927232
Change-Id: I6f9231ea24d7941a708e908602f82d34316c8f7d
Reviewed-on: https://chromium-review.googlesource.com/c/1460923
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630381}
fs
Fix typo in Document::RunPostLayoutTasks enumeration
kRunPostLayoutTasksAsyhnchronously -> kRunPostLayoutTasksAsynchronously

Change-Id: Ice2387d068a38bfcbe6a6fc14b1a35db576fa289
Reviewed-on: https://chromium-review.googlesource.com/c/1460916
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#630299}
bratell
Listing plugin_instance_throttler.h once in BUILD.gn is enough.
Change-Id: Ib42849852e32348385fcb4389e7ddcfb0085cdf3
Reviewed-on: https://chromium-review.googlesource.com/c/1456010
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630069}
wdzierzanowski
Clarify that ProxyDelegate tunnel methods are for HTTP/1.x
Bug: 926427
TBR: tbansal@chromium.org
Change-Id: Ic31bc0c40a1b21c45a3d5a47c13e07255a144234
Reviewed-on: https://chromium-review.googlesource.com/c/1457317
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#630046}
bratell
jumbo + gn analyze workaround: Add sources to |input|
Jumbo, as implemented as a gn template, will naturally hide
the original files behind new files target_jumbo_1.cc,
target_jumbo_2.cc, .... This breaks the gn analyze step which is
used by cq to figure out if it needs to test compile or not.

To give gn analyze a chance to see what is going on, put the original
sources in the merge action's |input| list. The action won't use
the files and it will serialize actions that don't need serializing
but it might be a small price to pay.

There might be unexpected and unwanted side effects from this.
The cleanest solution would be to give gn native jumbo support
which would also allow other changes like better IDE support
and better error messages, but this is what we got.

Bug: 893071
Change-Id: I36aa498795871a63cfcd4e2d27c29e2f59d5ccbb
Reviewed-on: https://chromium-review.googlesource.com/c/1455943
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629971}
mharanczyk
Fix memory leak in ChooserContextBase::GetGrantedObjects.
Bug: 854329
Change-Id: Ia163d503a4207859cd41c847c9d5f67e77580fbc
Reviewed-on: https://chromium-review.googlesource.com/c/1456080
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Cr-Commit-Position: refs/heads/master@{#629919}
bratell
[jumbo] Rename two WebContentsLifetimeHelper in chrome/browser
In some extreme jumbo builds two WebContentsLifetimeHelper classes
ended up in the same translation unit and cause class lookup
problems. To avoid that, this patch gives them unique
(non-imaginative) names.

Bug: 924823
Change-Id: I7a6f6a68430a3bee87595ee4a7319c4a97737a31
Reviewed-on: https://chromium-review.googlesource.com/c/1455902
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#629661}
fs
Make NinePieceImagePainter tiling setup more functional
Use base::Optional to achieve more "functional" semantics of the helper
functions.

Bug: 614125
Change-Id: Ic3a74ec27d3e05dd59041eee4240c0098c6edd8a
Reviewed-on: https://chromium-review.googlesource.com/c/1456002
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629628}
bratell
Correcting path to graphics/dom_node_id.h in BUILD.gn
Change-Id: Ie31066af89cf1e2c1c74d3a63b51d67471c9b3fc
Reviewed-on: https://chromium-review.googlesource.com/c/1456094
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#629614}
mharanczyk
Fix memory leak in TestRenderFrameHost::SimulateCommitProcessed.
Bug: 784904
Change-Id: I29399a9fd75e023b0289216e51eee8033e65d24c
Reviewed-on: https://chromium-review.googlesource.com/c/1454492
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Cr-Commit-Position: refs/heads/master@{#629559}
the_jk
Make asan blacklists optional
Default is still on but the use of blacklists for asan can be
disabled by setting asan_use_blacklist to false.

This is useful for distributed compilers such as icecc where
flags as -fsanitize-blacklist= pointing to a local source file
is not yet supported.

Bug: 818190
Change-Id: I828ada1142ef76ecc0f1ccad8bd41390f0cbceea
Reviewed-on: https://chromium-review.googlesource.com/c/946101
Commit-Queue: Joel Klinghed <the_jk@opera.com>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629534}
fs
Fix repeat spacing for 'border-image's when combined with 'round'
When either of the horizontal/vertical tile rules were 'round', we would
drop any tile spacing.

Bug: 928749
Change-Id: I6128084cdfc9e6b7604fe213d87f71b1e025d012
Reviewed-on: https://chromium-review.googlesource.com/c/1454375
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#629272}
fs
Fix rounding for border-image-width after scaling adjustment
The scaling of the various edges/widths would always round down, which
meant that edges that were supposed to be abutting were not.

Round the scaled width instead, but take care to avoid introducing a new
overlap (which we scaled down to avoid). Use LayoutUnits for this since
we probably want to just compute the widths to LayoutUnit directly in
the future for slightly improved fidelity (TODO added).

Also, fix typo in |include_rigt_edge|.

Bug: 918994
Change-Id: I359fd54d30ddcfa235217e14f340cd6139e9d040
Reviewed-on: https://chromium-review.googlesource.com/c/1452183
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629133}
fs
Fix calc() handling for "nine-piece image quads"
CSSPrimitiveValue::ComputeLength<Length> does not handle a mix of
percentages and non-percentages (treating them all as the latter). The
right function for that is ConvertToLength. However, since we're
handling <length-percentage> | auto here (after checking for <number>),
just forward to StyleBuilderConverter::ConvertLengthOrAuto.

This should fix all the properties that use the CSSQuadValue
representation for nine-piece images and have a <length-percentage>
in their syntax (border-image-width and -webkit-mask-box-image-width).

Bug: 918994
Change-Id: Ic29c8ec023d29d1e64eca2e0372e9e90611bbe73
Reviewed-on: https://chromium-review.googlesource.com/c/1451978
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#629078}
the_jk
Avoid crashing on Android devices with only 256 MB RAM.
On Android:
max_blob_in_memory_space is calculated as 1% of total RAM
min_page_file_size is hardcoded to 2.5MB

If 2.5MB > 1% of total RAM the CHECK(limits.isValid()) fails.
Avoid that by allowing max_blob_in_memory_space to be at least
min_page_file_size regardless of amount of physical memory.

R=dmurph@chromium.org, jianli@chromium.org, mek@chromium.org

Change-Id: I6fe9717affeb4bffbcb094e264cde57314b1535f

Bug: 841667
Change-Id: I6fe9717affeb4bffbcb094e264cde57314b1535f
Reviewed-on: https://chromium-review.googlesource.com/c/1448454
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628700}
bratell
Have jumbo dump the original sources in the gn |data| variable
Jumbo, as implemented as a gn template, will naturally hide
the original files behind new files target_jumbo_1.cc,
target_jumbo_2.cc, .... This breaks the gn analyze step which is
used by cq to figure out if it needs to test compile or not.

There might be unexpected and unwanted side effects from this.
The cleanest solution would be to give gn native jumbo support
which would also allow other changes like better IDE support
and better error messages, but this is what we got.

Bug: 893071
Change-Id: Ibbe8ccd71c932ca4c28c3157e386530d1ae00965
Reviewed-on: https://chromium-review.googlesource.com/c/1268336
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#628598}
fs
Update bug# for external/wpt/css/css-backgrounds/border-image-width-008.html
TBR=eae@chromium.org

Bug: 767352, 890543
Change-Id: I6202d0ba5b71baac213c24f18c388e5845e7348f
Reviewed-on: https://chromium-review.googlesource.com/c/1450191
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#628355}
bratell
Compiling headless_shell_switches.cc once should be enough
In Windows (multi dll) builds, headless_shell_switches.cc was
compiled twice and with some timings and linkers, that cause
a duplicate symbol link error. In other cases one set of symbols
was discarded as unused before the link errors.

This setup was probably triggered by several build target
(headless_renderer, headless_shell_browser_lib,
headless_shell_child_lib and more) being compiled as if they
were inside headless.dll in component builds. That prevented
them from actually accessing the switches inside headless.dll.

The fix is to only compile headless.dll ("component headless")
with HEADLESS_IMPLEMENTATION, which controls HEADLESS_EXPORT,
and to not have a duplicate copy of the switches in
headless_shell_browser_lib.

Bug: 919231
Change-Id: Id0d5cade84b47b9053474a26a1b14723c576d346
Reviewed-on: https://chromium-review.googlesource.com/c/1440141
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628335}
bratell
Support jumbo builds in the safe_browsing code (-6 CPU minutes)
Compiling the safe_browsing code is currently about 1% of the total
build effort in a jumbo build, and most of that effort can be
eliminated by adding support for jumbo in the safe_browsing code.

The gain would be a little bit bigger if the code hadn't been split
into a lot of 1-2 file targets. Those are not made jumbo since the
gain from merging just 2 files is limited, and merging just one file
makes no sense.

Bug: 927338
Change-Id: I0e8f57bdb1b39fc2f85a8adb4b00b3790d59d987
Reviewed-on: https://chromium-review.googlesource.com/c/1448455
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#628279}
fs
Hoist/fold GraphicsContext::DrawTiledImage (border-image version)
Folds the "border-image version" of GraphicsContext::DrawTiledImage into
NinePieceImagePainter. This should hopefully allow for better control of
tiling computations, and also seems like a better place from a layering
perspective.

The computation of <scale, phase, spacing> is refactored into a new
function ComputeTileParameters.

Switch from using Image::TileRule to using ENinePieceImageRule (the
style type), and remove the former since it is no longer used.

Bug: 614125
Change-Id: Ia7433f871bb0bc6f7f963a14ae49b898559860d2
Reviewed-on: https://chromium-review.googlesource.com/c/1448612
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628278}
fs
Hoist/fold GraphicsContext::DrawTiledImage (background-image version)
Folds the "background-image version" of GraphicsContext::DrawTiledImage
into BoxPainter(Base). Mostly a verbatim move of said method and
Image::DrawTiledBackground (the real "meat") an the associated helpers.

This also introduces the intended replacement (for versions of this
method): GraphicsContext::DrawImageTiled.

Calls to StartAnimation are moved into the implementations of
Image::DrawPattern as needed.

Bug: 614125
Change-Id: Ib04daa5abce9c61c12f4a8297920ea25760557cf
Reviewed-on: https://chromium-review.googlesource.com/c/1448458
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628136}
mharanczyk
Make ProxyDelegate work in TestURLRequestContext.
Bug: 915659
Change-Id: Ib277ee462b14fbeba96b065149ea413461a51cda
Reviewed-on: https://chromium-review.googlesource.com/c/1448154
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#627965}
bratell
Allow test() build targets with no deps
A test() target with no deps (maybe only public_deps or no
deps at all) would fail to compile on android because of
a "deps += [...]" statement.

Bug: 927257

Change-Id: I7fa3172a1f9cdca146800b8f81b965cfd46f81e9
Reviewed-on: https://chromium-review.googlesource.com/c/1443016
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#627962}
bratell
Adapt ui/libgtkui to jumbo compilation and add jumbo support
This moves a duplicated GetGtkSettingsStringProperty to
gtk_util.cc and renames two EnsureMethodsLoaded so that they
don't clash when jumbo compiled.

Jumbo is a Chromium implementation of a unity build system, a
build where many cc files are compiled in a single unit
(translation unit). This can make compilations much faster but
adds a bit of latency and reduces the parallelism.

Jumbo in this code saves about 1 CPU minute (which is not much)
so it's mostly for completion and because I've had the patch
for a long time.

Bug: 803406
Change-Id: Ib3b855d81ea45743568f8b247731f70d8bc659d6
Reviewed-on: https://chromium-review.googlesource.com/c/1446218
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#627873}
fs
Call ResetAnimation synchronously in ImageResource::AllClientsAndObserversRemoved
Running ResetAnimation asynchronously gives the "wake-up timer" used by
the SMIL animation engine an opportunity to race with the actual
sweeping of the surrounding objects (ImageResourceContent, SVGImage with
contained Page). Said sweeping could thus take place when the handler
for the "wake-up timer" was running, leading to UAFs. Running
ResetAnimation synchronously stops the "wake-up timer" and prevents the
race.

This essentially reverts the workaround added by
r400934 (crbug.com/613709). After the change made by
r412798 (crbug.com/627418), the issue worked around - that the SMIL
animation engine could be re-entered via the ResetAnimation call during
GC - have been eliminated. (Now, after said CL, what
SVGImage::ResetAnimation does is to pause the animation, stopping all
timers, and set a flag that the animation state needs to be reset. The
resetting then happens later as needed.)

Bug: 924450
Change-Id: Ideef98f05c81d779950aac56506cbbe152762afa
Reviewed-on: https://chromium-review.googlesource.com/c/1445935
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#627431}
bratell
Add jumbo support for blink's controller module.
This is more to make all blink do the same, than for the compile
time win which is probably about a CPU minute.

Bug: 713137
Change-Id: I99b05fcf7d639deb331d5a13e974abcdefd3a67d
Reviewed-on: https://chromium-review.googlesource.com/c/1443116
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#627369}
bratell
Drop "using namespace" in base/allocator
The code style guide does not allow "using namespace" and they
have a tendency to cause problems with jumbo builds. This patch
removes a "using namespace" in base.

Change-Id: I6b97574d6348e1b8df537708e99d89b97d6fc75e
Reviewed-on: https://chromium-review.googlesource.com/c/1443018
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#627356}
bratell
Delete unused BUILD.gn file in blink/renderer/bindings
Change-Id: Id4be15169850ae2347bd9f6e7bdfbcd12c466383
Reviewed-on: https://chromium-review.googlesource.com/c/1443114
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#627036}
bratell
Add safe_browsing:test_support dependency to fix flaky build
Builds could fail because safe_browsing:test_support
indirectly (via safe_browsing_service.h and
components/safe_browsing/db/util.h) depends on a generated
header file. Adding a dependency on the target containing
safe_browsing_service.h should prevent that error.

Example failed build:
https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux-rel/3142

Change-Id: Icf5e29ba57686fa20d9c4f52ea20ed090897f372
Reviewed-on: https://chromium-review.googlesource.com/c/1439256
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Reviewed-by: Daniel Rubery <drubery@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#626735}
bratell
Fix gfx related shadowing warnings in blink/platform
A long term plan is to support -Wshadow in the code, which both might avoid
coding mistakes and reduce the risk of jumbo-specific build problems. This
fixes about half the shadowing problems in blink/platform, the half
that is related to gfx.

Bug: 925310

Explicit warnings this patch fixes:

third_party/blink/renderer/platform/geometry/region.cc:45:33: error: declaration shadows a local variable [-Werror,-Wshadow]
                                    end = shape_.SegmentsEnd(span);
third_party/blink/renderer/platform/geometry/region.cc:39:56: note: previous declaration is here
  for (Shape::SpanIterator span = shape_.SpansBegin(), end = shape_.SpansEnd();
                                                       ^
third_party/blink/renderer/platform/geometry/region.cc:80:33: error: declaration shadows a local variable [-Werror,-Wshadow]
                                end = shape_.SegmentsEnd(span);
                                ^
third_party/blink/renderer/platform/geometry/region.cc:69:56: note: previous declaration is here
  for (Shape::SpanIterator span = shape_.SpansBegin(), end = shape_.SpansEnd();
                                                       ^
third_party/blink/renderer/platform/geometry/region.cc:110:33: error: declaration shadows a local variable [-Werror,-Wshadow]
                                end = shape_.SegmentsEnd(span);
                                ^
third_party/blink/renderer/platform/geometry/region.cc:105:56: note: previous declaration is here
  for (Shape::SpanIterator span = shape_.SpansBegin(), end = shape_.SpansEnd();
                                                       ^
third_party/blink/renderer/platform/geometry/region.cc:337:33: error: declaration shadows a local variable [-Werror,-Wshadow]
                                end = SegmentsEnd(span);
                                ^
third_party/blink/renderer/platform/geometry/region.cc:332:49: note: previous declaration is here
  for (Shape::SpanIterator span = SpansBegin(), end = SpansEnd(); span != end;
                                                ^
third_party/blink/renderer/platform/geometry/region.cc:465:11: error: declaration shadows a local variable [-Werror,-Wshadow]
      int test = *s1 - *s2;
          ^
third_party/blink/renderer/platform/geometry/region.cc:435:9: note: previous declaration is here
    int test = spans1->y - spans2->y;
        ^
third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc:144:7: error: declaration shadows a variable in namespace 'blink::(anonymous)' [-Werror,-Wshadow]
  int next_async_mutation_id = GetNextAsyncMutationId();
      ^
third_party/blink/renderer/platform/graphics/animation_worklet_mutator_dispatcher_impl.cc:24:5: note: previous declaration is here
int next_async_mutation_id = 0;
    ^
third_party/blink/renderer/platform/graphics/compositing/content_layer_client_impl.cc:72:10: error: declaration shadows a local variable [-Werror,-Wshadow]
    auto it = context.rendering_context_map.find(rendering_context);
         ^
third_party/blink/renderer/platform/graphics/compositing/content_layer_client_impl.cc:44:8: note: previous declaration is here
  auto it = context.transform_id_map.find(transform);
       ^
third_party/blink/renderer/platform/transforms/interpolated_transform_operation.cc:59:31: error: declaration shadows a field of 'blink::InterpolatedTransformOperation' [-Werror,-Wshadow]
    const TransformOperation* from,
                              ^
third_party/blink/renderer/platform/transforms/interpolated_transform_operation.h:84:29: note: previous declaration is here
  const TransformOperations from;
                            ^
third_party/blink/renderer/platform/transforms/interpolated_transform_operation.cc:60:12: error: declaration shadows a field of 'blink::InterpolatedTransformOperation' [-Werror,-Wshadow]
    double progress,
           ^
../../third_party/blink/renderer/platform/transforms/interpolated_transform_operation.h:90:10: note: previous declaration is here
  double progress;
         ^
third_party/blink/renderer/platform/transforms/transform_operations.cc:246:20: error: declaration shadows a local variable [-Werror,-Wshadow]
      FloatPoint3D to_point = point - origin;
                   ^
third_party/blink/renderer/platform/transforms/transform_operations.cc:218:16: note: previous declaration is here
  FloatPoint3D to_point = to_matrix.MapPoint(point);
               ^
third_party/blink/renderer/platform/transforms/transform_operations.cc:418:21: error: declaration shadows a local variable [-Werror,-Wshadow]
        for (size_t i = 0; i < 2; ++i) {
                    ^
third_party/blink/renderer/platform/transforms/transform_operations.cc:312:12: note: previous declaration is here
  for (int i = size - 1; i >= 0; i--) {
           ^
third_party/blink/renderer/platform/transforms/interpolated_transform_operation.cc:60:12: error: declaration shadows a field of 'blink::InterpolatedTransformOperation' [-Werror,-Wshadow]
    double progress,
           ^
../../third_party/blink/renderer/platform/transforms/interpolated_transform_operation.h:90:10: note: previous declaration is here
  double progress;
         ^
third_party/blink/renderer/platform/transforms/interpolated_transform_operation.cc:60:12: error: declaration shadows a field of 'blink::InterpolatedTransformOperation' [-Werror,-Wshadow]
    double progress,
           ^
../../third_party/blink/renderer/platform/transforms/interpolated_transform_operation.h:90:10: note: previous declaration is here
  double progress;

Change-Id: I57a663a9492d729d95fca02e2fa8027c235ad2f8
Reviewed-on: https://chromium-review.googlesource.com/c/1436365
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#626529}
bratell
Use Length::Is* functions instead of Length::GetType()
It makes the code more readable and reduces the amount of code
exposed to enum LengthType which will simplify future changes
of it.

Bug: 925310
Change-Id: Ie8e710086abdda2058535ea4ccf7d77871725fec
Reviewed-on: https://chromium-review.googlesource.com/c/1437633
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#626517}
wdzierzanowski
Allow CustomProxyConfig to apply to non-idempotent methods
It is a property of the Data Reduction Proxy that requests using
non-idempotent methods must never be proxied.  Other CustomProxyConfig
providers should be allowed to assume the proxy handles the
non-idempotent case correctly.

Change-Id: I3b31e3c9567e10ccd746541f2f1d46312356f14a
Reviewed-on: https://chromium-review.googlesource.com/c/1385145
Reviewed-by: Eric Roman <eroman@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#626033}
bratell
Deduplicate copied code in Android memory usage accounting
A big helper function was present both in newly added code and
in older code and that prevented jumbo compilation of
blink's controller (not yet enabled on master). This CL
deduplicates the code, and to not add the helper function
to to public API, makes it a private static member, with a
friend declaration that allows the other class to use it.

Bug: 920922
Change-Id: Ib24a2d9438a3e73c3f11276bb703516f67e75c23
Reviewed-on: https://chromium-review.googlesource.com/c/1433248
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#626025}
fs
Remove dead code in BoxPainterBase::PaintNormalBoxShadow
Dead since fd75e9942198e2f00d5713ab7bd44c12b0f3cab2.

Change-Id: I6490435071e027119a27cfcd29f99845c6769d9d
Reviewed-on: https://chromium-review.googlesource.com/c/1434354
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625779}
bratell
Fix variable shadowing in ui/gfx and enable the warning
Attempts to use ui/gfx code in content failed because of
variable/enum shadowing. The main problem is fixed in
https://chromium-review.googlesource.com/c/chromium/src/+/1424799

This fixes the remaining problems and enables the shadowing
warning to prevent future problems of the same kind. All the
problems are of the trivial kind, with inner blocks reusing
either the name of a variable or the name of an argument,
be it |cluster|, |font|, |i|, |path|, |alpha| or |line|. In one
case the fix was to delete an unused local variable.

Bug: 923078,794619
Change-Id: Iae8bb768c49332cbe610860e06fea9d7aebc7a4b
Reviewed-on: https://chromium-review.googlesource.com/c/1421104
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625635}
bratell
Rename new ResourceType->CanvasResourceType since ResourceType exists
third_party/blink/renderer/platform/loader/fetch/fetch_context.h
defines a blink::ResourceType enum which, if it's known by the
compiler, prevents the new code in canvas_resource_provider.cc
from compiling.

In some extreme jumbo builds, the compiler knows about
third_party/blink/renderer/platform/loader/fetch/fetch_context.h
when compiling that file and the compilation fails because
symbol lookup is ambiguous.

This renames the enum back to CanvasResourceType just to get
all the builds happy again.

Bug: 920626
Change-Id: I746325ede29cbb3fba5c9790b12af0b8925c81e3
Reviewed-on: https://chromium-review.googlesource.com/c/1433239
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#625606}
bratell
Remove potential hang+timeout from _nocompile tests
If output buffers got full while running the tests, the
script would hang, polling the process forever and it would never
return a return_code from proc.poll().

This might have caused some random timouts but if so, it is
unclear what 64 KB output filled up the buffers, unless the buffers
were smaller than local testing would indicate.

This stores stdout and stderr in temporary files and reads those
files back into memory after the process has finished.

Bug: 882852
Change-Id: I4e6ace2bb783fadcde3f43643ccad03c58ef519a
Reviewed-on: https://chromium-review.googlesource.com/c/1425736
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625603}
fs
Make SameSizeAsComputedStyle model reality better
Make a separate SameSizeAsComputedStyleBase struct and inherit from that
instead of composing.
Make sure the access specifiers match (so that for instance the reference
counter will place in the correct spot in the layout).

So the layout changes like:

 *** Dumping AST Record Layout
          0 | struct SameSizeAsComputedStyle
-         0 |   class RefCounted<SameSizeAsComputedStyle> (base)
-         0 |     uint32_t ref_count_
-         8 |   struct SameSizeAsComputedStyle::ComputedStyleBase base_
-         8 |     void *[7] data_refs
-        64 |     unsigned int [4] bitfields_
+         0 |   struct SameSizeAsComputedStyleBase (base)
+         0 |     void *[7] data_refs
+        56 |     unsigned int [4] bitfields
+        72 |   class RefCounted<SameSizeAsComputedStyle> (base)
+        72 |     uint32_t ref_count_
         80 |   void *[1] own_ptrs
         88 |   void * data_ref_svg_style
            | [sizeof=96, dsize=96, align=8,

And to exemplify with the change to field from [1], the change to the
SameSize... structs will be:

          0 | struct blink::SameSizeAsComputedStyle
          0 |   struct blink::SameSizeAsComputedStyleBase (base)
          0 |     void *[7] data_refs
-        56 |     unsigned int [4] bitfields
+        56 |     unsigned int [5] bitfields
-        72 |   class RefCounted<SameSizeAsComputedStyle> (base)
-        72 |     uint32_t ref_count_
+        76 |   class RefCounted<SameSizeAsComputedStyle> (base)
+        76 |     uint32_t ref_count_
         80 |   void *[1] own_ptrs
         88 |   void * data_ref_svg_style
            | [sizeof=96, dsize=96, align=8,

rather than:

          0 |     uint32_t ref_count_
          8 |   struct SameSizeAsComputedStyle::ComputedStyleBase base_
          8 |     void *[7] data_refs
-        64 |     unsigned int [4] bitfields_
+        64 |     unsigned int [5] bitfields_
-        80 |   void *[1] own_ptrs
+        88 |   void *[1] own_ptrs
-        88 |   void * data_ref_svg_style
+        96 |   void * data_ref_svg_style
-           | [sizeof=96, dsize=96, align=8,
+           | [sizeof=104, dsize=104, align=8,
-           |  nvsize=96, nvalign=8]
+           |  nvsize=104, nvalign=8]

Note primarily the layout of |ref_count_| from RefCounted<>.

(Layout data courtesy of 'clang++ -fdump-record-layouts', with slight
edits for improved readability.)

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1421188

Change-Id: I5f34a9bcdf86e3ddb8488bb14e531bba694c919b
Reviewed-on: https://chromium-review.googlesource.com/c/1430010
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Javier Fernandez <jfernandez@igalia.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#625602}
bratell
Add ajwong and wychen as owners of tools/nocompile_driver.py
Per request by current owner thakis.

Change-Id: Ie5418521d4ada0e21ea6b2b852b8ab7d3abbcaf6
Reviewed-on: https://chromium-review.googlesource.com/c/1430091
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#625590}
bratell
Fix shadowing between gfx::ITALIC and gfx::Font::ITALIC
With the shadowing warning enabled and a sufficiently new clang, there
will be warnings about gfx::Font::ITALIC (and STRIKE and UNDERSCORE)
shadowing gfx::ITALIC, coming from the enum gfx::TextStyle. To prevent
that shadowing, this renames the gfx enum values TEXT_STYLE_*,
including a new name, TEXT_STYLE_COUNT, for what would otherwise be
TEXT_STYLE_NUM_TEXT_STYLES.

This shadowing problem currently prevents content (where the shadowing
warning is already enabled) from using these headers together.

Fixes to other shadowing problems, including enabling the shadow
warning, will come in
https://chromium-review.googlesource.com/c/chromium/src/+/1421104
after this has landed.

Bug: 923078,794619
Change-Id: I3018054f06a2fd2dc04cc4e0e72e5a0d641e99c5
Reviewed-on: https://chromium-review.googlesource.com/c/1424799
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#625230}
bratell
[jumbo] Give two kBackgroundColor in chrome/.../views unique names
In jumbo builds, many files are compiled in the same translation
unit and then they also share the same anonymous namespace. Then
it becomes a problem (does not compile) if several constants/
symbols are named the same.

This follows earlier patterns of giving shared generic names
prefixes.

Bug: 918788

Change-Id: If45d63b9bfe77119735c67fca491a6227dded045
Reviewed-on: https://chromium-review.googlesource.com/c/1424842
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#625147}
mharanczyk
Fix memory leaks in content settings introduced by linked_ptr removal.
Bug: 556939, 914453
Change-Id: Ibd8757967a051507e0fc2a9ae93ac789e51b005b
Reviewed-on: https://chromium-review.googlesource.com/c/1425708
Reviewed-by: Jun Mukai <mukai@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Cr-Commit-Position: refs/heads/master@{#625144}
mharanczyk
Fix memory leaks in TtsControllerTest.
Bug: 517317
Change-Id: I85ebdbf5dd8ae98ce829abe3cf87e55779924559
Reviewed-on: https://chromium-review.googlesource.com/c/1425715
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624828}
fs
Remove dead RoundedMinimumValueForLength
Last use was removed in ae49f5caf2943049acab4abe802e82c8dc001184.

Change-Id: I226e8d7a629148d5c3cd869cf31f48cf909662bb
Reviewed-on: https://chromium-review.googlesource.com/c/1421997
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#624542}
wdzierzanowski
Expose CONNECT headers to ProxyDelegate
This brings back (slightly refreshed versions of) the
OnBeforeTunnelRequest(), OnTunnelHeadersReceived() hooks that were
removed in
https://chromium-review.googlesource.com/c/chromium/src/+/846261/.

These hooks are not used by the Data Reduction Proxy, because it
doesn't proxy https:// URLs.  They are restored for the benefit of those
downstream embedders (Opera) that use CONNECT tunnels to proxy HTTPS
requests.

Bug: 915659
Change-Id: Id0e120882a22a66c72802087a1775daeef661984
TBR: rockot@google.com
Reviewed-on: https://chromium-review.googlesource.com/c/1379766
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624075}
bratell
Remove team list that was listed as reviewer in wpt/workers/OWNERS
R=foolip@chromium.org

Change-Id: I97a3bb19a458a4114c1541ea4aaa790bb849bbca
Reviewed-on: https://chromium-review.googlesource.com/c/1407074
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#623273}
fs
Reland "Avoid copying Lengths (non-layout uses)"
This reverts commit ae5e5a5785d23ad6ca824b1ff399fe31b9060b77.

Reason for revert: The cause for the link failure is unknown but not the fault of the CL. (See for example https://crbug.com/921967 for similar failures.)

Original change's description:
> Revert "Avoid copying Lengths (non-layout uses)"
> 
> This reverts commit 784f852591a08f9bce6005cbb1df682cc5608af0.
> 
> Reason for revert: Causes link failures on Android FYI Release (Nexus 6P)
> 
> Original change's description:
> > Avoid copying Lengths (non-layout uses)
> > 
> > Copying/assigning a Length is not just a trivial copy, so when possible,
> > use a const Length& to avoid making a copy (saving some small bit of
> > footprint and hopefully a few CPU cycles too).
> > 
> > Change-Id: I8bcf5c6e6b99027110a20b1ef95d5f6607673ddc
> > Reviewed-on: https://chromium-review.googlesource.com/c/1411919
> > Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
> > Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#623209}
> 
> TBR=fs@opera.com,mstensho@chromium.org
> 
> Change-Id: Ifd8aad2dc3c78703a7f544564417ceb15cddcdda
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/1414993
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#623248}

TBR=fs@opera.com,cwallez@chromium.org,mstensho@chromium.org

Change-Id: Id247820a5c902209354452d495537ab02efb7605
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/1414939
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#623251}
fs
Simplify LayoutBox::ComputeLogicalWidth's replaced logical width setup
No need to create a temporary Length here, just use a LayoutUnit. We
can also fold the call to ComputeReplacedLogicalWidth() into the two
points that use it.

Change-Id: I0f5ca8c02ab79f3fb126c77acee83751f06202a1
Reviewed-on: https://chromium-review.googlesource.com/c/1414890
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623210}
fs
Avoid copying Lengths (non-layout uses)
Copying/assigning a Length is not just a trivial copy, so when possible,
use a const Length& to avoid making a copy (saving some small bit of
footprint and hopefully a few CPU cycles too).

Change-Id: I8bcf5c6e6b99027110a20b1ef95d5f6607673ddc
Reviewed-on: https://chromium-review.googlesource.com/c/1411919
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623209}
fs
Avoid copying Lengths (in layout sans NG)
Copying/assigning a Length is not just a trivial copy, so when possible,
use a const Length& to avoid making a copy (saving some small bit of
footprint and hopefully a few CPU cycles too).

Change-Id: Idd1633b4198a8af62c46c27c36751e7961eb356f
Reviewed-on: https://chromium-review.googlesource.com/c/1411693
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#622959}
fs
[LayoutNG] Avoid copying Lengths
Copying/assigning a Length is not just a trivial copy, so when possible,
use a const Length& to avoid making a copy (saving some small bit of
footprint and hopefully a few CPU cycles too).

Change-Id: Ib802f8e26c061e77bc8c0d8487a9dc8a8afe130b
Reviewed-on: https://chromium-review.googlesource.com/c/1411921
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622834}
bratell
Resolve another collision between Win32 and atomicops MemoryBarrier
Windows defines a MemoryBarrier macro which clashes with a MemoryBarrier
construct in base/atomicops.h. Depending on the order of includes,
various code can be affected. Currently the Windows jumbo builder is broken
in ppapi/proxy because of a sequence of
1. include base/atomicops.h  (undefs Memorybarrier which does nothing)
2. include ppapi_messages.h -> base/sync_socket.h -> windows.h
(Now MemoryBarrier is a macro)
3. include gpu/command_buffer/common/command_buffer_shared.h ->
3a  -> include base/atomicops.h (does nothing because include guards)
3b  -> uses base::subtle::MemoryBarrier which is a macro and poof.

Normally the undef MemoryBarrier is near the Windows.h include but
it's tricky to put in base since there is also code that needs the
macro so undeffing it in too generic code can make things worse.

Technically this was triggered by the removal of the PPB_compositor
APIs but only because the jumbo chunks changed when files were deleted.

Change-Id: I06940cadd2ad30d8698199a72cc91e36e8346b50
Reviewed-on: https://chromium-review.googlesource.com/c/1409520
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#622812}
bratell
Let jumbo builders be more like all other trybots.
This also affects the fyi builders. Is that a problem?

Change-Id: I9195bb71127162204712082292ea6556cda415ab
Reviewed-on: https://chromium-review.googlesource.com/c/1340327
Reviewed-by: Stephen Martinis <martiniss@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#622519}
bratell
Add some ATK version number checks on new ATK members.
Ubuntu 16.04 LTS still has an old version of atk (2.18.0) so
to be able to build on Ubuntu 16.04 without a sysroot, this
adds version checks for some of the new relations:
ATK_RELATION_DETAILS, ATK_RELATION_DETAILS_FOR,
ATK_RELATION_ERROR_MESSAGE and ATK_RELATION_ERROR_FOR.

Bug: 915453
Change-Id: I1ee0a4d0edcb128e225579138aa65df0b0f307db
Reviewed-on: https://chromium-review.googlesource.com/c/1409445
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Martin Robinson <mrobinson@igalia.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#622508}
bratell
Get chromium's major version directly instead of parsing strings
Getting Chromium's version is not trivial in code and some code
got the version string dynamically during runtime and parsed it.
Since several files defined the same helper function
GetCurrentMajorVersion, those clashed in some extreme
jumbo builds. This drops this function and instead gets the
version directly from the version system via a C/C++ define.

Since the version number now will be compiled into autofill,
it will have to recompile if the major version number changes.

Bug: 907570
Change-Id: I5823d977f3ff58c4b19f173c01031d4a9aa5c56c
Reviewed-on: https://chromium-review.googlesource.com/c/1409548
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#622490}
fs
Reduce the size of execution_context.h
execution_context.h is used in 4400+ compilation units. This reduces
its pre-processed size by ~1.1M.

The referrer_policy.mojom-shared.h include was added by
https://crrev.com/611587.

Bug: 242216, 860403
Change-Id: I5cdcbf17f05a6b121672f7fa9263f098a6450ee5
Reviewed-on: https://chromium-review.googlesource.com/c/1408970
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#622488}
bratell
Fixing the spelling of mmenke@chr in net/log/OWNERS
R=mmenke@chromium.org

Change-Id: I34db82f8d15864eab67c6cd7dd6490ebac31ec02
Reviewed-on: https://chromium-review.googlesource.com/c/1407004
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#622058}
fs
Remove some includes of console_message.h in central headers
Remove the (unneeded) includes of console_message.h from
core/dom/document.h and core/execution_context/security_context.h.

This should for instance avoids indirectly including dom_node_ids.h
more than needed.

This will hopefully improve compilation speed a little bit, for
some people.

Bug: 242216
Change-Id: I775478624933833981c0f9ccd28e82e1bf815e00
Reviewed-on: https://chromium-review.googlesource.com/c/1406974
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#622027}
bratell
Fix owner email typo in tools/gn/bootstrap/OWNERS
R=thakis@chromium.org

Change-Id: I60faf240e3335bba2a4258c1677b07fb892e9b69
Reviewed-on: https://chromium-review.googlesource.com/c/1407075
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#622026}
fs
Stop including node_computed_style.h in element_resolve_context.h
78cf9afa7b11d20e90bbe4838970ae13778a0f3c added this include, as well as
an 'inline' keyword on the declaration of the methods in it.
Undo this to avoid ballooning the files downstream of
element_resolve_context.h.

Fix the fallout which is all due to missing includes of
platform/wtf/functional.h.

Bug: 242216

Change-Id: Iae7d8aa96c043e76a12d3fb76972730e70113c8c
Reviewed-on: https://chromium-review.googlesource.com/c/1406247
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#621988}
bratell
Fix gpu service macro to be correct and identical to other macro
In jumbo builds there was a build error because
one LOCAL_CLEAR_REAL_GL_ERRORS was different from another one.
That was because there was a typo in one of them so this
fixes the typo. Better would probably be to merge them into a header.

Change-Id: Ia2e54fe58479e30236edd6bb20d358ceae9e527b
Reviewed-on: https://chromium-review.googlesource.com/c/1377425
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#621750}
fs
Eliminate some Persistent<>s in BorderImage*::InitialValue
Add a CSSQuadValue::Create that takes one value, and uses that for all
the four values (top, right, bottom, left), and use that to eliminate
some static Persistent<...>s.

Change-Id: I8e56dac6e70e37b096f40259e4e5c621ae20713c
Reviewed-on: https://chromium-review.googlesource.com/c/1402805
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#621529}
fs
Remove redundant calls to PaintFlags::setAntiAlias
In most of these cases we use GraphicsContext::FillFlags - which
will already have the value returned by GraphicsContext::ShouldAntialias
set.
In the remaining case we copy the flag from the PaintFlags which
we made a copy of already.

Change-Id: I25fe7f578017c215cd8950aa3a74b2664bf29615
Reviewed-on: https://chromium-review.googlesource.com/c/1403456
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#621263}
fs
Clean up SVGSMILElement::FindInstanceTime
Use lambdas and iterators, handling the case where an instance time
equal to the request time is not a valid result in the predicate passed
to std::lower_bound().

There's theoretically a change in behavior where (for 'begin' times), we
could previously have returned the magic 'indefinite' value after
looking for the next larger instance time.

Change-Id: I5e51c85298530548c6527116086355b00ea7ad3d
Reviewed-on: https://chromium-review.googlesource.com/c/1400822
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#621236}
fs
Use separate PaintFlags for the spaced tile shader
We would setup the tile shader using the same PaintFlags that we had
(partially) set up for the actual image draw. This meant that we'd draw
the shader picture using the same blend mode, which could easily end up
yielding nothing.

Set up a "fresh" PaintFlags for the tile shader as needed instead, using
only flags relevant for the shader.

Bug: 919637
Change-Id: Id141daca481ce3f90ed0c1f44c801eafcef5964b
Reviewed-on: https://chromium-review.googlesource.com/c/1401045
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#621188}
bratell
Resolve namespace ambiguity between blink::features and ::features
Inside the blink namespace, "features" can refer to either
::features or ::blink::features depending on what the computer knows.
That is why the code style guide don't want there to be sub
namespaces with the same name as top level namespaces.

This ambiguity broke some jumbo build configurations. An option
is to rename ::blink::features to something like
::blink::web_features (or ::blink::blink_features) but that is
a large operation so this patch just adds a ::prefix to
clarify what namespace is intended.

Change-Id: I3c2279e6a141de73efb4e6c4a0f6e2c6da48c61f
Reviewed-on: https://chromium-review.googlesource.com/c/1403117
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#621152}
bratell
Remove unused SurfaceTextureGLOwner::texture_id_
Some jumbo builds broke because of unused class member triggering
a compiler warning. That a class member is unused might sometimes
not be noticed in normal builds because the compiler doesn't have
access to the source of all class methods.

Bug: 892490

Change-Id: I733ec2d36be4639d49ea692b3d490da206215522
Reviewed-on: https://chromium-review.googlesource.com/c/1400824
Reviewed-by: Frank Liberato <liberato@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#621089}
bratell
Remove the ::media::gpu namespace which conflicted with ::gpu
We should not have sub namespace with the same name as top level
namespaces since that causes name lookup conflicts. ::media::gpu
in particular was only used by a single function, and I'm sure
it will be fine in ::media instead, saving us from having to
write ::gpu everywhere.

This broke the build in certain jumbo build configurations.

Bug: 910590

Change-Id: Ic735dedfe39485ec5f2bd0d0adcce22fa12ec951
Reviewed-on: https://chromium-review.googlesource.com/c/1400823
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#621088}
fs
Ignore instance times from endElement*() for inactive timed elements
When endElementAt()/endElement() is trying to add a new instance time
and there's no active interval, just ignore the new instance time.

Spec:

  "While the element is not active, any end specification of the
   event is ignored."

(https://www.w3.org/TR/2001/REC-smil-animation-20010904/#Timing-EventSensitivity)

Bug: 241742
Change-Id: Ic3333698ac275eff32bd87f5e0205c1004c3e2d4
Reviewed-on: https://chromium-review.googlesource.com/c/1400663
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#620752}
tmoniuszko
Handle missing anchor positions for BubbleBorder bounds calculation
Bug: 918516
Change-Id: Id97aac57ef7e4bc64e312712068d8500f1d2f4e2
Reviewed-on: https://chromium-review.googlesource.com/c/1386432
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619602}
fs
Move 'contain: size' handling for replaced content
For Legacy layout, hoist the check for size containment out to
ComputeIntrinsicSizingInfoForReplacedContent, since this is the "real"
entrypoint.
For NG, put the check in NGLayoutInputNode::IntrinsicSize.

This also makes ComputeIntrinsicSizingInfo slightly more focused on
computing the intrinsic dimensions, and avoids calling it at all if
the box is subject to size containment.

Bug: 917018
Change-Id: I0e3fdc48e9c5a104cadaa253cb7cef23fdc42ece
Reviewed-on: https://chromium-review.googlesource.com/c/1386849
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Aleks Totic <atotic@chromium.org>
Reviewed-by: Manuel Rego <rego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#618496}
fs
Simplify some has-multiple-boxes conditions in InlineFlowBoxPainter
We can use the |object_has_multiple_boxes| argument here.

Change-Id: I4e20b5e8d1af9efa8b32a13a8be1cde6ec0be1c1
Reviewed-on: https://chromium-review.googlesource.com/c/1386790
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#618263}
fs
Remove unused SkBlendMode arguments in *Box*Painter*
These argument are always SkBlendMode::kSrcOver, and are not used in the
end.

Change-Id: I1625bdced4601b3eec3de609063f331208282b0d
Reviewed-on: https://chromium-review.googlesource.com/c/1386789
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#618256}
fs
Remove duplicate TestExpectations entries
TBR=verwaest@chromium.org,jgruber@chromium.org

Bug: 855009, 916975
Change-Id: I1bf43a418707c064ca902f888161f91c278d91f0
Reviewed-on: https://chromium-review.googlesource.com/c/1386786
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#618222}
bratell
[jumbo] Two blink tests used kViewportWidth in a way that clashed
This moves two kViewportWidth and two kViewportHeight into
tighter scopes to reduce risk for future clashes in jumbo builds.

Change-Id: I7527018809a4bf62b8e831e18235327b11a95f29
Reviewed-on: https://chromium-review.googlesource.com/c/1386149
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#618168}
bratell
[jumbo] Move two clashing RunPendingTasks() in blink tests
There is a ::blink::test::RunPendingTasks() but one test
imported it into ::blink with a using statement and another
test created its own ::blink::RunPendingTasks(). This cause
problems in some jumbo builds. This moves both RunPendingTasks
away from the blink namespace.

Change-Id: Ib811f27269305cc1ed2fa4019377e1a4b2e36d6e
Reviewed-on: https://chromium-review.googlesource.com/c/1386209
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#618167}
bratell
[jumbo] Rename one of two GetDeviceScaleFactor functions
There are two (similar but not identical)
GetDeviceScaleFactor() functions in chrome/browser and in some
extreme jumbo configurations those clash.

This renames one of them to GetPrimaryDisplayScaleFactor()

Change-Id: I55e7bf310eab4a21e7e56bb21c6c6accf0de3eff
Reviewed-on: https://chromium-review.googlesource.com/c/1378097
Reviewed-by: Nigel Tao <nigeltao@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#618139}
fs
Don't apply (-webkit-)mask-composite on the bottom mask layer
 "If there is no further mask layer, the compositing operator must
  be ignored."

  (https://drafts.fxtf.org/css-masking/#the-mask-composite)

Bug: 915847
Change-Id: Ia42f188160cf84648e364829c7733dbb0895936b
Reviewed-on: https://chromium-review.googlesource.com/c/1384251
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#617865}
fs
Resolve computed 'transform-origin' for SVG elements
Make the local helper ReferenceBoxForTransform available via
ComputedStyleUtils and use it in TransformOrigin::CSSValueFromComp...
Replace usages of MinimumValueForLength with FloatValueForLength. This
matches what is done when resolving/applying transform in the general
case.
Also sink the common handling of the 'z' component out of the 'if'.

Bug: 740300
Change-Id: Id0e6cbcc85942ccc8cdb3f8ed86ecc6e7aaf492e
Reviewed-on: https://chromium-review.googlesource.com/c/1382434
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617548}
fs
Resolve percentages in computed 'transform' for SVG elements
SVG (child; non-root) elements should resolve percentages in computed
'transform' values just like regular boxes.

Rename ComputeTransformReferenceBox to ComputeSVGTransformReferenceBox
(for clarity) and expose it for a wider audience. Make it apply the
effective zoom, since both clients require that.
Use ComputeSVGTransformReferenceBox in ComputedStyleUtils to compute the
reference box for the LayoutObject in question.

Bug: 915426
Change-Id: I5323056cc54ff07e0b3cf943f52a7210ea320c78
Reviewed-on: https://chromium-review.googlesource.com/c/1382433
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617515}
fs
Narrow "is constrained" check for LayoutImage layout invalidation
If our containing block has auto height, we need to relayout.
Add !HasAutoHeightOrContainingBlockWithAutoHeight() to the
condition for |image_size_is_constrained|.

Bug: 870599
Change-Id: I22858843d7ad87c63eb7b8d6e771e0f8d6cfa09d
Reviewed-on: https://chromium-review.googlesource.com/c/1373823
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617446}
bratell
Call the client hints factory "client hints factory".
Jumbo builds failed when several files claimed to define
the g_previews_service_factory.

Change-Id: Id16f0c0c66da9fdb7c0d42afda611d672ab6da14
Reviewed-on: https://chromium-review.googlesource.com/c/1377441
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#616722}
bratell
[jumbo] Replace one of two colliding GetMainFrame with IsMainFrame()
There were two GetMainFrame() functions in chrome/browser which
clashed in jumbo (unity) builds. Since one of them is only
used to check if the current frame is the main frame, simplify
the code a bit.

Change-Id: I2d0b30d4ca2c18f202db709514c55c84a7eb350f
Reviewed-on: https://chromium-review.googlesource.com/c/1378140
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#616720}
bratell
[jumbo] Rename a GetBrowserContext function
There are several GetBrowserContext functions in content/browser
and in jumbo builds, base::BindRepeating did not know which
one to use. This renames one of them to make it clear for everyone,
including the compiler in jumbo builds.

Change-Id: Ifd35c418ae780c8e7874603c1e261cb3db02acf0
Reviewed-on: https://chromium-review.googlesource.com/c/1377740
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616715}
fs
Use StyleColor for the stop-color property
This changes the ComputedStyle storage for the stop-color property to be
a StyleColor rather than a plain color. This fixes explicit inheritance
for the property ('currentcolor' computes to itself).
It also means we'll properly pick up changes to 'color'.

Bug: 914728
Change-Id: I3c78a3615220b9149d1ea5102a6e5863526a6d51
Reviewed-on: https://chromium-review.googlesource.com/c/1377437
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#616660}
fs
Refactor "needs layout" check in LayoutImage
Move the conditions used to check if layout is needed when the intrinsic
size changes out into a new function, and call that from
LayoutImage::InvalidatePaintAndMarkForLayoutIfNeeded.
Replace open-coded HasRelativeLogicalWidth() with a call to that method.

Bug: 870599
Change-Id: Iae480326083eb493d58233378d95af8c1dd62f0a
Reviewed-on: https://chromium-review.googlesource.com/c/1373839
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616624}
fs
Add reftest-wait to css/filter-effects/svg-sourcegraphic-currentcolor-dynamic-001.html
Attempt to stabilize in Gecko.

Bug: 626744
Change-Id: Idfa06176948d1ffaf6ba8e65263bf5818ffd321b
Reviewed-on: https://chromium-review.googlesource.com/c/1375875
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616543}
joleksy
[Mac] Use non-autoreleased mock object in ScopedBundleSwizzlerMac
The "release" call in the destructor might or might not destroy the
mock object, depending on current autorelease pool.
If we add to the picture the local autorelease pool (used in tests),
we no longer can name the class "Scoped".

The fix creates OCPartialMockObject without the helper function,
avoiding the autoreleasability.

Change-Id: Id17a1ef571246370f6e84cde60773f90d7d35cb0
Reviewed-on: https://chromium-review.googlesource.com/c/1375871
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616424}
fs
Return used width/height for SVG <image>, <rect> and <foreignObject>
Per https://drafts.csswg.org/cssom/#resolved-values we should return the
"used value" for 'width' and 'height' on these elements [1].
This behavior was clarified in SVGWG GitHub issue #349 [2].

[1] And also on <svg>, but we don't support those properties there yet.
    Tests added for that case too though.
[2] https://github.com/w3c/svgwg/issues/349

Bug: 772707
Change-Id: Ic7b6b148883d4380daadb41b62bddd02da55e1af
Reviewed-on: https://chromium-review.googlesource.com/c/1374291
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#616343}
fs
Regression test for crbug.com/626744
Bug: 626744
Change-Id: I4244c3f0316ceb55bc69655212f6677345b0a6cc
Reviewed-on: https://chromium-review.googlesource.com/c/1374988
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#616311}
tmoniuszko
Avoid modifying Windows registry in RemoveProtocolHandler test
Writing to Windows registry requires elevated privileges and the test
fails on Windows 7 unless it's run as administrator (but in this case
all modifications stay in registry because the test doesn't do the
cleanup during its tear down).

Bug: 849660
Change-Id: I6cb8e9b2ba30e5bd9af2d8ede97c9bd62ccbc9ca
Reviewed-on: https://chromium-review.googlesource.com/c/1348115
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616303}
bratell
Don't compile Windows chrome_cleaner prompt code on other OSes
srt_chrome_prompt_impl.cc is code that is only used in Windows
but was compiled for all operating systems. Since it uses constants
that only exist in Windows it's kind of lucky that it doesn't
cause any problems, except in some jumbo build experiments where
there was linker errors.

(TBR for name change in BUILD.gn)
TBR=nparker@chromium.org

Bug: 904958
Change-Id: If1e3f76c7bc913d4041d0cb38b4891d898d24506
Reviewed-on: https://chromium-review.googlesource.com/c/1350870
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Joe Mason <joenotcharles@google.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#616067}
bratell
Fix full ChromeOS builds - generated cryptauth proto file has moved.
ChromeOS cryptauth unittest use cryptauth_api.pb which moved from
components/cryptauth to chromeos/services/device_sync in bug 912743.
A file still included that file from the old path (and the new path)
which worked in trees where an earlier tree had generated it but didn't
work in a clean tree. The files presumably had the same include guards
so that is was ok to include both.

TBR=khorimoto@chromium.org

Bug: 912743
Change-Id: I6708c674f5fd99c94e233df5ec9b9c462c7814ad
Reviewed-on: https://chromium-review.googlesource.com/c/1373826
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#615911}
bratell
[jumbo] Give two MaybeGetConnectorForProcess unique names
In some (non default) jumbo configurations, two identical
MaybeGetConnectorForProcess functions ended up in tha same
translation unit. It would be good to share the implementation
between frame_host and renderer_host but I know no good place
and the function is small, so instead give them unique names.

Change-Id: I6dcb65e7f3a095ec7a73bd6bc40944180ddc6f07
Reviewed-on: https://chromium-review.googlesource.com/c/1348334
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#615898}
bratell
Don't compile app_icon_factory except for ChromeOS.
Compiling app_icon_factory  code triggered compilation errors in some
Windows and Mac builds since the code references app_list which
only exists in ChromeOS. In most builds it was ok because the generated
object file was unused and got stripped by the linker before the dangling
references was found.

BUG=826982

TBR=nigeltao@chromium.org,rdevlin.cronin@chromium.org,dominickn@chromium.org

Change-Id: I25f0fa090f3466bcc83e06a070c7aa6c8600976d
Reviewed-on: https://chromium-review.googlesource.com/c/1373450
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#615856}
fs
Reduce type-impedance for LayoutImageResource::GetImage
The container size will be converted to FloatSize in the end, so make
the argument type a FloatSize too rather than a LayoutSize.
Clean up callers, removing some conversions in SVGImagePainter, and add
an IntSize overload (since it's common to call GetImage with an
IntSize).

Change-Id: I4f5c4389d21617ad60d18b258674999e9ef51f2c
Reviewed-on: https://chromium-review.googlesource.com/c/1367651
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#615130}
bratell
Don't prefix absolute paths in gn_run_binary.py.
Absolute paths become broken paths if prefixed with ./ so
only do the ./ addition for non-absolute paths.

The result would be that the command failed with:
"WindowsError: [Error 2] The system cannot find the file specified"
on the command execution. This could easily be misunderstood as
some argument to the command being wrong.

You get absolute paths in gn when using rebase_path(path) with no
extra arguments. This is the recommended and supported way to interact
with external programs since gn internal paths can contain and be
based on "//" which is not understood by anyone but gn internally.


Change-Id: I2ab49f529c7d030f73f693e5ea6cacc5ebbf3c99
Reviewed-on: https://chromium-review.googlesource.com/c/1367670
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615087}
bratell
Don't build ppapi/{proxy,shared_impl} with jumbo in nacl
An upcoming CL triggers nacl toolchain problems in jumbo builds where
some combination of template instantiations cause some build errors.
To not block that CL, disable jumbo for nacl in relevant directories.

Bug: 912152
Change-Id: Ie79729414d765fec22325bacdb7df8cf714457f3
Reviewed-on: https://chromium-review.googlesource.com/c/1363282
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#614014}
fs
Eliminate unnecessary uses of Node::ToNode
This method is supposed to be used to go from an EventTarget to its node
(if any). Remove uses where it's called on something that obviously
derives from Node already.
Make it private on Node to prevent any future such uses.

Change-Id: I0ed70ac122e877ae90ee7c6f6c53caaa63edd574
Reviewed-on: https://chromium-review.googlesource.com/c/1361070
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#613910}
fs
Clamp contents visual overflow for LayoutSVGRoot
If the contents overflow rect for the SVG root is too large, it could
end up shifting the overflow rect such that it is culled and thus never
painted.

To avoid this, clip the content overflow rect with
LayoutRect::InfiniteIntRect(). This gives reasonable enough leeway, and
also matches the rect that is commonly used to represent infinity for
culling and clipping etc.

Bug: 911186
Change-Id: I22d505ac0582f4d1fe6ac3ead9041c4a87176994
Reviewed-on: https://chromium-review.googlesource.com/c/1361225
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#613692}
fs
Simplify GraphicsContext::ApplyHighContrastFilter implementations
We assume that SkColor <=> Color::Rgb(), so simplify the Color variant
accordingly.

PaintFlags are always passed as constant references, so pass it like
that to the PaintFlags variant too and remove the null-checks. Also
always explicitly copy the PaintFlags so that we get RVO.

Change-Id: I46b6f5aff7cbe175d6b9a2ff8277ff5ce9b4fce8
Reviewed-on: https://chromium-review.googlesource.com/c/1358497
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#613158}
fs
Restore "same layer" check in CalculateRectsWithGeometryMapper
If the root layer and the "current" layer are the same, we can't really
guarantee that the "pre"-transform is the same as the "local border
box"-transform - for example in the case where we're performing a hit-
test from/under a foreignObject element which has a 'transform' applied.

Bug: 908570
Change-Id: Icbaf3c15ca7b483f8209d5d0cc8b4613d80d49ce
Reviewed-on: https://chromium-review.googlesource.com/c/1355184
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612643}
fs
Disabled (empty) SVG shapes cannot be hit
Disabled SVG shapes [1][2][3] should not be possible to hit since they
are considered "not rendered".

[1] https://svgwg.org/svg2-draft/shapes.html#RectElement
[2] https://svgwg.org/svg2-draft/shapes.html#CircleElement
[3] https://svgwg.org/svg2-draft/shapes.html#EllipseElement

Bug: 896641
Change-Id: I5fe530722a4d60ecd416cd68f06a7555bb6a520f
Reviewed-on: https://chromium-review.googlesource.com/c/1353983
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#611840}
auygun
Fix frequency index set for AAC Parametric Stereo profile.
Bug: 908472
Change-Id: I2d67e946f46a83b930a22ace762cb064e73bb8fb
Reviewed-on: https://chromium-review.googlesource.com/c/1350894
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Attila Uygun <auygun@opera.com>
Cr-Commit-Position: refs/heads/master@{#611634}
fs
Clean up LayoutSVGShape::NodeAtPoint
Since LayoutSVGShape::NodeAtPointInternal is now only called from
LayoutSVGShape::NodeAtPoint, we can make it private. Rename it to
something more helper-like - HitTestShape.

Move the check of 'visibility' to LayoutSVGShape::NodeAtPoint from
HitTestShape, to better match other similar methods.

Change-Id: If251b8b9258b754bfc94044739d6a8c41f1b04e7
Reviewed-on: https://chromium-review.googlesource.com/c/1352253
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#611618}
fs
Remove Pattern-wrapper in GeneratedImage::DrawPattern
Don't create a Pattern just to have it create a PaintShader - just
create the PaintShader directly.

Change-Id: I85b96ed9becea31e93d62191baac263f08f53f91
Reviewed-on: https://chromium-review.googlesource.com/c/1352258
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611258}
bratell
Give autofill's LegacyStrikeDatabas constants legacy names
In some (non default) jumbo configurations, strike.cc and
legacy_strike_database.cc compile in the same translation
unit and then some constants clash. Assuming
LegacyStrikeDatabase will soon go away, just give its
constants a bit longer names.

Bug: 884817
Change-Id: I1dc6d8b6499d3c6195a56423236198a02c32f3f0
Reviewed-on: https://chromium-review.googlesource.com/c/1348471
Commit-Queue: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610594}
fs
Move StyleBuilderConverter::ConvertValueToNumber to FilterOperationResolver
This function has a very generic name, but not a wide enough use case to
match. Move it to FilterOperationResolver, where its only two callers
are. Rename to something less generic.

Change-Id: Ibe6eaf68fbeddd86464d508cba3d6b235117f780
Reviewed-on: https://chromium-review.googlesource.com/c/1348096
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#610474}
fs
Expose all constants on SVGFEBlendElement
Per:

  https://drafts.fxtf.org/filter-effects/#InterfaceSVGFEBlendElement

All other browsers expose these already.

Bug: 906612
Change-Id: I4be6185d4832d980a5d7c6518dcb0b2ccca2ce82
Reviewed-on: https://chromium-review.googlesource.com/c/1341846
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610379}
fs
Fix typo'd URL for Blink license entry
Three 'w' should be enough for everyone...

Bug: 907470
Change-Id: I7a724e708b73e4d5a80bcd28a2a459912e5ae69b
Reviewed-on: https://chromium-review.googlesource.com/c/1346399
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#610147}
fs
Add one more test for viewport units in SVG-in-<img> context
This one using inline style instead of presentation attributes.

Bug: 650147
Change-Id: I00ee6c52b95803a928dd0b95a33da89f531a05ac
Reviewed-on: https://chromium-review.googlesource.com/c/1344102
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#609772}
bratell
Resolve conflict between two policy::kMaxValue
Both
components/policy/core/common/cloud/machine_level_user_cloud_policy_metrics.h
and
components/policy/core/common/cloud/enterprise_metrics.h
define policy::kMaxValue in two different enums. If code includes
both headers, it won't compile and this happens in some jumbo
build configurations.

This patch changes one of the enums to use enum class so that
the symbols are in different namespaces. (One will shadow the
other but as long as they are used correctly it will be fine)

Bug: 905702
Change-Id: Ia4dd0c89dc8ec5c23c516e90eae7f6c3256a232a
Reviewed-on: https://chromium-review.googlesource.com/c/1344129
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#609769}
bratell
Jumbo support for ppapi (-7.5 CPU minutes)
Jumbo is a unity build system for Chromium (see
https://chromium.googlesource.com/chromium/src/+/lkgr/docs/jumbo.md )
which merges cc files at the build target level.

The code in //ppapi needs roughly 15 CPU minutes to compile in my
measurements, which is 2.3% of the total jumbo build time and one of
the largest remaining non-thirdparty code blocks without jumbo support.

This saves about 7.5 CPU minutes in a jumbo build, which is
a bit over 1% of the total reference build time. It doesn't cover
thunk which is most of the remaining compile time. There are
too much generated code with reused symbol names in thunk for it
to be trivially supported right now.

Bug: 898475
Change-Id: I1ee592578ac765cbd58cb856fcd5f331d3dd8c50
Reviewed-on: https://chromium-review.googlesource.com/c/1297366
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#609687}
bratell
Update some documentation for the binary_size tool
The documentation didn't include the crucial information
that generate_linker_map has to be set to true in gn for the tool
to work in Linux.

Bug: 716209
Change-Id: I62919e26a80a0b5d592f6b8953762e35575142d2
Reviewed-on: https://chromium-review.googlesource.com/c/1338085
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#609686}
wdzierzanowski
Initialize TestNavigationObserver::last_navigation_type_ in ctor
With |TestNavigationObserver::last_navigation_type_| initialized properly, it's
possible to use TestNavigationObserver::last_navigation_type() to check whether
a navigation is still ongoing.

Change-Id: Ie814270d5e79bebb95e7ebea05c1ed7eb53bf88c
Reviewed-on: https://chromium-review.googlesource.com/c/1340813
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#609462}
yorenault
[Mac] Fix cursor when dropping to desktop
Allow mouse cursor to be a green plus when dropping items to desktop

Bug: 905238
Change-Id: I90a6f7156e681271f577f1f604f1d75ada4beba2
Reviewed-on: https://chromium-review.googlesource.com/c/1334994
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609410}
fs
Add test for viewport units in SVG-in-<img> context
Bug: 650147
Change-Id: I4a158f600acb733477d33ebbd6a504490a5b54a4
Reviewed-on: https://chromium-review.googlesource.com/c/1341836
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609346}
bratell
[doc] Jumbo builds can't be considered experimental anymore
Change-Id: I88b641bf356044ca94552273081af22c0fde1795
Reviewed-on: https://chromium-review.googlesource.com/c/1341530
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#609218}
fs
Fix parsing of negative values for 'r', 'rx', 'ry' and 'stroke-width'
For all of these properties[1][2][3][4], a negative value is considered
illegal and should fail in the parser. (The value range is already
corectly specified for instance for animation, and also for the
corresponing presentation attributes.)

[1] https://svgwg.org/svg2-draft/geometry.html#R
[2] https://svgwg.org/svg2-draft/geometry.html#RX
[3] https://svgwg.org/svg2-draft/geometry.html#RY
[4] https://svgwg.org/svg2-draft/painting.html#StrokeWidthProperty

Bug: 902346
Change-Id: I4b073288b97151d7a9df4b1c2ce99341dca9c8ee
Reviewed-on: https://chromium-review.googlesource.com/c/1304561
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609077}
bratell
Drop jumbo support for .S asm files
We don't need it and it doesn't work. It's probably been ok up
until now because we have never had more than one S file per
build target.

See errors at
https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Jumbo%20Win%20x64/22538

R=fs@opera.com

Change-Id: Idde99aba83e01c0111e5a50590e319993e0effaa
Reviewed-on: https://chromium-review.googlesource.com/c/1340312
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#608826}
bratell
Have linux-jumbo-rel build with non-goma jumbo chunk size
Currently linux-jumbo-rel, the CQ bot, builds with the default
jumbo chunk size, and since it uses goma that is 8. Building
with relatively small chunks (8) means that it doesn't notice
symbol clashes that happen with larger chunks so it's better to
build with the non-goma default, 50.

This will slightly reduce parallelism of builds, and might trigger
more files to be recompiled for changes, but it will also bring
along with it the benefits of larger jumbo chunks (less CPU cycles
spent per compiled cc file, faster linking) so it's not obvious
how it will affect performance, if at all.

Bug: 905588
Change-Id: I950ef63093f60580e98891aa0f556fa57b5d6628
Reviewed-on: https://chromium-review.googlesource.com/c/1337496
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#608822}
fs
Fix serialization of computed style for 'paint-order'
We were always serializing as the completed (all keywords present) form,
which is not the shortest canonical form.

 https://svgwg.org/svg2-draft/painting.html#PaintOrder

Fold the ComputedStyleUtils helper into the PaintOrder CSSProperty
class, since this is very specific to this property.

Matches WebKit and almost Gecko (which seems to handle some "two
keyword" cases differently.)

Bug: 904898
Change-Id: Ib796a111e601485e339fdf2739a587fb5f893b8a
Reviewed-on: https://chromium-review.googlesource.com/c/1335579
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608623}
bratell
Restore the nonull warning in chrome/browser/ui for everything but mac
-Wno-null has been disabled for clang in chrome/browser/ui since 2015
but it seems to be enough to disable that warning for mac (the only
platform that used clang by default in 2015).

Bug: 383820
Change-Id: Iadc03f761c120db91fb806369ecf6f3bd8459c1c
Reviewed-on: https://chromium-review.googlesource.com/c/982057
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608368}
mharanczyk
[IWYU] Add missing include in scoped_generic_unittest.h for std::make_unique.
Change-Id: Ie5725cd32fff43807e6f4129d7234ecf1143e14b
Reviewed-on: https://chromium-review.googlesource.com/c/1335575
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Cr-Commit-Position: refs/heads/master@{#608306}
bratell
Remove references from .gn to third_party/mesa
third_party/mesa is no longer part of Chromium, and having it
listed here enforces gn checks for any product that still
checks out mesa in third_party (i.e. Google Chrome) which is
a problem.

Bug: 873321
Change-Id: If1c28fb2c393f04c9b0fe0703204fd7225a1a483
Reviewed-on: https://chromium-review.googlesource.com/c/1333812
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607653}
fs
Fixes and tweaks to wpt/css/filter-effects/
filter-contrast-003.html

  Adjust the color from #400000 to #3f0000, since (0x40 / 255) is just
  over 0.25 and can after filtering and rounding end up above 0.
  (0x3f / 255) on the other hand is just below 0.25 and the result will
  be clamped to zero.

filter-external-001-test.html
filter-external-002-test.html

  Change the hue-rotate parameter in the external file from 120 to 150.
  Move the file to support/ and remove lint entry.
  Make both filters operate in sRGB to make computing the reference
  easier. Use rgb(...) notation with percentage values in reference.

fecolormatrix-type.html

  Add color-interpolation-filters=sRGB to the filter to make it easier
  to reason about what the result should be. Use rgba(...) notation in
  the ref using percentage notation.

filters-test-brightness-003.html

  Add 'filter: brightness(0)' before 'filter: brightness()' to properly
  test if the "no argument" notation is considered valid by the parser.

filter-grayscale-001.html
filter-grayscale-002.html
filter-grayscale-003.html
filter-grayscale-004.html
filter-grayscale-005.html

  Remove the " (and not blue)" text from the reference and update the
  001,004 and 005 tests accordingly.

css-filters-animation-saturate.html

  Interpolate the argument from 4900% rather than 5000% to end at the
  ref's 2500% (25).

css-filters-animation-hue-rotate.html

  Sample the animation at .5 to match the expectation.

css-filters-animation-drop-shadow.html

  Use explicit rgba(...) in the ref rather than the keyword 'gray'.
  We're interpolating the color of the drop-shadow from 'black'
  (rgba(0, 0, 0, 1)) to 'transparent' (rgba(0, 0, 0, 0)) here, so it's
  better and more accurate to describe the color as "semi-transparent
  black" (rgba(0, 0, 0, 0.5)).

css-filters-animation-combined-001.html

  Initial value for animation for 'opacity(...)' is '1' - not zero.
  Change test to interpolate from 0 -> 1 (rather than 1 -> 1)

Bug: 903383
Change-Id: I4d0113989414616494b98c22fbac817f007cd762
Reviewed-on: https://chromium-review.googlesource.com/c/1333816
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#607628}
fs
Slimmer SVG enumeration tables
This replaces a Vector<std::pair<..., ...>> with a new SVGEnumerationMap
class that wraps a list of entries (also "pairs".) The setup of the map
is however not done runtime but rather compile time, saving a bunch of
code footprint in the process.

Change-Id: If2c77f1ebcf15dcf8fc75d6a25cacebf42401287
Reviewed-on: https://chromium-review.googlesource.com/c/1329974
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#607620}
bratell
[jumbo] Avoid using kSymbolKey name in the blink scope
There is a kSymbolKey in the public API and due to the new
enum shadow warnings, jumbo builds might combine the code in
such an order that the public blink::WebInputEvent::kSymbolKey
shadows the blink::{anonymous namespace}::kSymbolKey.

Note, there is no bug, just an unfortunate false warning and one
that only appears in rare jumbo builds.

Change-Id: Id575b2aef3b3f1be46d3722ed79454212bcf650e
Reviewed-on: https://chromium-review.googlesource.com/c/1333649
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607606}
bratell
[ppapi] Merged two identical interface_name
In jumbo build experiments, two cc files both defined
interface_name<PPB_InputEvent_1_0>() which clashed since in
jumbo builds many cc files are compiled in the same translation unit.

This moves the shared code to a shared file.

Bug: 898475
Change-Id: I9ce58e837d663cb5c15ba2596c22812a41def4c0
Reviewed-on: https://chromium-review.googlesource.com/c/1297148
Reviewed-by: Bill Budge <bbudge@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Sam Clegg <sbc@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#607601}
bratell
Let gn check verify that blink/public dependencies are sane
We can't have gn check look through all of blink because it's
a messy monolithic pile of internal dependencies, but the
public API layer has strict rules that should be enforced by
gn check.

Also removing a mojo header from a build target since it's supposedly
already in a mojo build target and listing it here as well
makes gn check unhappy.

Bug: 898837
Change-Id: Id46485ffa4ffeb0c897f6d22e684f6d45d4804e6
Reviewed-on: https://chromium-review.googlesource.com/c/1307373
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607283}
fs
Use a table for CSSSelectorParser's custom pseudo element use counter
This if cascade consumes both a fair bit of footprint while it makes the
switch slightly less readable.

Change-Id: Ia8cb0d14ec831ccfcf7f22154a12f16d44fbc9ad
Reviewed-on: https://chromium-review.googlesource.com/c/1329147
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607223}
bratell
Avoid -Wshadow warnings related to content::UNINITIALIZED
Due to a new clang, a couple of shadowing warnings
appeared in existing code, related to enum values INVALID,
UNINITIALIZED and RUNNING. This patch moves both clashing
enums into enum classes.

Full errors below:

In file included from ./../../content/browser/renderer_host/input/synthetic_gesture.cc:10:
../../content/browser/renderer_host/input/synthetic_pointer_action.h:30:23: error: declaration shadows a variable in namespace 'content::(anonymous)' [-Werror,-Wshadow]
  enum GestureState { UNINITIALIZED, RUNNING, INVALID, DONE };
                      ^
./../../content/browser/browser_thread_impl.cc:36:3: note: previous declaration is here
  UNINITIALIZED = 0,
  ^
In file included from gen/content/browser/browser_jumbo_1.cc:505:
In file included from ./../../content/browser/renderer_host/input/synthetic_gesture.cc:10:
../../content/browser/renderer_host/input/synthetic_pointer_action.h:30:38: error: declaration shadows a variable in namespace 'content::(anonymous)' [-Werror,-Wshadow]
  enum GestureState { UNINITIALIZED, RUNNING, INVALID, DONE };
                                     ^
./../../content/browser/browser_thread_impl.cc:38:3: note: previous declaration is here
  RUNNING,
  ^
In file included from gen/content/browser/browser_jumbo_1.cc:505:
In file included from ./../../content/browser/renderer_host/input/synthetic_gesture.cc:10:
../../content/browser/renderer_host/input/synthetic_pointer_action.h:30:47: error: declaration shadows a variable in namespace 'content::(anonymous)' [-Werror,-Wshadow]
  enum GestureState { UNINITIALIZED, RUNNING, INVALID, DONE };
                                              ^
./../../content/browser/frame_host/ancestor_throttle.cc:52:3: note: previous declaration is here
  INVALID = 6,
  ^

TBR=avi@chromium.org

Change-Id: I2877006171e318dc43fe66ed4c2bcd558f6233a8
Reviewed-on: https://chromium-review.googlesource.com/c/1326498
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#606536}
bratell
Avoid shadowing problems with TOTAL_KEYWORDS and others
gperf can generate symbols directly into the global namespace
(in this case wrapped in "blink") or into more tight scopes.
Most of the code generates into a tight scope but not
css_property_names.cc. In a new clang a shadowing warning appeared
in jumbo builds because of it. There seems to be no downside
to using a reduced scope.

In file included from gen/third_party/blink/renderer/core/core_generated_jumbo_1.cc:152:
./gen/third_party/blink/renderer/core/css_value_keywords.cc:3612:7: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
      TOTAL_KEYWORDS = 842,
      ^
./gen/third_party/blink/renderer/core/css_property_names.cc:55:5: note: previous declaration is here
    TOTAL_KEYWORDS = 554,
    ^
In file included from gen/third_party/blink/renderer/core/core_generated_jumbo_1.cc:152:
./gen/third_party/blink/renderer/core/css_value_keywords.cc:3613:7: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
      MIN_WORD_LENGTH = 1,
      ^
./gen/third_party/blink/renderer/core/css_property_names.cc:56:5: note: previous declaration is here
    MIN_WORD_LENGTH = 1,
    ^
In file included from gen/third_party/blink/renderer/core/core_generated_jumbo_1.cc:152:
./gen/third_party/blink/renderer/core/css_value_keywords.cc:3614:7: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
      MAX_WORD_LENGTH = 42,
      ^
./gen/third_party/blink/renderer/core/css_property_names.cc:57:5: note: previous declaration is here
    MAX_WORD_LENGTH = 34,
    ^
In file included from gen/third_party/blink/renderer/core/core_generated_jumbo_1.cc:152:
./gen/third_party/blink/renderer/core/css_value_keywords.cc:3615:7: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
      MIN_HASH_VALUE = 18,
      ^
./gen/third_party/blink/renderer/core/css_property_names.cc:58:5: note: previous declaration is here
    MIN_HASH_VALUE = 9,
    ^
In file included from gen/third_party/blink/renderer/core/core_generated_jumbo_1.cc:152:
./gen/third_party/blink/renderer/core/css_value_keywords.cc:3616:7: error: declaration shadows a variable in namespace 'blink' [-Werror,-Wshadow]
      MAX_HASH_VALUE = 6641
      ^
./gen/third_party/blink/renderer/core/css_property_names.cc:59:5: note: previous declaration is here
    MAX_HASH_VALUE = 3587
    ^
5 errors generated.

Change-Id: I03ffd31e0b6731b2e8bacb1e7222be5defce3ea4
Reviewed-on: https://chromium-review.googlesource.com/c/1326500
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#606535}
fs
Handle word-spacing for leading white space on SVG text
SVGTextLayoutEngineSpacing checking if the current and last characters
were non-nuls before attempting to apply word-spacing. This would mean
that we'd never add word-spacing at the beginning of a text box.
Remove the checks for non-nuls.

Bug: 902839
Change-Id: I751e1bd1317f7411960d137b7e55a3b83e8cb0df
Reviewed-on: https://chromium-review.googlesource.com/c/1326156
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#606528}
bratell
Put a bluetooth enum in an enum class to shadowing errors
A bluetooth enum was putting some common names like "SUCCESS",
"UNKNOWN" and "FAILED" in the content namespace. A recent
clang (I think) added new warnings when these got
got shadowed by other uses of the names. See full error below.

This enum was always intended to be in an enum class judging from
how it's used, so just use enum class to avoid further clashes.

This primarily affected jumbo builds but could happen to any build
which happened to include two conflicting headers in the same file.

../../content/browser/histogram_synchronizer.h:54:5: error: declaration shadows a variable in namespace 'content' [-Werror,-Wshadow]
    UNKNOWN,
    ^
../../content/browser/bluetooth/bluetooth_metrics.h:228:3: note: previous declaration is here
  UNKNOWN = 5,
  ^
In file included from gen/content/browser/browser_jumbo_1.cc:170:
In file included from ./../../content/browser/devtools/devtools_instrumentation.cc:16:
../../content/browser/frame_host/navigation_request.h:68:5: error: declaration shadows a variable in namespace 'content' [-Werror,-Wshadow]
    FAILED,
    ^
../../content/browser/bluetooth/bluetooth_metrics.h:229:3: note: previous declaration is here
  FAILED = 6,
  ^
In file included from gen/content/browser/browser_jumbo_1.cc:247:
In file included from ./../../content/browser/download/drag_download_file.cc:5:
../../content/browser/download/drag_download_file.h:53:37: error: declaration shadows a variable in namespace 'content' [-Werror,-Wshadow]
  enum State {INITIALIZED, STARTED, SUCCESS, FAILURE};
                                    ^
../../content/browser/bluetooth/bluetooth_metrics.h:223:3: note: previous declaration is here
  SUCCESS = 0,
  ^

TBR=jyasskin@chromium.org

Change-Id: I2f35c1c11262e4f071cf1d64348c9bc30c76351b
Reviewed-on: https://chromium-review.googlesource.com/c/1326507
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#606520}
bratell
Avoid shadowing UNKNOWN (defined in both quic and ftp)
If you include both net/ftp/ftp_directory_listing_parser.h and
net/quic/quic_chromium_client_session.h you get an error
about an UNKNOWN shadowing another UNKNOWN. I don't think this
is a new problem but something we got with a new clang version.

This renames the net::UNKNOWN to net::UNKNOWN_CAUSE so that
net::FtpDirectoryListingEntry::UNKNOWN and other unknown
UNKNOWNs can stay.

net/ftp/ftp_directory_listing_parser.h:21:5: error: declaration shadows a variable in namespace 'net' [-Werror,-Wshadow]
    UNKNOWN,
    ^
net/quic/quic_chromium_client_session.h:83:3: note: previous declaration is here
  UNKNOWN,
  ^
1 error generated.

TBR=zhongyi@chromium.org

Change-Id: I96c6c8ba3b923a691537debbfe468874c767b939
Reviewed-on: https://chromium-review.googlesource.com/c/1326494
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#606509}
bratell
Make it easier to surgically exclude targets from jumbo
Currently disabling jumbo for a build target in a local build means
that you also disable jumbo for all other targets with the same local
name, and giving a fully qualified label as name won't work at
all. This patch changes the matching to be more flexible so that you
can supply both a local name (as before) but also a full path or
qualified name like //third_party/blink/renderer/core/svg:svg

Bug: 825240
Change-Id: I706e4d7c3f863a7996e576d36ddd62ac81b8cb12
Reviewed-on: https://chromium-review.googlesource.com/c/1323110
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#606433}
fs
Remove fast/hidpi/image-srcset-relative-svg-canvas{,-2x}.html expectations
Does not appear to be flaky anymore.

TBR=schenney@chromium.org

Bug: 306222
Change-Id: I4e381ca9d89e5495cb98286e0fd387b94d67c125
Reviewed-on: https://chromium-review.googlesource.com/c/1326008
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#606413}
bratell
Unleak blink's internals from web_graphics_context_3d_provider.h
A change included an internal blink header in the public api
layer which then leaked parts of blink's internal out into the
wild dangerous world outside. This is a quick fix to close that
leak. Might need some tuning.

Bug: 902022
Change-Id: I076f4c5d0a27cd4c3070d8fe8a5be97f2f65e1e0
Reviewed-on: https://chromium-review.googlesource.com/c/1323715
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: enne <enne@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606409}
bratell
Remove using namespace from components/signin code
The using namespace construct is disallowed in the code style guide.
It also causes issues (compilation warnings turned into errors)
in jumbo builds since they will be in a "header context" there
which is explicitly blocked by our compiler settings.

This patch also has a bit of a feature creep to remove a number
of unnecessary static_casts that made the code hard to read,
especially with the namespaces.

Change-Id: Icaa4968695a6f033868aac681a9ebe08eee75c3e
Reviewed-on: https://chromium-review.googlesource.com/c/1320131
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606113}
fs
Reenable fast/hidpi/image-srcset-relative-svg-canvas{,-2x}.html
Hopefully these tests are no longer flaky, but as a cautionary step,
mark them as Pass/Fail for now and keep an eye on them.

TBR=schenney@chromium.org

Bug: 306222
Change-Id: Ia0e87564e2113dfaa50cd723654786805026924d
Reviewed-on: https://chromium-review.googlesource.com/c/1322789
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#606010}
bratell
Jumbo build fix: Rename some test constants in peerconnection
In jumbo builds many cc files compile in the same translation
unit. That means that they also share the same anonymous namespace
(which is per translation unit, not per file which would have
been better). In https://chromium-review.googlesource.com/c/1316836
and https://chromium-review.googlesource.com/c/1315534 two
peerconnection tests each added a kWriteBufferSize and a
kDelegateReadBufferSize with different values which broke
some jumbo build configurations (unluckily not the one in CQ but
some in fyi builders).

This renames the variables to have more unique names.

TBR=shampson@chromium.org,hbos@chromium.org

Bug: 874296
Change-Id: Ifc8af2be440f7a959b948c05e18deaf55aeefad2
Reviewed-on: https://chromium-review.googlesource.com/c/1322709
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#606002}
fs
Need to walk ancestors when text descendants of LayoutSVGText changes
In LayoutSVGText::InvalidatePositioningValues - which is called when a
number of different modifications to text is performed - we only flagged
the node itself for layout/paint invalidation. We also need to walk the
ancestor chain in case the text is a descendant of a resource.
(A <clipPath> in this specific case.)

Bug: 901851
Change-Id: Ia70860107616496e979c43a1d1a681def8b8c206
Reviewed-on: https://chromium-review.googlesource.com/c/1320069
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#605789}
bratell
Use not_needed() rather than asserts to avoid warnings in jumbo.gni
gn has a function not_needed() intended to avoid "Variable is not
used" errors in gni files. So far the code has used asserts for the
same purpose but it is better to use the function intended for the
purpose.

Change-Id: I5ec7e50c4089b265e104aaede24d0e4e50452cef
Reviewed-on: https://chromium-review.googlesource.com/c/1314588
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#605338}
fs
Remove Settings::is_shadow_page_ and its setter/getter
The referenced bug seems to be fixed, and nothing seems to read the
flag (anymore.)

Change-Id: I9975182364e9344e2dde88cb70211e78b10b69c1
Reviewed-on: https://chromium-review.googlesource.com/c/1314634
Reviewed-by: Luna Lu <loonybear@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#605222}
bratell
GetClassName is a Win32 macro, use a different name in AXVirtualView
In jumbo builds, AXVirtualView::GetClassName sometimes expanded to
AXVirtual::GetClassNameW (but not always). This caused build breakage.

Rather than carefully ensuring that ui/views/accessibility is compiled
with the same GetClassName macro every time (be it defined or
not defined), just rename it to get the build going.

If the undef method is to be used, it needs be in the header file, but
then it will also affect View::GetClassName and that is another can
of worms. It's possible GetClassName should be added to
base/win/windows_types.h which could be used everywhere, but that
is a larger fix than just getting the build working again.

TBR=nektar@chromium.org,dmazzoni@chromium.org

Bug: 811277
Change-Id: I8e5a8b71f21d57ef03a5c5e58bee84b5b99b2abd
Reviewed-on: https://chromium-review.googlesource.com/c/1314488
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#604892}
bratell
[jumbo][extensions] Give two kPrefsName unique names
In jumbo builds many cc files compile in the same translation unit
which also means that they share the same anonymous namespace. That
means that constant names need to be unique in the whole build
target even if they are in anonymous namespaces.

A service worker extension just introduced a second kPrefsName into
extensions/browser which broke some (but not all) jumbo build
configurations. This patch renames them both to prevent
confusion (from compiler or human).

TBR=lazyboy@chromium.org,rdevlin.cronin@chromium.org

Bug: 889687
Change-Id: I6d3d44d9941038cc8e2304bc3100c7e681ea18a9
Reviewed-on: https://chromium-review.googlesource.com/c/1314468
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#604882}
bratell
Do more gn check of third_party/*
More of third_party/* has been made gn check clean and this CL
enables it for another 14 directories. Most (but not all) of the
rest look non-trivial.

Bug: 898837
Change-Id: I95c7348d8c1fa0bf85e0345aaaa9228f971a300e
Reviewed-on: https://chromium-review.googlesource.com/c/1309743
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#604365}
bratell
[jumbo] Give two GetPromoStringSpecifier() functions unique names
In jumbo builds many cc files compile together in the same
translation unit and then they share the same anonymous namespace.
That means that within a (jumbo) build target, also symbols in
anonymous namespaces need (build target) unique names.

In a recent patch, two GetPromoStringSpecifier functions appeared.
They are almost identical but not quite, so this patch just
gives them unique names to make all jumbo build configurations
happy again. Most jumbo build configurations were already happy
because the relevant files did not easily end up in the same
jumbo chunk.

See https://chromium-review.googlesource.com/c/1298394

TBR=collinbaker@chromium.org,bsep@chromium.org,nyquist@chromium.org,robliao@chromium.org

Change-Id: I5f244fc6a4e5b2047f2fdb443d0e40565c8bc103
Reviewed-on: https://chromium-review.googlesource.com/c/1309739
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Robert Liao <robliao@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604284}
fs
Fix ancestor bounding box for "disabled" <foreignObject> and <image>
Per:

 "A value of zero for either width or height disables rendering of the
  element and its embedded content."

 (https://svgwg.org/svg2-draft/embedded.html#Placement)

and:

 "For each descendant graphics element child of parent:
  * If child is not rendered then continue to the next descendant
    graphics element."

 (https://svgwg.org/svg2-draft/coords.html#BoundingBoxes)

<foreignObject> / <image> with 'width' or 'height' zero should not
contribute to an ancestor container's bounding box.

Bug: 643493
Change-Id: I097d9d28faaa52fc793dab251f22bc7b2610d6ad
Reviewed-on: https://chromium-review.googlesource.com/c/1309773
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#604276}
bratell
[zlib] Make build system pass gn check
There are some circular include dependencies in the zlib
build system because some parts are extracted into their
own targets. To make gn check understand that, those targets
need to be added to the allow_circular_includes_from list.

Bug: 898837
Change-Id: Ic94c5f5ac88e10792b458f4d734c4ad0487023c2
Reviewed-on: https://chromium-review.googlesource.com/c/1299135
Reviewed-by: Chris Blume <cblume@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#604210}
bratell
Move cacheinvalidation testing file to a testing build target
This allows third_party/cache_invalidation to be checked
with gn check (as soon as it's enabled in //.gn).

Bug: 898837
Change-Id: Ica669d8a7277178878d630b54879e1439350f566
Reviewed-on: https://chromium-review.googlesource.com/c/1307496
Reviewed-by: Nicolas Zea <zea@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#604196}
bratell
Correct abseil dependencies to make it possible to run gn check
//third_party/abseil-cpp is currently excluded from
gn check because of a couple of dependency fails. This patch
tries to fix those.

Most complicated is the dependency to gmock. The code does
include "gmock/gmock.h" which gn will see as a dependency on
//third_party/googletest:gmock.

Bug: 898837
Change-Id: I2c1d33935511e790e1343cb59db11908cf4fab15
Reviewed-on: https://chromium-review.googlesource.com/c/1307497
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Patrik Höglund <phoglund@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603976}
bratell
Removing dependency from blink/public to media/base
There is no reasonable target to depend on to get access
to media/base/video_rotation (depending on all of //media
seems to be the only way) so to clean up dependencies from
blink/public, forward declare the enum.

Better solutions are welcome.

Bug: 800764

Change-Id: Ic5079fbb11c6be189a3fc658ea9d10764c0149e5
Reviewed-on: https://chromium-review.googlesource.com/c/1301521
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603854}
bratell
Moving common_export.h to blink's public folder
common_export.h was kept out of public since it was not to be
directly included by users of blink's public API but that made
dependency tracking unnecessarily complicated and it was included
indirectly anyway since many public headers included it.

This patch moves the header to blink's public/common. It's still
not to be include by external blink API users, but there is also
no reason for them to do it. This allows us to remove the dependency
hacks and makes dependency checks easier.

Bug: 800764

Change-Id: I834f389f9c1871a5e1e66b2fa69477b7eb40e0a0
Reviewed-on: https://chromium-review.googlesource.com/c/1301467
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603654}
fs
Use clampTo<int> in SVGInteger::CalculateAnimatedValue
Matches what we do in SVGIntegerOptionalInteger::CalculateAnimatedValue,
and avoids undefined overflow.

Bug: 899445
Change-Id: I1250a05482713780f707301ed29e015fd81e65f2
Reviewed-on: https://chromium-review.googlesource.com/c/1304483
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#603548}
bratell
Remove non-existing headers from openh264 sources list
openh264 sources lists referred to two non-existing headers which
prevented gn check from successfully working on that code. This
patch removes those headers from the sources list. One of them
(utils.h) does exist but with another path, and it's already included
with that path,

Change-Id: Ie0a1e7e0b48295a28e9a89651e07800a70a36154
Reviewed-on: https://chromium-review.googlesource.com/c/1298956
Reviewed-by: Henrik Boström <hbos@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603483}
fs
Add use counter for SVG geometry properties unitless values
Add the kSVGGeometryPropertyHasNonZeroUnitlessValue use counter for
non-zero unitless (<number> / "user units") values in the 'x', 'y', 'r',
'rx', 'ry', 'cx' and 'cy' properties.

Bug: 899074
Change-Id: I1a7e6cdce018a75ed46745ec245dabcaed5ea954
Reviewed-on: https://chromium-review.googlesource.com/c/1301597
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#603454}
bratell
[jumbo] resolve ::switches / ::extensions::switches confusion
There is both a top level namespace ::switches and a sub
namespace ::extensions::switches so inside extensions,
if both namespaces are known to the compiler, you need to
clarify which one you want. This is the reason the code
style guide prohibits sub namespaces with the same name as
common top level namespaces.

This is a quick fix to make some jumbo builds happy. I am not sure
exactly what commit triggered this, but it can easily happen just
by adding an include somewhere.

TBR=hubbe@chromium.org

Change-Id: I22d742aa1645aa1b37317524e9b1aa18e91d2fd3
Reviewed-on: https://chromium-review.googlesource.com/c/1303362
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603452}
bratell
Remove s2.h from s2cellid sources lists
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

Change-Id: I656a0a2f3aeaded7cace52ebc39cf80e1907163b
Reviewed-on: https://chromium-review.googlesource.com/c/1288872
Reviewed-by: Jia Meng <jiameng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603437}
bratell
Delete unused WebCanonicalCookie::BuildCookieLine()
The BuildCookieLine() function violated layering by using
internal blink types in the blink public API but since it
wasn't used anyway it can just be deleted.

Also hide the export include from gn since it's an ugly
exception, just for debug component builds.

Bug: 800764

Change-Id: I7381e68f801e6037667d254d690faa376461e9da
Reviewed-on: https://chromium-review.googlesource.com/c/1301469
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603371}
bratell
Remove dependency from blink/public to webrtc/p2p
As part of making blink/public's dependencies automatically
checked by gn, this is one dependency that was unintended and
unnecessary. Moving the dependency into platform/export makes
for a cleaner API.

Bug: 800764

Change-Id: I4e5f2095bddc4e51de08ed16db51c248884dfd5f
Reviewed-on: https://chromium-review.googlesource.com/c/1301468
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603370}
bratell
Remove WebThread code violating dependency rules from blink/public
blink/public can't depend on internal blink code but luckily
the code that was violating this was unused so it could just be
deleted.

Bug: 800764

Change-Id: Id487e43362931677e93e15d736e7e74922103be0
Reviewed-on: https://chromium-review.googlesource.com/c/1301522
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603369}
bratell
Updated the .gn check_targets list to include all* of third_party/*
gn check by default only works on those targets that are listed in
check_targets, and since we can't whitelist all of //third_party,
every sub-folder has to be individually listed. Some were listed
before but this adds another two hundred.

5-10% of the folders are still excluded because they have one or
more internal check problems. Specifically third_party/blink is
not included yet. Working on it.

Bug: 898837
Change-Id: Ia2a2cc14c00ecfdb956eb553664efe46356dedc3
Reviewed-on: https://chromium-review.googlesource.com/c/1299086
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603156}
bratell
Making it (almost) possible to gn check blink/public/*
Mostly it's about marking includes inside INSIDE_BLINK as
// nogncheck

Also some added dependencies on for instance //media to cover
an include of "media/base/video_rotation.h" and on various
mojo headers.

There are five errors left which look like real layer violations.

Bug: 800764
Change-Id: Ie63283def2dadc6c0b5933175551e9addb9da5ec
Reviewed-on: https://chromium-review.googlesource.com/c/1299142
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603072}
fs
Remove 'using' directives in web_idb_cursor_impl_unittest.cc
All of the 'blink::*' directives should be unnecessary (now that the code
is within Blink.) Remove the testing::StrictMock 'using' too, and just
"expand" it at its single usage point.

Change-Id: I3171d05f41364fa134c2ee781e93178d831d4eab
Reviewed-on: https://chromium-review.googlesource.com/c/1301458
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603049}
fs
[jumbo] Remove 'using' declaration for mojom::blink::IDBCursor
The lone 'IDBCursor' can collide with the blink::IDBCursor. Remove the
'using' and specify the namespace instead.

TBR=pwnall@chromium.org

Bug: 717812
Change-Id: I092b6d3c30931f45d13fd5c35af24539884fa686
Reviewed-on: https://chromium-review.googlesource.com/c/1301434
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#603039}
bratell
Correct the spelling of a file in libxslt's sources list
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

Change-Id: I1bef29f477965e254e955970b1ab2471eb956f66
Reviewed-on: https://chromium-review.googlesource.com/c/1288870
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602810}
bratell
[ppapi] undef MemoryBarrier on Windows to avoid atomicops clash
MemoryBarrier is a macro in some versions of the Win32 API and it's
also a name in the base/atomicops.h API. If windows.h is included
after atomicops.h, further use of the atomicops API will fail
unless MemoryBarrier is undefined. See base/atomicops.h for more info.

Bug: 898475
Change-Id: I4a4be93d534f54a5758dc09d1b1e52c1f2bee79c
Reviewed-on: https://chromium-review.googlesource.com/c/1299139
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602793}
bratell
Correct a header path for sync.h in libsync
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

Change-Id: I37b2cff42454a5f4c49eb947289c279701639868
Reviewed-on: https://chromium-review.googlesource.com/c/1288972
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602773}
bratell
[flatbuffers] Make build system pass gn check
There were some broken dependencies that gn check reported
errors for which were easily fixed by moving relevant headers
to :flatbuffers. The other targets depend on :flatbuffers so
they can still use those headers.

Bug: 898837
Change-Id: I259a7e5d781ea17e667b6e6469a1133e875ec7b8
Reviewed-on: https://chromium-review.googlesource.com/c/1299137
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602753}
bratell
[libaddressinput] Make build system pass gn check
There were some missing headers that gn check found in
third_party/ced instead (string_util.h is a common name) and
then complained that libaddressinput can't include files from
third_party/ced. This adds those headers and some more.

It doesn't add the public headers since those have no natural
position in the dependency tree (used externally, and by util).

Bug: 898837
Change-Id: Iec0d622c0da861d149f86267eebafa63221d3906
Reviewed-on: https://chromium-review.googlesource.com/c/1299000
Reviewed-by: Mathieu Perreault <mathp@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602712}
fs
Insert an error message block when parsing was stopped after an error
The <parsererror> element was not being added to the parsed document in
certain cases involving attribute parsing. For example, if an undeclared
namespace prefix was used in the document, then parsing would stop, but
a <parsererror> element would not be inserted into the document to
indicate that a parsing error occurred.

When XMLDocumentParser::StopParsing() is called to stop parsing, call
InsertErrorMessageBlock() to insert the <parsererror> element if an
error occurred.

Based on https://codereview.chromium.org/771493002/ by dtrebbien@gmail.com

Bug: 295809, 898775
Change-Id: Ic67a3ab885fae4b01ca92f6d927b3f523f7423ed
Reviewed-on: https://chromium-review.googlesource.com/c/1224791
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602674}
bratell
[ppapi] Renamed two global variables and types in ppapi/proxy
In jumbo build experiments, the different
InstanceToDispatcherMap types and g_instance_to_dispatcher
globals ended up in the same translation unit and thus the same
anonymous namespace where the symbols clashed. This just renames
them as Dispatcher -> PluginDispatcher/HostDispatcher.

Bug: 898475
Change-Id: Ieae4310fdbe7ea27954011964d2bb6fa4d83e338
Reviewed-on: https://chromium-review.googlesource.com/c/1297145
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602647}
bratell
[ppapi] Merged three RunCallback methods doing the same thing
In jumbo build experiments, the different RunCallback functions
ended up in the same translation unit and thus the same
anonymous namespace where the symbols clashed. Since they,
and VideoDecoderResource::RunCallbackWithError had the same
implementation, this merges the functions into a shared
SafeRunCallback.

Bug: 898475
Change-Id: I3ee20972794d3c6ef73e49882e1ceba24c487e19
Reviewed-on: https://chromium-review.googlesource.com/c/1297427
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602646}
bratell
[jumbo] Change how jumbo.gni handles headers in sources
Up until now headers were removed from |sources| and then
reinserted. Cleaner/easier is to never remove them from the start.

Change-Id: I8f7560ef96f409880647e2924c2f71317f519468
Reviewed-on: https://chromium-review.googlesource.com/c/1290969
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602363}
bratell
Adding bratell@opera.com as owner of build/config/*jumbo*
Original developer and main maintainer.

Change-Id: Ia7eacd431f2d83c30ffb5231745b8fcfab8ebd21
Reviewed-on: https://chromium-review.googlesource.com/c/1297135
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602362}
bratell
[jumbo] Rename one of the OnNetworkServiceCrashed methods.
In jumbo builds, many cc files compile in the same translation
unit which means that they also share the same anonymous namespace.
This makes it necessary for constants and global scope functions
to have names that are unique in the build target.

This particular error only happens in extreme jumbo (many files
compiled at once) and not the more modest jumbo configurations
(8-50 files compiled at once) I think.

Change-Id: I86d15bcfd5c55db9592cb9423943d2e46b8f2e5c
Reviewed-on: https://chromium-review.googlesource.com/c/1297361
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#602359}
fs
Update isPointInFill/isPointInStroke to match spec adjustments
Rather than using the value of the 'pointer-events' property (and
indirectly, the 'visibility' property and potentially others not
explicitly listed in the spec), pass 'fill' and 'stroke' respectively to
better match spec [1].

Use AsPath() in isPointIn{Fill,Stroke} instead of going to the
LayoutSVGShape, to hopefully allow the LayoutSVGShape to be stricter
about invariants.

[1] https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement

Bug: 896638
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I4f8ef5ae4e84d29187e68ca243e3344a9a27544c
Reviewed-on: https://chromium-review.googlesource.com/c/1288574
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602018}
bratell
Fix spelling of crazy_linker_system.h in a sources lists
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

Change-Id: I030e6068e857de2957b4e20a3e53fc26af3017a8
Reviewed-on: https://chromium-review.googlesource.com/c/1288873
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601909}
fs
An <img> with no 'src', no 'alt' but 'srcset' represents nothing
Based on [1], it would seem that we should treat the case where we have
no image candidate as representing nothing - this apparently also
matches what other UAs do.

Simplify the NoImageSourceSpecified helper function a bit. (IsNull
implies IsEmpty and !hasAttribute.)

[1] https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element:the-img-element-5

Bug: 897033
Change-Id: I37ecad8faea2b929e8cf35ce7c746313b2d3b915
Reviewed-on: https://chromium-review.googlesource.com/c/1293574
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#601648}
bratell
Remove duplicate plugin header in sources list
pepper/fullscreen_container.h sometimes appeared twice in
the sources list. This confused some other tools so it seems
like a good idea to only have it there once.

Change-Id: I02d88c68c6581eadb171ca5a5d72f75281c52717
Reviewed-on: https://chromium-review.googlesource.com/c/1293455
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601550}
fs
Plumb HitTestLocation further in LayoutSVG*
Plumb HitTestLocation into clip-path handling and
LayoutSVGShape::*Contains.

Change-Id: Ibd4e433e868ac427e637f906ff3d778fd33e1a80
Reviewed-on: https://chromium-review.googlesource.com/c/1291409
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#601413}
bratell
Remove duplicate header wtf/test/string_statics.h from sources list
A header appeared twice in the sources list which confused some
other tool. Seems like better to have it there only once.

Change-Id: If713c5a241fab6e8fb30705240bc534e0598f704
Reviewed-on: https://chromium-review.googlesource.com/c/1290909
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601331}
bratell
Remove deleted file ssl_validity_checker_android.h from build system
The file payments/android/ssl_validity_checker_android.h was
removed when the JNI registration code changed but it remained
in the sources list, where it ended up causing some unrelated
problems so here it goes.

Bug: 683256
Change-Id: I7e57af91ad5848c73d814fc4b89712d106ecf358
Reviewed-on: https://chromium-review.googlesource.com/c/1290271
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601328}
bratell
For ios, only compile the necessary parts of //ipc.
Until recently ios didn't use //ipc but //services/network
needs some small parts of them. Some of the rest of the ipc
code won't even link in ios since ios has no
discarding some unused object files before noticing they referenced
non-existing symbols.

base: :WaitableEventWatcher. It's built so far thanks to the linker
Change-Id: Ieaf3749e1b4f0d8f46f652248b839ae9e8650282
Reviewed-on: https://chromium-review.googlesource.com/c/1273498
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601218}
bratell
Remove headers in mojo and data_decoder sources list
Some headers appeared twice in some sources list. This confused
some other tools so it seems like a good idea
to only have them there once.

Change-Id: Ifa0c7b2e0fbb8b7ec401bad2737384cffa3d940a
Reviewed-on: https://chromium-review.googlesource.com/c/1290949
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601177}
bratell
Remove duplicate headers from base sources list
allocator/allocator_shim.h and base/base_paths_posix.h were
in base's |sources| list twice each in some configuration.
This removes the duplicates since that confused some tools.

Change-Id: I0dfbf796a73ce28fd66352afe0651e61058506eb
Reviewed-on: https://chromium-review.googlesource.com/c/1290910
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601139}
bratell
Fixed misspelled references to browser_switcher headers
Some isolate step errors in trybots mentioned these non-existing
headers so hoping the trybots will be happier, this patch removes
and changes the names to point to existing files.

Bug: 881589
Change-Id: I6c7728110a9ce162293c57606824140cdacd8d38
Reviewed-on: https://chromium-review.googlesource.com/c/1286660
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601133}
bratell
Headers in :make_core_generated_css_value_id_mappings appeared twice
The target :make_core_generated_css_value_id_mappings was listed
twice which made its output be twice in some sources lists. This
confused some tools. Seems better to only have it there once.

R=fs@opera.com

Change-Id: I1da2cfbda7021fa5262d0c0a74b894989fc200de
Reviewed-on: https://chromium-review.googlesource.com/c/1290929
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601105}
fs
Add TransformedHitTestLocation helper
This moves code for transforming a HitTestLocation using with an
AffineTransform from the helper function
SVGLayoutSupport::TransformToUserSpaceAndCheckClipping into a helper
class TransformedHitTestLocation.

Calls to SVGLayoutSupport::IntersectsClipPath are hoisted into callers
and SVGLayoutSupport::TransformToUserSpaceAndCheckClipping is removed.

Change-Id: I52f95ba2480df86a509285c2ec2edea776517bc6
Reviewed-on: https://chromium-review.googlesource.com/c/1282930
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#601099}
bratell
Remove aes_via_ace.h from the the minizip sources lists
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

Change-Id: I5db5e075cf4d01783fb44660ee008ea0fa9a26c6
Reviewed-on: https://chromium-review.googlesource.com/c/1288871
Reviewed-by: Yuki Awano <yawano@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601091}
bratell
Clean some harfbuzz-ng sources lists from headers that are gone
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

This is mostly that harfbuzz-ng has stopped using the suffix
"-private" on headers.

Change-Id: I6f3bd45378b011c8ea33fa98053c507fbdc68ed2
Reviewed-on: https://chromium-review.googlesource.com/c/1288791
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601089}
fs
Generalize computation of stroke bounds for LayoutSVGShape
Store the (stroke) geometry class in the LayoutSVGShape. This allows us
to compute stroke bounds in a slightly less "context-aware" way. This is
a step on the way to break up UpdateShapeFromElement into several steps.

We can also get rid of LayoutSVGPath::HitTestStrokeBoundingBox since we
now carry the information it provided in the geometry class.

The geometry class also replaces the LayoutSVGShape::affected_by_miter_
so it is removed, and replaced with a new kNoMiters class type.

Bug: 435097, 493888
Change-Id: I422b72451c6cea8045dea547a500984863e83a8d
Reviewed-on: https://chromium-review.googlesource.com/c/1288359
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601081}
bratell
Remove references from blink/public to non-existing headers
An android specific block in BUILD.gn kept some references to
files that no longer existed after a cleanup in
https://chromium-review.googlesource.com/896839

This caused some local issues with trybots so it was time to
clean up the build files. Bye unnecessary code block.

Bug: 808221
Change-Id: I29ff4fc149fe408bd2a97517fbc338b408d13e7d
Reviewed-on: https://chromium-review.googlesource.com/c/1290272
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601073}
bratell
Remove discard_reason.h from chrome sources lists
The file discard_reason.h was deleted when its content
moved into a mojom file in
https://chromium-review.googlesource.com/1176267 but
it was not removed from the sources lists. This caused
some local problems with trybot servers so here it goes.

Change-Id: I873bc5e643c87f83197b4f0512d2859371c1e005
Reviewed-on: https://chromium-review.googlesource.com/c/1288794
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601065}
bratell
Correct the path of some woff2 headers in sources lists
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

Change-Id: Ie643b34a044b927021ce8ad2774568973c328a3c
Reviewed-on: https://chromium-review.googlesource.com/c/1288793
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#601061}
bratell
Correct spelling of a crc32c header in BUILD.gn.
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

Change-Id: I5bfe35139a41ab5d88aca564b1f7a2ded5ebab06
Reviewed-on: https://chromium-review.googlesource.com/c/1288971
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600818}
bratell
Clean some blink sources lists from headers that are gone
Not all sources lists have been kept up to date with code
movement/removal and it seems to make some isolate steps in
cq sad for some CLs (mine).

R=haraken@chromium.org

Change-Id: I2657e05f5df6079f4b493ea9a7df8ee6bbdbf544
Reviewed-on: https://chromium-review.googlesource.com/c/1288970
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#600817}
fs
Refactor computation of stroke bounds in LayoutSVGShape
Move all stroke bounds related computations into the
CalculateStrokeBoundingBox() method in LayoutSVGShape. Add a new enum
StrokeGeometryClass, and pass that as an argument to the method.
Currently all callsites use a constant argument value. This will be
modified in a future CL.

Split out computation of the bounds for non-scaling-stroke into a new
method CalculateNonScalingStrokeBoundingBox().

Also fold LayoutSVGShape::CalculateObjectBoundingBox() since it only has
a single caller.

Bug: 435097
Change-Id: I538b31f98dc7f0777e2538ef74b5e3553b435a7f
Reviewed-on: https://chromium-review.googlesource.com/c/1276770
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600733}
fs
Remove ImageObserver::AnimationAdvanced
This is only called from test-code, and thus is dead in practice.
Replace uses in test-code with the the Changed() method.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9cdf92314140e65c30bc2a901d34345bf128392d
Reviewed-on: https://chromium-review.googlesource.com/c/1286813
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#600538}
bratell
Removed webdatabase/BUILD.gn references to deleted headers.
In February a number of obsolete header files were deleted but
some of them were still listed in sources lists. That might have
caused isolate step errors in trybots.

Bug: 778580
Change-Id: Ica026a5d157c64f07465f520a15ed2ffab92c234
Reviewed-on: https://chromium-review.googlesource.com/c/1286428
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#600492}
fs
Split out HitTestFragments from SVGInlineTextBox::NodeAtPoint
We can only ever hit the same Node in this loop, so even if the query
is penetrating/list-based we won't add more to the result if we would
happen to hit multiple fragments.

It's also easier to read and maybe slightly faster in some cases.

Change-Id: I3ce41ce58ef4a188d948690b1840d66e20ac0631
Reviewed-on: https://chromium-review.googlesource.com/c/1277792
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#600479}
bratell
Removed reference to deleted scheduler/util/thread_type.h
scheduler/util/thread_type.h was deleted in January but the
reference to it in BUILD.gn remained. Now that seems to make
the isolate step in trybots sad.

Bug: 776416
Change-Id: Iff685c54def879a8c5a53c9893f1c7eef4c9c13c
Reviewed-on: https://chromium-review.googlesource.com/c/1286851
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Alexander Timin <altimin@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600455}
bratell
Removed reference to deleted speech_recognition_client.h
In chasing isolate step errors in trybots, this is removing some
dangling references from a BUILD.gn file (though it seems to be
a never-ending sequence of problems so whatever started generating
the isolate step errors should probably be reverted).

Bug: 781655
Change-Id: I09f530fa4a1e1cf3e1c0f15125eb8d9886f1038b
Reviewed-on: https://chromium-review.googlesource.com/c/1286818
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Adithya Srinivasan <adithyas@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#600448}
bratell
Create a windowsx_shim.h for windowsx.h patching
Despite existing undefs, windowsx.h macros cause troubles with
some jumbo builds. We can add more undefs, or we can change
approach to this, a windowsx_shim.h that solves the same
problem at one place instead of many.

The macros that have caused the most problems are IsMaximized,
IsMinimized and IsRestored which are common names to use in
code that manages windows.

Change-Id: Ib5f429aaeca4c35962c17a9973274e486b510c2f
Reviewed-on: https://chromium-review.googlesource.com/c/1280429
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#600422}
bratell
Removed BUILD.gn reference to non-existing void_callback.h
The file void_callback.h has never existed but there was
a VoidCallback.h in third_party/WebKit until February this year
when it was deleted in a cleanup.

This might have triggered isolate step errors on trybots.

Bug: 778580

Change-Id: I659c7ec456a8c21a274d1743d701061c798c7ace
Reviewed-on: https://chromium-review.googlesource.com/c/1286811
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#600418}
tmoniuszko
Add missing include to chrome_authenticator_request_delegate.cc
ListPrefUpdate is used in this file. It fails to compile with some build
configurations.

Change-Id: Icebb5b6f0ab59d4fad05ce3c1d2b6b64225f77ea
Reviewed-on: https://chromium-review.googlesource.com/c/1286467
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600367}
bratell
[jumbo] Merge two identical kFaviconsPerCategoryImage constants
In some jumbo build experiments (not official) there was an
identical constant in two explore_sites files. In jumbo builds
many cc files are merged into one translation unit for much
faster compilation.

This moves the constant to a header where it can be reused.

Change-Id: Id460645a39d69999bf2227c25651d1149f1a6d6c
Reviewed-on: https://chromium-review.googlesource.com/c/1275895
Commit-Queue: Justin DeWitt <dewittj@chromium.org>
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600172}
fs
Remove redundant hit-testing result handling in LayoutSVG{Container,Root}
The children/leaves (LayoutSVGShape et al) will handle this.
Cf. LayoutBox::HitTestChildren.

Move the code to SVGLayoutSupport::HitTestChildren, and share that
between the two users.

Change-Id: Ibad76d35d90b2738cc3b840e0762147ef5098b4d
Reviewed-on: https://chromium-review.googlesource.com/c/1278401
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#599832}
fs
Path2D.addPath should throw if DOMMatrix validation fails
Step two of [1], invokes [2], whose step 1 invokes [3], which says to
throw a TypeError if the dictionary is not "well-formed".

Also remove some dead code in DOMMatrix/DOMMatrixReadOnly and remove few
unused includes of svg_matrix_tear_off.h.

[1] https://html.spec.whatwg.org/multipage/canvas.html#dom-path2d-addpath
[2] https://drafts.fxtf.org/geometry/#create-a-dommatrix-from-the-2d-dictionary
[3] https://drafts.fxtf.org/geometry/#matrix-validate-and-fixup-2d

Bug: 895244
Change-Id: Icd3f7058ce945d761ab7128e294ccc2e3fd3a879
Reviewed-on: https://chromium-review.googlesource.com/c/1278789
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#599723}
fs
Replace ShapeValue::IsImageValid with StyleImage::CanRender
The former looks like an open-coded version of the latter. Using the
latter will be more consistent (and future-safe.)

Change-Id: I3353d0181201df681779575d78fe0df22065a9e4
Reviewed-on: https://chromium-review.googlesource.com/c/1280447
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#599691}
bratell
Unduplicate GetHitTestQuery helper method.
Quickfix to resolve some jumbo build problems after a duplicate
instance of the GetHitTestQuery function was added.

Change-Id: I924ff8254e59d00a92170d09664c20328209103a
Reviewed-on: https://chromium-review.googlesource.com/c/1256688
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599628}
fs
Rename SVGLayoutSupport::PointInClippingArea to IntersectsClipPath
This function specifically checks only the shape(s) defined by the
'clip-path' property. It will also learn to handle more than just points
in the near future.

Change-Id: Icae665ff000ed5da2f7b0c5fad77411c856d176b
Reviewed-on: https://chromium-review.googlesource.com/c/1278402
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#599627}
bratell
Prepending switches by :: to not clash with safe_browsing::switches
There is both a ::safe_browsing::switches namespace and a ::switches
namespace. If you inside the safe_browsing namespace write |switches|
it will map to ::safe_browsing::switches if that namespace is known to
exist. In some jumbo builds where many cc files are compiled together
the compiler knows about that namespace and chooses it wrongly.

There is a style guide instruction to not use sub namespace names that
are identical to top level namespace names, probably for this reason,
so maybe all sub namespaces named |switches| should be given new
names, the same way that has already happened to some |features|
namespaces.

This patch is a small trivial fix, add a :: prefix to |switches| to
make it clear which |switches| namespace is intended.

Change-Id: I2f39ca26b2174455b94eeadd8b6cfb756248a6c9
Reviewed-on: https://chromium-review.googlesource.com/c/1278729
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#599595}
bratell
Adding a const to a static char array
When a different static char broke the build (for unrelated
reasons), I looked through the tree for other static chars without
const. This was the only other one outside third_party and tests.

It's possible the generated machine code is the same, or it might
become better this way. Depends on the compiler/linker/OS.

Change-Id: I11a75cda4de25d468357f36e1afb23c79460ace8
Reviewed-on: https://chromium-review.googlesource.com/c/1278730
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599241}
ckulakowski
Set proper permissions for package's framework directory.
Bug: 893616
Change-Id: I09d5d906c3cb2e075e142a36b3ebe9b6532eb11f
Reviewed-on: https://chromium-review.googlesource.com/c/1271001
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599218}
fs
Enable ZoomAndPan in an "SVG document" without an <svg> document element
Disabling zoom and pan in this (odd special-)case leads to some weird
behavior, so just enable it instead to avoid confusion.

This takes care of one of the testcases mentioned in the referenced bug,
but does not address the real issue in any way.

Bug: 222786
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I25d9cbf9cd10c1631d64fddcd133014b9602bcba
Reviewed-on: https://chromium-review.googlesource.com/c/1275886
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#598756}
bratell
[jumbo] Give two kNodeNumberLimit constants unique names
In jumbo builds many cc files compile together in the same
translation unit, and thus share the same anonymous namespace.
That means that constants need to have unique names in the
whole build target, and not just unique in the file.

This renames two constants, one that was just added/copied and
one that already existed to give them more descriptive, and
unique, names.

TBR=maxlg@chromium.org,skobes@chromium.org

Bug: 893068
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I45ec9852370fb5572fd53e21136a21f1dd14e220
Reviewed-on: https://chromium-review.googlesource.com/c/1275891
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#598730}
bratell
Remove impossible mojo/public/cpp/system file from nacl build
file_data_pipe_producer.cc refers to the base::File::File(path, flags)
constructor which does not exist (dangling symbol) in nacl builds. It
can work anyway if the whole object file is unused and gets ignored
by the linker. That didn't happen in jumbo build experiments where
file_data_pipe_producer.cc was combined with other files before being
compiled.

So let's not compile dead code that would not be possible to link anyway.

Change-Id: I39de768fb241bee2111bd29a516c5973951cdbd0
Reviewed-on: https://chromium-review.googlesource.com/c/1268320
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#598357}
bratell
Prevent X509_NAME collisions between Win32 and OpenSSL
Both OpenSSL/BoringSSL and some Windows headers define X509_NAME and
to avoid problems, we have wrapped wincrypt.h in crypto/wincrypt_shim.h.

The Win32 header xpsprint.h turned out to indirectly include wincrypt.h
so it too needed special treatment to not cause clashes with OpenSSL/
BoringSSL. This occurred when compiling chrome/service/cloud_printing with
jumbo, where OpenSSL and printing/backend/win_helper.h ended up in
the same translation unit.

Change-Id: I0dab33a4692b76817bc51ed355dad48e7ebe829b
Reviewed-on: https://chromium-review.googlesource.com/c/1258163
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#598290}
bratell
net test_support uses Mac Security functions so link against those
keychain_test_util_mac.cc uses for instance SecKeychainCreate
which is a platform function. If that usage survives all the way
to the linker and nobody else links against Security.framework,
there will be a linker error.

This patch adds a lib dependency so that the function will always
be found. Normally this works anyway because usage of
for instance SecKeychainCrete will be removed before the linking
step thanks to dead object file removal.

Change-Id: I80bb38a2d2d79a7df525ab8c8ab90fcfeb12761f
Reviewed-on: https://chromium-review.googlesource.com/c/1268242
Reviewed-by: David Benjamin <davidben@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#597982}
bratell
Add a comment to generic_stop.icon to explain why it's not stop.icon
The file was added as stop.icon which broke some builds, was
renamed generic_stop.icon to unbreak those builds.
See https://chromium-review.googlesource.com/c/chromium/src/+/1261042

R=estade@chromium.org

Bug: 877702
Change-Id: If90932dac4868053748e25f2d0f0dd15876087cc
Reviewed-on: https://chromium-review.googlesource.com/c/1269730
Reviewed-by: Evan Stade <estade@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#597928}
bratell
Renamed some duplicate symbols in Blink paint timing code
image_paint_timing_detector.cc and text_paint_timing_detector.cc
are similar and had identically named helper functions. This
broke some jumbo builds. This patch renames the helper functions
to have unique names.

Bug: 869924
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I0a42ef4f647ea0b5bfb80bf9dc363a0650424efd
Reviewed-on: https://chromium-review.googlesource.com/c/1268135
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#597517}
bratell
Move crypto/wincrypt_shim.h to remove build dependency on crypto
The DEPS system and gn will enforce some kind of dependency on
//crypto if code needs to use crypto/wincrypt_shim.h. Now, that
header file will not in itself indicate a dependency on actual
code in //crypto so the dependency becomes a bit unexpected. By
moving it to base/win, code can avoid depending on //crypto just
to use that header file.

This became an issue when //printing needed to use wincrypt_shim.h

Change-Id: I68a3b8263da0d4307907a0b242444402675072a4
Reviewed-on: https://chromium-review.googlesource.com/c/1261024
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#597256}
bratell
Break up dependency cycle between search_engines and omnibox
In 2015 a dependency from search_engines to omnibox was created
and it's created a cycle that causes linking problems in some
ios+jumbo configurations. It works without jumbo because the cycle
will be part of a dead .o file which will be ignored by the linker.
With jumbo the .o file is not 100% dead anymore since dead and live
code will be mixed in it.

Bug: 488901
Change-Id: I4b36a1b4e9f46a2814d9562f288e55dadc63d9dd
Reviewed-on: https://chromium-review.googlesource.com/c/1254082
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597093}
fs
Avoid resolving the URL twice when initiating image loads
Rather than resolving the URL again during Task::Create, pass the KURL
resolved by ImageLoader::UpdateFromElement through.
Also move the resolution before the |loading_image_document_| special-
case.

Bug: 889183
Change-Id: I52ea65d1af96a5919e128f0623fa6bd9026850f7
Reviewed-on: https://chromium-review.googlesource.com/c/1254266
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#597071}
bratell
Avoid creating a local mojom namespace that confuses symbol lookup
A local mojom namespace meant that it became ambigious inside the
content namespace whether "mojom" meant "::mojom" or
"::content::mojom". This problem surfaced in jumbo build experiments
where the compiler knew about the ::content::mojom namespace. In
most builds the compiler only knows about ::mojom and then it
compiles.

Bug: 746953
Change-Id: Ifec37f45009693d7e41eb393ca9bbea136f884b2
Reviewed-on: https://chromium-review.googlesource.com/c/1256926
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#596665}
fs
Replace WebStringToGURL with KURL::operator GURL in NetworkUtils
This allows reusing the data from the KURL - i.e does not require
performing canonicalization again.

Bug: 889183
Change-Id: I10e5f9b3725a0fb25594bc6dbe61791bb3826fe9
Reviewed-on: https://chromium-review.googlesource.com/c/1257927
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#596663}
fs
Perform a cycle check on the <use> target up front
Rather than deferring the check until ExpandUseElementsInShadowTree
(which will fail if the initial target is an ancestor of the <use>),
just check for cycles directly in BuildShadowAndInstanceTree(), and
don't build the initial shadow tree if the cycle check fails.
Stop cleaning up the partial tree after ExpandUseElementsInShadowTree(),
and adjust HasCycleUseReferencing such that it detects cycles earlier
(not requiring a clone into the shadow tree before a cycle can be
noticed.)

Behavior-wise this means that we now don't clone a target subtree if it
will create a cycle. We will however abort cloning of nested <use> after
a cycle is detected.

Bug: 397525
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I1b2c22bacb63d788509ec7984ac35357b84a3020
Reviewed-on: https://chromium-review.googlesource.com/c/1258065
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596652}
bratell
Rename some newly added k...Key constants that broke jumbo builds
The new extensions_internals_source.cc code used the same constants
as extension_basic_info.cc, and since in some jumbo builds those
files compile in the same translation unit, those clashed.

This is a quick rename to give the clashing variables unique names
to make builds happy again. An alternative solution would be to
reuse the variables if they have the same value (the linker will
(probably?) merge them anyway so probably no wasted binary size).

TBR=dbertoni@chromium.org,rdevlin.cronin@chromium.org

Bug: 891788
Change-Id: Ia7342f249c9bb0cdb6697e8be00413879b26d284
Reviewed-on: https://chromium-review.googlesource.com/c/1261104
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#596572}
bratell
kStopIcon is a constant in the OSX APIs so rename kGenericStopIcon
Jumbo Mac fyi builder broke when a kStopIcon was introduced in
https://chromium-review.googlesource.com/c/chromium/src/+/1239010
because the OSX API has a kStopIcon in
.../MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Headers/Dialogs.h

This renames it to kGenericStopIcon to make the builds go again.

TBR=jrw@chromium.org,estade@chromium.org

Bug: 877702
Change-Id: Id6c675b539f8e3161ef322bf008174ec2911d4be
Reviewed-on: https://chromium-review.googlesource.com/c/1261042
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#596571}
fs
Avoid UTF-8->UTF-16 conversion in HashAndUTF8CharactersTranslator
The Translate() function can use the same check as Equal() to determine
if the string is ASCII-only. Saving a conversion from UTF-8 to UTF-16.

Bug: 889183
Change-Id: Ieffab05f34a1e4a2ef725e298e7f15e7ff14a3f8
Reviewed-on: https://chromium-review.googlesource.com/c/1257928
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Yuta Kitamura <yutak@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596556}
bratell
Removing unused private field from Windows NSSDecryptor
Coding standard and compiler do not like unused private fields, but
sometimes they slip between the cracks until they trigger something:

In file included from gen/chrome/utility/utility_jumbo_1.cc:12:
In file included from .\../../chrome/utility/importer/firefox_importer.cc:26:
In file included from ../..\chrome/utility/importer/nss_decryptor.h:13:
../..\chrome/utility/importer/nss_decryptor_win.h(169,29):  error: private field 'PK11_CheckUserPassword' is not used [-Werror,-Wunused-private-field]
  PK11CheckUserPasswordFunc PK11_CheckUserPassword;
                            ^
1 error generated.

This removes the unsued field. Also removing an "explicit" to get past
presubmit checks.

Running presubmit upload checks ...

L: \src\clean_chromium\src\chrome\utility\importer\nss_decryptor_win.cc:18:  Zero-parameter constructors should not be marked explicit.  [runtime/explicit] [5]
Change-Id: Id310c0f65a406c1a47ec29312472580d15dfd1ce
Reviewed-on: https://chromium-review.googlesource.com/c/1259018
Commit-Queue: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596375}
mharanczyk
Override manifest handler registry in ManifestHandlerPerfTest.
MANUAL_CommonMeasureFinalization and MANUAL_CommonInitialize tests
reseted global registry on exit without initializing it again causing
random test flakes on tests that operated on manifests that happen to
run after those two tests (they passed on retry).

Change-Id: I2b4297d33441c72d9cdd099106abad68921c2f6a
Reviewed-on: https://chromium-review.googlesource.com/1259046
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596271}
fs
Restructure cycle checking in SVGUseElement
Hoist call to ResolveTargetElement() out of HasCycleUseReferencing(),
leaving the latter only checking for cycles.
Drop the InUseShadowTree() check from BuildShadowAndInstanceTree since
its single caller checks it already.
Use ToSVGElementOrNull to simplify the code a bit.

Bug: 397525
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Idb6cbd9e155d6217db77ef97299e77fa57cd0d8d
Reviewed-on: https://chromium-review.googlesource.com/c/1257918
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#596202}
fs
Use StringUTF8Adaptor in KURL::operator GURL
This can save a conversion to UTF-8 (and copy to CString) for ASCII-only
URLs.

Bug: 889183
Change-Id: Ie5edad4a95da70bac0acd27b01d6e03cd1315bbd
Reviewed-on: https://chromium-review.googlesource.com/c/1257926
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596192}
bratell
Removing safe_browsing::features to not clash with ::features
According to the coding style guide a sub-namespace should not
have the same name as a common top level namespace. That still
happens with many "features" namespaces which causes problems
whenever the compiler knows about the root ::features namespace.

This patch removes the namespace completely and lets the
constants live in the safe_browsing namespace directly, making
the code a little shorter.

Another option would have been to rename the namespace from
::safe_browsing::features to ::safe_browsing_features like was
recently done to some other features namespaces, for instance app_list_features.

Change-Id: I3655cca7fb56b45a03118a80a957599bd5f316b3
Reviewed-on: https://chromium-review.googlesource.com/c/1251604
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596179}
bratell
Remove unused OptionMenuModel from components/translate
It was linked into some jumbo build experiments where it triggered
link errors.

If you include an object file, for instance options_menu_model.o, in
an archive, for instance libtranslate.a, and nothing references that
object file, then the linker won't care if options_menu_model.o is
referencing all kinds of undefined symbols. It's a feature or quirk
depending on who you asks.

With jumbo compilation this options_menu_model.o would be combined
with 7+ other .o files into translate_jumbo_1.o and since the .o file
is no longer completely unused, the linker will get upset about the
dangling references.

So something that used to be "just" dead code compilation with
dangling references becomes a linking error when compiling with jumbo.

Change-Id: Id15f7e15804efe2fdf959c4db7fdade061477102
Reviewed-on: https://chromium-review.googlesource.com/c/1256685
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596168}
fs
Fix wpt/css/css-masking/mask-svg-content/mask-text-001.svg
The test has fixed dimensions of 100x100 pixels - the reference does
not. Add same fixed dimensions to the reference to get the same clipping
behavior.

Bug: 890755
Change-Id: Ib3d12ad1f7ace05027b81b9c683158490ae116ab
Reviewed-on: https://chromium-review.googlesource.com/1256568
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#595936}
bratell
Include .h file instead of .cc file, fixing linking problem
In some builds there were duplicate symbols because a cc file
was compiled twice and linked with itself. This happened because
some code accidentally included the cc file instead of the header.

Change-Id: Ifa145ce13190a9fa855e06986ca60605005aa9fc
Reviewed-on: https://chromium-review.googlesource.com/1255824
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595853}
bratell
Rename a header so that it has the .h suffix
input_predictor_unittest.cc is used purely as a header file so
it should have the .h suffix. Now it looks like some .cc files
are trying to include another .cc file.

The class was too large to have an implicit inline
constructor/destructor so those remain in a cc file. This presubmit
check didn't work before because the file was named *.cc.

Change-Id: I67740f4181ea60d02cd3149ce57b0d4e8c36aaf2
Reviewed-on: https://chromium-review.googlesource.com/1255638
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#595838}
bratell
Resolve conflicts between Win32 headers and OpenSSL
Both some Win32 headers and OpenSSL/BoringSSL defines some
constant macros like X509_NAME. To avoid that clash we have
a wrapper for <wincrypt.h>, crypto/wincrypt_shim.h Use that
one in chrome/chrome_cleaner/os/system_util.h too since
that header might be used close to OpenSSL code.

Change-Id: I678b5aa1658e8436eed4b431e6c2950ce7acfb3b
Reviewed-on: https://chromium-review.googlesource.com/1255825
Reviewed-by: Joe Mason <joenotcharles@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#595820}
bratell
Avoid having two global GetInfo() methods in the same module
In jumbo builds a whole build target can compile together
and share the same anonymous namespace. Then two methods with
the same name and arguments will clash which happens in
chrome/common.

This resolves that clash twice over by giving one GetInfo a
longer name and inlining the other one since it was only used
once in a one line function.

Bug: 890323
Change-Id: Icbb1d768bdf9c1385f35bebd54d0d008e4be49d9
Reviewed-on: https://chromium-review.googlesource.com/1251603
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#595765}
fs
Adjust SVGImageElement::InsertedInto to match HTMLImageElement
This does the same edit to SVGImageElement::InsertedInto as
https://chromium-review.googlesource.com/1141121 did to HTMLImageElement.

Bug: 864306
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I74696c16c27eba363e4965d996f3ae688ef27c91
Reviewed-on: https://chromium-review.googlesource.com/1254265
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#595507}
bratell
Resolve Windows conflict between zlib and angle
Windows normally defines macros so that FAR expands to far, and
far expands to nothing.

Angle undefs far, leaving the FAR macro hanging, expanding to far
which is not a legal keyword anymore. zlib already tries to handle
that someone/something has undefined FAR but it doesn't handle
that someone/something has undefined far. This patch changes that.

This problem appeared in some jumbo builds in
gpu/command_buffer/service which uses both angle and zlib.

Bug: 889429
Change-Id: Ia3b10a9a82fc51b302c67b24a19f30a73bdda489
Reviewed-on: https://chromium-review.googlesource.com/1245723
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595425}
fs
Include CSSPropertyID HashTraits in renderer/core/svg/svg_element.cc
SVGElement::CssPropertyIdForSVGAttributeName has a:

  HashMap<StringImpl*, CSSPropertyID>

which will require traits for the value (CSSPropertyID). Without Jumbo
this usually works out by using the default traits.

Bug: 890434
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I6ff50a0648106057dad898d1fe6d79e9a53a1bd2
Reviewed-on: https://chromium-review.googlesource.com/1253662
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#595414}
fs
Fix WebP sniff pattern
The current pattern wouldn't be able to sniff the 'lossless' and
'extended' WebP formats.

Adjust the pattern to match the one described by [1].

[1] https://mimesniff.spec.whatwg.org/#matching-an-image-type-pattern

Bug: 889420
Change-Id: I4b5a73d4d9477502d58df7460b9494e6540a59f3
Reviewed-on: https://chromium-review.googlesource.com/1248782
Reviewed-by: Asanka Herath <asanka@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#595273}
bratell
Give two g_lazy_tls global variables unique names
In content/child there were two g_lazy_tls global variables
in two different anonymous namespaces. In jumbo build experiments,
where many files compile together and share anonymous namespace,
those globals collided. This patch gives them more distinct names.

Bug: 746953
Change-Id: Icac936f2092d1c8b1bc5de38d443d71cb8955045
Reviewed-on: https://chromium-review.googlesource.com/1251605
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#595100}
bratell
[jumbo] One kInvalidId constant should be enough.
Jumbo compilation in components/sync broke when a kInvalidId
clone appeared with the same name. This build unbreaking patch
renames it to kInvalidNodeId. A longer term fix is probably to
move the constant to modules/sync/base or another shared location.

Regression from https://chromium-review.googlesource.com/c/chromium/src/+/1164742

TBR=mastiz@chromium.org,treib@chromium.org

Bug: 870624
Change-Id: Ie300cf3338c8ffb93a2a0b3b656838bdbf10248a
Reviewed-on: https://chromium-review.googlesource.com/1250965
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#595052}
fs
Use LayoutRect for frame rect in HitTestResultInFrame
This is consistent with how the frame rect is treated in other cases of
hit-testing (such as LayoutView::HitTestNoLifecycleUpdate). It also
eliminates the need for HitTestLocation::Intersects(const FloatRect&).
(The other "use" of this method is removed since it isn't used.)

Bug: 823796
Change-Id: I7532f0e685e9960d8afd16f9b41d699ae27bfd11
Reviewed-on: https://chromium-review.googlesource.com/1249142
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594795}
bratell
Removing unused field in DXVAVideoDecodeAccelerator
Some jumbo build configurations would not compile because of
the unused field. The are not allowed by the build system but
sometimes only jumbo builds notice such things since they
have access to more source code.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I079412fc98e5812f709b6566d02de9d91a5a8706
Reviewed-on: https://chromium-review.googlesource.com/1249485
Reviewed-by: Frank Liberato <liberato@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#594759}
bratell
[net] Don't compile RemoteTestServer for iOS since it's unused
Noticed because RemoteTestServer refers to BaseServer which
is not included in ios builds.

Change-Id: I006a32ca751dd8d9e3c3d6be6ece93f30e0bc992
Reviewed-on: https://chromium-review.googlesource.com/1244841
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Asanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594639}
fs
Remove marker handling from SVGResources::RemoveClientFromCache
Markers don't actually have any per-client caches, so all this code does
is trigger a call to SetNeedsBoundariesUpdate - but if a marker was
changed this flag would already be set. Hence worst case we may end up
updating more than need (update the shape when only the transform
changed for instance.) Not generally a huge deal, but also not good.

Bug: 225808, 534817
Change-Id: I4d958cbc700c101a471c4ced1d79591cd1f2ebc9
Reviewed-on: https://chromium-review.googlesource.com/1245709
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#594376}
bratell
[ios] Fix typo: include header instead of mm file.
This caused a link error, duplicate symbols, in a jumbo build
experiment. How it ever worked in normal builds we'll never know.

Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I4136a153aa989f2187d745f291658ac4e05fa6db
Reviewed-on: https://chromium-review.googlesource.com/1244461
Reviewed-by: Moe Ahmadi <mahmadi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#594357}
fs
Pass oBB to SVGLayoutSupport::AdjustVisualRectWithResources
Most callsites have easy (even trivial) access to the object bounding
box (oBB), so just pass it as a parameter.

Change-Id: I2ec67dbea178356a3130bcef27204875143cf26c
Reviewed-on: https://chromium-review.googlesource.com/1245444
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#594300}
bratell
Add declaration for a newly defined highlight path property
A missing declaration broke some jumbo builds because in those
builds an implicit instantiation was seen before an explicit
specialization. This is illegal in C++. A forward declaration
solves the problem.

TBR=pbos@chromium.org,tapted@chromium.org

Bug: 861975,888204
Change-Id: Iecf736bcf9748d3c68265c21f9351c56d9a23dd8
Reviewed-on: https://chromium-review.googlesource.com/1245785
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#594289}
fs
Make LayoutSVGResource*::ResourceBoundingBox uniform
The LayoutSVGResourceFilter and LayoutSVGResourceMasker versions was
taking const LayoutObject* while the one on LayoutSVGResourceClipper
took a const FloatRect&. Align the two former with the later - thus
eliminating unnecessary dependencies on the client.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I26dcfb5ba9d164e4c5f97b9063cac8b6281cd6e6
Reviewed-on: https://chromium-review.googlesource.com/1243193
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594051}
fs
Remove dead code in SVGResources::RemoveClientFromCache
This method is never called for a LayoutObject which has a "linked"
resource (<pattern>), so remove the handling of |linked_resource_|.

Change-Id: I8c57804ecb58f4b7e286e427f0b7de84909286b8
Reviewed-on: https://chromium-review.googlesource.com/1243807
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#594041}
fs
Uninline unit-accessors in LayoutSVGResource{Clipper,Masker}
This uninlines MaskUnits() and MaskContentUnits() in
LayoutSVGResourceMasker as well as ClipPathUnits() in
LayoutSVGResourceClipper - reducing unnecessary includes/dependencies.
Also streamline LayoutSVGResourceFilter::ResourceBoundingBox a bit by
using the FilterUnits() accessor, and remove the redundant null-check on
the element.

Change-Id: I658b7626627ac38fc8b43bfd54630adb778233e8
Reviewed-on: https://chromium-review.googlesource.com/1243117
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#594040}
fs
Hoist SetNeedsPaintPropertyUpdate calls in SVGResourcesCache
We don't want/need to call SetNeedsPaintPropertyUpdate in the
TemporaryStyleScope helper.
Hoist the calls to SetNeedsPaintPropertyUpdate out of
AddResourcesFromLayoutObject/RemoveResourcesFromLayoutObject.
Also add a new UpdateResourcesFromLayoutObject function that wraps the
common Remove+Add sequence.

Bug: 866487
Change-Id: I8f8a82802be0e16807e04eead0e409562ecbdb77
Reviewed-on: https://chromium-review.googlesource.com/1243244
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#593943}
fs
Remove visual rect check from SVGMaskPainter::PrepareEffect
This just adds an (additional) dependency on the LayoutObject, while
likely not giving much in terms of gain nowadays.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I0b44312f82002d5fc5b510f9eb51b9cd0caf95a2
Reviewed-on: https://chromium-review.googlesource.com/1243303
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#593940}
fs
Update expectations for wpt/svg/pservers/reftests/meshgradient-*
TBR=schenney@chromium.org

Bug: 367760, 888869
Change-Id: I3a128e57f7a12d2fdd0e885bc1104ace39b64b06
Reviewed-on: https://chromium-review.googlesource.com/1243071
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#593923}
bratell
Support jumbo compilation for content/shell (-11 CPU minutes)
Compiling content/shell does in tests consume 13.5 CPU minutes which
is brought down to 2 CPU minutes with jumbo compilation. Jumbo
compilation works by combining many cc files in a single translation
unit, thereby avoiding recompilations of headers and re-instantiation
of templates, as well as by reducing the amount of work needed by the
linker.

Unfortunately IPC message generators can not be combined with other
code since they use some headers under very special circumstances.

Bug: 886902
Change-Id: I4ceee107ea64b774c9f540047182dbcfcf3c487f
Reviewed-on: https://chromium-review.googlesource.com/1238413
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#593905}
bratell
Remove references to gyp from DEPS and docs
Bug: 826218
Change-Id: I176e1aeb0b24b21c6b4e5ee40910dce2bce52c95
Reviewed-on: https://chromium-review.googlesource.com/1239461
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#593522}
fs
Use StyleColor for the flood-color and lighting-color properties
This changes the _interface_ to these properties in ComputedStyle
(and SVGComputedStyle) to use StyleColor - storage is changed to
a <Color, bool> (separated) pair. Usage is updated accordingly.
This is needed in order to support "better" tainting on 'feFlood'
and other filter primitive elements to which these properties apply.
The actual tainting functions will be updated in a follow-up CL.

Bug: 792518
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I705ee38219615c4c691e4a5fbc73799a72b604da
Reviewed-on: https://chromium-review.googlesource.com/797271
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593438}
fs
Revert "[Sherrif] Disable worklet-animation-responsive-to-zoom.html"
This reverts commit 1f654b07812cf771043806cdb4b5e1c0aa7cda64.

Reason for revert:

This test was reverted by https://chromium-review.googlesource.com/c/chromium/src/+/1239773 causing presubmits to fail.

Original change's description:
> [Sherrif] Disable worklet-animation-responsive-to-zoom.html
> 
> It wasn't included in TestExpectations by
> 
> https://chromium-review.googlesource.com/c/chromium/src/+/1237235
> 
> but it looks like it failed all the same.
> 
> NOTRY=true
> TBR=majidvp@chromium.org
> 
> Bug: 887659
> Change-Id: Iabb8204a4b4b05515838cf20378e61d07062ea51
> Reviewed-on: https://chromium-review.googlesource.com/1239446
> Reviewed-by: Frank Liberato <liberato@chromium.org>
> Commit-Queue: Frank Liberato <liberato@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#593345}

TBR=majidvp@chromium.org,liberato@chromium.org

Change-Id: I6bb03b3d8d78f3c7c66132656f00f32ee36e9a21
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 887659
Reviewed-on: https://chromium-review.googlesource.com/1238916
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#593437}
fs
Fix scrollIntoView(...) for SVG elements
AbsoluteBoundingBoxRectForScrollIntoView and associated helpers did not
compute the correct bounding box for SVG shapes (or anything but the SVG
root.)
Compute the bounding rect using the stroke bounding box.

Bug: 803440
Change-Id: If25ca98b686f17a0db699e569460cb4c276f06a0
Reviewed-on: https://chromium-review.googlesource.com/1238458
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#593306}
bratell
Bring back gn.el for the Emacs GN mode
gn.el used to be in the chromium source tree until gn moved
elsewhere. Now it lives somewhere else,
https://gn.googlesource.com/gn/+/master/tools/gn/misc/emacs/gn-mode.el
which makes it less useful.

This is a copy of that file as of today. The file is not updated
often, and when it is, it's just to add more keywords so
nothing critical.

Bug: 887937
Change-Id: I39335815a2cc8ecfe2b0e1728443f6abe84a85fa
Reviewed-on: https://chromium-review.googlesource.com/1238462
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#593217}
bratell
Support jumbo in //headless (-12 CPU minutes)
Jumbo is a unity build system for Chromium where many files are
compiled together. Since so much code is in headers and templates
this is much more efficient, and depending on your hardware, can
significantly speed up builds.

The headless module needs 26 CPU minutes to compile without jumbo.
With jumbo for everything, it needs 3.1 CPU minutes. Half of that
is already on master through the jumbo support in mojo. This patch
adds jumbo support for the rest, changing the compilation effort
from 15 CPU minutes to 3.

In real world time, this saves about 1.5 minutes on a full build on an
8 thread machine.

Bug: 883727
Change-Id: I3ede4805064344574c314d03904208110fdcb462
Reviewed-on: https://chromium-review.googlesource.com/1225702
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#593216}
bratell
Give two ClampBufferSize functions distinct names
In some jumbo build configurations, two ClampBufferSize functions
in services/network ended up in the same translation unit which
caused compilation errors.

Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: I6b7ea9c226b114a10d59fa9891e67f83537c5ec6
Reviewed-on: https://chromium-review.googlesource.com/1238219
Reviewed-by: Matt Menke <mmenke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#593215}
bratell
Gave some content_shell constants unique names and better docs
content_shell wants to replicate a chome constant at several
places which caused collisions in jumbo build experiments. This
give the replicas unique names and fixes the documentation which
was a bit outdated.

Bug: 886902
Change-Id: Ibf65de50bb2f938392fcecc910d70a4c4182c87d
Reviewed-on: https://chromium-review.googlesource.com/1233715
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593143}
bratell
[jumbo] Resolve symbol clashes in content/shell
Rename two TestServiceImpl to not clash in jumbo build experiments,
and change a kIllegalString constant to be shared.

Bug: 886902
Change-Id: I513e0641834476bb198cf24d71ef088634458313
Reviewed-on: https://chromium-review.googlesource.com/1233709
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#593125}
bratell
Retire ToValueImpl and rely on ToValue for headless devtools
The previous ToValue -> ToValueImpl implementation caused
template resolution complexities and prevented jumbo support
by having a clone of the same template in every domain_types_cc
file.

Bug: 883727
Change-Id: Iec49d7bde93515fe180f26073cea59db3cf4be82
Reviewed-on: https://chromium-review.googlesource.com/1236355
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#593104}
bratell
Give content_shell message headers include guards
This is in preparation for jumbo compiling content/shell.

IPC headers generate code by being included multiple times with
different macros. This requires careful juggling of inclusions
and jumbo is not careful with when headers are included. In most
of the code this has already been solved by adding include guards
but not in content/shell until this patch.

Bug: 886902
Change-Id: I84644fba628a827dfd7825d97844aacca3a9cd8e
Reviewed-on: https://chromium-review.googlesource.com/1233743
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592905}
fs
Return const char* from CSS*Property::GetJSPropertyName
This makes callsites slightly slower (requiring calls to strlen()), but
the result is cached for the primary user of this, so the difference
from that is likely negligible. Each indiviual method however no longer
need to instantiate a WTF::String, yielding a perhaps modest, but not
insignificant, reduction in binary size (-1568 bytes according to
the android-binary-size bot.)

Change-Id: Ib9ecc17cbe3e745bc2c33e1b4d9dcbd40190e026
Reviewed-on: https://chromium-review.googlesource.com/1233710
Reviewed-by: Anders Ruud <andruud@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#592728}
bratell
Remove "using namespace" from content_shell code
"using namespace" is not allowed per the Code Style Guide, but
worse, much much much worse, it won't work in jumbo builds because
they will be in a different context where a compiler error
will be triggered.

Bug: 886902
Change-Id: I635ceb8ec5d65a9d599ecd38bf0c150c90edf056
Reviewed-on: https://chromium-review.googlesource.com/1233837
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#592717}
fs
Add bug component for blink_perf.svg
Change-Id: I78b9172711cad010a754ad4d524758df39af5e61
Reviewed-on: https://chromium-review.googlesource.com/1233337
Commit-Queue: Ned Nguyen <nednguyen@google.com>
Reviewed-by: Ned Nguyen <nednguyen@google.com>
Cr-Commit-Position: refs/heads/master@{#592388}
fs
Use DEFINE_STATIC_LOCAL in CSSProperty::GetPropertyNameAtomicString
This avoids having a destructor being run when terminating the process.
These destructor could have ordering issues wrt to the destruction of
the AtomicStringTable. Using DEFINE_STATIC_LOCAL also shrinks the binary
a bit. (The android-binary-size bot says -16375 bytes.)

Remove some redundant '\0' characters for some additional (but minor)
savings.

Change-Id: I4f5c19fceb9b668e74d3ef9bad58b104182ddb86
Reviewed-on: https://chromium-review.googlesource.com/1233700
Reviewed-by: Anders Ruud <andruud@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#592383}
fs
Remove unneeded static empty_string in GetNameForFeature
This gets rid of a non-trivial (exit-time-)destructor.

Previously a (null) String was returned, but it seems that returning an
empty ("") String is more appropriate (if this is reached at all.)

Change-Id: Iba329053ea463883b41000ccb9970b3025da1ae7
Reviewed-on: https://chromium-review.googlesource.com/1230736
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#592351}
fs
Use DEFINE_STATIC_LOCAL for StorageNamespace::local_storage_namespace
This eliminates an exit-time destructor.

Change-Id: I18e3d7a9bd965c6898ba31c110b993258503a2d4
Reviewed-on: https://chromium-review.googlesource.com/1230737
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592336}
fs
Use DEFINE_STATIC_LOCAL for ParkableStringManager::instance
Change-Id: Ibb54621a413f1928a04498dae65a1ae5f3e48361
Reviewed-on: https://chromium-review.googlesource.com/1230716
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#592335}
fs
Merge fast/masking into css3/masking
These two cover the same specification (CSS Masking), so merge the
smaller corpus into the larger one (also preferring non-fast over fast.)

The following tests are converted to testharness.js:

  css3/masking/clip-path-selection.html
  css3/masking/parsing-clip-path-shape.html
  css3/masking/parsing-mask-source-type.html
  css3/masking/parsing-mask.html

and additionally css3/masking/clip-path-selection.html is converted
away from using eventSender.

Bug: 885137
Change-Id: I36607239ec37c69095632fe409f8a315ceb3e31e
Reviewed-on: https://chromium-review.googlesource.com/1230027
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592063}
fs
Ship CSS gradient color stop double-position syntax
Intent-to-Ship thread:

 https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/8B9FbeTBIK0/DNkC2pz-AAAJ

Also removing the actual feature and corresponding check, because it's
only used in a single spot, so if the feature should need to be
unshipped it ought to be a fairly trivial revert.

Bug: 707047, 880733
Change-Id: Ie854d7fd9f7a22e9c6144668a37f694dd1c508ee
Reviewed-on: https://chromium-review.googlesource.com/1230018
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#592028}
pkalinowski
Do not try to look up non-standard URLs in auth cache
Auth cache uses URL's origin as a key, and non-standard URLs don't have
it, so it only results in an attempt to use an invalid key, trigerring a
DCHECK on the way, too.

This can happen if page uses a data URL as a source for an HTML5 video.

Bug: 882842
Change-Id: I0a1861d27152d4d84f3a7692fd94af6222ca027c
Reviewed-on: https://chromium-review.googlesource.com/1219607
Reviewed-by: Min Qin <qinmin@chromium.org>
Commit-Queue: Piotr Kalinowski <pkalinowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#592005}
bratell
Windows build fix: Only depend on views_bridge_mac in mac builds
views_bridge_mac now uses a function called CreateWindow which happens
to be a macro in Win32 APIs. If a Windows builds sees that function
and knows about the macro, the build breaks, as just happened in
jumbo builds after
https://chromium-review.googlesource.com/c/chromium/src/+/1226251

TBR=ellyjones@chromium.org

Bug: 859152
Change-Id: Ia2314b7697aa75f8df60310cc504848b86c3ed05
Reviewed-on: https://chromium-review.googlesource.com/1229675
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#591986}
fs
Improve EOF handling in the headless REPL
When the REPL encounters an EOF, it can start spinning on just
generating a lot of empty ("") expressions.
Instead quit if an EOF is received and there's an empty expression. If
the expression is not empty it will still be evaluated. This helps
certain non-interactive use-cases.

Bug: 748419
Change-Id: Ica91f2164361bd6891f71e25fbdba0773c6c9941
Reviewed-on: https://chromium-review.googlesource.com/1225764
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#591979}
fs
Add basic tests for multiple position gradient stops
Tests rendering for the the case where <color-stop-length> or
(or <color-stop-angle>) is two <length-percentage> (or
<angle-percentage>.)

Spec:
 https://drafts.csswg.org/css-images-4/#color-stop-syntax

Bug: 707047, 880733
Change-Id: I56bc9b43858b37c003e081ea0ef8588f3da78627
Reviewed-on: https://chromium-review.googlesource.com/1228120
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591717}
bratell
[headless] Avoid compiling files that will not be used
In component builds headless_shell_lib compiled
lib/browser/headless_content_browser_client.cc which referred to
a lot of other code that was not compiled. Thanks to a linker
feature/quirk, the whole object file was ignored and nothing
bad happened. In jumbo build experiments the linker couldn't
do dead object file removal and the result was a lot of linkage
errors.

Bug: 883727
Change-Id: I3ef9f69cbf61ddccdb55d0929963ad33a6fb442b
Reviewed-on: https://chromium-review.googlesource.com/1226615
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591683}
bratell
One copy of headless shell switches should be enough
Many different parts of headless use the headless command
line switches, and compiled them into their lib/binary. This
caused build failures due to duplicate symbols in jumbo
build experiment. It seems the code depends on the dead object
file removal feature in the linker. Better is to just compile
and link the code once and export it from there.

Bug: 883727
Change-Id: I47ff0c86e56f2f86fbdaef6f5f7589ac82d16c66
Reviewed-on: https://chromium-review.googlesource.com/1225761
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#591663}
bratell
Reorganize headless printing support slightly
Including rendererer only code in the library "headless" that will be
used in the browser process only works if that code is dead and is
packaged in an unused object file inside a static library and linked
with a linker that ignores such object files. That is why including
"lib/renderer/headless_print_render_frame_helper_delegate.cc" kind of
worked but in jumbo build experiments it didn't.

This patch moves the renderer only printing code to libheadless.so
build code and to headless_renderer code.

Bug: 883727
Change-Id: I2ff6edfbf8c1cd79c84973933dd34a9de8fd3632
Reviewed-on: https://chromium-review.googlesource.com/1227937
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#591659}
fs
Update expectation for hittesting/image-with-clip-path.html
This test has not been flaking since it was re-enabled over a week ago.

TBR=schenney@chromium.org

Bug: 805292
Change-Id: I27fed5ac7e66b937d63adfec6f11f320e2ab7437
Reviewed-on: https://chromium-review.googlesource.com/1225986
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#591632}
fs
Change serialization for SVG resource url(...)'s
For non-local URLs, serialize the absolute form.

Reduce the AtomicString <-> String impedance while at it.

Bug: 842665
Change-Id: Ibc7804eeb6436d32202915e20e612b7bb5cf6b94
Reviewed-on: https://chromium-review.googlesource.com/1213175
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#591627}
tmoniuszko
Remove duplicated devtools_frontend_host.h from browser_sources
Change-Id: Ibaff557837b56061a0efbb2b82c673585963deb8
Reviewed-on: https://chromium-review.googlesource.com/1204132
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#591618}
fs
Trigger paint invalidation for <detail> on 'color' changes
Much like a list marker, the details marker needs be added to the
"color changed" special case/optimization.

Bug: 883711
Change-Id: Ib2237bd13887f4b5ff7fd2270bae6cb8654e0cd3
Reviewed-on: https://chromium-review.googlesource.com/1225875
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591354}
bratell
Remove unused object field that broke some builds
It's not allowed to have unused object fields but the compiler
can't always know if a field is unused. In jumbo builds it will
know more so sometimes those detect cases that normal compilation
won't see. In this case a field only used in ChromeOS builds.

In file included from gen/chrome/browser/browser_jumbo_1.cc:80:
In file included from ./../../chrome/browser/chrome_content_browser_client.cc:428:
In file included from ../../chrome/browser/speech/extension_api/tts_engine_delegate_factory_impl.h:10:
../../chrome/browser/speech/extension_api/tts_engine_delegate_impl.h:35:28: error: private field 'browser_context_' is not used [-Werror,-Wunused-private-field]

  content::BrowserContext* browser_context_;
                           ^

TBR=dmazzoni@chromium.org

Bug: 862710
Change-Id: I4eca7b940ad49fb44ec61ec513ba54db55f4914c
Reviewed-on: https://chromium-review.googlesource.com/1225759
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Jinho Bang <jinho.bang@samsung.com>
Cr-Commit-Position: refs/heads/master@{#591337}
bratell
[headless] Specify namespace in cases where it might be ambiguous
There are sub-namespaces to ::headless named storage and
switches and those will be chosen by the compiler instead of
::storage or ::switches if the compiler knows about them.

This problem appeared in jumbo builds where the compiler knew
more about all the namespaces. Fix is to either rename/remove
the sub-namespaces or to do what this patch does, prefix
storage with :: (so ::storage and ::switches) to clarify what
namespace is intended.

Bug: 883727
Change-Id: I1f6e428926f0a959787c2205f92505280d96b831
Reviewed-on: https://chromium-review.googlesource.com/1225792
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#591336}
tmoniuszko
Add double-click protection to bubbles
Potentially dangerous situation is possible when user is performing
double-click on UI element. If bubble is being shown as a result of
the first click, the control under the mouse cursor (button on
the bubble) can be activated with the second click. This wasn't
the intention of the user as the time between clicks was too short
to read the contents in the bubble that appeared. For example, user
can accidentally click "Accept" button on the permission prompt
bubble.

This CL adds protection against such unintended clicks. Mouse and
touch events are ignored for a short period of time after bubble
has been shown.

Bug: 864530
Change-Id: I54d229bf39dd000079b9eabd8de1cfba5103a022
Reviewed-on: https://chromium-review.googlesource.com/1140307
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591324}
bratell
Add support for jumbo in services/network (-7 CPU minutes)
This adds support for jumbo compilation of services/network. Jumbo
is a unity build implementation where many files are compiled
together in the same translation unit. That is usually much faster,
and more efficient, than compiling one file at a time, but it requires
the code to be compatible with such treatment.

In services/network there were two problems, one duplicated function
which this patch unduplicates, and the IPC/ParamTraits system which
is sensitive to include header ordering.

In total, on the build time reference test, this saves 7 CPU minutes
(from 12 to 4), or roughly 1 minute on an 8 core machine.

Cq-Include-Trybots: luci.chromium.try:linux_mojo
Change-Id: I997cc61159ccf9f23eb22f3b954b888b498e3862
Reviewed-on: https://chromium-review.googlesource.com/1221946
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#591300}
fs
Replace void* with ViewportDescription& in HTMLMetaElement
bbc7c4cca93dbfe2513b4288ff7ecf10878ebcf3 removed the old callback-driven
interface to the 'content' attribute parser - where "void* data" was the
callback closure/user data. Clean up to the type-safer way.

Change-Id: I2d9fffee65d7d38f226586be1b24d1c0ba9e8859
Reviewed-on: https://chromium-review.googlesource.com/1224394
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#591024}
bratell
[jumbo] A global enum ResourceType appeared so rename a local one
In https://chromium-review.googlesource.com/1214980 a more visible
blink::ResourceType was introduced and when jumbo compiling that
will clash with a local one inse canvas_resource_provider.cc.

This renames that enum to CanvasResourceType just to avoid the clash.

TBR=tkent@chromium.org

Bug: 242216
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I71a9a306f7763728ae6800c78be225fd1e965bb9
Reviewed-on: https://chromium-review.googlesource.com/1224012
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#590973}
fs
Remove StyleImage::SetIsLazyloadPossiblyDeferred
The only time when this is used is to set the value to true on a
StylePendingImage. The StylePendingImage is never read from or used
except for getting the underlying CSSValue though, making the store dead
and the method unused.
Also remove the cast from StyleImage to StyleFetchedImage, which is
unnecessary because the flag lives in the base class (StyleImage) and
is only set by the subclass constructors.

Change-Id: Idc899bc050ae3a7266df311279378e932194189d
Reviewed-on: https://chromium-review.googlesource.com/1213147
Reviewed-by: rajendrant <rajendrant@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#590971}
bratell
Support jumbo builds in components/viz
Jumbo is a unity build system for Chromium. By combining many cc files
in the same translation unit, the compiler doesn't have to repeat all
the work triggered by shared header. This normally makes building 5-20
times faster.

The downside to jumbo is that code intended to be local to one cc file
suddenly becomes more exposed and might clash with other code.

Jumbo support in components/viz currently saves about 5 CPU minutes of effort,
about 1% of the total reference build effort.

Bug: viz bug
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I7bff566b96b2caeac66aa8e6fb67495231206d51
Reviewed-on: https://chromium-review.googlesource.com/951791
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590954}
fs
Implement step 1 of "look up a custom element definition"
Per [1], elements with a non-HTML namespace should cause a null
custom element definition to be returned.

Implement this step.

[1] https://html.spec.whatwg.org/multipage/custom-elements.html#look-up-a-custom-element-definition

Bug: 882773
Change-Id: Idc8f4c61b94af848e13acf4ff06da2c5f6842454
Reviewed-on: https://chromium-review.googlesource.com/1221325
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#590949}
bratell
Support jumbo in the //gpu code
Jumbo is a unity build system for Chromium. By compiling many
cc files as one unit, the compile time is drastically reduced. This
patch adds support for jumbo compiling //gpu.

The expected effect is about 6 CPU minutes (~1 wall clock minute on a
normal computer) or 1% of the total reference jumbo compilation time.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I096335ba283f9b03cf4dcde554e7b19620f08834
Reviewed-on: https://chromium-review.googlesource.com/1151323
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#590626}
bratell
[jumbo] Give two GetDelegate/GetDelegateWrapper methods unique names
In jumbo builds whole chunks of the code is compiled in the same
translation unit, using the same anonymous namespace. If two
files use the same symbol names they will then clash and that
happened in chrome/browser/extensions between
active_tab_permission_granter.cc and extension_tab_util.cc.

This patch renames GetDelegate() and GetDelegateWrapper to include
the more exact names of the Delegate type, making them unique.

Bug: 865947
Change-Id: I46426e8dee715d57acaa3d2385e6dd5b6ac38cf1
Reviewed-on: https://chromium-review.googlesource.com/1219246
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590327}
bratell
[jumbo] Make it one GetIdMap() instead of two.
A commit just introduced two GetIdMap functions in ui/views/cocoa,
which broke jumbo builds because in jumbo builds they end up in
the same translation unit. This patch renames them
GetIdToWidgetImplMap and GetIdToWidgetHostImplMap

Bug: 859152

TBR=ccameron@chromium.org,ellyjones@chromium.org

Change-Id: I55b4a48d3d4f97c30450fd89bb8f52f46c2cedd7
Reviewed-on: https://chromium-review.googlesource.com/1219127
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#590257}
fs
Redirect WPT clip-path path() tests
TBR=schenney@chromium.org

Bug: 880983, 882649
Change-Id: I5d75f448106ad20adf8e9e02ab33883b7eaa54a8
Reviewed-on: https://chromium-review.googlesource.com/1219247
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#590256}
bratell
[jumbo] Specify which features namespace is intended
There are more than one namespace named features, and specifically
there are both ::printing::features and ::features. When the
compiler knows about both and is inside namespace printing,
referring to "features" will resolve to ::printing::features even
if ::features was intended.

This happens in jumbo builds in some configurations. The fix is
to clarify what features namespace is intended by using a ::
prefix. An alternative fix would be to remove ::printing::features
to ::printing::printing_features.

Change-Id: I0499ed98c3ad699e89dce8f1141c327937ba0a87
Reviewed-on: https://chromium-review.googlesource.com/1213167
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#589868}
bratell
Remove some dead and duplicate code that broke some jumbo builds
Some test code was compiled into chrome which in jumbo builds
broke the linking. In non-jumbo builds the code was probably
eliminated by the implicit dead-code-removal in the linker
(an .o file that is completely unused is ignored).

Also changing an #include "foo.cpp" to #include "foo.h" since that
caused similar linking errors related to duplicate code.

Change-Id: I6c39314fadc3a82f48135755cc7de1a540006ae5
Reviewed-on: https://chromium-review.googlesource.com/1213166
Reviewed-by: James MacLean <wjmaclean@chromium.org>
Reviewed-by: Jialiu Lin <jialiul@chromium.org>
Reviewed-by: Fady Samuel <fsamuel@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#589863}
fs
Serialize the path() function with double quotes
Per https://drafts.csswg.org/cssom/#serialize-a-string double quotes
should be used when serializing strings.

Bug: 873527
Change-Id: I3b7a3c6425c6a5d0d6f96399663f5ae8b3929a59
Reviewed-on: https://chromium-review.googlesource.com/1213171
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589652}
fs
Fix svg/parser/whitespace-{integer,length}.html
Integers should be parsed per the <integer> production, and thus should
not accept units.

In whitespace-length.html there was a bug in the test-setup that made
some tests fail that ought to pass (incorrect parameter.)

Also take the opportunity to clean up the tests a bit.

Change-Id: Id7b8964ec52f484dad424b0a1b7be6d70d062eb6
Reviewed-on: https://chromium-review.googlesource.com/1213149
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589606}
fs
Invalidate clipPath clients after mutating 'transform'
When the 'transform' presentation attribute (or CSS property) was
mutated on a <clipPath>, its clients were not notified. Make sure they
are.

Bug: 881700
Change-Id: Id42aedf814472d8156804a955e6bbf2aa2792ec2
Reviewed-on: https://chromium-review.googlesource.com/1213142
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589511}
bratell
Add support for jumbo compilations to the rest of //ui
Jumbo is the Chromium implementation of a Unity build system aimed at
dramatically lowering the compilation times, especially for those
without access to goma.

In reference testing, this patch reduces the effort to compile
content_shell+chrome+blink_tests by about 9 CPU minutes, 1-2% of the
total effort. Earlier patches saved more so the total build effort
reduction in //ui is about 41 CPU minutes.

There is still some code in ui that doesn't use jumbo. Specifically
most of the tests.

Bug: 773275
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ie59fec4b67fc1e3d6855d04a4b9a1088e0a08768
Reviewed-on: https://chromium-review.googlesource.com/834348
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#589473}
fs
Pass a float height to Font::SelectionRectForText
Rather than converting an int argument to a float in the function (that
return a FloatRect), pass a float argument and let the caller handle a
conversion (if needed.)

Bug: 881188
Change-Id: If3083fc19c866f003b0d60e10246b3088463dcdd
Reviewed-on: https://chromium-review.googlesource.com/1209923
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589471}
bratell
[jumbo] Make it one g_id_map instead of two.
A commit just introduced a second g_id_map in ui/views/cocoa,
which broke jumbo builds. This renames the g_id_map
globals to the longer names g_id_to_impl_map and
g_id_to_host_impl_map.

Bug: 859152

TBR=ccameron@chromium.org,ellyjones@chromium.org

Change-Id: Id30d71b67f4bfb7c3ddc3ec8d03c759b5b7df14f
Reviewed-on: https://chromium-review.googlesource.com/1212862
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#589465}
fs
SVGAnimatedInteger initial values
This implements initial values for SVGAnimatedInteger properties (which
includes SVGAnimatedIntegerOptionalInteger since it is a reverse proxy
for the former.)

Bug: 225807
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I0563b6cfe4dc22b08ed04ab508faf4fb9491b5b4
Reviewed-on: https://chromium-review.googlesource.com/1209743
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589463}
fs
SVGAnimatedNumber initial values
This implements initial values for SVGAnimatedNumber properties (which
includes SVGAnimatedNumberOptionalNumber since it is a reverse proxy to
the former.)

Bug: 225807
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Icb62d7383cacf7df122fc56af0977015b5adf9b7
Reviewed-on: https://chromium-review.googlesource.com/1209705
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589219}
fs
SVGAnimatedEnumeration initial values
This implements initial values for SVGAnimatedEnumeration properties.

Bug: 225807, 523685
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I857dd5d6a52b2e3c4e866c2b589be3373449fc24
Reviewed-on: https://chromium-review.googlesource.com/1209683
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589217}
fs
Don't include local_frame.h in page.h
Shrinks expanded page.h size by ~2.1M.

Change-Id: I20c304f7c2a47e86a14dfecd792f0b9b4da35531
Reviewed-on: https://chromium-review.googlesource.com/1204131
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589191}
wdzierzanowski
Add missing MappedHostResolver overrides
Save for remapping hosts according to the rules, MappedHostResolver
should be a transparent wrapper around the "real" resolver.  Thus, it
must forward all HostResolver methods to the real resolver.

Change-Id: I34deed523b3cb690d450599c89bfd7f2184e843d
Reviewed-on: https://chromium-review.googlesource.com/1209402
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589150}
bratell
[jumbo] Unduplicate duplicated IsShuttingDown
Quick fix to unbreak jumbo builds. In
https://chromium-review.googlesource.com/c/chromium/src/+/1205976
a copy of IsShuttingDown was added and this patch changes the code
to instead use the original version.

TBR=kinuko@chromium.org,nhiroki@chromium.org

Bug: 715632
Change-Id: I2451fcaa009ec6403827cdb05cd3b47112c4681b
Reviewed-on: https://chromium-review.googlesource.com/1209703
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#589148}
fs
Unskip hittesting/image-with-clip-path.html
To have a chance of seeing what might be problem here (if it still
exists) we need some historical data, since there appear to be no
obvious issues with the test as such.

Bug: 805292
Change-Id: Iccbb92e2a324533858ee42802eaa2fa7ebc2240c
Reviewed-on: https://chromium-review.googlesource.com/1209363
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589139}
fs
Rework StyleImage equality determination
StyleFetchedImage and StyleFetchedImageSet needs to take the URL into
consideration because it can contain a fragment that will require the
image to change.

Bug: 643716
Change-Id: If87d3583df0fcb37f872c1423a88f4bd33e8c38f
Reviewed-on: https://chromium-review.googlesource.com/1207390
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589128}
fs
Update bug# for wpt/css/css-masking/clip-path/clip-path-path-00{1,2}.html
TBR=schenney@chromium.org

Bug: 880983
Change-Id: Ic31f977a104c95d1896ec4855c7be2c37e1e68d1
Reviewed-on: https://chromium-review.googlesource.com/1209342
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#589127}
fs
SVGAnimatedAngle initial values
This CL implements correct initial values for all SVGAnimatedAngle properties
(which is only one: 'orient' on <marker>.)

Bug: 225807, 589856
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I61c50162a98a47d0da23f3a7d0830440b8c7aa25
Reviewed-on: https://chromium-review.googlesource.com/1207331
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588942}
fs
Fold Page::NonFastScrollableRectsForTesting
Fold Page::NonFastScrollableRectsForTesting into the only user
Internals::nonFastScrollableRects. The former method does not even touch
the Page object.

Change-Id: I3d8bec815dbcbb45cb01e2a77a1d87885d7d94f9
Reviewed-on: https://chromium-review.googlesource.com/1206590
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588939}
fs
SVG property initial value mechanism and support for SVGAnimatedLength
This CL introduces a mechanism for handling "initial values" for SVG
properties. The initial value is stored in a new
|initial_value_storage_| field in SVGAnimatedPropertyBase. Subclasses
that need to store an initial value - for many cases a default
initialized object is sufficient - define what is stored in the allotted
number of bits (and thus indirectly how many bits that are required.)

The SetInitial method needs to be overloaded on the SVGPropertyBase
subclasses that the SVGAnimatedProperty holds, and is responsible for
resetting the value of the property (after "decoding" the value.)

This CL adds an implementation of the above for SVGAnimatedLength. For
this type, the initial value is stored as an index into a table of
values.

The 'fx' and 'fy' properties on SVGRadialGradientElement are updated to
have their initial values be 50% (matches Gecko.)

Bug: 225807, 474523
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ida144d6bed2d1946186e8fb3b3a0b9695ca81789
Reviewed-on: https://chromium-review.googlesource.com/1193822
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588797}
fs
[jumbo] Fix symbol clashes in components/rapport unittests
Follow up to ad2c0dc8c2bca1b767007ac3cacdb8652b566907.

TestLogUploader is defined as both rappor::TestLogUploader and
rappor::(unnamed namespace)::TestLogUploader and could thus be ambiguous
if being present in the same jumbo unit. Add rappor:: qualification in
TestRapporServiceImpl to combat this.

The kTestRapporParameters structure is defined in sampler_unittest.cc
and rappor_metric_unittest.cc. Give these slightly more unique name
(reflecting the test they are for) to avoid this.

Change-Id: I1292c643316291420f24755241a9533d89a3e45a
Reviewed-on: https://chromium-review.googlesource.com/1204018
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588604}
fs
Resolve :root and table-cell currentcolor using background box's style
In BackgroundImageGeometry::ImageStyle we'd always return the computed
style for |box_| (the box for which we're painting), and thus use that
to resolve currentcolor, although in some cases (for :root and table-
cells that get their backgrounds from the row or column) we ought be
using the style from the element that the background originated from.

Bug: 848860
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9113957889a3f091d3fe71830c0805a4064734b5
Reviewed-on: https://chromium-review.googlesource.com/1203373
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588536}
fs
Forward declare DocumentLoader in deprecation.h
Shrinks page.h by ~1.1M.

Cq-Include-Trybots: luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ie71224313e0a1c26319854707b14e62e65dc46a3
Reviewed-on: https://chromium-review.googlesource.com/1203911
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588504}
fs
Get rid of include of page_overlay.h in page.h
Shrink page.h from ~9.16M to ~7.01M.

Change-Id: If7516a607c481637ec12872edd33641df8e5ad95
Reviewed-on: https://chromium-review.googlesource.com/1203835
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588484}
fs
Redirect css-masking expectations to crbug.com/432153
These tests are all about 'mask-image' (the unprefixed property.)

TBR=schenney@chromium.org

Bug: 432153, 880183
Change-Id: I399ea4dd6a3dd48ee464a12279caa2a4fdd9f3a2
Reviewed-on: https://chromium-review.googlesource.com/1203891
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588478}
bratell
[jumbo] Give two kForcedInvocationDeadline constants unique names
In certain jumbo configurations, the two constants names
kForcedInvocationDeadline could end up in the same translation
unit and then clash. This patch changes the names to
kTextFinderTestTimeout and kIdleSpellcheckTestTimeout.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I76e030b98bead46fa0aff7f3e0ce1f264d754ef9
Reviewed-on: https://chromium-review.googlesource.com/1202064
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588441}
fs
Use Element::LocalNameForSelectorMatching in InvalidationSet
To match ElementRuleCollector et al. We will lower-case tag names on
(selector) parsing in HTML documents, and thus need to give the same
treatment to the local name extracted from the element.

Bug: 856368
Change-Id: I07e726864de048f5948cb27fa7e5dd6eaad9b0ef
Reviewed-on: https://chromium-review.googlesource.com/1202206
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#588427}
oscarj
Enable jumbo support in storage/browser
//storage/browser takes around 6.2 CPU minutes to
build without jumbo. With jumbo the build time is
reduced by around 83 %.

This commit enables jumbo support in storage/browser.

Bug: 871163
Change-Id: I51254087ea584d64fc599aa232ab2b73027791ec
Reviewed-on: https://chromium-review.googlesource.com/1170691
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#588365}
fs
Distribute widths evenly among code points in SynthesizeGraphemeWidths
Previously we did not consider the possibility of a typographic unit
containing multiple surrogate pairs, and could as an effect "lose" part
of the width.

Distribute the width evenly among code points instead to at least get
some sort of consistency.

Bug: 879361
Change-Id: I51a4e6c574926215a087b0bc824ac90d580ff169
Reviewed-on: https://chromium-review.googlesource.com/1199423
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588183}
fs
Simplify candidate selection in HTMLImageElement::SelectSourceURL
Rather than using the |found_url| local, recognize that it is equivalent
to !candidate.IsEmpty(), and use regular control flow instead.

Change-Id: I5f28a4099bc4252ec9ea5b9ed616116f64b97ace
Reviewed-on: https://chromium-review.googlesource.com/1196383
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588048}
fs
Handle non-image backgrounds in BoxModelObjectPainter::PaintTextClipMask
When we paint a background color for a line, we don't adjust the paint
offset based on the logical offset on the "virtual line", so we mustn't
try to undo the adjustment in BoxModelObjectPainter::PaintTextClipMask
when we're generating the mask for "(-webkit-)background-clip: text".

Check the |object_has_multiple_boxes| and don't undo the adjustment if
it is false.

Bug: 879292
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9ec9c5cdfeb675803e54407f2e98e39b2dc1bc6b
Reviewed-on: https://chromium-review.googlesource.com/1199343
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#588038}
fs
Handle degenerate curve segments for marker orientation
When a cubic or quadratic curve have a point that coincide with another
of its point such that either the start or end tangent vector is
degenerate, the orientation in that point will be 0. In such cases try
to use the next/previous non-degenerate tangent vector (if any) instead.

Bug: 450368
Change-Id: I35db404b3f82cf61b10427678feecc2157eeeb26
Reviewed-on: https://chromium-review.googlesource.com/1196503
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#587743}
fs
Fix SVG systemLanguage conditional processing
The algorithm that performs the test between browser language preference
and the systemLanguage value has been modified
to implement a language-tag match based on the prefix,
making it consistent with BCP 47's basic filter operation and
as specified in the SVG 1.1 spec.

The previous behavior was:

- Tests whether the value of the attribute (e.g., "en-us") is a prefix
of the user preferred language (e.g., "en")
(which would evaluate to false)

The test was modified to compare in the opposite manner,
now user preferred language must be a prefix of the value.

- If the language tag length was not 2, the language tag
was not matched, (e.g. It did not match "en-us" to "en-us").
This check has been removed.

- The algorithm did not check for a trailing hyphen ("-").
We do not want langtag "it" matching langtag "ita",
but it is ok for "it" to match "it-it".
Now it does.

------------

The algorithm that performs the test between browser language preference
and the systemLanguage value has been modified
to implement a case insensitive language-tag match:

"en" matches "EN".

The previous behavior was case sensitive.

------------

Add Luca Di Domenico to AUTHORS

------------

Bug: 872378, 869440
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ibe767644b5a92e8d79ffe4b7777f5f51851b3883
Reviewed-on: https://chromium-review.googlesource.com/1188314
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#587592}
fs
Update expectation for fast/dom/HTMLImageElement/image-srcset-w-onerror.html
Re-routing to newer bug which contains more analysis of the issue.

TBR=schenney@chromium.org

Bug: 636207, 876732
Change-Id: Ic857feff265217a0244fd0bd25999d0db354b0b2
Reviewed-on: https://chromium-review.googlesource.com/1196343
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#587507}
tmoniuszko
Fix views_mus_unittests dependency on views test support
Bug: 878384
Change-Id: I9105fbf1d4dcd52037b2ab6a56a42f5c7124c380
Reviewed-on: https://chromium-review.googlesource.com/1194026
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#587486}
fs
Force layout and paint when 'filter' changes on SVG elements
Because of how filters interact with layout and paint (bounds dependency
and filter caching et.c), we need to trigger layout (for bounds) and
paint (for caching) when 'filter' changes. (A 'none' <=> <something>
transition will trigger layout in general, but not a change from one
filter to another.)

Bug: 878591
Change-Id: I8bfad033f962bdfcb5000052ee07db7771428e3d
Reviewed-on: https://chromium-review.googlesource.com/1195485
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#587272}
fs
Refactor SVGMarkerData
This CL reworks the core of SVGMarkerData so that it first extracts the
"features" of the current segment/PathElement, and then uses those
features to determine the orientation.

The state of SVGMarkerData is also changed from two pairs of points to
two vectors, since this is the representation that's actually used by
CurrentAngle(). It should also be a better representation when handling
of degenerate curves is added.

CurrentAngle() is changed to return a 'double', and the clamping
previously done in the method is now done by the callers. Additionally
The code that computes the bisected angle is split out to a separate
function.

Bug: 450368
Change-Id: Ic9561cab3bbf9c3f5cbc9f3607cfc9bfe90fea05
Reviewed-on: https://chromium-review.googlesource.com/1193847
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#587220}
fs
Call CommitChange after a SVG*List.clear() operation
The SVGListPropertyTearOffHelper did not call CommitChange(), meaning
that the element wasn't notified of the change, and wouldn't invalidate
et.c as needed. It also could've failed to synchronize the attribute
properly.

Bug: 843901
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iad581027c3748e3e90cf6fe3d944273b207fef0f
Reviewed-on: https://chromium-review.googlesource.com/1189882
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586625}
fs
Empty SVG*List should serialize to the null String
When synchronizing an empty list, the result should be that the
attribute is removed. However, since StringBuilder::ToString for an
"empty" StringBuilder returns the empty string we end up setting an
empty attribute. Add a special case to handle empty lists, and return
the null String there instead. The null String will translate to an
attribute removal.

All the SVG*List types that inherit from SVGListPropertyHelper are
changed call a new shared implementation (SerializeList) in that class.

Bug: 843901
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9442268196aaa605886fd4d6d31d66ae075f901d
Reviewed-on: https://chromium-review.googlesource.com/1189862
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#586251}
fs
Clear SVG property synchronization flag on attribute update
When an SVGAnimatedProperty has its associated attribute updated, we can
cancel any pending attribute synchronization.
This prevents overwriting the new value with the old in some cases.

Bug: 843901
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I3654ad616fd6e6ef82a1933ec034bc9cf0097d56
Reviewed-on: https://chromium-review.googlesource.com/1189842
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#586246}
fs
Align HitTestClippedOutByClipPath coordinate space with paint
In the paint code (ClipPathClipper), the reference box used is the one
computed by LocalReferenceBox(), and the coordinate space is adjusted
for that. In the hit-testing code however, the reference box is adjusted
instead, leading to incorrect results when the reference box is
subjected to an additional transform (a 'transform' on a <clipPath>.)

Instead, set up the reference box and coordinate space in the hit-
testing code in the same way as for paint, by translating to the correct
local coordinate space before performing the actual hit-test.

Bug: 876390
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I60acd616964a942893f0e256766aca728d14b494
Reviewed-on: https://chromium-review.googlesource.com/1188302
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#586028}
fs
Make baseVal attribute synchronization explicit
This moves the |base_value_updated_| flag from the "primitive type"
version of SVGAnimatedProperty to SVGAnimatedPropertyBase, and sets it
in BaseValueChanged. The flag is cleared in SynchronizeAttribute.
This allows some code to be simplified. It also avoids synchronizations
triggered by just having created the tear-off object like in the bug.

Bug: 873470
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I59f30dd69286dc0799a583eb6a52c41022b0af91
Reviewed-on: https://chromium-review.googlesource.com/1188305
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585852}
fs
Remove some unneeded includes of svg_element.h
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I989622cb82e8135d387f5807723eaf0704e2bbb3
Reviewed-on: https://chromium-review.googlesource.com/1188306
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#585842}
fs
Rename SVGAnimatedPropertyBase::SetBaseValueAsString
Rename SVGAnimatedPropertyBase::SetBaseValueAsString to
AttributeChanged, to reflect how it interacts with the system in general
(sets a new value based on an updated attribute string) - the counter-
part to this notifier being BaseValueChanged.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I55b42d7662c744d4d4d39b8ea0545d0318bcbeab
Reviewed-on: https://chromium-review.googlesource.com/1184844
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#585077}
mpawlowski
Fix PrefHashFilter's behavior when clearing a tracked pref
When a tracked pref is cleared, it will no longer be present in the
DictionaryValue that represents the pref store contents, but
FilterUpdate() and FilterSerializeData() will still be called. Make
the code handle nullptr Values safely.

Bug: 867337
Change-Id: I1840c3f60bd815145a0f765adf5907a35bca1c87
Reviewed-on: https://chromium-review.googlesource.com/1150034
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: proberge <proberge@chromium.org>
Commit-Queue: proberge <proberge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585055}
fs
Rework SVG*TearOff types back-referencing
In preparation for making base-val <-> attribute synchronization,
refactor the SVG*TearOff hierarchy so that "mutation notifications" are
funneled through the SVGAnimatedProperty(Base) if the tear-off is
associated with an attribute.

Rather than storing a SVGElement* and QualifiedName, store a reference
to the underlying SVGAnimatedProperty(Base) instead of the latter. This
is then used to send notification through.

BUG=873470

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ib6e5c25cf97b806ff613a39478dc4f10f85dcaf5
Reviewed-on: https://chromium-review.googlesource.com/1181342
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584888}
ggacek
Fix possible use-after-free when menu is closed by its item.
Fix use-after-free which occured when a menu contained an item closing
it on a mouse press event. In such case MenuController object was freed
during a call of its OnMousePressed() but it continued to modify its
member variables.

Bug: 871205
Change-Id: Ic2a5dd3a745da6b0c1ef7a87f2cb498cc1a97234
Reviewed-on: https://chromium-review.googlesource.com/1163617
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584706}
mpawlowski
Don't re-initialize mojo::core in gaia unittests
mojo::core::Init() should be called once per process, not once per test.
run_all_unittests.cc happens to already define a test launcher that
calls mojo::core::Init(), so if we use that instead of the base
launcher, we can get rid of re-initialization in test fixtures.

Bug: 869281
Change-Id: Ieb96cbe580f5f1750d7f61693c288bb578cb63b0
Reviewed-on: https://chromium-review.googlesource.com/1155595
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584501}
fs
Fix naming of SVG{AnimatedProperty,PropertyTearOff}Base::contextElement
contextElement -> ContextElement

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If22cc5a0624cfaf9e1e448198c891de3030bc889
Reviewed-on: https://chromium-review.googlesource.com/1181058
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584435}
fs
Update bugref for a bunch of tests in wpt/svg/text/reftests/
TBR=schenney@chromium.org
BUG=875411

Change-Id: I83c6386435a1d519359e41b9a38bb37d8c646900
Reviewed-on: https://chromium-review.googlesource.com/1180890
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584388}
fs
Simplify SVGElement::ParseAttribute
There's no real reason to give 'tabindex' preferential treatment (not
anymore at least.) Just let it be handled by the common fall-through
code-path and flatten the structure of the code a bit.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I96e6c265aeb384fe1acc0b61378078bb3d06051c
Reviewed-on: https://chromium-review.googlesource.com/1179886
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584218}
fs
Remove dead code in SVGListPropertyHelper<...>::ReplaceItem
If |values_| does not contain any entries, then CheckIndexBound will
fail, so the 'values_.IsEmpty()' condition can never be true here.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I3c96b6b198a8d9f345a08a436101d803384d11e2
Reviewed-on: https://chromium-review.googlesource.com/1179834
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584174}
fs
Remove dead code in SVGElement::ParseAttribute
The 'params.name == HTMLNames::classAttr' condition will never be true,
because the if-block just above it will catch that case. The
|class_name_| SVGAnimatedProperty object is registered in the attribute
map. Retain and update the comment about the somewhat special handling
of the 'class' attribute.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9928fb6f9c29d5db961b7f937fe4b1c0fb3fde82
Reviewed-on: https://chromium-review.googlesource.com/1179749
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584067}
fs
Remove SVGDocumentExtensions::IsSVGRootWithRelativeLengthDescendents
It's not used.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If6630b2e404108044833ea5512151facdfe7e59d
Reviewed-on: https://chromium-review.googlesource.com/1179760
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#584061}
fs
Avoid recursing in the FragmentData destructor
Too deep recursions can cause stack overflows.

Bug: 874759
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ie532e28bceee4e7f1c3ab501b80c0e2f14be083a
Reviewed-on: https://chromium-review.googlesource.com/1106378
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#583657}
fs
external/wpt/svg/render/reftests/blending-00[12].svg now pass
TBR=schenney@chromium.org
BUG=866928

Change-Id: I3d228b5596e2c644399882f0c5c697ff0d882b6e
Reviewed-on: https://chromium-review.googlesource.com/1177383
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#583586}
fs
Tweak cover blending in wpt/svg/render/reftests/blending-00[12].svg
Set 'mix-blend-mode' to 'normal' on the stroked rects that make up the
"edge cover". Hopefully this avoids aliasing artifacts on the edge cover
itself.

In blending-002.svg, localize the use of (non-auto) isolation to the
content of the test.

BUG=866928

Change-Id: I269e01a4d814f7fd8e202ffdf71c1a1d5dc48347
Reviewed-on: https://chromium-review.googlesource.com/1175825
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#583277}
fs
wpt/svg/painting/reftests/markers-orient-001.svg now pass
TBR=schenney@chromium.org
BUG=872697

Change-Id: Ib925da7763c4091feacfd489bce1c82c752309ef
Reviewed-on: https://chromium-review.googlesource.com/1175796
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#583226}
fs
Fix element creation in wpt/svg/idlharness.window.js
Adjust casing for 'desc', 'switch' and 'mpath'. Remove a duplicate
'animateColor'.

BUG=868861

Change-Id: I19256547abea3028791de402e354c47eee8ce949
Reviewed-on: https://chromium-review.googlesource.com/1174261
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582955}
fs
Fix ref for external/wpt/svg/painting/reftests/paint-order-001.svg
The property:

  paint-order: stroke markers

is equivalent to:

  paint-order: stroke markers fill

(Spec: "If any of the three keywords are omitted, they are painted last,
 in the order they would be painted with paint-order: normal."
 @ https://svgwg.org/svg2-draft/painting.html#PaintOrder )

So the fill should be painted last. Add 'marker:none' to the appropriate
element in the ref.

Disable stroke and marker in a few cases to avoid "overdraw" and thus
"incorrect" edge rendering in some cases.

BUG=872972

Change-Id: I835a6980fa069825ed2a2e920862018faec6d93c
Reviewed-on: https://chromium-review.googlesource.com/1172778
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#582914}
mharanczyk
Add target to mojom template that generates all bindings headers.
The change should address random build failures of missing mojo
bindings generated headers on targets that cannot depend on bindings
code directly but need to use it.

Extra: Add missing deps to blink scheduler test_support target.

Bug: 852558
Change-Id: Ib0e3be23093dcda6629f6f8d0149d9d5a57bac07
Reviewed-on: https://chromium-review.googlesource.com/1151301
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Cr-Commit-Position: refs/heads/master@{#582874}
fs
Disable 'visual aid' in wpt/svg/painting/reftests/markers-orient-001.svg
The test has a red version of the reference painted under the actual
test content. Because of how alpha/coverage often work (at least in
software rasterizers), this can lead to the read bleeding through and
thus affecting the comparison with the reference image.
Disable the red reference shapes by adding a CSS rule. This way, if
someone feels it's useful for debugging they can easily re-enable it.

BUG=872697

Change-Id: Id47757c9dd112ead0db9c2dcd1adc74d5a52e55d
Reviewed-on: https://chromium-review.googlesource.com/1172622
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#582598}
fs
Update bugrefs for SVG WPT tests from crbug.com/872697
external/wpt/svg/text/reftests/text-multiline-001.svg
external/wpt/svg/text/reftests/text-multiline-002.svg
external/wpt/svg/text/reftests/text-multiline-003.svg

 => crbug.com/366558

external/wpt/svg/text/reftests/text-inline-size-001.svg
external/wpt/svg/text/reftests/text-inline-size-002.svg
external/wpt/svg/text/reftests/text-inline-size-003.svg
external/wpt/svg/text/reftests/text-inline-size-005.svg
external/wpt/svg/text/reftests/text-inline-size-006.svg
external/wpt/svg/text/reftests/text-inline-size-007.svg
external/wpt/svg/text/reftests/text-inline-size-101.svg
external/wpt/svg/text/reftests/text-inline-size-201.svg

 => crbug.com/366553

external/wpt/svg/painting/reftests/markers-orient-001.svg

 => crbug.com/872697 (pending testfix)

TBR=schenney@chromium.org
BUG=366553,366558,872697

Change-Id: Ib75f5c0cda767108745618ab508a6a8730e3b1b1
Reviewed-on: https://chromium-review.googlesource.com/1172430
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#582576}
fs
Update bugref for external/wpt/svg/shapes/reftests/pathlength-002.svg
TBR=schenney@chromium.org
BUG=863355

Change-Id: Ib58518bb68af39fb5e106cb0da0f08df5e6a832a
Reviewed-on: https://chromium-review.googlesource.com/1172361
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#582565}
fs
Update bug references for some failing SVG WPT tests
These tests fail because of lack of support for references to general
shapes from <textPath> and the 'side' attribute in <textPath>.
crbug.com/366559 is the bug for supporting thos features, so redirect to
it.

Tests:

  external/wpt/svg/shapes/reftests/pathlength-003.svg
  external/wpt/svg/text/reftests/textpath-side-001.svg
  external/wpt/svg/text/reftests/textpath-shape-001.svg

TBR=schenney@chromium.org
BUG=366559,863355

Change-Id: Ia2fc56704fafd3ace0af949fceeaf2799f960fe7
Reviewed-on: https://chromium-review.googlesource.com/1172298
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#582542}
oscarj
Enable jumbo support in components/password_manager/
Without jumbo, password_manager takes around 3.6 CPU
minutes to build. With jumbo and chunk size 50,
password_manager takes around 11 seconds to build,
a decrease by around 94 %.

This commit enables jumbo support in
components/password_manager.

Bug: 869381
Change-Id: Icce9d9800a01d452d63ba137c52c2a0495359da8
Reviewed-on: https://chromium-review.googlesource.com/1166963
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582109}
oscarj
Enable jumbo support in components/autofill
//components/autofill takes 6.6 CPU minutes to compile.
With jumbo and chunk size = 50 the build time is reduced
by around 54 %.

This commit enables jumbo support in components/autofill.

Bug: 869381
Change-Id: Iba405b8c2199f68c11a13ee0872bfaae87943d7f
Reviewed-on: https://chromium-review.googlesource.com/1170689
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#582105}
oscarj
Replace operator with lambda (content/browser)
When building with jumbo the compiler sees two
operator==, declared in the files:
content/common/media/media_devices.h
content/browser/indexed_db/scopes/scopes_lock_manager.cc

Therefore, it throws an error. This commit solves the
issue by replacing the operator with a lamdba doing
the same operation.

Change-Id: I285a95a77ac55d2502d146316da12339de277fc9
Reviewed-on: https://chromium-review.googlesource.com/1169468
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582086}
oscarj
Make function names unique (components/autofill)
When building using jumbo, files gets merged and
functions with the same name may end up in the
same namespace and conflict. This happens for
functions in:
components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc
components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc

The functions are very similar but not identical. Therefore,
the functions in
components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc
are renamed to be something more file specific.

Bug: 869381
Change-Id: I8b26857cfa9fd80b42d9ff79de4b49753c824b54
Reviewed-on: https://chromium-review.googlesource.com/1169018
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#581867}
oscarj
Move TruncateUTF8 to util (components/autofill)
When building using jumbo, files gets merged and
functions with the same name may end up in the
same namespace and conflict. This happens for
the function TruncateUTF8.

This commit solves the issue by moving the function
to a shared util file.

Bug: 869381
Change-Id: Ia9f754138fb18aa9af575f7cd2f92bca4e8ea0c2
Reviewed-on: https://chromium-review.googlesource.com/1168497
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#581866}
oscarj
Specify autofill::AddressField (component/autofill)
When building using jumbo, files gets merged and
the compiler gets a larger scope. AddressField is
defined in both autofill::AddressField and
::i18n::addressinput::AddressField and the
reference is ambiguous. That is the reason
the namespace autofill:: needs to be specified
even though the call is made within that namespace.

Bug: 869381
Change-Id: I3ac8813403e04b37b7936397e617aab436214056
Reviewed-on: https://chromium-review.googlesource.com/1169012
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#581864}
oscarj
jumbo build: Rename constants to be unique (storage/browser)
When building using jumbo, files gets merged and
constants with the same name may end up in the same
namespace/scope and conflict.

This commit solves the issue by renaming the constants
to something more file specific.

Bug: 871163
Change-Id: Ic4973b976597dbc097897406951ae8c2cbdf6430
Reviewed-on: https://chromium-review.googlesource.com/1163505
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581535}
oscarj
Forward declare operator overload (components/)
When building using jumbo, files get merged and more options
are presented for the compiler. When using the operator overload <<
in PasswordRequirementsSpec, the compiler gets too many
options and will fail before reaching the correct operator overload.

The issue solved by forward declaring the operator overload in the files
that uses it.

Bug: 869381
Change-Id: I3d0226c9e12b1e64b3359a1efb2f9948a24e61b6
Reviewed-on: https://chromium-review.googlesource.com/1160228
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#581526}
oscarj
Move macro to util file (storage/browser)
When building using jumbo, files gets merged
together and macros with the same name may
end up in the same namspace and conflict. This
happens for the macro UMA_HISTOGRAM_MBYTES.

This commit solves the issue by moving
the macro to a shared util file.

Bug: 871163
Change-Id: If3af541913a6add55ce739eb43f5a747cf4afd9a
Reviewed-on: https://chromium-review.googlesource.com/1163602
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#581192}
oscarj
Enable jumbo support in //chrome/renderer
Without jumbo, chrome/renderer takes around
7 CPU minutes, which is around 1.2 % of the
total build time.

This commit will enable jumbo support for
this target, reducing build time when using
jumbo.

Bug: 870617
Change-Id: I4b35b6fc69e30c61dc1f24082bbaa338ad96b4ef
Reviewed-on: https://chromium-review.googlesource.com/1161804
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#580827}
oscarj
Rename constants to be unique (chrome/renderer)
When building using jumbo, files gets merged and
constants with the same name may end up in the
same namespace and conflict. This happens for:
chrome/renderer/chrome_content_renderer_client.cc
chrome/renderer/extensions/extension_hooks_delegate.cc
chrome/renderer/extensions/tabs_hooks_delegate.cc

This commit solves the issue by renaming the constants
to something more file specific.

Bug: 870617
Change-Id: I3ded3625b3851724362d496191c5bd25dda081f6
Reviewed-on: https://chromium-review.googlesource.com/1161803
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#580821}
oscarj
Move function to util (components/password_manager/)
When building using jumbo, files gets merged and
functions with the same name may end up in the same
namespace/scope and conflict. This happens for the
function UpdateMetadataForUsage.

This commit solves the issue by moving the function
to a shared util file.

Bug: 869381
Change-Id: I57b8f9c96c785a3bbfc8250f0edbe7690c3b3ff7
Reviewed-on: https://chromium-review.googlesource.com/1160482
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580514}
oscarj
Rename UserDataKey to be unique (components/autofill)
When building using jumbo, files gets merged and
functions with the same name may end up in the same
namespace/scope and conflict. This happens for
the function UserDataKey. Since the function relies
on that the static int is unique this function could
not be moved to a shared util file. Instead, the issue
was solved by renaming the function.

Bug: 869381
Change-Id: Ifd67ac865e9d0bad272cc51ef1af8c3a5b382893
Reviewed-on: https://chromium-review.googlesource.com/1160487
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#580483}
oscarj
Rename LoginTableColumns (components/password_manager)
When building using jumbo, files gets merged and enums
with the same name may end up in the same namespace and
conflict. This happens for he enum LoginTableColumns.

This commit solves the issue by renaming one instance
of LoginTableColumns to something more file specific.

Bug: 869381
Change-Id: I9a0b95dcddee3bbc9f1b8969142aa683e11025a0
Reviewed-on: https://chromium-review.googlesource.com/1160496
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#580482}
oscarj
Move variable to util (components/autofill/)
When building using jumbo, files get merged and
variables with the same name may
end up in the same namespace and conflict.

This happens for the constant kLocalGuidSize in autofill/core/browser.
The variable is moved to a util file in
common.

Bug: 869381
Change-Id: I038ef40acd5617f9d9d1e18c81a2fcce55cab8eb
Reviewed-on: https://chromium-review.googlesource.com/1158544
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#580142}
oscarj
Enable jumbo support for //components/omnibox
Without jumbo, omnibox takes around 3 CPU minutes to build
which is around 0.5 % of the total build time.

This commit enables jumbo support in components/omnibox.

Bug: 869381
Change-Id: Ifb51dab5a6b034a384c6bf07ee2f5b8c17b952a7
Reviewed-on: https://chromium-review.googlesource.com/1156593
Reviewed-by: Tommy Li <tommycli@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#580114}
oscarj
Move CreditCard function to util (/autofill)
When buidling using jumbo, files gets merged and functions
with the same name may end up in the same namespace and
conflict. This happens for the function IsCreditCardExporationType
in:
components/autofill/core/browser/form_structure.cc
components/autofill/core/browser/autofill_manager.cc

Since the functions are identical they are moved to a shared
util file. Since the function needs
components/autofill/core/browser/field_types.h it cannot be
moved to components/autofill/core/common.

Bug: 869381
Change-Id: I69492fbc8af0ed9289504cb6aba3e745acb17b24
Reviewed-on: https://chromium-review.googlesource.com/1158364
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579778}
oscarj
Renaming conflicting variables names (components/autofill)
When building using jumbo, files get merged and variables
and functions with the same name may end up in the same
namespace/scope and conflict.

This commit solves the issues in components/autofill
by renaming the conflicting functions and variables to
something more file specific.

Bug: 869381
Change-Id: Ifccae861ca7379346fb0939113ac227b770f9640
Reviewed-on: https://chromium-review.googlesource.com/1158235
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#579768}
oscarj
Resolve namespace scope issue (components/autofill)
When building using jumbo, files get merged. This
results in a conflict with the namespace i18n.
This commit solves the issue bu specifying that the
global namespace should be used, by addind the
"::" prefix.

Bug: 869381
Change-Id: I3432251c5f91fbb1f35df6ef5a9c70337df5e21f
Reviewed-on: https://chromium-review.googlesource.com/1156601
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#579765}
oscarj
Enable jumbo for media/capture
Building //media takes around 23 CPU minutes. A experimental
branch showed that this could be reduced, by using jumbo,
to around 9 CPU minutes. media/capture is the fifth largest part
of media and takes around 2 CPU minutes to compile without
jumbo.

This commit enables jumbo for media/capture.

Bug: 867350
Change-Id: Ib53497ecde8a096b4436b4c60069e9e24e482a68
Reviewed-on: https://chromium-review.googlesource.com/1154922
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579745}
oscarj
Remove "using namespace" (jumbo, media/capture)
When building using jumbo, files get merged and
the usage of "using namespace..." results in the
error:
using namespace directive in global context in header

This commit solves the issue by removing
"using namespace" and instead write the complete
name when it is used.

Bug: 867350
Change-Id: Iba570fbb737819ed515dc686ba65f9e7f9b47653
Reviewed-on: https://chromium-review.googlesource.com/1154538
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579380}
bratell
Avoid the name "interface" since it's a macro in Windows
In Win32 some headers defines "interface" to mean struct which
makes it unsuitable to cross platform code. This instance was
hit in a jumbo experimental build where apparently enough
win32 headers were included in the translation unit.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I1e906a46620378be2ded6a4a4868e2034cc1868b
Reviewed-on: https://chromium-review.googlesource.com/1152735
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#578715}
oscarj
Enable jumbo for media/cast
Building //media takes around 23 CPU minutes. A experimental
branch showed that this could be reduced, by using jumbo,
to around 9 CPU minutes. media/cast is the fourth largest part
of media and takes around 2 CPU minutes to compile without
jumbo.

This commit enables jumbo for media/cast.

Bug: 867350
Change-Id: Iaefb6e7ac95c1c7fab78478f879a8ba542f329d9
Reviewed-on: https://chromium-review.googlesource.com/1152807
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578609}
oscarj
Enable jumbo for media/filters
Building //media takes around 23 CPU minutes. A experimental
branch showed that this could be reduced, by using jumbo,
to around 9 CPU minutes. media/filters is the third largest part
of media and takes around 2 CPU minutes to compile without
jumbo.

This commit enables jumbo for media/filters.

Bug: 867350
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I01fe34fb39b35bf1a95e893916c2fc49e59a6d9e
Reviewed-on: https://chromium-review.googlesource.com/1152808
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578608}
oscarj
Move transport functions and variables to util (media/cast)
When building using jumbo, files get merged and functions and
variables with the same name may end up in the same namespace
and conflict. This happens in:
media/cast/net/cast_transport_impl.cc
media/cast/net/udp_transport_impl.cc

Since the functions and variables are identical they are
moved to a common util file.

Bug: 867350
Change-Id: I08747781d56b78e9a8783bfec870c7084183062a
Reviewed-on: https://chromium-review.googlesource.com/1152738
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578596}
oscarj
Rename InProgressFrameEncode to be unique (media/cast)
When building using jumbo, files get merged and functions
with the same name may end up in the same namespace. This
happens with the functions InProgressFrameEncode defined in:
media/cast/sender/external_video_encoder.cc
media/cast/sender/h264_vt_encoder.cc

This commit solves the issue by renaming the functions
to something more file specific.

Bug: 86750
Change-Id: I8f6fb84783539dcec4aae824bb971e982b4db5c2
Reviewed-on: https://chromium-review.googlesource.com/1152745
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578594}
oscarj
Resolve jumbo conflict in video decoders (media/filters)
When building using jumbo, files gets merged. Files and
variables with the same name may merge into the same
namespace or scope and conflict. This happens in the files:
media/filters/aom_video_decoder.cc
media/filters/ffmpeg_video_decoder.cc
media/filters/vpx_video_decoder.cc

This commit solves the issue by renaming the function
GetThreadCount to something more file specific. It also
moves some constants to that function.

Bug: 867350
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Id57aa6cc6ac10acd0073eee032d0d04592ba87e4
Reviewed-on: https://chromium-review.googlesource.com/1151311
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578593}
oscarj
Resolve function name conflict (media/filters)
When building using jumbo, files merged and functions with
the same name may end up in the same namespace/scope. This
happens for the function OnError() that gets called by Bind().
OnError() is defined in:
media/filters/audio_video_metadata_extractor.cc
media/filters/media_file_checker.cc

This commit solves the issue by renaming one of the functions
to something more file specific.

Bug: 867350
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I1b762e4f1c4b11751df2302874af53106889d085
Reviewed-on: https://chromium-review.googlesource.com/1151316
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578592}
oscarj
Forward declare template specialization (media/filters)
In jumbo builds the compiler complain about not
knowing about the template specialization of the
function OnStartOfCodedFrameGroup, that is defined
in source_buffer_stream.cc. To solve this issue
a fordward declaration is done before usage.

Bug: 867350
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: If090b848bc2ae78121620aba2349eac4c63d8a65
Reviewed-on: https://chromium-review.googlesource.com/1151313
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578591}
bratell
Split osmesa code into its own build target
Some osmesa code uses the "real" OSMesa API headers and those are
not 100% compatible with the wrapper API headers normally used.
That incompatibility means that they cannot compile in the same
translation unit (jumbo builds). This splits the osmesa files
into their own build target to avoid potential conflicts.

Also changes the code to be consistent with how osmesa.h is included.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ifc96cf25f7b69f23f293e297ab59ce5192f1cd20
Reviewed-on: https://chromium-review.googlesource.com/1149874
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#578588}
bratell
Change variable names in gpu info tables to be jumbo compatible
In jumbo compilation many cc files compile in the same translation
unit and if they use the same local variable names, there will
be compilation clashes. That happened in the automatically generated
code with info about various problems in gpu drivers or the like.

This patch makes sure necessary variables have unique names by
adding a unique keyword for each set of data.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ief86248f2d17f123602c7e641c286d0550a85d89
Reviewed-on: https://chromium-review.googlesource.com/1151314
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578587}
bratell
Don't use Khronos headers from gpu code
Switching from Khronos headers to more approprite headers
primarily to avoid jumbo compilation problems but also
because it was wrong.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I9a7c33acfcc72133638c47ae370020331c445ac9
Reviewed-on: https://chromium-review.googlesource.com/1151630
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#578402}
mboc
Allow values with dot delimiters as split mac dictionary keys.
Using e.g. URLs as hash split keys is not possible ATM. Change this by
deliberately not expanding the dictionary tree on settings split hashes.

Change-Id: Ifbc09aedd546f2f7e774807e091caa2069e1d0a6
Reviewed-on: https://chromium-review.googlesource.com/1144880
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578378}
oscarj
Enable jumbo support in media/base
Building //media takes around 23 CPU minutes. A experimental
branch showed that this could be reduced, by using jumbo,
to around 9 CPU minutes. media/base is the second largest part
of media and takes around 3.1 CPU minutes to compile without
jumbo.

This commit enables jumbo for media/base.

Bug: 867350
Change-Id: Ie2dae0a65bfc596b30339712a39cab321e293f48
Reviewed-on: https://chromium-review.googlesource.com/1150037
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#578305}
oscarj
Move operator to namespace "media" (media/base)
When building using jumbo, the call:
s << " decrypt=" << (*decrypt_config_);
in media/base/decoder_buffer.cc does not
find the operator overload in:
media/base/decrypt_config.h
since it is not located within the same
namspace as DecryptConfig.

This commit solves the problem by moving
the operator overload to the namespace.

Bug: 867350
Change-Id: I92073b73cc52ac0bacc7446ce3d1389fef5f6c13
Reviewed-on: https://chromium-review.googlesource.com/1150164
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#578246}
bratell
[jumbo] Refactor and deduplicate some command_buffer constants
A couple of constants in the command_buffer code were duplicated
which caused symbol clashes in jumbo build experiments. This patch
tries to ensure each constant is only in the code once.

To make it possible to deduplicate kS3TCBlockWidth, ASTCBlockArray
and kASTCBlockArray, some validation code had to move from
gles2_cmd_decoder.cc to gl_utils.cc where there already were some
validators.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I4ffb28630a1900a9400f29690cfb802497550077
Reviewed-on: https://chromium-review.googlesource.com/1145308
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#578244}
oscarj
Enable jumbo for media/mojo
Building //media takes around 23 CPU minutes. A experimental
branch showed that this could be reduced, by using jumbo,
to around 9 CPU minutes. media/mojo is the largest part
of media and takes around 5 CPU minutes to compile without
jumbo.

This commit enables jumbo for media/mojo.

Bug: 867350
Change-Id: Iad7e5957cc7f01110c4163c9d368f1f04496630a
Reviewed-on: https://chromium-review.googlesource.com/1149863
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#578232}
bratell
[jumbo] Declare a template specialization before using it
A quirk in C++ is that you can't specialize a template after it
has been "used" unspecialized in a translation unit. This would
happen in jumbo builds with
ApiResourceManager<EasyUnlockPrivateConnection>::GetFactoryInstance()
which is defined in easy_unlock_private_connection.cc but used
undeclared in easy_unlock_private_api.cc.

The fix is simple, just declare the specialization before it's used
and this patch adds that declaration to
easy_unlock_private_connection.h.

Bug: 850484
Change-Id: If5c12b67c92889a5c986b6a571d9895dea03cb6e
Reviewed-on: https://chromium-review.googlesource.com/1149860
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#578061}
bratell
Fix link error for ViewProperties for Mac (!aura)
TBR=sky@chromium.org

Bug: 854704

Change-Id: I58fded8d7ad7c764e55ac435940ff0656a1d2aa5
Reviewed-on: https://chromium-review.googlesource.com/1150235
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#578006}
bratell
constexpr all the blink geometry types
With constexpr you make it slightly easier for the compiler to
optimize code, though the effect will be small.

Also, with constexpr types the compiler becomes better at telling
us when a variable is unused. This removes such variables.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I6b52edc7ef67167bf8b7864c97a5f57b50d85398
Reviewed-on: https://chromium-review.googlesource.com/1131509
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577950}
oscarj
Move function to util files (media/mojo)
When building using jumbo, files gets merged and functions
with the same name may end up in the same scope and conflict.

This commits moves such functions to shared util files,
instead of having duplicates.

Bug: 867350
Change-Id: I9986d6d653ef71acbf9583e18aa85a8e34f6e6f0
Reviewed-on: https://chromium-review.googlesource.com/1149781
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#577850}
oscarj
Remove unnecessary include (media/mojo/services)
When building using jumbo, files get merged together
and macros may end up in the same scope and conflict.
In media/mojo/services/test_mojo_media_client.cc a include
resulted in including ui/gl macros, which conflicted with
GLES2 macros.

This commit solved the issue by removing the include. The include
seems to be unnecessary and not used within the file.

Bug: 867350
Change-Id: I54f01bcd5d18b4acbaa231a5cf78a8b5e8f719e7
Reviewed-on: https://chromium-review.googlesource.com/1149862
Reviewed-by: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#577847}
bratell
[jumbo] Give two internal ui/gl functions unique names
MakeFunctionUnique and MockInvalidFunction are functions
that are generated twice by ui/gl/generate_bindings.py. With that
double generation the code can't be jumbo compiled because of
the resulting symbol clash when the code ends up in
a single translation unit.

This patch gives the functions unique names by adding the "set_name"
(gl, egl) to their names.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ia08d42a86b99bddc808d1ac7c921f6801eb07782
Reviewed-on: https://chromium-review.googlesource.com/1148453
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#577800}
bratell
Switch ui/gl/gl_enums.cc from khronos GL to ui/gl
gl_enums used Khronos to get a definition of GL_NONE but
that broke jumbo build experiments because you cannot have
khronos headers and ui/gl headers in the same translation
unit.

This patch switches gl_enums.cc to use ui/gl/gl_bindings.h like
the rest of the code.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Id239ca4aa55278ac012c066d6a6f8e243b3ec319
Reviewed-on: https://chromium-review.googlesource.com/1148442
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#577799}
bratell
Deduplicated a gpu code helper function to avoid jumbo clashes
There are three identical small ToGLuint functions which clashed
in jumbo build experiments. This moves it to gles2_cmd_utils.h and
changes the type to not add a dependency on GL in
command_buffer/common.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Iad7cfc8a2506b765ba7a93c2eb9dc59149e5b8f4
Reviewed-on: https://chromium-review.googlesource.com/1141944
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#577499}
bratell
Delete temporary local AHardwareBuffer definition
While waiting for a newer ndk, some constants and types
were locally declared. Since January there is an NDK that contains
those types so the local declarations are not needed anymore

In some jumbo builds the local and ndk declaration clashed so it
is time to drop the local declarations, but keeping some types
still needed by the dynamic lookup of some (to be public) internal
functions.

Bug: 771171
Change-Id: Ie29ad63108b6c7aef857752daf6741902fdd749e
Reviewed-on: https://chromium-review.googlesource.com/1141735
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Klaus Weidner <klausw@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#577237}
bratell
Switch shader_translator from khronos GL to ui/gl
In jumbo experiments build targets using both ui/gl+mesa and khronos
at the same time fail to compile because the two GL libraries
declare the same constants and functions.

This happened in gpu/command_buffer/service because ShaderTranslator
used khronos GL when it should have been using ui/gl. This patch switches
that code over to ui/gl.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I522243374eaf0416df58d84e20585c11aef3de32
Reviewed-on: https://chromium-review.googlesource.com/1145306
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#577236}
oscarj
Enable jumbo for chrome/browser/ui
This commit will enable jumbo for chrome/browser/ui. This will
reduce the build time by approximately 90 CPU minutes (more
than 10 % of the total jumbo build time for chromium), compared to
building without jumbo.

Bug: 803406
Change-Id: I7774bd55378ea88dadcbf452679686e383bb15a2
Reviewed-on: https://chromium-review.googlesource.com/1143269
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577213}
oscarj
Rename kSeparatorWidth to be unique (browser/ui)
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kSeparatorWidth in:
chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc

This commit solves the issue by renaming the constants to
something more file specific. It also renames other variables
in the same namespace, so the naming is locally consistent.

Change-Id: I2ae24ce5b67372286a5aa4e48a0bc125606ff778
Reviewed-on: https://chromium-review.googlesource.com/1146641
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577166}
mharanczyk
Add missing deps to v8 binding test target to fix random build failures.
Random failures encountered so far can be reproduced by compiling
third_party/blink/renderer/bindings/core/v8:testing target on clean repo.

Change-Id: If92737cdfdc6f12533776b6ded935ac1a2689137
Reviewed-on: https://chromium-review.googlesource.com/1127040
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577137}
wdzierzanowski
Reset timestamp validator when config change is complete
When DecoderStream<DemuxerStream::AUDIO> encounters a config change it needs to
do two things, among others: flush the decoder and reset the audio timestamp
validator. It's important that it does the latter only after processing any
decoder output produced during the flushing.

This CL moves the responsibility of resetting the validator from
DecoderStream to DecoderStreamTraits<DemuxerStream::AUDIO>. It also adds
a test where the decoder's behavior of releasing internally buffered
samples upon flushing is mocked.

Bug: 865926
Test: New test AudioBufferStreamTest.FlushOnConfigChange doesn't fail assertions. No regressions in media_unittests.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I8cbb01df3792ca9de5db8ab637285d1e64188b39
Reviewed-on: https://chromium-review.googlesource.com/1145188
Reviewed-by: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#577123}
oscarj
Resolve include and define issues for jumbo (mac)
When building using jumbo, files get merged and variables,
functions and defines could end up in the same scope and
conflict. This commit solves issues with includes and defines
for the mac specific part of chrome/browser/ui.

Bug: 803406
Change-Id: I55d1f6110a6144bc7ee3037a374d3e33c36a9879
Reviewed-on: https://chromium-review.googlesource.com/1144928
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#577121}
bratell
[jumbo] undef SHADER macros after using them
Several files in gpu/command_buffer/service use local SHADER
macros. If they are compiled together in a jumbo build those
macros will collide and prevent the compilation.

This patch undefs the macros after use. An alternative is to
give them unique names.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I9de4011e1d609e5658a9d6cbe1775a3146364fa1
Reviewed-on: https://chromium-review.googlesource.com/1143265
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#577044}
bratell
Reuse the logging glCompileShader instead of redefining it
Three files had their own logging glCompileShader wrapper named
CompileShader and in jumbo build experiments those clashed. This
makes that helper function shared, makes the logging a little more
accepting of long error messages, but loses a little bit of
information about where the code was called from.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: If7e518cc993e165c2f51c4b32a7f1df96d31ad5d
Reviewed-on: https://chromium-review.googlesource.com/1143266
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#577004}
bratell
Clarify which of ::base and ::angle::base is intended
There is a namespace base inside the namespace angle so when
writing code inside angle, "base" is ambigious.

This triggered a compilation failure in some jumbo experiments where
the compiler knew about both ::angle::base and ::base.

There are guides to not name inner namespaces the same as common
top level namespaces for this reason but I guess renaming
angle::base is not an option.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I7c780aea3408d11082a96baa729f2cc0b6dd3247
Reviewed-on: https://chromium-review.googlesource.com/1144936
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#576892}
oscarj
Rename constants to be unique (mac)
When building using jumbo, files gets merged and constants
with the same name may end up in the same scope and conflict.

This commit solves the issue by renaming the constants to
something more file specific.

Bug: 803406
Change-Id: I70976f012e9be6f395d4bfcc43e785515071ebb3
Reviewed-on: https://chromium-review.googlesource.com/1142783
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576511}
oscarj
Move functions and constants to util files (mac)
When building using jumbo, files gets merged and functions and
constants with the same name may end up in the same scope.
This commits moves such functions and constants to shared
util files.

Bug: 803406
Change-Id: I3a0d763741c3d6b631539fdfe51f8fddc0b255a0
Reviewed-on: https://chromium-review.googlesource.com/1141865
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Sidney San Martín <sdy@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#576502}
bratell
Avoid "using namespace gles2" in the gpu code
Jumbo isn't compatible with "using namespace" since those cause
compiler warnings unless in the top level file, but "using namespace"
is also prohibited by the code style guide (see:
https://google.github.io/styleguide/cppguide.html#Namespaces )

This makes the code a bit more verbose, but it also makes it
more self consistent since the gles2:: prefix was already
occasionally used.

Bug: 864986
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I7c2111e70407a7ddf65473cb83e7f63b70b18747
Reviewed-on: https://chromium-review.googlesource.com/1141882
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#576159}
oscarj
Make variable names unique (mac)
When building using jumbo, files gets merged and
variables with the same name may end up in the same
scope. This commit renames such varaibles to something
more descriptive or file specific.

Bug: 803406
Change-Id: Ia43af0d95b0693ce917722397bc23db655441c29
Reviewed-on: https://chromium-review.googlesource.com/1141579
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#576139}
oscarj
Specify class type before calling setCornerFlags (mac)
Specifying what subclass of NSView being called,
in this  case BubbleView.

Bug: 803406
Change-Id: Iabc0a02ab17a881993f34b9c120978ca7f45264c
Reviewed-on: https://chromium-review.googlesource.com/1141879
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#576137}
bratell
Don't use split_static_library when lld is used
split_static_library is mainly a fix to avoid hitting internal
size limits in the Windows toolchain and it's not needed when
using lld because its thin archives are orders of magnitude smaller.

Bug: 857060
Change-Id: Idf101fc57d5fed8ee8644715fdebb879f7974da6
Reviewed-on: https://chromium-review.googlesource.com/1138330
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576067}
bratell
Use MobileScroller instead of cloning it.
Chromecast wants to scroll exactly like Android and for that
the code cloned the mobile scrolling code, but simpler and
easier and with less code and fewer jumbo compilation errors
is to just use the existing code directly.

Only a minor code difference existed and that is controlled with
a conditional statement instead now.

Bug: 813911
Change-Id: I9d037da9b58c1ad0916dc22ee194328c113075cd
Reviewed-on: https://chromium-review.googlesource.com/1136541
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Kevin Schoedel <kpschoedel@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#576035}
oscarj
Fix typo in SadTabViewCocoa (from SabTabViewCocoa)
The class SadTabViewCocoa has a typo and is currently
named SabTabViewCocoa. This commit renames the class
to the correct name.

TBR=avi@chromium.org

Bug: 803406
Change-Id: Id290fe8d016fe0fae9c760cb556e7c8896d17426
Reviewed-on: https://chromium-review.googlesource.com/1141569
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#575986}
oscarj
Resolve name conflict between regular and cocoa classes
When building using jumbo, files may end up in the same scope.
In chrome/browser/ui, ui elements defined with the same name in
both browser/ui and  browser/ui/cocoa conflict. This is relevant
for the classes:

HoverButton
ReloadButton
TabStripController
TabController
NewTabButton
BookmarkBarView
DownloadShelfViewCocoa
ToolbarButton
AvatarButton
SadTabView
AlertIndicatorButton
ToolbarView

This commit solves the issue by adding "Cocoa" to the classes
defined in chrome/browser/ui/cocoa. This is changed in
chrome/browser/ui/cocoa and ui/base/cocoa.

Bug: 803406
Change-Id: Iafd3b9447e4ed6960d86d43d12213ad367919357
Reviewed-on: https://chromium-review.googlesource.com/1140055
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#575959}
bratell
[jumbo] Merged two GetActiveTextureUnit functions
In jumbo build experiments, two (identical but small)
GetActiveTextureUnit() functions ended up in the same translation
unit which caused the compiler to fail.

This patch moves the useful function into a shared utility file.

Bug: 801580
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: Id6f8f1002db18593150bec30f1e8b7092f464e13
Reviewed-on: https://chromium-review.googlesource.com/1136308
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#575721}
oscarj
Specify sender type before changing state (browser/ui/cocoa)
Instead of using id as sender type this commit specifies which
types that are possible to recieve.

Bug: 803406
Change-Id: If5a6cfb0c0788b1e2a9e911ae05e9f7dc5e3840d
Reviewed-on: https://chromium-review.googlesource.com/1140166
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575637}
oscarj
Make category names unique for interfaces (browser/ui)
When building using jumbo, interfaces and implementations
end up in the same scope. The interfaces with the same
category name conflicts.

This commit solves the issue by renaming the category to
something more file specific.

Bug: 803406
Change-Id: I21a6645640d40b0ed6cd1324dfc30efa87da23c0
Reviewed-on: https://chromium-review.googlesource.com/1140162
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#575624}
bratell
Use :: prefix to distinguish between ::media_router::prefs and ::prefs
There are two namespaces named prefs in scope inside media_router code:
The global ::prefs namespace and the local ::media_router::prefs namespace.

If both namespaces are known to the compiler, as happens in jumbo builds,
then the name lookup will be ambigious and the compiler will fail to
compile the code.

Bug: 803406
Change-Id: Ib4be547ffe1ba7a790c2003fd54bd091935c378e
Reviewed-on: https://chromium-review.googlesource.com/1138244
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575379}
bratell
[jumbo] Deduplicate a time constant in autofill code
Two different bubbles needed the same time constant and when
they got copies of the constant that broke certain jumbo
builds. This merges the constants to a single constant.

It also changes type to base::TimeDelta which is the actual
type needed and since the addition of constexpr can be used
in global constants.

Bug: 852904,862397
Change-Id: I52a63d3301efb1c7aec55541c15427c5d96ba524
Reviewed-on: https://chromium-review.googlesource.com/1134998
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Mathieu Perreault <mathp@chromium.org>
Reviewed-by: Mathieu Perreault <mathp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574578}
fs
Remove the 'double' methods from blink::TimerBase
Remove the methods in blink::TimerBase that either take or return
a time delta as a double. These methods are mostly unused - a few calls
to StartOneShot and NextFireInterval, and it should be preferable for
new code to use the TimeDelta methods. The non-Delta-suffixed names are
kept - i.e they take on the name of their removed equivalent where
applicable.

The few users of StartOneShot(double, ...) are open-coded instead, and
uses of other methods are adjusted as needed.

The unit tests for Timer is overhauled to use TimeTicks and TimeDelta
throughout.

Bug: 763980
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I47c0449a9ea68e6e984c371e19f03f747bb5b1e0
Reviewed-on: https://chromium-review.googlesource.com/1131131
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574127}
bratell
Hide syslog's LOG_INFO from the rest of the code
Both syslog and the base namespace have LOG_INFO symbols and
in certain cases (which include, but is not limited to,
jumbo builds) those will clash.

This patch undefs the syslog LOG_INFO macro
as is already done with LOG_WARNING previously.

Change-Id: Iff59a2ef079d3bb38378af76932b21a128507353
Reviewed-on: https://chromium-review.googlesource.com/1027611
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574103}
tmoniuszko
Add missing include for views::CreateEmptyBorder
Change-Id: I5558e93ca31e5ab546457b0e07a73e5f1a60c614
Reviewed-on: https://chromium-review.googlesource.com/1125074
Reviewed-by: Kim Paulhamus <kpaulhamus@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#574095}
fs
Fix propagation of 'width' and 'height' in HTMLImageFallbackHelper
Use CSSValue::Create(const Length&, ...) to produce values in unzoomed
coordinates. This handles for instance calc(...) expressions correctly.

Bug: 860204
Change-Id: I30e639c38dc49795d44a5e28cc1bf01734543730
Reviewed-on: https://chromium-review.googlesource.com/1126307
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#573893}
fs
Remove unused LayoutImage::kPadding{Width,Height}
Probably managed by the HTMLImageFallbackHelper/UA shadow nowadays.

Change-Id: I6d70bafb0247f186a7c5e119f0368497d22c2dc6
Reviewed-on: https://chromium-review.googlesource.com/1131734
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#573825}
bratell
Forbid implicit conversions from IntPoint to FloatPoint
This is a followup from an analogous change for IntRect and FloatRect which was triggered
by some unintended conversions happening.
Since FloatPoint is not a perfect superset of IntPoint, converting from IntPoint to
FloatPoint is potentially lossy, and conversions that happen by accident hide that APIs
are not used as intended.

Behaviour has been kept where it's not obviously a mistake. Truncating or snapping to
integers is sometimes beneficial.

R=fs@opera.com, pdr@chromium.org

Bug: 860535

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I84e72a890dbddc2a9f40bb25a000f7eec75f6ffa
Reviewed-on: https://chromium-review.googlesource.com/1126396
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#573675}
fs
Scrub line-endings in chrome/browser/ui/views/tabs/tab.cc
93e913c148a1a54557c8b29517a4be2eab7949ea added mixed line-endings,
making git unhappy. Remove the excess carriage returns (CRs.)

Tbr: pkasting@chromium.org
Bug: 859585
Change-Id: Ied4e1465491679a607c9f273da0c3d8cbc6be499
Reviewed-on: https://chromium-review.googlesource.com/1130528
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#573673}
bratell
[jumbo] Resolve Windows conflict between Win32 API and OpenSSL headers
Windows head wincrypt.h and OpenSSL use the same constants so we can't
include wincrypt.h directly or indirectly. In
content/renderer/gpu/gpu_benhcmarking_extension.cc we include
the Windows header XpsObjectModel.h which includes msopc.h which
includes wincrypt.h which causes problems in some jumbo configuratons.

This patch makes sure to include crypt/wincrypt_shim.h first so that
the include of wincrypt in msopc.h does nothing.

Bug: 860646
Change-Id: Ieda7096234575b8d1fda8af2a103972632e0f6d2
Reviewed-on: https://chromium-review.googlesource.com/1127786
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#573672}
oscarj
Resolve multiple definitions of GetSequenceValue
When building using jumbo unnamed namespaces gets merged
and functions with the same name conflict. This happens
for the function GetSequenceValue in
net/cert/internal/parsed_certificate.cc and
net/cert/x509_certificate.cc.

This commit solves the issue by renaming the function to
something more file specific.

Bug: 772146
Change-Id: Ic8609a3c5a75b8187a58d3891eb3d8d32650fa76
Reviewed-on: https://chromium-review.googlesource.com/1118276
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573651}
oscarj
Fix line endings when writing bookmark URLs to clipboard.
Add "\r\n" instead of "\n" when copying multiple bookmark
URLs on Windows.

Bug: 861717
Change-Id: I0d15a8662bbb27ee67b899ea805ddd5b147be71f
Reviewed-on: https://chromium-review.googlesource.com/1128879
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#573646}
fs
Fix handling of 'auto' for 'rx' and 'ry' on <ellipse>
Per the spec[1][2], when 'auto' is specified for 'rx' or 'ry' the used
value of said property will be the used value of the other property
('rx' for 'ry' and vice versa.)

[1] https://svgwg.org/svg2-draft/geometry.html#RX
[2] https://svgwg.org/svg2-draft/geometry.html#RY

Bug: 861585
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iec0a9179527a5b0e99cc6a0ec671e5b6d92f828b
Reviewed-on: https://chromium-review.googlesource.com/1128885
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#573457}
fs
Eliminate HitTestResult::is_rect_based_test_
This flag should be a copy of the same flag in an associated
HitTestLocation. In all cases where it is used we have said
HitTestLocation and can use the flag from there instead.

The most complicated case - HitTestResult::ResolveRectBasedTest - will
return a HitTestLocation with the flag cleared, which should mean that
the state invariant is maintained. EventHandlingUtil::HitTestResultInFrame
as changed to take a HitTestLocation to be able to maintain this invariant
a little easier.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I8b8d17a4fabca725ec089f18550523a19b677c75
Reviewed-on: https://chromium-review.googlesource.com/1127939
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573441}
fs
Use TimeDelta for a bunch of timer durations/timeouts
Most of these changes are of the (int|unsigned|double) -> TimeDelta
type.

In a few cases (EventSource, GeoNotifier, VibrationController), an
invocation of StartOneShot(double, ...) is changed to a
StartOneShot(TimeDelta, ...) with an appropriate TimeDelta::From...
conversion (all for milliseconds even.)

In some cases names of constants are changed to remove the unit, since
that's no longer meaningful.

EventHandler::TargetGestureEvent was doing an unnecessary conversion, so
just drop that.

Remove the GeoNotifier::Timer::StartOneShot(double, ...) overload since
it's no longer used.

Bug: 763980
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ie5b117500db400da60faba0e308bc1644c26992d
Reviewed-on: https://chromium-review.googlesource.com/1127785
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#573359}
fs
Use TimeDelta in FirstMeaningfulPaintDetector
This changes the |network2_quiet_window_seconds_| and
|network0_quiet_window_seconds_| fields from double to TimeDelta,
renaming them to not have 'seconds' in the name (replaced by 'timeout'.)

Adjust the unit test, and replace AdvanceClockSeconds with AdvanceClock
throughout.

Add a new TestingPlatformSupportWithMockScheduler::RunForPeriod,
mimicking the setup for AdvanceClock{,Seconds}.

Bug: 763980
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I9316759a30c6fbe3fb4d7ea15106d6c47366ba33
Reviewed-on: https://chromium-review.googlesource.com/1127779
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573298}
fs
Use Time{Delta,Ticks} in LayoutProgress
Make |animation_start_time_| TimeTicks and |animation_repeat_interval_|
and |animation_duration_| TimeDelta to match semantics.

Update AnimationDurationForProgressBar and
AnimationRepeatIntervalForProgressBar in LayoutTheme to return
TimeDelta.

Bug: 763980
Change-Id: I3134116861dce6bdf0be050870cba25b0ef56e68
Reviewed-on: https://chromium-review.googlesource.com/1127780
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573291}
fs
Use TimeDelta in Scrollbar/ScrollableArea/ScrollbarTheme
Straightforward conversion in Scrollbar and ScrollableArea.

In ScrollbarTheme, OverlayScrollbarFadeOutDelaySeconds,
OverlayScrollbarFadeOutDurationSeconds, InitialAutoscrollTimerDelay and
AutoscrollTimerDelay are changed to return TimeDelta. The "Seconds"
suffix is dropped from the two earlier methods.

Bug: 763980
Change-Id: Idf1a8b1e44db18427db7a9acebd09f63be2c4cdc
Reviewed-on: https://chromium-review.googlesource.com/1127781
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573274}
bratell
Forbid implicit conversions from IntRect to FloatRect
This is a followup from removing some accidental conversions via FloatRect. Since
FloatRect is not a perfect superset of IntRect, converting from IntRect to FloatRect is
potentially lossy, and conversions that happen by accident hide that APIs are not used
as intended.

A few new helper functions that use IntRect were added to make the change smaller, but
there is potential for future further cleaning up of what types are used where, and how.

Behaviour has been kept where it's not obviously a mistake. Truncating or snapping to
integers is sometimes beneficial.

R=fs@opera.com, pdr@chromium.org

Bug: 860535

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I733b4273b847654f22bae726255cfb75ba8023bb
Reviewed-on: https://chromium-review.googlesource.com/1124454
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#573263}
oscarj
Resolve namespace scope issue for "switches"
When building using Jumbo files gets merged.
This results in a conflict with the namespace switches in:
chrome/browser/extensions/bookmark_app_helper.cc
chrome/browser/extensions/extension_util.cc

This commit solves this by specifying that the global
namespace should be used, by adding the "::" prefix.

Bug: 850484,856964,860646
Change-Id: I6b7b8343bb66ea5c8a5796f77b85c882085f5d93
Reviewed-on: https://chromium-review.googlesource.com/1127661
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#573000}
bratell
Add desktop_window_tree_host_win.h to ui/views' public api
The file desktop_window_tree_host_win.h is used by chrome/browser/ui/views
(apps/app_window_desktop_window_tree_host_win.h,
frame/browser_desktop_window_tree_host_win.h, ime/ime_window_view.cc and
tabs/window_finder_win.cc) so it's part of the external API of ui/views
and the file needs to be listed as such in the "public" part of the target.

This error is detected by gn gen --check in some builds and not in others.
I think it has gone undetected because with split_static_library you get
an empty public list for the part where this file belongs. No |public|
list means that all of |sources| is public. Or something similar.

(Fix by oscarj who had to leave for the weekend)

Change-Id: If6b5805bdd20c988e45b132dd680bb73b667e16c
Reviewed-on: https://chromium-review.googlesource.com/1127943
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#572989}
fs
Use TimeDelta in media controls/PiP
Straightforward double -> TimeDelta conversion. Names of constants have
been changed to remove any unit (like "...Seconds") - often replaced by
"...Duration". "Trans" was also expanded to "Transition" in a few
places.

Bug: 763980
Change-Id: I1b193ecf338245c5873f002c0cfcd1b679b345d7
Reviewed-on: https://chromium-review.googlesource.com/1127782
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#572971}
bratell
Removing intermediate IntPoint objects when FloatPoint is needed
Sometimes (probably for historical reasons), IntPoint objects
are created where FloatPoint objects are needed. The IntPoint will
(still) be converted to a FloatPoint by the compiler so all that
happens is that the code takes an unnecessary detour.

Need to be careful so that we don't depend on some truncation
performed by the detour via integers.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ia3b90f2a80cb7a65cfdf78c1370bea0acb79491d
Reviewed-on: https://chromium-review.googlesource.com/1126397
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#572961}
bratell
Renamed a method named Service since there is a class Service
There is a class Service in services/content/service.h which
makes it unsuitable to have other symbols named Service in
content. There was a local helper function named Service in
content/browser/notifications that caused a clash in jumbo builds
and this patch renames that method NotificationService()

Change-Id: I268c3afb3c5cc43315f0638f9685579d1fe1dcf9
Reviewed-on: https://chromium-review.googlesource.com/1118174
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572774}
fs
Move ImageResourceContent::BrokenCanvas to a better place
This function has no association with ImageResourceContent, so move it
to html_canvas_element.cc where it's only user resides.

Change-Id: I22e50d0f526f150957aec262452c7f1dfcf612e5
Reviewed-on: https://chromium-review.googlesource.com/1120332
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#572751}
fs
Replace uses of RepeatInterval() in DOMTimer with RepeatIntervalDelta()
RepeatInterval() is used in DOMTimer::Stop and DOMTimer::Fired to
determine if the timer is an interval timer or not. This can trivially
use the TimeDelta version instead.

Also use g_null_atom to pass a null AtomicString, rather than creating
a temporary.

Bug: 763980
Change-Id: I7b191ab7b99d22f73974b7b448b059c2f8cb51ef
Reviewed-on: https://chromium-review.googlesource.com/1125930
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#572631}
fs
Use TimeDelta in PausableTimer
Mostly s/double/TimeDelta/ and Method() to MethodDelta(). The
kNextFireIntervalInvalid constant is changed to TimeDelta::Min().

Bug: 763980
Change-Id: I878a4136edcfe815184e7021a19eefffbc02fd31
Reviewed-on: https://chromium-review.googlesource.com/1125919
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#572612}
fs
Use NextFireIntervalDelta instead of NextFireInterval in SVGImage*Test
Avoids run-tripping TimeDelta -> double -> TimeDelta.

Bug: 856082
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: If4a6a0626be6341770ef01d368fc8a1ddf00de31
Reviewed-on: https://chromium-review.googlesource.com/1126115
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#572560}
bratell
Avoid converting via or creating IntRect when we want a FloatRect
It's currently easy to use an IntRect when a FloatRect is needed
since there is an implicit (lossy) conversion from IntRect to
FloatRect. This patch changes some code to remove some
unnecessary conversions between the types.

(A float can store all integers up to, but not including,
16,777,217 so it the conversion is most of the time non-lossy)

R=fs@opera.com, pdr@chromium.org

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I324b79c3d78d387574f47a4bda8f7dc7bdad567b
Reviewed-on: https://chromium-review.googlesource.com/1124682
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#572306}
fs
Scale the viewport size in SVGImagePainter
LayoutImageResource::GetImage expects a zoomed container size (it passes
it unmodified to SVGImageForContainer::Create which unzooms it), so we
need to scale the viewport size before passing it.

Bug: 859774
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I24f7f0b1f402aaef112882ab146d573981889cae
Reviewed-on: https://chromium-review.googlesource.com/1124163
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#572190}
bratell
Give a global factory a globally unique name
There are two g_previews_factory now which causes issues with
some jumbo builds. This renames one of them
g_previews_service_factory.

Change-Id: I05d4ab366239888e80fb32f782ac4e4880a8609f
Reviewed-on: https://chromium-review.googlesource.com/1122131
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#572143}
oscarj
Move kDefaultNumConnections (net/)
When building using jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variable kDefaultNumConnections in:
net/third_party/quic/core/congestion_control/cubic_bytes.cc
net/third_party/quic/core/congestion_control/tcp_cubic_sender_bytes.cc

This commit solves the issue by moving the variable
definition to net/third_party/quic/core/quic_constants.h.

Bug: 772146
Change-Id: Ib7c961511823a8ecbc996775485a5fe23649e65e
Reviewed-on: https://chromium-review.googlesource.com/1120169
Reviewed-by: Ryan Hamilton <rch@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#572123}
fs
Reland "Suspend SVG image animations when the page is hidden"
Check Document::hidden() in LayoutObject::WillRenderImage,
thus pausing animations on pages that are not visible.
To resume animations, we may need to explicitly resume the
timeline, so a hook is added in Page::SetVisibilityState to
allow calling StartAnimation() on the relevant SVGImages.

Update: Added RunPendingTasks() to test to make sure the later
code is actually waiting for a proper animation frame.

Tbr: chrishtr@chromium.org
Bug: 856082
Change-Id: I457fc0b92576edf7d70933373d12d49d52a0b912
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/1122413
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#571904}
oscarj
Move constants from namespace to class (browser/ui)
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kStartPadding and kEndPadding in
chrome/browser/ui/views/download/download_item_view.cc
and chrome/browser/ui/views/download/download_shelf_view.cc.

This commit solves the issue by moving the variables from
the namespace to the class. It also moves other variables
in the same namespace, to keep the files locally consistent.

Bug: 773275
Change-Id: I8d23ae9999fe404d253a3a189e6d17d81786939d
Reviewed-on: https://chromium-review.googlesource.com/1107063
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571901}
oscarj
Rename local kColor constants (browser/ui)
When building using jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kFooterBackgroundColor and kSeparatorColor
in ui/views/autofill/autofill_popup_view_native_views.cc and
ui/views/passwords/password_generation_popup_view_views.cc.

This commit solves the issue by renaming the constants to
something more file specific. It also renames other variables
in the same namespace, so the naming is locally consistent.

Bug: 773275
Change-Id: I3f71efeaa29eccdbe646e7c2fb512f218c2f010a
Reviewed-on: https://chromium-review.googlesource.com/1118260
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571897}
bratell
Don't convert IntRect -> FloatRect -> IntRect.
If EnclosingIntRect() is called on an IntRect it is first
converted to a FloatRect or DoubleRect since that is what
EnclosingIntRect() is used for. Then you (hopefully) get
the originally IntRect back.

This strange conversion wasn't obvious in the code because the
type of the IntRect was hidden by an |auto|. It was discovered in
jumbo builds because the compiler had access to both DoubleRect
and FloatRect and didn't know which one to use.

Bug: 843606
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I1ca799cc27da02e1c6615bf403bc190fec1d5cde
Reviewed-on: https://chromium-review.googlesource.com/1122219
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#571887}
oscarj
Rename function NetLogEntryCreationCallback (net/)
When building using Jumbo namespaces with the same name
gets merged and functions with the same name conflict.
This happens for the function NetLogEntryCreationCallback
in:
net/disk_cache/net_log_parameters.h
net/disk_cache/memory/mem_entry_impl.cc

This commit solves the issue by renaming the function in
net/disk_cache/net_log_parameters. Also renames
CreateNetLogEntryCreationCallback to keep names
consistent.

Bug: 772146
Change-Id: Ice0a53054dbf2ded14728d48a7fd7b33bfe0d5a5
Reviewed-on: https://chromium-review.googlesource.com/1120180
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571881}
oscarj
Remove "using base::File" to avoid conflict (net/)
When building using Jumbo namespace aliases with the same
name may end up in the same unit, causing a conflict at
compilation. This happens for base::File and
disk_cache::File in:
net/disk_cache/simple/simple_index_file.cc
net/disk_cache/simple/simple_synchronous_entry.cc

This commit removes "using base::File" and
instead call the namespace by its full
name.

Bug: 772146
Change-Id: I7385edf04bc23d519ee8800bc4941807a85340ad
Reviewed-on: https://chromium-review.googlesource.com/1120252
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571880}
oscarj
Rename kNoPendingResult to be unique (net/)
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kNoPendingResult in:
net/socket/ssl_client_socket_impl.cc
net/socket/ssl_server_socket_impl.cc

This commit solves the issue by renaming the constants to
something more file specific.

Bug: 772146
Change-Id: I918d551970e249fbb5e0bfadf0ebaeae99ffebcb
Reviewed-on: https://chromium-review.googlesource.com/1119916
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571852}
oscarj
Rename function ParseCertificate to be unique (net/)
When building using Jumbo unnamed namespaces gets merged
and functions with the same name conflict. This happens
for the function kParseCertificate defined in:
net/cert/internal/ocsp.cc
net/cert/internal/parse_certificate.cc

This commit solves the issue by renaming the function in
net/cert/internal/ocsp.cc.

Bug: 772146
Change-Id: I071682c8f330183f637a7985061980b6aa34c93a
Reviewed-on: https://chromium-review.googlesource.com/1119911
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571848}
oscarj
Move kVlog constants to util file (net/)
When building using jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variable kVlogSetCookies in
net/cookies/canonical_cookie.cc and
net/cookies/cookie_monster.cc.

This commit solves the issue by moving the variable
definition to net/cookies/cookie_util.h. Other
kVlog variables defined in net/cookies/cookie_monster.cc
are also moved.

Bug: 772146
Change-Id: I850c27406f687dfffcf682b0957a41ecbeaca291
Reviewed-on: https://chromium-review.googlesource.com/1118382
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571842}
oscarj
Move kMaxSegmentSize to constant file (net/)
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kMaxSegmentsSize in:
net/third_party/quic/core/congestion_control/bbr_sender.cc
net/third_party/quic/core/congestion_control/prr_sender.cc

This commit solves the issue by moving the constant to
net/third_party/quic/core/quic_constants.h.

Bug: 772146
Change-Id: I07da21c2bc8c96f6ed5cc83e2724ae948d80a9be
Reviewed-on: https://chromium-review.googlesource.com/1119689
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Reviewed-by: Ryan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571814}
fs
Revert "Suspend SVG image animations when the page is hidden"
This reverts commit b56e2510d08c0a8fd0be69ad29a2558c6ce63523.

Reason for revert: Test flaky on cast_shell_linux

Original change's description:
> Suspend SVG image animations when the page is hidden
> 
> Check Document::hidden() in LayoutObject::WillRenderImage,
> thus pausing animations on pages that are not visible.
> To resume animations, we may need to explicitly resume the
> timeline, so a hook is added in Page::SetVisibilityState to
> allow calling StartAnimation() on the relevant SVGImages.
> 
> Bug: 856082
> Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I4a0b008730ec3e6c2af26e15d52eebb26020ad32
> Reviewed-on: https://chromium-review.googlesource.com/1115130
> Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
> Commit-Queue: Fredrik Söderquist <fs@opera.com>
> Cr-Commit-Position: refs/heads/master@{#571543}

TBR=fs@opera.com,chrishtr@chromium.org

Change-Id: I53a07f59bf48095c21ccf6eb357162786012ad1c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 856082
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://chromium-review.googlesource.com/1120976
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#571587}
fs
Suspend SVG image animations when the page is hidden
Check Document::hidden() in LayoutObject::WillRenderImage,
thus pausing animations on pages that are not visible.
To resume animations, we may need to explicitly resume the
timeline, so a hook is added in Page::SetVisibilityState to
allow calling StartAnimation() on the relevant SVGImages.

Bug: 856082
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I4a0b008730ec3e6c2af26e15d52eebb26020ad32
Reviewed-on: https://chromium-review.googlesource.com/1115130
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#571543}
oscarj
Resolve macro CACHE_UMA_BACKEND_IMPL_OBJ (net/)
The macro CACHE_UMA_BACKEND_IMP_OBJ is defined
in:
net/disk_cache/blockfile/backend_impl.cc
net/disk_cache/blockfile/entry_impl.cc

When building using jumbo these end up in the same
scope and conflict. This commit solves the issue
by undefining the macro at the end of the file.

Bug: 772146
Change-Id: Ib888216156c3054616f6e906e6c23a648154d2d9
Reviewed-on: https://chromium-review.googlesource.com/1118273
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571453}
oscarj
Rename kBeta to be unique (net/)
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kBeta in:
net/third_party/quic/core/congestion_control/cubic_bytes.cc
net/third_party/quic/core/congestion_control/rtt_stats.cc

This commit solves the issue by renaming kBeta in
net/third_party/quic/core/congestion_control/cubic_bytes.cc
to kDefaultCubicBackoffFactor to avoid the conflict and
to give the variable a more descriptive name.

Bug: 772146
Change-Id: Ibc2e6732d2c5fa70672a73e7b6669d8b71f581d1
Reviewed-on: https://chromium-review.googlesource.com/1119691
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571452}
oscarj
Resolve RETURN_STRING_LITERAL macro conflict (net)
The macro RETURN_STRING_LITERAL is defined in namespaces in:
net/third_party/quic/core/crypto/crypto_utils.cc
net/third_party/quic/core/quic_error_codes.cc
net/third_party/quic/core/quic_utils.cc
net/third_party/quic/core/quic_versions.cc

When building using jumbo these end up in the same
namspace and conflict. This commit solves the issue
by undefining the macro inside the namespace.

Bug: 772146
Change-Id: Ibb07acd829f8ad2867748d1db8aba5aa59a39e47
Reviewed-on: https://chromium-review.googlesource.com/1118222
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571450}
oscarj
Resolve LogSeverity macro/typedef conflict (browser/extensions)
LogSeverity is a typedef in base/logging.h and a macro
in the Windows header setupapi.h. When building using jumbo
this causes a conflict.

This commit solves the issue by undefining LogSeverity after importing
setupapi.h.

Bug: 850484,856964
Change-Id: I3e56c1a06357d8e03dbc98e01e51b18ae05e94dc
Reviewed-on: https://chromium-review.googlesource.com/1116790
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571436}
oscarj
Resolve ENDPOINT macro conflict (net/)
The macro ENDPOINT is defined inside namespaces in:
net/third_party/quic/core/quic_connection.cc
net/third_party/quic/core/quic_crypto_handshaker.cc
net/third_party/quic/core/quic_crypto_stream.cc
net/third_party/quic/core/quic_data_reader.cc
net/third_party/quic/core/quic_framer.cc
net/third_party/quic/core/quic_packet_creator.cc
net/third_party/quic/core/quic_sent_packet_manager.cc
net/third_party/quic/core/quic_session.cc
net/third_party/quic/core/quic_spdy_stream.cc

When building using jumbo these end up in the same
namspace and conflict. This commit solves the issue
by undefining the macro inside the namespace.

Bug: 772146
Change-Id: Ie85920ac632dd90402afc2276ed30fff8609d9be
Reviewed-on: https://chromium-review.googlesource.com/1118220
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571418}
oscarj
Move kTitleIconSize to class member (browser/ui)
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kTitleIconSize in
views/ime/ime_window_frame_view.cc,
views/relaunch_notification/relaunch_recommended_bubble_view.cc
and views/relaunch_notification/relaunch_required_dialog_view.cc.

This commit solves the issue by moving the variables from
the namespace to the class. It also moves other variables
in the same namespace, to keep the files locally consistent.

Bug: 773275
Change-Id: I0ec9b735f6f6c579bebe61ab6a1a8cfcac876f56
Reviewed-on: https://chromium-review.googlesource.com/1107619
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571196}
fs
Use DataEquivalent(...) when comparing StyleSVGResources
While the underlying SVGResource should be unique (or nullptr - for
invalid cases), the StyleSVGResource wrapper usually isn't. Hence we
need to use DataEquivalent(...) to properly determine equality.

Bug: 769774, 855914
Change-Id: I333bc7a737d0635aabe35e39bb066edbc4282790
Reviewed-on: https://chromium-review.googlesource.com/1118219
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#571099}
oscarj
Resolve LocationBarDecoration conflict(browser/ui)
LocationBarDecoration is defined as a struct in
chrome/browser/ui/views/location_bar/location_bar_layout.h
and as a class in
chrome/browser/ui/views/location_bar/location_bar_layout.h.
When building using jumbo this causes a conflict.

This commit solves the issue by renaming the struct to
DecorationInfo.

Bug: 773275
Change-Id: Iaeece5319fe66b335cf1dcda01f3d984f0cc5f7a
Reviewed-on: https://chromium-review.googlesource.com/1116797
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571063}
oscarj
Rename local kError constants to be unique
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
when building in Chrome OS for the variables
kErrorNotAvailable in:
chrome/browser/extensions/api/input_ime/input_ime_api.cc
chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc

This commit solves the issue by renaming the variables to
something more file specific. It also renames other variables
in the same namespace, so the naming is locally consistent.

Bug: 850484
Change-Id: Id2282be73d75c76bb820c0946fc1caf09aeca8a4
Reviewed-on: https://chromium-review.googlesource.com/1116698
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571043}
oscarj
Resolve issues with WRITE_RESULT constants (net/)
When building using jumbo the WRITE_RESULT constants
defined in net/disk_cache/memory/mem_entry_impl.cc
and in net/disk_cache/simple/simple_entry_impl.cc
conflict with each other.

This commit solves the issue by renaming the constants to
something more file specific.

Bug: 772146
Change-Id: I118bea2e4943983975640ce178a48adb597f25f3
Reviewed-on: https://chromium-review.googlesource.com/1117066
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#571042}
bratell
Make it one blink/gpu/mojom conversion function instead of three
There were three identical SharedBitmapIdToGpuMailboxPtr functions
which converted from viz::SharedBitmapId to
gpu::mojom::blink::MailboxPtr and those clashed in jumbo builds,

This patch makes all code use the same shared copy in
canvas_resource.cc

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ic7980af0aa30d7cc90acac1d0846f626ad58671d
Reviewed-on: https://chromium-review.googlesource.com/1104461
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#570705}
bratell
Revert "jumbo: stable assignment of inputs to chunks"
This reverts commit 2c7a71c3fd6cc3ee5eda41467ea6d5b8ee337386.

Reason for revert: Linux with chunk size 50 broke in v8 which we
can't quickly fix, and Windows (chunk size 8) has a DWORD logging
error that looks non-trivial. We need to fix those before landing
this.

Original change's description:
> jumbo: stable assignment of inputs to chunks
> 
> Adding or removing a file from a jumbo source set causes on average
> half of the chunks to have their inputs reallocated.
> Derive chunk boundaries from a combination of list position and path
> content. This is so that when a file is added or removed, only the
> boundaries with adjacent chunks typically move.
> For a balance between maximum chunk size and stability of partitions:
> * Partition uniformly into the required number of chunks.
> * Pick a "center" from each chunk by minimum hash value.
> * Pick the boundaries between centers by maximum hash value.
> 
> Bug: 782863
> Change-Id: Ie71d82b132e8145b4ed3d1141f85886a12149d5a
> Reviewed-on: https://chromium-review.googlesource.com/1102218
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Daniel Bratell <bratell@opera.com>
> Commit-Queue: Dirk Pranke <dpranke@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#570623}

TBR=dpranke@chromium.org,bratell@opera.com,brucedawson@chromium.org,david.barr@samsung.com

Change-Id: I8c81aca34ab2876aebea6b54e847cb24be3aa27f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 782863
Reviewed-on: https://chromium-review.googlesource.com/1116658
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#570701}
oscarj
Replace magic constant with kFixedSize
When calling certain functions in GridLayout a resize
parameter is passed, defining how much the layout should
resize.
Most often it is passed as 0 or 1. Sometimes 100 (which
is assumed to be the same as 1) and sometimes 0.5.

This commit defines the variable kFixedSize = 0.f
in grid_layout.h and remove every local defintion of
the variables. The magic constant are replaced by this
variable. The replacements are:
0, 0.f and 0.0f becomes kFixedSize (0.f)

This commit affects chrome/browser/ui.

Bug: 854186
Change-Id: I287b1b38350a2dce2bd6e02cc871e82e0a5d89db
Reviewed-on: https://chromium-review.googlesource.com/1106159
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#570693}
oscarj
Rename local k<name> constants to be unique
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
when building in Chrome OS for the variables
kErrorInvalidX509Cert in:
chrome/browser/extensions/api/certificate_provider/certificate_provider_api.cc
chrome/browser/extensions/api/enterprise_platform_keys/enterprise_platform_keys_api.cc

This commit solves the issue by renaming the variables to
something more file specific. It also renames other variables
in the same namespace, so the naming is locally consistent.

Bug: 850484
Change-Id: I67fc4d43785460ea5aa8fd1a08a2fd1985569117
Reviewed-on: https://chromium-review.googlesource.com/1114963
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#570682}
oscarj
Remove conflicting namespace declarations (jumbo)
In jumbo builds, on chrome os, the namespace redeclarations
of media_perception in:
chrome/browser/extensions/api/media_perception_private/media_perception_api_delegate_chromeos.cc
extensions/browser/api/media_perception_private/media_perception_api_manager.cc
extensions/browser/api/media_perception_private/media_perception_private_api.cc
conflict with the declaration in:
third_party/cros_system_api/dbus/service_constants.h

This commit solves the issue by removing the redeclaration of
media_perception and instead use the full name
extensions::api::media_perception_private.

Bug: 850484
Change-Id: I5a6363ca7e305d1bd7929555f60f9e1bd3322bfc
Reviewed-on: https://chromium-review.googlesource.com/1114852
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#570680}
bratell
Building chromium now requires uuid-dev (uuid/uuid.h)
The latest version of fontconfig requires uuid/uuid.h so
we need to install that in install-build-deps.sh.

(Only tested in Ubuntu 16.04)

Bug: 856666,829890
Change-Id: I586aa703e24a1ea2c10d08948acad37ce177f70f
Reviewed-on: https://chromium-review.googlesource.com/1115129
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570454}
oscarj
Resolve namespace scope issue (chrome/browser/ui)
When building using Jumbo files gets merged.
This results in a conflict with the namespace prefs in
views/media_router/cloud_services_dialog_view.cc.
This commit solves this by specifying that the global
namespace should be used, by adding the "::" prefix.

Bug: 773275
Change-Id: I4803ef96e32ae8a1d9f4c54b3cf95780ecedb6e5
Reviewed-on: https://chromium-review.googlesource.com/1114838
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: mark a. foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570439}
oscarj
Move kResizeAreaCornerSize from namespace
When building with Jumbo, kResizeAreaCorner in
views/frame/opaque_browser_frame_view.cc and
views/overlay/overlay_window_views.cc conflict.
This commit solves the issue by moving the
constants from the namespace to the place where
it is used.

Bug: 773275
Change-Id: I87195fe6f650088e7aaa6117ad44e9e919d17cc9
Reviewed-on: https://chromium-review.googlesource.com/1102499
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569978}
oscarj
Rename kAvatarIconSize to be unique (browser/ui)
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kAvatarIconSize in
views/profiles/dice_accounts_menu.cc and
webui/signin/user_manager_screen_handler.cc.

This commit solves the issue by renaming the variables to
something more file specific.

Bug: 773275
Change-Id: Ibb0aa4bf8c65fcdc70d5b747cccea336ab77ca9b
Reviewed-on: https://chromium-review.googlesource.com/1107708
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#569977}
oscarj
Rename kNameField to be unique (browser/ui)
When building using Jumbo unnamed namespaces gets merged
and variables with the same name conflict. This happens
for the variables kNameField in webui/certficates_handler.cc
and webui/inspect_ui.cc.

This commit solves the issue by renaming the variables to
something more file specific. It also renames other variables
in the same namespace, so the naming is locally consistent.

Bug: 773275
Change-Id: I0b900803f4f84c058c43e1b5b3f395c8e14774f9
Reviewed-on: https://chromium-review.googlesource.com/1107929
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: calamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569975}
fs
Update/recompute the is-downscaled flag when image loading finishes
If the <img> is layouted before the referenced image finishes loading
(and has dimensions available) and also has specified width and height,
then the |LayoutImage::is_downscaled_image_| will not be set correctly.
Also update said flag in LayoutImage::ImageNotifyFinished.

Bug: 854464
Change-Id: Iee9ad62dff436a0ef4d4a390902309159acb7cb7
Reviewed-on: https://chromium-review.googlesource.com/1107805
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569462}
oscarj
Remove "using" to avoid namespace conflict
When building using Jumbo namespace aliases with the same
name may end up in the same unit, causing a conflict at
compilation. This commit removes "using windows" and
"using tabs" and instead call the namespace by its full
name. This is done to increase the robustness of the code.

std::unique_ptr<T>() are removed because of presubmit check
errors.

Bug: 850484
Change-Id: I91f44728d4b54dd15213bac602176ca8736bb3cd
Reviewed-on: https://chromium-review.googlesource.com/1107633
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#569267}
tmoniuszko
Remove duplicated header file from BUILD.gn
Duplicated header caused Visual Studio error when opening platform.vcxproj
project.

error : Cannot load project with duplicated project items:
../../../../../../../third_party/blink/renderer/platform/graphics/compositor_mutator.h
is included as 'None' and as 'None' item types.

Change-Id: Iee35d7ef24dce3083c291858546fbe5b80428ee9
Reviewed-on: https://chromium-review.googlesource.com/1107921
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#569181}
fs
Remove unused (dead) friend-declaration in ResourceClient
SVGElementProxy no longer exist.

Change-Id: I552e9d3d0d092ba5d0c51c8bacc8b27bdf29fe4c
Reviewed-on: https://chromium-review.googlesource.com/1105977
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#568971}
fs
Simplify the CSSParserSelector destructor
Rather than moving the tag history into a Vector and let that perform
the destruction, just iteratively "collapse" the list until it is empty.

Change-Id: If1f6611caeea9b83da58f94e021647a2db0b7daa
Reviewed-on: https://chromium-review.googlesource.com/1107629
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#568900}
mpichlinski
Added missing eventlog_messages dependency in chrome_watcher.
Bug: 854179
Change-Id: Icee4af543850a30116e811f32a16c38b3498bcf2
Reviewed-on: https://chromium-review.googlesource.com/1106145
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Michal Pichlinski <mpichlinski@opera.com>
Cr-Commit-Position: refs/heads/master@{#568832}
mpichlinski
Do not create MediaRouterActionController when Media Router is disabled.
Following change: https://chromium-review.googlesource.com/1026975 disallows
having a control of Chromecast preference in settings, because calling Cast...
after enabling Chromecast preference in runtime without a restart causes a
crash due to missing MediaRouterUIService.

Instead of not creating MediaRouterUIService, do not create
MediaRouterActionController in this service when Media Router is disabled.

Bug: 834719
Change-Id: I218523d631d9050ff27e69915ba098fe21907e25
Reviewed-on: https://chromium-review.googlesource.com/1067817
Commit-Queue: Michal Pichlinski <mpichlinski@opera.com>
Reviewed-by: Derek Cheng <imcheng@chromium.org>
Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568726}
bratell
[jumbo] interface is a Windows API macro so avoid that name
interface is macro for struct in some Windows headers which
causes problems when Windows headers get exposed to code that
has named variables or functions interface. This happened
with the newly added jumbo support in chrome/browser/extensions.

Bug: 850484
Change-Id: I5d838bad5658bfe97542b32647e182348f63c4cc
Reviewed-on: https://chromium-review.googlesource.com/1106339
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#568492}
bratell
Qualify |storage| namespace in some extensions code
There is both ::extensions::api::storage and ::storage so inside
extensions::api, unless you explicitly write ::storage it's unclear
what namespace is intended.

In jumbo builds, some code ended up in a translation unit where
both storage namespaces were known, so this patch adds ::
to storage to make the code explicit.

There is a code style guideline to not use namespace names that are
also top level namespace for this reason, but it's not easy to
change all extension api namespaces.

Bug: 850484
Change-Id: I1c85fbc9dd3dc8be49d41be25f4886ec98c47926
Reviewed-on: https://chromium-review.googlesource.com/1104678
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568116}
fs
Move common AddOutlineRects implementations to LayoutSVGModelObject
All of the (direct) subclasses of LayoutSVGModelObject (LayoutSVGImage,
LayoutSVGShape and LayoutSVGContainer) have the same implementation of
this method, so we can push it up to the common base class.

Change-Id: Ief6d4502917c87505ddab436a3c005597615c49b
Reviewed-on: https://chromium-review.googlesource.com/1104344
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#568072}
bratell
[gn] Doc: Fix toochain typo and clarify the toolchain syntax.
Change-Id: Ica4288a6984f296958b7f9b812edb07663cec22e
Reviewed-on: https://chromium-review.googlesource.com/1104159
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#568046}
fs
Remove unused LayoutObject::AbsoluteElementBoundingBoxRect
Looks like the last caller was removed in
https://codereview.chromium.org/2287433003 .

Change-Id: I2664063bab31fe4983be65cb5c21039a90b73920
Reviewed-on: https://chromium-review.googlesource.com/1104342
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568019}
oscarj
Enable Jumbo for chrome/browser/extension
This commit will enable Jumbo for chrome/browser/extensions.
By enabling and running Jumbo the effort of building is
reduced by 7 times (around 40 CPU minutes on the test computer).

Bug: 850484
Change-Id: Icd42cbbf53dc58d64143c6979ba500d3ec9315c5
Reviewed-on: https://chromium-review.googlesource.com/1101017
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567971}
bratell
Remove aura only files from non-aura content/renderer
Some mostly harmless *_aura* files were included by mistake
in the non-aura build of content/renderer. They turned out to not be
quite so harmless in a jumbo build if combined with the non-aura
version of the same code.

Change-Id: Idfe65638ca16a2e700b485acd67f253073ae5867
Reviewed-on: https://chromium-review.googlesource.com/1102426
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#567961}
oscarj
Rename kDialogWidth constants to make them unique
When building with Jumbo, kDialog in
webui/signin/signin_email_confirmation_dialog.cc and
views/webshare/webshare_target_picker_view.cc conflict.
This commits solves the issue by renaming the constant
to something more file specific.

Bug: 773275
Change-Id: Iea327ab1948297fac97d3e7aaab9cb27a3631a30
Reviewed-on: https://chromium-review.googlesource.com/1102474
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567945}
oscarj
Remove function (chrome/browser/extensions)
The function ProfileForWebContents is defined in both
extension_install_prompt_show_params.cc and
extension_install_prompt.cc. In Jumbo build this causes
a conflict. The function is replaced by a inline statement.

Bug: 850484
Change-Id: I6e8da38fa7c90bc6b53d7c3f770daa3e158d16c2
Reviewed-on: https://chromium-review.googlesource.com/1100462
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567940}
oscarj
Resolve namespace scope issue (chrome/browser/ui)
When building using Jumbo files gets merged.
This results in a conflict with the namespace prefs in
webui/media_router/media_router_webui_message_handler.cc.
This commit solves this by specifying that the global
namespace should be used, by adding the "::" prefix.

Bug: 773275
Change-Id: I504984ef83db8cc23561f1f16ce99cdbee89721e
Reviewed-on: https://chromium-review.googlesource.com/1102419
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567665}
oscarj
Rename enums to avoid conflict (chrome/browser/ui)
The enums ColumnSetType are defined in both
views/passwords/password_pending_view.cc
and views/passwords/password_items_view.cc.
When building using Jumbo both declaration
ends up in the same namespace, causing a
conflict. This commits resolves the issue
by renaming the enums to something more
file specific.

Bug: 773275
Change-Id: I8f48b68df53166e910ab0beaf13ba80af63e40ae
Reviewed-on: https://chromium-review.googlesource.com/1102432
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567661}
fs
Change handling of negative exponents in GenericParseNumber
Rather than enforcing a limit on the smallest exponent, pass all
negative exponents straight to pow(...) and let it deal with it. Per
IEEE754 pow(10, -Inf) should yield 0, and the cast should round properly
for larger negative exponents (smaller than -37.)

Bug: 852785
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iccd80f7e80c8b87c49cd5eedf5e49ad1e9ccc8dc
Reviewed-on: https://chromium-review.googlesource.com/1102329
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567660}
oscarj
Resolve member conflict in enums
In Jumbo build, the member NONE in the enum
VerifyStatus in install_verifier.cc conflicts
with the same member in the enum
Transformation inactivity_log/activity_log.cc.
This commit solves the issues by defining
VerifyStatus as a strongly typed enum.

Bug: 850484
Change-Id: Idc3cab01b96073b20adf6fcd87e01cdf9b02a739
Reviewed-on: https://chromium-review.googlesource.com/1098664
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567168}
oscarj
Remove using-declaration to resolve conflict
When building using Jumbo, the using-declaration
of api::webrtc_logging_private::RequestInfo
results in a conflict, since a declaration of
RequestInfo exists in both api/webrtc_logging_private.h
and api/webrtc_audio_private.h. This commit solves the
conflict by removing the using-declaration.

Bug: 850484
Change-Id: I9bc25994cccdfd2e9ae19ecdacde06ed7780b1b2
Reviewed-on: https://chromium-review.googlesource.com/1098658
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567167}
oscarj
Rename g_shown in bubble delegates for Jumbo build
The function g_shown is defined in every bubble delegate.
When building using Jumbo those functions conflict with
each other. This commit fixes this by renaming the functions
to something more file specific.

Bug: 850484
Change-Id: I9df3a8e90ed77e95649cdb734cc4d7364b5fc310
Reviewed-on: https://chromium-review.googlesource.com/1096945
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567166}
oscarj
Resolve function and variable conflict
When using Jumbo build, there are conflicts between
dashboard_private_api.cc and webstore_private_api.cc.
The conflicts are the variable kUserCancelledError
and the function WebstoreInstallHelperResultToApiResult.
This commit solve the issues by renaming the variable and
function to something more file specific.

Bug: 850484
Change-Id: I600a036505ef731124ac6e4c3ea2f750a50ccad5
Reviewed-on: https://chromium-review.googlesource.com/1098958
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567165}
oscarj
Remove namespace alias (chrome/browser/extensions)
When using Jumbo build, the namespace alias Create in
/api/context_menus/context_menus_api.cc conflicts
with the function Create called from
api/desktop_capture/desktop_capture_base.cc.
This commits solves the issue by removing the namespace
alias. It also removes the namespace aliases
Update and Remove in the same file to avoid
this issue in the future.

Bug: 850484
Change-Id: Ibdb940e153a89b7120c670e806be34fc4e95ab90
Reviewed-on: https://chromium-review.googlesource.com/1099062
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567164}
bratell
Rename some kBackgroundColor constants to make them unique
In jumbo experiments in chrome/browser/ui, one of the problems
is that there are many kBackgroundColor variables in anonymous
namespaces that become the same anonymous namespaces in jumbo.

This patch gives those constants unique names, matching their
individual use.

Bug: 773275
Change-Id: I8746a88a32f64a0645fd88e850e39d22bc635e19
Reviewed-on: https://chromium-review.googlesource.com/1078814
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567021}
bratell
Rename some kButtonPadding constants to make them unique
In jumbo all files are merged into a single (or many) larger
translation unit and then a couple of kButtonPadding variables
end up in same anonymous namespace so that they clash.

This patch gives those constants unique names, matching their
individual use.

Bug: 773275
Change-Id: I9d8be1076552b7ffaa095bb4d50d3fa3d5845274
Reviewed-on: https://chromium-review.googlesource.com/1078816
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#566957}
bratell
Rename some kBorderThickness constants to make them unique
In jumbo all files are merged into a single (or many) larger
translation units and then a couple of kBorderThickness variables
end up in same anonymous namespace so that they clash.

This patch gives those constants unique names, matching their
individual use.

Bug: 773275
Change-Id: I1d81153af042c27927902b648fd7271a13f47c92
Reviewed-on: https://chromium-review.googlesource.com/1079168
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#566956}
tmoniuszko
Force en_US locale in SyncCycleSnapshotToValue test
Bug: 852349
Change-Id: I8367c10390caf2f5eda219eadb958e10e049c4cc
Reviewed-on: https://chromium-review.googlesource.com/1098933
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Reviewed-by: Tim Schumann <tschumann@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566826}
bratell
Move two identical SecondsToTimeTicks to tighter scopes
Two blink tests used their own SecondsToTimeTicks helpers which
clashed in jumbo builds where those files were compiled in the
same translation unit. Since it's a small function and hard to
find a suitable shared place, this moves the functions to
tighter scopes to not interfere with each other.

Change-Id: I9e04eed676e9e07f4aa5a815b655625bba03593f
Reviewed-on: https://chromium-review.googlesource.com/1095336
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#566824}
oscarj
Rename constants with the same name
When building with Jumbo, unnamed namespaces gets merged.
Constants with the same name within those namespaces conflict.
This commit renames those constant to something more file
specific.

Bug: 850484
Change-Id: If04a32cbf9ce544d852b1297f229d24d96845c59
Reviewed-on: https://chromium-review.googlesource.com/1096757
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566596}
fs
Don't corrupt list-based hit-test results in LayoutSVGForeignObject
Assigning the HitTestResult used for the PaintLayer will corrupt (reset)
any result acquired previously. So results from the foreground phase
would be erased by any later phase(s). Use HitTestResult::Append
instead if we're performing a list-based hit-test.

Bug: 849617
Change-Id: I5f53cad7e8396377815af51bd52db924b3fe6d5a
Reviewed-on: https://chromium-review.googlesource.com/1095182
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566382}
bratell
Cut down the number of kIconSize variables
In jumbo build experiments, one obstacle for using jumbo for
chrome/ui is that there are too many kIconSize is the global
anonymous namespace. This patch renames them according to their
use, but other options are available (and are used) such as
moving the constants into the functions where they are used or
into a less global namespace.

Bug: 773275
Change-Id: I62db42da677cffc53087aede879deaf5245b3640
Reviewed-on: https://chromium-review.googlesource.com/1076237
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#566377}
oscarj
Remove using declarations in browser/extensions
In Jumbo builds the declaration "using base::Time" (also
"using base::TimeDelta") conflicts with a typedef in X11 system header.
This commit will remove the declarations and use the namespace
prefix instead.

The function CalculatePingDays in
extension_updater.cc has been renamed since a function with
the same name exists in chrome_update_client_config.cc.

Bug: 850484
Change-Id: I67a2e6f8710f5c730344b8d47be742c72f1667c6
Reviewed-on: https://chromium-review.googlesource.com/1092693
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#566348}
oscarj
Resolve namespace conflicts in Jumbo build
When using Jumbo build, local namespaces conflict with global
namespaces. The local redefinition of namespaces, for example
"namespace bookmarks = api::bookmarks" also causes conflicts
between files. This commit removes the local
redefinitions and adds the "::" prefix when necessary.

Bug: 850484
Change-Id: Idd8b281a0e4999c27baffe326b5de33ba2247692
Reviewed-on: https://chromium-review.googlesource.com/1094636
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#566338}
fs
Remove "dead" code in BackgroundImageGeometry
BackgroundImageGeometry::SetSpaceX/SetSpaceY computes
|computed_{x,y}_position| from Length() - which is 'auto' and thus
always resolve to 0. Remove the computation, replacing it with '0' and
simplify.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I3e0648da78d9a0ff6e644cb4440f188ee8f52e53
Reviewed-on: https://chromium-review.googlesource.com/1095258
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#566044}
oscarj
Resolve conflict for namespace "errors"
In Jumbo build, the local redefinition of the namespace
errors, for example "namespace errors = manifest_errors",
causes conflicts between files. This is resolved by removing the local
redefinition and using the full name instead.

Bug: 850484
Change-Id: I5b8aecd3dc5b7c922bef515b82f11c5bfdf19515
Reviewed-on: https://chromium-review.googlesource.com/1095075
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#565999}
oscarj
Remove conflicting namespace declarations
In Jumbo builds the namespace declarations such as "keys", "helpers" and
others conflict. The are named the same in multiple files since they
have the same purpose, but with Jumbo this is no longer appropriate.
The declarations that conflict are removed.

Bug: 850484
Change-Id: I62246ebe303f1cdcabb2c21312eef4c6d4a7d92a
Reviewed-on: https://chromium-review.googlesource.com/1090916
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#565937}
bratell
Rename the two CreateMemoryCoordinatorHandle functions in content
There were two small (identical) helper functions in
content/browser named CreateMemoryCoordinatorHandle(..). One in
gpu and one in render_host, and with no obvious place
to put a shared copy.

These two cause problems in some extreme jumbo configurations so
this patch renames them according to how they are user.

Change-Id: I508530b6290606a01046ec0378d8da7d9f8c164b
Reviewed-on: https://chromium-review.googlesource.com/1092696
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565646}
bratell
Move duplicate CappedSizeInKB() to header file for sharing
Some jumbo builds broke because of too many CappedSizeInKB so moving
it to heap.h to unbreak the builds. It's a small inlined method.
The moved function is not using std::min to avoid including
<algorithm> in heap.h and potentially causing a measurable
build time regression.

TBR=mlippautz@chromium.org,haraken@chromium.org

Bug: 840789
Change-Id: I4e4bf3989235c6e7274a56f5c10823d8bb37a4df
Reviewed-on: https://chromium-review.googlesource.com/1090839
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#565289}
fs
Fold marker methods in LayoutSVGPath
Fold all of ProcessMarkerPositions, ShouldGenerateMarkerPositions,
MarkerRect and CalculateUpdatedStrokeBoundingBox into a larger, but
still manageable, single function (UpdateMarkers). Shorter term this
makes for less (and slightly more efficient) code. Longer term this
should make future changes to resource handling easier.

Also take this opportunity to make some minor cleanups (use a range-
based for loop; replace a ternary expression with an equivalent.)

Bug: 769774
Change-Id: I029fcdfa388c786fa30ebe861ba78d15d3a3d792
Reviewed-on: https://chromium-review.googlesource.com/1086943
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#564593}
auygun
Android: Move ContentViewRenderView to the embedder support component
Bug: 840360, 617324
Change-Id: I66a3a35d5fb8df66ee003ae1be48cbb89ba848d2
Reviewed-on: https://chromium-review.googlesource.com/1070159
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Commit-Queue: Attila Uygun <auygun@opera.com>
Cr-Commit-Position: refs/heads/master@{#564425}
oscarj
Avoid ambiguity between blink::Path and blink::XPath::Path
If XPath headers and graphics headers end up in the same translation
unit a collision will occur for the symbol Path. This commit will fix
the collision by adding blink:: prefix. According to a post in
chromium-dev this can happen in Jumbo builds.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I30ad0be4ea2000779313024d57531c1200bb2603
Reviewed-on: https://chromium-review.googlesource.com/1085055
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564111}
bratell
Disable all of the include guard presubmit check for third_party
The style check for include guards in third_party had already been
disabled but there are also headers in third_party with no
normal include guards at all so we better disable all of the check.

(blink is not considered third_party).

Bug: 845584
Change-Id: I801022a18daec38e9e6788c313e6bac6ed8a150b
Reviewed-on: https://chromium-review.googlesource.com/1080511
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#564045}
fs
svg/animations/viewspec-checkaspectparams.html no longer failing
TBR=schenney@chromium.org

Bug: 843192
Change-Id: I71f2dec1606aec96200731eeb9d3785347507216
Reviewed-on: https://chromium-review.googlesource.com/1080512
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#563189}
bratell
[jumbo] Make sure all AtomicString maps use the same hash
text_break_iterator_icu.cc didn't use the AtomicString hash
function and when the compiler noticed that inconsistancy in
a jumbo build, that jumbo build broke with the error:

../../third_party/blink/renderer/platform/wtf/text/atomic_string_hash.h:51:8:
error: explicit specialization of 'WTF::HashTraits<WTF::AtomicString>' after instantiation

This was triggered by an unrelated change that happened to reorder
some code.

TBR=drott@chromium.org

Change-Id: I4773df7ce31e676b39dac9a8e2c4e2602d3746ce
Reviewed-on: https://chromium-review.googlesource.com/1079569
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#563183}
bratell
Typo fixes: Include h files instead of cc files in chromeos
So:
Include chromeos_switches.h instead of chromeos_switches.cc
Include base_event_utils.h instead of base_event_utils.cc

Typo made a test include a cc file instead of the more commonly
included header file. This patch changes to include the header file.

There are no known bad side effects of this, but it was found
when looking for similar instances of a piece of code that did
cause problems.


Change-Id: I33105752517ba4e423dcae7c1ea0186fc7613127
Reviewed-on: https://chromium-review.googlesource.com/1005065
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#563154}
bratell
Typo fix: Include a .h file instead of a .cc file in a test
A test includes the cc file
components/search_engines/search_engines_test_util.cc instead of
its header file. This patch changes that to include the header
file instead.

This inclusion has caused no to me known problems and was just found
as a result of looking through the source for this pattern after
a similar instance did cause problems.

Change-Id: Iffdb68a8055d69a8a3df450c7982ec1e674dcf6e
Reviewed-on: https://chromium-review.googlesource.com/1005175
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563075}
bratell
Add dependency gpu:test_support -> ui/gfx:test_support
In some jumbo build configurations the linker needs
gfx::PrintTo(gfx::Size const&, ...) referenced from
obj/gpu/libtest_support.a
testing::internal::UniversalPrinter<gfx::Size>::Print(
    gfx::Size const&, ...)

This reference might be in dead code that would otherwise (in
non-jumbo builds) have been stripped earlier, but since the
reference apparently is there it's best to have
the dependency as well.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I6fe98a5427e5bc30625773bfa73d5b248b34f30a
Reviewed-on: https://chromium-review.googlesource.com/1005340
Reviewed-by: Victor Miura <vmiura@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#562997}
fs
Rework SVGViewSpec to be an immutable object
This reworks SVGViewSpec to be an immutable object created from either a
fragment string or a <view> element (indirectly via the fragment
identifier.) "Inheritance" of the value is then handled by checking if
there's a SVGViewSpec set (like before) and whether it has a value set
(for 'viewBox', 'preserveAspectRatio' et.c), and if it doesn't just use
the value from the SVGSVGElement.
This allows any animations of the SVGSVGElement to properly take effect
while still allowing overrides from an SVGViewSpec.
While this should arguably also be the case for SVGViewElements
referenced by a fragment identifier, these are left as before (not
responding to animations.)

Bug: 843192
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ic36e754ef211182391e041cb3c6f9443535c3acc
Reviewed-on: https://chromium-review.googlesource.com/1078647
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562853}
fs
<view> elements should apply to the root element
Like the comment here indicates, it wasn't clear which <svg> a <view>
element should apply to. This was clarified in SVG2 [1] to be the "root
'svg' element", which is the same as for a "svgView(...)" fragment.
The comment is updated to reflect the new spec text.
The new behavior matches Gecko.

[1] https://svgwg.org/svg2-draft/linking.html#SVGFragmentIdentifiersDefinitions

Bug: 843192
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: If76e2ca1c954af75203905ca6e50eef60ccf9ec4
Reviewed-on: https://chromium-review.googlesource.com/1075207
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#562471}
fs
Remove inheritance of SVGZoomAndPan into SVGViewSpec
Since we no longer expose SVGViewSpec as a DOM interface, we don't need
to have it inherit SVGZoomAndPan. This allows simplifying the code a bit
and will eventually allow making SVGViewSpec immutable (in a cleaner
way.)

To allow this, the parsing of the SVGZoomAndPan value is rework such
that one can go from String to SVGZoomAndPanType without the inheritance
i.e by not operating on the internal value, but rather return one.

Also make some minor cleanups such as uninlining
SVGZoomAndPan::ParseAttribute.

Bug: 843192
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I4dedcb6a76f3dabf3f7c441d03bee2dfae8efb2d
Reviewed-on: https://chromium-review.googlesource.com/1075128
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#562440}
fs
Clamp argument to SVGGeometryElement.getPointAtLength to [0, length]
Per:

  https://svgwg.org/svg2-draft/types.html#__svg__SVGGeometryElement__getPointAtLength

Bug: 847198
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I9067ce9f196453bd54560d5119ebc38d35c8ac86
Reviewed-on: https://chromium-review.googlesource.com/1075332
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#562422}
fs
Remove stray argument to GetRoundedBorderFor in ShapeOutsideInfo
Once upon a time, GetRoundedBorderFor(...) did accept a LayoutView*
argument, but it no longer does. Luckily this would've yielded true
anyway - matching the default argument - so no functional change is to
be expected.

Change-Id: Ief012e7a37efc9e9293f10bc2c67172ab088200d
Reviewed-on: https://chromium-review.googlesource.com/1076231
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562398}
bratell
Use the same libjpeg in all of blink/platform
The normal libjpeg renames some symbols with macros so if its
headers are included together with libjpeg-turbo's headers
in the same translation unit, there will be an inconsistent
renaming of libjpeg symbols. This happened in some extreme
jumbo configuration and resulted in confising linker errors.

This patch changes an include so that jpeglib.h becomes included
the same way everywhere.

Change-Id: I7f122d0919d58371bb40dc0097a766b857b9815e
Reviewed-on: https://chromium-review.googlesource.com/1073423
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#562243}
fs
Move intrinsic_sizing_info.h to core/layout
It's a layout-related gizmo. Take this opportunity to forward-declare
IntrinsicSizingInfo and only include where used.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I39750738147dbfce05ac1e77042fecfc02b2a92d
Reviewed-on: https://chromium-review.googlesource.com/1070374
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#561895}
fs
Fix errors in wpt/css/css-masking/* tests
clip-path-svg-content/clip-path-clip-rule-008.svg:
  Add missing reference (reference/clip-path-clip-rule-004-ref.svg).

clip-path-svg-content/clip-path-css-transform-002.svg:
  Adjust translation to match reference.

clip-path-svg-content/clip-path-dom-href.svg:
  Do setAttribute(...) on the correct <g>.

clip-path/clip-path-element-userSpaceOnUse-002.html:
  Shrink the clip-path so that it clips out the border, to match the
  reference.

clip-path/clip-path-ellipse-002.html:
clip-path/clip-path-ellipse-003.html:
clip-path/clip-path-ellipse-004.html:
clip-path/clip-path-ellipse-005.html:
  Adjust the description text so that it matches the reference.

clip-path/clip-path-ellipse-006.html:
  Use a different reference (reference/clip-path-ellipse-ref.html), and
  adjust the target <div> such that it matches the reference (replacing
  the red border with a margin.)

clip-path/clip-path-ellipse-007.html:
clip-path/clip-path-ellipse-008.html:
  Replace red border with a margin.

clip-path/clip-path-polygon-001.html:
clip-path/clip-path-polygon-002.html:
clip-path/clip-path-polygon-003.html:
  Adjust the description text so that it matches the reference.

clip-path/clip-path-polygon-004.html:
  Fix typo in assertion.

clip-path/clip-path-polygon-005.html:
  Adjust the description text so that it matches the reference.

Bug: 626703, 843084
Change-Id: I09c37cbe80ca3b82478bdd994ae027e9a72f280c
Reviewed-on: https://chromium-review.googlesource.com/1071529
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#561880}
bratell
Change some payments code to not have so many kFirstTagValue
In jumbo build experiments all the kFirstTag variables ended up
in the same translation unit and prevented compilation. This patch
retires those variables, and also renames an enum that had got
a copy-paste name.

Bug: 803406
Change-Id: I887d85a3632766845a7caede089d99ed73efba35
Reviewed-on: https://chromium-review.googlesource.com/1073308
Commit-Queue: anthonyvd <anthonyvd@chromium.org>
Reviewed-by: anthonyvd <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561861}
fs
Fix wpt/css/css-masking/parsing/clip-valid.html subtest
Percentages are not allowed in rect() (arguments are '<length> | auto'.)
Move the old test to clip-invalid.html and replace it with one that
doesn't use percentages.

Bug: 843084
Change-Id: I3cadd99da0d302ac5a0cd012450dd7ade233681c
Reviewed-on: https://chromium-review.googlesource.com/1071469
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561598}
fs
Remove stray, unneeded (and incorrect) forward declaration
WebContentsObserver is in the 'content' namespace, not in the global.
This causes a collision with a 'using' directive for the same class,
which breaks Jumbo builds.

TBR=avi@chromium.org,siggi@chromium.org

Bug: 755840, 846328
Change-Id: I977106611b374c955bf3c5c161c8a52eea927698
Reviewed-on: https://chromium-review.googlesource.com/1071663
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Sigurður Ásgeirsson <siggi@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#561512}
bratell
[jumbo] Fixing collision between wtf ntohs and Windows ntohs
A recent change in blink added a dependency on services/network which
indirectly use winsock2.h for htons a ntohs. Since blink uses its custom
ntohs and htons for Windows, those clash. This changes so that blink also
uses winsock2.h for htons, ntohs.

Bug: 839982
Change-Id: I5bebce4e62227512da2c922dc41a564ce442f388
Reviewed-on: https://chromium-review.googlesource.com/1070973
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#561469}
fs
Allow Text node in elementsFromPoint if descendant of SVG text content
When hit-testing, SVG text content nodes will use their Text node
descendants as the inner-most/hit node, and hit-testing will not be
performed in any of the background phases. Thus we need to selectively
allow Text node which has an SVG text content element as their parent.

Bug: 842504
Change-Id: Ie282d5e9a66880f3f0d5e319b249f5f41db9e9db
Reviewed-on: https://chromium-review.googlesource.com/1059753
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561238}
fs
Reverse traversal order in SVGRootInlineBox
Text painted later should make the top-most node, so line boxes should
be visited front-to-back. This will generally only make a difference for
text nodes that overlap.

This will also make a difference when elementsFromPoint is fixed, since
then we'll add the hit elements in the required "innermost to outermost"
order.

Bug: 842504
Change-Id: I541a394cbb0677980308615793f5e1fa9ea3b401
Reviewed-on: https://chromium-review.googlesource.com/1070196
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561222}
bratell
[jumbo] Rename one of the EnumerateOutputDevices functions
Since we just got two EnumerateOutputDevices functions in
content/browser/renderer_host/media, in a jumbo build the compiler
doesn't know which to use in a Bind call. This renames one of them
OldEnumerateOutputDevices since the code was renamed that way.

TBR=guidou@chromium.org,ossu@chromium.org

Bug: 837661
Change-Id: I1cb5201e05400f726e5081baa10a87fe2dce5cc5
Reviewed-on: https://chromium-review.googlesource.com/1069357
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#561208}
fs
Document SVGImage::{Get,Has}IntrinsicSizingInfo
TBR=schenney@chromium.org

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Icd23f26d15c522033d84c832d6655277533c0e37
Reviewed-on: https://chromium-review.googlesource.com/1070278
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#561130}
fs
Use consistently computed lengths when finding relevant contour
In CalculatePointAndNormalOnPath, compute the accumulated length of the
contours and compare against the passed in (now unmodified) |length|, to
increase the chances of comparing similarly computed length with each
other. |length| is often, directly or indirectly, derived from the
computed length of the Path (i.e using Path::length().)

Bug: 845375
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ibda61dd29921f41e0b294edde31ddb21ebbefd08
Reviewed-on: https://chromium-review.googlesource.com/1069071
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561032}
mpichlinski
Wait for completion of changing enabled tracks in PipelineIntegrationTests.
Calling Seek/Resume on Pipeline when OnEnabledAudioTracksChanged or
OnSelectedVideoTrackChanged have not finished their job will end with a crash:
- PlaybackWithVideoTrackDisabledThenEnabled crashes on
  DCHECK(!(pending_audio_track_change_ || pending_video_track_change_));
  in RendererImpl::Flush when calling Seek after unfinished
  OnSelectedVideoTrackChanged,
- TrackStatusChangesWhileSuspended crashes on
  return time_source_->CurrentMediaTime();
  in RendererImpl::GetMediaTime() due to nullptr time_source_
  when OnEnabledAudioTracksChanged finishes its job after calling Resume.

In production code PipelineController is responsible for gating operations
via callbacks in order to prevent race conditions.

Sometimes RunUntilIdle may be insufficient for changing track state, instead
of it wait in the RunLoop until completion callback has been called.

Bug: 836785
Change-Id: I8a784d668b6d92bebd90fafd6e6dbddb18c9ceb4
Reviewed-on: https://chromium-review.googlesource.com/1066015
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560640}
fs
Fix SVGImage filtering in JankTracker
The condition claiming to filter out documents (frames) originating from
SVGImages was in fact filtering out all SVG documents. Adjust.

Move the unit test to SVGImageTest because it already has usable
infrastructure to test this properly.

Also add DISALLOW_NEW to the JankTracker definition to indicate its
relation to the GC.

Bug: 581518
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I53ae6100c1538430c97c8b0fd6cda2f5c1ee9a6c
Reviewed-on: https://chromium-review.googlesource.com/1068914
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560630}
fs
Allow more selective invalidations for 'filter'
Add a new InvalidationMode flag (kSkipAncestorInvalidation) to allow skipping
the invalidation of ancestors, and then use that for the "fine-grained"
invalidation in LayoutSVGResourceFilter to restore the more efficient method
for clients which have a usable FilterData.

For filters referenced by SVG content, this restores the behavior (by not
invalidating more than needed, avoiding caches being dropped.) For non-SVG
content the behavior remains the same (flags are not used/ignored.)

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I41ccbbb6552558297329050dbe7630a2d624273a
Reviewed-on: https://chromium-review.googlesource.com/1065910
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#560529}
bratell
[jumbo] Declare BubbleDialogDelegateView template specialization
BubbleDialogDelegateView has a specialization of view properties
so declare it to be sure the compiler doesn't get upset about
using properties before it knows about the specialization.

Bug: 764918
Change-Id: I55b70dc3dacfdcd5eb466cfcde234090573d2bfa
Reviewed-on: https://chromium-review.googlesource.com/1067346
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#560502}
fs
Apply zoom in LayoutSVGRoot::ComputeIntrinsicSizingInfo
Previously we didn't know in what context said method was called, so we
didn't know if zoom ought to be applied or not.
Add LayoutSVGRoot::UnscaledIntrinsicSizingInfo and change current
callers of ComputeIntrinsicSizingInfo to use it. Then make
ComputeIntrinsicSizingInfo scale the intrinsic size.

Bug: 722055
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: If668e85bcea1028e48a3bc98c74d07435d425338
Reviewed-on: https://chromium-review.googlesource.com/1067397
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560331}
fs
Get rid of SVGImage::EmbeddedReplacedContent
Rather than exposing the document root's LayoutObject, add an bunch of
methods to achieve the same thing as the returned object is used for.
Reuse the same names as used on FrameView. Also rename the method on
LayoutImage to something more appropriate.

Bug: 722055
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I6d006206365988c2ad8068db7251414529ed3bca
Reviewed-on: https://chromium-review.googlesource.com/1065997
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560322}
fs
Rebuild the SVGResources for <pattern> after changing SVGResource
Since we reassociate the SVGResource synchronously, we need to also make
sure that the associated SVGResources object is updated, else it could
end up pointing to the old <pattern> LayoutObject.

Bug: 845040
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I026b46abcd510485ddfe33622cb5f5aa1bab9610
Reviewed-on: https://chromium-review.googlesource.com/1065779
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#560300}
fs
Reland: "[CI] Convert SVG resources to use SVGResource"
From using AtomicString (for 'mask', 'marker-*', 'fill' and 'stroke') or
the string representation of SVGResources ('filter' and 'clip-path'),
convert to using SVGResources.
Add an implementation of SVGResourceClient (SVGElementResourceClient)
and register it with the existing resources. Invalidation code is moved
here. This makes the invalidation code slightly more homogeneous between
the various code-paths.

The new SVGResourceClient implementation is stored in SVGElementRareData
as needed.
The various computed style representations are converted to use the new
StyleSVGResource, which is a ref-counted wrapper around an SVGResource
and its underlying string representation (which is needed for
serialization.) Style building is changed to produce this new wrapper
(rather than an AtomicString.) A helper for serialization is added to
ComputedStyleUtils.
The kHasPendingResources flag is removed since it no longer used, and
the hook in Element is removed.
All LayoutSVGResource* subclasses are changed to take SVGResourceClients
instead of LayoutObjects, and the |clients_| set is removed in favor of
the set in SVGResource.
A bunch of helpers are added for updating (adding/removing) the client
registrations. The various LayoutSVG subclasses are updated to call
these helpers.

Changes on reland: LocalSVGResources are now tracked using WeakMember, and
the associated IdTargetObservers are cleaned up when weak references are
cleared.

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ie0b42471aea5ea5afb5d239662b4ba195281f764
Reviewed-on: https://chromium-review.googlesource.com/1057330
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Justin Novosad <junov@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559479}
bratell
Don't check header guard style in third_party
The presubmit check warning for correct include guards would
trigger for generated files in third_party/win_build_output. Since
files in third_party is often not written with the Chromium style
guide in mind that is over zealous so this patch stops
checking their names (except for in blink).

The presubmit code will still check the existence of a guard since
lack of one can cause problems outside the module and there has been
no reports of false warnings.

This patch also removes the exceptions that used to be there for
blink since blink has moved and been reformatted.

Bug: 814776
Change-Id: Ic7f2bbba5b9bcafbb5bec15b79b04d5e81994b77
Reviewed-on: https://chromium-review.googlesource.com/1061698
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#559185}
fs
Refactor computation of intrinsic size for "nested" objects
Sink the update of intrinsic_size_ out of the if-else in
ComputeIntrinsicSizingInfoForReplacedContent, and then push
GetNestedIntrinsicSizingInfo down into subclasses, folding it away to use the
"local" constructs of the relevant subclasses.

This leaves subclasses to deal with issues such as if whether to apply zoom
or not et.c, and will with some additional tweaks allow for more succinct
interfaces in the "nested" cases. It also makes LayoutReplaced much simpler.

Bug: 722055
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ie8493ffa89ffb34d2591d6a7ecdc8ebc20c6264f
Reviewed-on: https://chromium-review.googlesource.com/1059776
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#559069}
bratell
Avoid ambiguity between ::i18n and ::autofill::i18n.
Unfortunately there are two i18n namespaces, including one
global one, so if you are in ::autofill, referring to i18n is
ambigious if the compiler knows about both of them. This happens
in jumbo builds which means that my previous jumbo fix here didn't
actually work.

Change-Id: I7467ff958e93433581da0134d9a6e8ddd21bde49
Reviewed-on: https://chromium-review.googlesource.com/1057728
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#558364}
bratell
[jumbo] Make PhoneNumber unambigious
There is a ::i18n::phonenumbers::PhoneNumber and a
::autofill::PhoneNumber. To avoid ambiguity (especially in jumbo
builds where more types are known to more code), refer to
::i18n::phonenumbers::PhoneNumber with the full name inside
autofill code.

Also refer to PhoneNumberUtils from the same namespace the same
way for consistency.

Change-Id: Ic36cae9a8df0ceb07f3494fa34d8b08531cd46e4
Reviewed-on: https://chromium-review.googlesource.com/1050288
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557164}
fs
Revert "[CI] Convert SVG resources to use SVGResource"
This reverts commit 3431b89c8be2d7b1a60f5eb135b1d27ce432ce9b.

Reason for revert: Tickled fuzzers

Original change's description:
> [CI] Convert SVG resources to use SVGResource
> 
> From using AtomicString (for 'mask', 'marker-*', 'fill' and 'stroke') or
> the string representation of SVGResources ('filter' and 'clip-path'),
> convert to using SVGResources.
> Add an implementation of SVGResourceClient (SVGElementResourceClient)
> and register it with the existing resources. Invalidation code is moved
> here. This makes the invalidation code slightly more homogeneous between
> the various code-paths.
> 
> The new SVGResourceClient implementation is stored in SVGElementRareData
> as needed.
> The various computed style representations are converted to use the new
> StyleSVGResource, which is a ref-counted wrapper around an SVGResource
> and its underlying string representation (which is needed for
> serialization.) Style building is changed to produce this new wrapper
> (rather than an AtomicString.) A helper for serialization is added to
> ComputedStyleUtils.
> The kHasPendingResources flag is removed since it no longer used, and
> the hook in Element is removed.
> All LayoutSVGResource* subclasses are changed to take SVGResourceClients
> instead of LayoutObjects, and the |clients_| set is removed in favor of
> the set in SVGResource.
> A bunch of helpers are added for updating (adding/removing) the client
> registrations. The various LayoutSVG subclasses are updated to call
> these helpers.
> 
> TBR=junov@chromium.org
> 
> Bug: 769774
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
> Change-Id: I62418465251532240c4e895e5c4d253ed9e53b9a
> Reviewed-on: https://chromium-review.googlesource.com/977965
> Commit-Queue: Fredrik Söderquist <fs@opera.com>
> Reviewed-by: Fredrik Söderquist <fs@opera.com>
> Reviewed-by: Philip Rogers <pdr@chromium.org>
> Reviewed-by: Stephen Chenney <schenney@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#556743}

TBR=pdr@chromium.org,fs@opera.com,junov@chromium.org,schenney@chromium.org

Change-Id: I695b3eed793bb000b057bca52364265d201f0bae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Reviewed-on: https://chromium-review.googlesource.com/1051345
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#557120}
fs
Fix [a-z] range comparison in IsValidElementNamePerHTMLParser
Bug: 648179
Change-Id: I623023d6e195447381bf8b08124d7475bb0fe93d
Reviewed-on: https://chromium-review.googlesource.com/1049629
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#557117}
fs
[CI] Convert SVG resources to use SVGResource
From using AtomicString (for 'mask', 'marker-*', 'fill' and 'stroke') or
the string representation of SVGResources ('filter' and 'clip-path'),
convert to using SVGResources.
Add an implementation of SVGResourceClient (SVGElementResourceClient)
and register it with the existing resources. Invalidation code is moved
here. This makes the invalidation code slightly more homogeneous between
the various code-paths.

The new SVGResourceClient implementation is stored in SVGElementRareData
as needed.
The various computed style representations are converted to use the new
StyleSVGResource, which is a ref-counted wrapper around an SVGResource
and its underlying string representation (which is needed for
serialization.) Style building is changed to produce this new wrapper
(rather than an AtomicString.) A helper for serialization is added to
ComputedStyleUtils.
The kHasPendingResources flag is removed since it no longer used, and
the hook in Element is removed.
All LayoutSVGResource* subclasses are changed to take SVGResourceClients
instead of LayoutObjects, and the |clients_| set is removed in favor of
the set in SVGResource.
A bunch of helpers are added for updating (adding/removing) the client
registrations. The various LayoutSVG subclasses are updated to call
these helpers.

TBR=junov@chromium.org

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I62418465251532240c4e895e5c4d253ed9e53b9a
Reviewed-on: https://chromium-review.googlesource.com/977965
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556743}
fs
Fix drop-shadow(...) offset int conversion in FilterEffectBuilder
Avoid the implicit conversion to int in the constructor for WebPoint.
Also don't pass through WebPoint at all since AppendDropShadowFilter
take an IntPoint.

Bug: 836480
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I2c05681c686cf9f7169c79cf5f67849f483f36f8
Reviewed-on: https://chromium-review.googlesource.com/1039829
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#555499}
fs
Remove (trivially) unneeded ImageResourceContent::IntrinsicSize calls
Since SVGImage is handled explicitly already, and we pass
kDoNotRespectImageOrientation to IntrinsicSize() in these functions,
just call Image::Size() directly rather than passing through the
ImageResourceContent method.

Bug: 773272
Change-Id: I6b7c24f5be425f04cd2f68cbc4612054b635bc2b
Reviewed-on: https://chromium-review.googlesource.com/1032745
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#554763}
fs
Factor out <clipPath> user space transform computation
This computation (clipPath[transform] and optional oBB transform) is
used by LayoutSVGResourceClipper::HitTestClipContent,
LayoutSVGResourceClipper::ResourceBoundingBox and ClipPathClipper.

Factor it into a new method CalculateClipTransform() on
LayoutSVGResourceClipper and use it at the three locations.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Icaa9707f24c11f1a45d80ff71d8e156c868898c1
Reviewed-on: https://chromium-review.googlesource.com/1030212
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#554022}
mpichlinski
Fixed compositor_unittests that crashed on Mac
After recent changes TestCompositorHostMac started requiring
a real AcceleratedWidgetMac, otherwise it would crash while
trying to Show. After fixing that, there was another issue
that ImageTransportSurface started crashing, because of
skipped SetAllowOSMesaForTesting in compositor test_suite.

Tests affected:
LayerWithRealCompositorTest.*

Change-Id: I60b84611406744989e2f00f13e20c1177912814f
Reviewed-on: https://chromium-review.googlesource.com/1014101
Reviewed-by: ccameron <ccameron@chromium.org>
Reviewed-by: Ian Vollick <vollick@chromium.org>
Commit-Queue: Michal Pichlinski <mpichlinski@opera.com>
Cr-Commit-Position: refs/heads/master@{#553960}
fs
Fix style on some parameter names in the CSS parser
  unitlessZeroFeature -> unitless_zero_feature
  negativeSize -> negative_size
  threeValuePosition -> three_value_position

Change-Id: Id42906e518e6780bfa601031d8ad00430b2f48b4
Reviewed-on: https://chromium-review.googlesource.com/1027878
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553777}
fs
Use round() [not roundf()] in RoundedIntPoint(const DoublePoint&)
This avoids the implicit conversion to float, which can lead to loss of
precision.

Bug: 836722
Change-Id: I66ea0f42823347b17e41e5d823aaf766429eacbf
Reviewed-on: https://chromium-review.googlesource.com/1027710
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#553543}
mharanczyk
Prevent ManifestHandlerRegistry override from leaking to different tests.
ContentVerifierTest was setting up override but never reseting it
causing other tests that loaded extension to access invalid memory
of stack allocated registry override.

This is regression after crrev.com/c/957645 that causes crash
or timeout in extensions_unittests.

Bug: 809088, 832801
Change-Id: I45d8ee2e4e450e8d5f619e502e7a6e96c8879ef0
Reviewed-on: https://chromium-review.googlesource.com/1013982
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: proberge <proberge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551738}
ppluciennik
Fixed problem with absolute paths in ninja files.
R=brettw@chromium.org, rsesek@chromium.org, sdefresne@chromium.org, sergeyu@chromium.org

Bug: 821738
Change-Id: Ib1dcca4070ad7019c082653217df48adda69ab32
Reviewed-on: https://chromium-review.googlesource.com/962282
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551519}
wdzierzanowski
Avoid calling GetAllStreams() on uninitialized Demuxer
The first time we know the Demuxer initialization is complete is when
Pipeline::Start() completes (asynchronously).

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I7451187be2d141780d5aa514fb3a1ec4abe8fbbe
Reviewed-on: https://chromium-review.googlesource.com/1000858
Commit-Queue: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551156}
bratell
Avoid redefining IsMsgHandled by making all Win message handlers safe
There were two sets of message map macros, one with IsMsgHandled as a
function, one with it as a macro. If combined in some translation unit
that could cause compilation problems, and it did in some Opera builds.

This patch changes the code so that there is only one implementation
of the macros and it's the "safe" one, where "safe" means that it
can handle that the underlying object is deleted inside a message
handler without crashing.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I2f039d8d93a539c8322caa664e642956c5d6d372
Reviewed-on: https://chromium-review.googlesource.com/995896
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550711}
mpichlinski
Added missing depenencies in chrome/services/media_gallery_util/public/cpp
Bug: 832591
Change-Id: I8d104a7e0ede58f20d71bb5ce00f8b398cf8e28b
Reviewed-on: https://chromium-review.googlesource.com/1012023
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Michal Pichlinski <mpichlinski@opera.com>
Cr-Commit-Position: refs/heads/master@{#550643}
fs
Remove LocalFrameView::forcing_layout_parent_view_
This flag is never set to true anymore.

Bug: 442939
Change-Id: I03bc6129d923ff90d39e32b7508bb56cf1139b31
Reviewed-on: https://chromium-review.googlesource.com/1010164
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550313}
bratell
Too many crash_keys::SetCrashKeysFromCommandLine()
When building chrome_app_unittests chrome/common/crash_keys.cc are
compiled both as a dependency and locally. Enough to compile it
as a dependency. (Noticed in jumbo build experiments where the
duplicate symbols met in the linker)

Change-Id: I517436d21ae17c2ff664afeed43ad8e1b7e529e9
Reviewed-on: https://chromium-review.googlesource.com/1005341
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#550207}
mpichlinski
GN: Allow XCode projects to use ICECC environment variables.
Without them XCode cannot compile generated projects with ICECC.

Bug: 831500
Change-Id: I3b50c730660c4e8a6a06b9fda340e20edb87e40a
Reviewed-on: https://chromium-review.googlesource.com/1006577
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Michal Pichlinski <mpichlinski@opera.com>
Cr-Commit-Position: refs/heads/master@{#550159}
bratell
More common to include headers than cc files so lets do that
An accidental inclusion of a cc file caused interesting
linking errors (duplicate chrome::kChromeUIPrintURL) in certain
build configurations.

Fix is to include the header instead of the cc file so that
references to chrome::kChromeUIPrintURL will be external as intended.

Change-Id: Iba69dbd17267955534609d308cef16ab0467671d
Reviewed-on: https://chromium-review.googlesource.com/1005342
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#549560}
fs
[CI] Drop redundant |candidate_| prefixes from SearchCandidate helper
Change-Id: I07129786b29acb7eea5fd1946e9301a370472125
Reviewed-on: https://chromium-review.googlesource.com/1002556
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#549167}
fs
[PE] Don't early-out in LayoutSVGText::NodeAtFloatPoint
Since <text> can have descendants that may both differ in visibility as
well as fill/stroke, we can't evaluate pointer-events in LayoutSVGText,
but should rather let LayoutBlock (and SVGInlineTextBox et al) handle
the hit query. This makes LayoutSVGText somewhat similar to the same
method on LayoutSVGContainer.

Bug: 828930
Change-Id: I2767ed149705289e770d5ae165efd910c2c7ff15
Reviewed-on: https://chromium-review.googlesource.com/998352
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549154}
bratell
Made two GetExtensionView() functions into member functions
There were two GetExtensionView functions which clashed in
jumbo build experiments where they ended up in the same
translation unit. This patch makes them member functions which
removes the need to supply an argument, which in turn makes the
code a bit simpler and easier to read.

Bug: 803406
Change-Id: I09fad295de900d6d78092397654314e757761226
Reviewed-on: https://chromium-review.googlesource.com/997774
Reviewed-by: Ben Wells <benwells@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#549133}
bratell
Reuse existing AcceleratorMapping struct
The two identical AcceleratorMapping structs clashed in jumbo
build experiments (no offical support of jumbo in this code
yet).

Bug: 803406
Change-Id: I065bfb447de67c05d2f6172ffbdeff4bc68e6538
Reviewed-on: https://chromium-review.googlesource.com/997832
Reviewed-by: Ben Wells <benwells@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#548810}
bratell
Gave some Mac/Views helper functions unique names
In jumbo experiments (jumbo is not yet supported in
chrome/browser/ui) several GetBubbleAnchorView and
GetBubbleAnchorRect functions clashed. They were more or less
identical but there is no obvious place to share them, and even
though they are small, the code gets messier if you inline them.

This patch gives the functions unique names as a preparation
for jumbo support in chrome/browser/ui

Bug: 803406
Change-Id: I104ae7cc961dd867e89e06fe8f18b401b39af549
Reviewed-on: https://chromium-review.googlesource.com/998158
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#548778}
fs
Update 'lighter' and 'bolder' computations to match spec
Update FontDescription::BolderWeight and LighterWeight to match the table
in https://drafts.csswg.org/css-fonts-4/#font-weight-prop .

Bug: 809956
Change-Id: I18cb9a10ef3d86f68113bb0663e5364d0120a739
Reviewed-on: https://chromium-review.googlesource.com/997592
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548741}
bratell
[jumbo] Too many kSha256Hash
Earlier this year, all kSha2Hash got longer names but two
kSha256Hash must have remained, and now they ended up in
the same translation unit and jumbo on Windows stopped
compiling. This renaming follows the pattern of earlier renames.

TBR=thestig@chromium.org

Change-Id: I95b7d6b7e5f43f25bee8e98aa3eeeb4de9d7e55f
Reviewed-on: https://chromium-review.googlesource.com/999415
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#548730}
fs
[PE] Improve SVG text selection for vertical text
We were previously always using the "left edge" of the fragment bounding
box when computing the position within the fragment. This works poorly
for vertical text. Use "top edge" for the vertical case instead.

Bug: 829214
Change-Id: I52e0aeffa95d05b1c86cd6aeca5dde7a886db486
Reviewed-on: https://chromium-review.googlesource.com/997792
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548722}
bratell
Rename a function whose name conflicted in jumbo builds
In jumbo build experiments the presence of two different
OnCheckIsDefaultBrowserFinished functions meant that
Bind didn't know which one to bind and it didn't compile.

This patch renames one OnCheckIsDefaultBrowserFinished to
OpenURLAfterCheckIsDefaultBrowser which seems like a good
name for that function.

Bug: 803406
Change-Id: I056e613b7e3d55c0b2dbde68db8d75d3e2c55876
Reviewed-on: https://chromium-review.googlesource.com/998152
Reviewed-by: Ben Wells <benwells@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#548712}
bratell
Inlined two GetProfileFromWebContents helpers
In jumbo build experiments (no jumbo for chromium/browser/ui yet)
two GetProfileFromWebContents ended up in the same translation unit.
Each of them was only used once. This inlines them both.

I dropped the null check from the GetProfileFromWebContents() in
account_chooser_dialog_view.cc because if that helper returned
null, then the code would already crash inside
GetDefaultStoragePartition() (GetStoragePartitionFromConfig()
will call browser_context->IsOffTheRecord() without any null check).

Bug: 803406
Change-Id: I0200eb42c0a54b674eaec6122e1193c931dd2344
Reviewed-on: https://chromium-review.googlesource.com/997793
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#548711}
fs
Adjust weight ranges in FontDescription::Lighter/BolderWeight
Since the (CSS) parser allows numeric weight values in the range
[1, 1000], adjust the ranges in FontDescription::Lighter/BolderWeight
to match that.
Also factor in that the values can have fractions (by implicitly
truncating them) and simplify the range check since there's now a
set of adjacent intervals in practice.

Bug: 828747
Change-Id: I5fe3405ca45ed8016530d995976e36a6ebbcf366
Reviewed-on: https://chromium-review.googlesource.com/995452
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#548448}
fs
Nudge click point in svg/custom/use-events-crash.svg
Issue the click in the test further down the rect in the hope that the
selection code won't end up picking one or the other of the <text>s, but
only the one further down.

Bug: 829316
Change-Id: Iae3419bf902a864ea8ec46e69764480c0f240b8a
Reviewed-on: https://chromium-review.googlesource.com/997843
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#548430}
bratell
Removing some "using namespace std"
The code guide doesn't allow "using namespace", and they have
a tendency to cause problems with jumbo builds so this is just
a cleanup to avoid possible future problems.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ibf519c5e4ddb0497961f1befa8de416039e4fc61
Reviewed-on: https://chromium-review.googlesource.com/992318
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#548386}
bratell
Rename some symbols that were duplicated in cert code
Duplicates of kTrafficAnnotation and g_is_fake_official_build_for_testing
just appeared and caused problems for certain (extreme) jumbo build
configurations.

In jumbo builds much code is compiled in the same translation
unit which means that they share the same anonymous namespace.

This patch renames the variables following the pattern of similar clashes.

(nopresubmit because any changes to net::URLFetcher are currently
 blocked and this just changes a name)

NOPRESUBMIT=true

Change-Id: Ib55f61c2c8a76c235de45f509df493c875a3a12b
Reviewed-on: https://chromium-review.googlesource.com/992313
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Ryan Sleevi <rsleevi@chromium.org>
Reviewed-by: Matt Mueller <mattm@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548379}
fs
[CI] Cleanup some SVG hit-testing code
...mostly by de-indenting it by reversing the visibility-check. Also
reuse ComputedStyle locals and switch to using a ComputedStyle&.
In LayoutSVGShape::NodeAtFloatPointInternal, the large-ish condition is
split into three slightly smaller.

Change-Id: I275081391a3b399f9887215f4fe3075884de103c
Reviewed-on: https://chromium-review.googlesource.com/995674
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#548154}
fs
Reland "Serialize 'oblique' computed values for 'font-style'"
Handling of 'oblique' values were missing in
ComputedStyleUtils::ValueForFontStyle - serialize as 'oblique <angle>'.
Because of this the return value needs to be widened to CSSValue.

Expectations for css/css-fonts/variations/font-shorthand.html updated.

TBR=drott@chromium.org

Bug: 809935, 809938
Change-Id: I753324776ba080820bc5c4a14e8aff6237ee5d12
Reviewed-on: https://chromium-review.googlesource.com/995793
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#548143}
fs
Revert "Serialize 'oblique' computed values for 'font-style'"
This reverts commit 755a9214dc9116a826f8881851c07e352004a6c5.

Reason for revert: Mid-flight collision with 162e9dda47d694596620b69c5fb23cc7f0f87126 - will update and reland.

Original change's description:
> Serialize 'oblique' computed values for 'font-style'
> 
> Handling of 'oblique' values were missing in
> ComputedStyleUtils::ValueForFontStyle - serialize as 'oblique <angle>'.
> Because of this the return value needs to be widened to CSSValue.
> 
> Bug: 809935, 809938
> Change-Id: I1de846595ed955455d57ab9f6ea45326e502a65b
> Reviewed-on: https://chromium-review.googlesource.com/995273
> Reviewed-by: Dominik Röttsches <drott@chromium.org>
> Commit-Queue: Fredrik Söderquist <fs@opera.com>
> Cr-Commit-Position: refs/heads/master@{#548044}

TBR=fs@opera.com,drott@chromium.org,futhark@chromium.org

Change-Id: I379a152245f16fc792c8bfc55a2d8b127ba30820
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 809935, 809938
Reviewed-on: https://chromium-review.googlesource.com/995695
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#548052}
fs
Serialize 'oblique' computed values for 'font-style'
Handling of 'oblique' values were missing in
ComputedStyleUtils::ValueForFontStyle - serialize as 'oblique <angle>'.
Because of this the return value needs to be widened to CSSValue.

Bug: 809935, 809938
Change-Id: I1de846595ed955455d57ab9f6ea45326e502a65b
Reviewed-on: https://chromium-review.googlesource.com/995273
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#548044}
bratell
Give two cert testing classes unique names
A second WrappedTestingCertVerifier and
g_cert_verifier_for_testing just arrived and in some
extreme (non standard) jumbo build configurations those
ended up in the same translation unit. Since translation units
only have one common anonymous namespace, there was a symbol clash.

This patch renames the global variables to
g_cert_verifier_for_io_thread_testing and
g_cert_verifier_for_profile_io_data_testing and renames the classes
to WrappedCertVerifierForIoThreadTesting and
WrappedCertVerifierForProfileIoDataTesting.

Change-Id: I41549bc81943864f64ce304220e20ab00d91c889
Reviewed-on: https://chromium-review.googlesource.com/992494
Reviewed-by: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Matt Mueller <mattm@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#548029}
bratell
Avoid having two SendReport functions to not confuse Bind(..).
In certain (extreme) jumbo build configurations, SendReport in
chrome/browser/net/chrome_report_sender.h and
chrome/browser/net/trial_comparison_cert_verifier.cc ended up as
symbols in the same translation unit and then the address
operator didn't know which function to refer to in a Bind(...) call.

This renames the local SendReport in
net/trial_comparison_cert_verifier.cc to SendCertVerifyReport.

Change-Id: I9cc17beb509452f66f5620cf7ea4ca4f1f04ed33
Reviewed-on: https://chromium-review.googlesource.com/992495
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Matt Mueller <mattm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548012}
bratell
Removing some "using namespace WTF" and "using namespace WTF::Unicode"
The code guide doesn't allow "using namespace", and they have
a tendency to cause problems with jumbo builds so this is just
a cleanup to avoid possible future problems.

Change-Id: I058ed20ba072036b1995cf039ddb3c2ffc884483
Reviewed-on: https://chromium-review.googlesource.com/992952
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#547996}
bratell
[jumbo] X11/gfx: Need to say ::Display or it's ambiguous.
There are several classes/types named Display so to get
the X11 one, you have to specify it with ::Display (gfx::Display
is a common alternative when you're inside the gfx namespace).

TBR=hubbe@google.com

Bug: 822068
Change-Id: I402b7ad2d37a82d3091577733f3f06e673c29c7e
Reviewed-on: https://chromium-review.googlesource.com/994212
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Hubinette <hubbe@chromium.org>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#547916}
fs
[SPv175] Don't crash on <feImage> which reference an element with a mask
This works around a crash where a layout box references a filter that
contains a feImage filter primitive, which in turn reference content
that has a mask applied.

Bug: 814815, 825538
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ib2433b3ba48b3ea56462a1eb64209d36aa37cfa4
Reviewed-on: https://chromium-review.googlesource.com/982114
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#547802}
fs
Remove unused declarations in SVGFEDropShadowElement
StdDeviationXIdentifier/StdDeviationYIdentifier don't have definitions.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I187cd3d4991e89dc91e6a021771616cd441e0c22
Reviewed-on: https://chromium-review.googlesource.com/992493
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#547716}
fs
Update baselines for new Win10 version
Update baselines for

 fast/text/color-emoji.html,
 fast/text/emoticons.html,
 fast/text/international/002.html,
 fast/text/international/wrap-CJK-001.html,
 svg/W3C-SVG-1.1/text-intro-01-t.svg and
 svg/W3C-SVG-1.1/text-intro-04-t.svg

after bots got upgraded (minor changes to font data.)

Bug: 828051, 828260, 828314
Change-Id: I37d8d68348452338a09ae584742e83323713c463
Reviewed-on: https://chromium-review.googlesource.com/991953
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#547697}
fs
svg/animations/getCurrentTime-pause-unpause.html no longer flaky
TBR=schenney@chromium.org

Bug: 824930
Change-Id: I123f2d2c7e95e5bbb0dd90abeab57246d312bc54
Reviewed-on: https://chromium-review.googlesource.com/992037
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#547674}
bratell
Narrowed scope of a UrlWithoutFragment method
In jumbo builds many files are compiled in the same
translation unit and then their anonymous namespaces will also
be one and the same. In blink/inspector two (identical)
UrlWithoutFragment functions end up colliding. This patch
changes it so that one of them has a more narrow scope.

The patch also removes the special casing of these files
from the build system.

Bug: 713137
Change-Id: If0b8bfb8a13c1191aa4e1c07d2aa1472ed168f29
Reviewed-on: https://chromium-review.googlesource.com/985978
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#547653}
bratell
Move editing helper LocalToAbsoluteQuadOf() to a shared file
A commit just added a second copy of LocalToAbsoluteQuadOf
which triggered compilation failures in jumbo builds. This
deduplicates the function by moving it to EditingUtilities.cpp.

Change-Id: Ifee2d67714c18300f84c49e6371c95aaf8b95e9f
Reviewed-on: https://chromium-review.googlesource.com/985834
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#546784}
bratell
Remove the "::" prefix from testing namespace declarations.
Since ::blink::testing was renamed ::blink::test_helpers, the
"::" prefix on testing is no longer necessary. There is no longer
anything that can confuse the compiler regarding what "testing"
means.

Bug: 825768
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ibf65dd643185623530ce2f06ddc46fb8be34947a
Reviewed-on: https://chromium-review.googlesource.com/980035
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546783}
bratell
Rename ::blink::testing to ::blink::test
Inside blink there is an ongoing conflict for the code whether
"testing" means ::testing (from gtest) or ::blink::testing. So
far it has been resolved mostly by adding a "::" prefix whenever
::testing was intended, but that is a bit annoying and coding should
not be annoying.

This patch renames ::blink::testing to ::blink::test (aka
"test" in all the code since the code is already
inside blink). That resolves the conflict once and for all and also
adheres to the coding standard that says no sub-namespace may have
the same name as a common top level namespace.

This does *not* move the files to a new directory test.
This does *not* remove all the :: prefixes that are now unnecessary.

Bug: 825768
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ie35502b0d5b4f401df104e38600ede878d24bdfa
Reviewed-on: https://chromium-review.googlesource.com/980054
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546491}
bratell
Gave some global variables a g_ prefix to avoid collisions
In jumbo builds many cc files are compiled in the same translation
unit to make the compilation (much) faster. This also joins those
files' anonymous namespace and caused clashes if several files
use symbols with the same name. That happened with two global
"instance_" variables.

This patch renames them g_descriptive_name which matches a common
pattern for naming global variables.

Bug: 803406
Change-Id: I13e84ba5dba717d978ff2a43470e1ca4ab0457b2
Reviewed-on: https://chromium-review.googlesource.com/980880
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#546444}
bratell
Gave two kBubbleReshowsHistogramName unique names
In jumbo builds many cc files are compiled together in the same
translation unit. When that happens, those files will share the
same anonymous namespace so if they use symbols of the same name
they will clash.

That happened with two kBubbleReshowsHistogramName constants in
chrome/browser/ui/exclusive_access and this patch gives
those two more unique names.

Bug: 803406
Change-Id: I2b8e3a060c7b7853a3a001317e80d32b7d6e56d4
Reviewed-on: https://chromium-review.googlesource.com/980879
Commit-Queue: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546239}
fs
Rewrite svg/animations/getCurrentTime-pause-unpause.html to avoid flakes
The test in it's current form imposed too strict requirements on the
time that had passed. We cannot guarantee a maximum elapsed time, only a
minimum (and barely that...) Rewrite the test to not impose any
restriction on the maximum elapsed time. Also convert it to use
testharness while at it. Also rewrite/convert the sibling test with
setCurrentTime.

Bug: 824930
Change-Id: I79882b0189e44790e3096c8346c2a0bf47276dd8
Reviewed-on: https://chromium-review.googlesource.com/981145
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#546190}
bratell
Rename helper function WriteFile to give it a unique name
In //extensions/browser a second helper function named
WriteFile just appeared and in jumbo builds where all of
extensions/browser is compiled in one translation unit (an extreme
jumbo configuration), the two clash. This patch renames the function
that is the least like base::WriteFile to "CreateDirAndWriteFile".

Change-Id: I0d3dc1bb3e13279a2bf333bc0c12985f2133a35d
Reviewed-on: https://chromium-review.googlesource.com/980056
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546050}
bratell
Use the predefined Android SDK constants instead of numbers
Half the code used the SDK_VERSION_* constants when checking
Android version, half the code used hard coded numbers 19, 21,
22, ....

This changes the code to use SDK_VERSION_ everywhere.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;master.tryserver.chromium.android:android_arm64_dbg_recipe;master.tryserver.chromium.android:android_compile_x64_dbg;master.tryserver.chromium.android:android_compile_x86_dbg;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Icb4e3183f0490b00d16039681548ccf469e9d236
Reviewed-on: https://chromium-review.googlesource.com/975841
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545870}
fs
Remove outdated DCHECK in SVGUseElement::InsertedInto
This DCHECK was made obsolete by
9b88406d1a87dfeef593c6d1a91beb3a2b696391, since it stopped using the
"pending resource" flag for <use>.

Bug: 825460
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ie1202097eb2172ef9ed3866e3a6575fbe4aa09db
Reviewed-on: https://chromium-review.googlesource.com/980252
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#545854}
bratell
Remove references to the non-existing android_compile_mips_dbg bot
Per answers on chromium-dev@, the android_compile_mips_dbg trybot
is no more.

Bug: gerrit:8617
Change-Id: I2f23c663d2baf397f30532290300bf2946531ab9
Reviewed-on: https://chromium-review.googlesource.com/980492
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545813}
fs
Reland "[PE] Don't reparse "restart" and "fill" repeatedly"
Rather than doing an attribute lookup in GetRestart() and Fill(), just
map the attributes in ParseAttribute. Pack with active_state_.
Also get rid of the static AtomicStrings.

Noticed while looking at the referenced bug.

Use new accessor GetActiveState() for active_state_ accesses to avoid
stumbling over signedness mismatches.

Bug: 823473
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I9adf72cdfcc794885b79be1bfc374554f9382d11
Reviewed-on: https://chromium-review.googlesource.com/979807
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#545786}
bratell
Rename TestPrerendererClient since that name is already used
In some extreme jumbo configurations the newly added
TestPrerendererClient class in
Source/core/html/parser/HTMLDocumentParserTest.cpp
compiled in the same translation unit as TestPrerendererClient
in Source/core/exported/PrerenderingTest.cpp and then it
didn't compile.

This patch renames TestPre* to MockPre*/MockWebPre* which also matches
a common pattern when creating mock classes.

Change-Id: Ib800e5e65756bf3c3709d8f570982aaa46dc7cd4
Reviewed-on: https://chromium-review.googlesource.com/980332
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Matthew Cary <mattcary@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#545771}
bratell
Gave two kBufferSize constants unique names.
In some (extreme) jumbo configurations on Mac two kBufferSize
constants ended up in the same translation unit and caused
a compilation error. This patch gives them unique names to
not cause any future problems.

Change-Id: I96d5e51024ff99fcb838346726aa1635127841eb
Reviewed-on: https://chromium-review.googlesource.com/978209
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545720}
bratell
Avoid clashes between the kLeftToRight in OSX SDK and WTF::Unicode.
There is a kLeftToRight in OSX's SDK and in WTF::Unicode. If
WTF::Unicode is imported into global scope those might clash and
this happens in some non-standard (extreme) jumbo configurations.

Since "using namespace" isn't allowed per the coding standard,
this just adds the WTF::Unicode namespace to those symbols
that need it.

Change-Id: I97c59e5ffed7d2bd0f8340f5d14b69dc532175d6
Reviewed-on: https://chromium-review.googlesource.com/978205
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545718}
bratell
Use ::testing to not get mixed up with ::blink::testing
There is both a ::testing namespace and a blink::testing namespace
and if you inside namespace blink says "testing", which one you
get depends on what the compiler knows. In jumbo builds compilers
often know about both namespaces and will assume you mean
::blink::testing.

To be sure to get ::testing, you need to prefix it with ::.

In the long run ::blink::testing should probably be renamed. Its
name violates the rule that no sub namespace should have the same
name as a common top level namespace.

Change-Id: I60857ebd08d4b35ce56212d03b4ed63045803402
Reviewed-on: https://chromium-review.googlesource.com/978004
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545717}
fs
[PE] Don't reparse "restart" and "fill" repeatedly
Rather than doing an attribute lookup in GetRestart() and Fill(), just
map the attributes in ParseAttribute.
Also get rid of the static AtomicStrings.

Noticed while looking at the referenced bug.

Bug: 823473
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I19d1244c6034430c30e65c09e20c8f04552b1e5f
Reviewed-on: https://chromium-review.googlesource.com/978246
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#545686}
fs
[PE] Restore LayoutObject check in SVGElement::NotifyIncomingReferences
When an element has incoming references that are not in the layout tree
(like an element animated by [multiple] SMIL elements), the overhead of
the hash set insert/erase can be noticable (like for instance in
balls_svg_animation.html.)

Bug: 661598, 769774, 823473
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I8a5879186dabd5e071f708ac953b8f1e91b62847
Reviewed-on: https://chromium-review.googlesource.com/978213
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#545467}
bratell
Avoid having duplicate StopLoadingInBackgroundEnabled()
This is a jumbo compilation fix. A couple of hours ago a second
StopLoadingInBackgroundEnabled() was added which in jumbo builds
where *.cc files are compiled together caused a compilation failure.

The function is small enough to be inlined so that is what this patch
does here and at the original place it was copied from.

Bug: 820634
Change-Id: I09d8fe48f4573d67b353eda563abad54c2325769
Reviewed-on: https://chromium-review.googlesource.com/978001
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#545446}
pkalinowski
Do not use null Uri for camera intent
In case of failure to create a temporary image capture file,
GetCameraIntentTask#onPostExecute will receive null Uri. For capture
fields, this was already handled by aborting file selection.

However, in remaining cases, it would result in an attempt to add this
null Uri as EXTRA_OUTPUT and to convert it to ClipData. The latter
results in NullPointerException.

This change skips processing null Uri in remaining cases. Camera
intent without an Uri can only return small version of the image
directly as a bitmap, but that is unlikely what user can work with
and the rest of the code is not prepared to handle it anyway.

So, abort if mDirectToCamera == true, as there is no useful intent
to show. Otherwise, proceed with null as a camera intent which
will still enable other modes of file selection. This is also
in line with the behavior before the introduction of
GetCameraIntentTask.

Bug: 821440
Change-Id: Ib4024c406bbcaf560e5cdde584c317f1ab6477d2
Reviewed-on: https://chromium-review.googlesource.com/960722
Commit-Queue: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545440}
wdzierzanowski
Add missing dependency on ppapi_plugin_sources
content_main_runner.cc uses the functions PpapiPluginMain() and
PpapiBrokerMain() from //content/ppapi_plugin/ when
(!is_multi_dll_chrome && enable_plugins) is true.

This fixes the linking of app_shell_helper_app_executable on macOS in a
static jumbo build after
https://chromium-review.googlesource.com/958282.  The error was
https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.fyi%2FJumbo_Mac%2F14982%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout

BUG=367595

Change-Id: If2dab9414a780aa4f60a70153042608f225b37c0
Reviewed-on: https://chromium-review.googlesource.com/977682
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#545396}
fs
[CI] Move InvalidationMode to SVGResourceClient; pass to clients
In preparation for always invalidating through SVGResourceClient.

TBR=fserb@chromium.org

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I733987de91d1051a72652aba3115e387dc909dbf
Reviewed-on: https://chromium-review.googlesource.com/976063
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545393}
bratell
Reuse existing constants for Android SDK versions
There are constants for Android SDK versions in build_info.h
so nobody has to declare their own. This changes some duplicated
custom constants that clashed in jumbo builds to use the
global constants.

Bug: 598880
Change-Id: I32bc147729e561130eaaf4feab545bd0cd9714c1
Reviewed-on: https://chromium-review.googlesource.com/975641
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#545069}
fs
[CI] Add LayoutSVGBlock::GetElement helper
Like the equivalent helper on LayoutSVGModelObject, this provides a more
specific type of Node (an SVGElement), since is guaranteed for
subclasses of LayoutSVGBlock.
Also update the documentation in LayoutSVGModelObject to reflect the
current name.

Bug: 769774
Change-Id: I720af53e5a24e960773059f7d2a113e74bd5bdc5
Reviewed-on: https://chromium-review.googlesource.com/973378
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545034}
fs
[CI] Use ToReferenceClipPathOperationOrNull instead of IsReferenceClipPath
Since DEFINE_TYPE_CASTS now provide a To<type>OrNull, we can use that
instead of essentially open-coding the same thing.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I22113ff36a406d0afc17e5ecf37158e1dec1fe8e
Reviewed-on: https://chromium-review.googlesource.com/973376
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#544833}
fs
Remove one hash lookup in SVGResourcesCycleSolver
Make use of the return value from HashSet::insert to eliminate the
preceding Contains().

Bug: 534817
Change-Id: I07ccfb26310801fd7534278550479df299f43d15
Reviewed-on: https://chromium-review.googlesource.com/970961
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#544550}
fs
[PE] Don't use callbacks for SVGElement::NotifyIncomingReferences
Dispatch overhead is high.

Bug: 661598, 769774, 823473
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I4b200d0076c209584a033be810f95c504e81c102
Reviewed-on: https://chromium-review.googlesource.com/970422
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#544431}
fs
Make TranslateTransformOperation::X/Y return const Length&
Also eliminate a few copies in TranslateTransformOperation::Blend.

Change-Id: Icb390e3da70e2c3b651c34758f8e0fefa7bb4484
Reviewed-on: https://chromium-review.googlesource.com/970821
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#544377}
bratell
Followup WorkerModuleFetchCoordinater, move test code to shared file
Both the new and old code use an identical ClientImpl test class.
In jumbo builds those end up in the same translation unit and
it won't compile. This patch moves the class to a shared file
WorkerFetchTestHelper.h

Bug: 680046
Change-Id: Iabe58f2f2c93e4d77fb36c8c454952af994d302c
Reviewed-on: https://chromium-review.googlesource.com/968363
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544077}
fs
[CI] Restructure SVGResourcesCycleSolver
Restructure the code so that traversing a LayoutObject's resources is
shared, and rename ResourceContainsCycles to TraverseResourceContainer.
Hoist the side-effects (clearing out resources with cycles) to the
caller.

Bug: 534817, 769774
Change-Id: Icd8200a2cd9073487479e32827a9fdeb1d8d04c4
Reviewed-on: https://chromium-review.googlesource.com/966661
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#544037}
bratell
Manually inline the IsTouchOptimized method to avoid jumbo clashes
There is a common helper method IsTouchOptimized() that is a shortening
of ui::MaterialDesignController::IsTouchOptimizedUiEnabled(). That
helper method is placed in anonymous namespaces which are merged in
jumbo builds, causing clashes.

Alternatives are to find a shared location for this method (maybe in
//ui?) or inline it. This patch inlines it.

Bug: 803406
Change-Id: Ia389432bfdb506d27b625c916a9baf73b7b70f30
Reviewed-on: https://chromium-review.googlesource.com/966204
Reviewed-by: Bret Sepulveda <bsep@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#543939}
bratell
Give two kTextContext unique names for jumbo builds
There are two different kTextContexts in chrome/browser/ui, living
in different namespaces that in jumbo builds become the same
namespace. This patch renames them so that they have
unique names.

This affects Opera builds but not Chrome builds yet since jumbo
is not yet supported in chrome/browser/ui in Chrome.

Bug: 803406
Change-Id: I3354881b9dedae9499356800cbaed4de3cc0da4c
Reviewed-on: https://chromium-review.googlesource.com/966202
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#543938}
fs
[CI] Cleanup SVG <pattern> attribute collection
Move the 'href' lookup to a helper function (as seen in the very similar
SVGGradientElement.) Use a similar setup in SVGGradientElement
equivalent method.
Move attribute synchronization from LayoutSVGResourcePattern into
SVGPatternElement::CollectPatternAttributes.
Change the SetPatternAttributes helper to take a SVGPatternElement
reference.
Remove the element null-check in the LayoutObject.

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I16901de05437bbeea1981f5340bec1a3e4329b50
Reviewed-on: https://chromium-review.googlesource.com/966221
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#543709}
bratell
Have git ignore the third_party/llvm-bootstrap-install dir
third_party/llvm-bootstrap-install is sometimes created by
tools/clang/update.py and should not disturb git.

Change-Id: Id30390bc0e15e69661828f0124c08475539e3490
Reviewed-on: https://chromium-review.googlesource.com/966421
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#543687}
fs
[CI] Stop tracking <*Gradient> 'href' references through SVGResources
Gradient resources are currently only using the 'linked' resource in the
SVGResources object for cycle breaking and change notifications. The
SVG*GradientElements also perform cycle breaking on their own,
disregarding what SVGResourcesCycleSolver has done. The 'href's
themselves are what risk introducing cycles for gradients at the moment,
so handling them explicitly (as is already done) doesn't add any
additional complexity. Mixing resources defined by the DOM with those
defined by style does add complexity though.

This CL stops tracking <*Gradient> href's using SVGResources, and starts
tracking them using an IdTargetObserver in SVGGradientElement, much like
how similar 'href's are tracked.

Bug: 661598, 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I5538ede4170c7181098fe2308dbfa640506334f4
Reviewed-on: https://chromium-review.googlesource.com/880965
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543685}
bratell
Solving jumbo build offline_pages clash with base::DoNothing()
Too many SavePageLaterCallback functions caused problems in
jumbo builds. Since two of the three were just empty functions
this patch replaces them with base::DoNothing()

Change-Id: Ie9c939ee10674cdab77aab0a9ade65d70293fb0c
Reviewed-on: https://chromium-review.googlesource.com/964441
Reviewed-by: Cathy Li <chili@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#543397}
tmoniuszko
Fix crash on ResetWindowControls with no non-client view
Crash happens when Widget with no non-client view (for example
TYPE_WINDOW_FRAMELESS) is being shown on Windows 7 with Aero Glass
disabled.

This is a regression introduced by
https://chromium-review.googlesource.com/924315.
ResetWindowControls is called from HWNDMessageHandler::OnSysCommand.
Previously it wasn't called if non-client view was null because
ShouldHandleSystemCommands returned false in such case.

Bug: 189112
Change-Id: Ia12013ab11fd67dd28bcaf5d490c846928569a78
Reviewed-on: https://chromium-review.googlesource.com/960029
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543350}
bratell
Disable blink pch for jumbo builds
pch makes jumbo builds slower instead of faster since each
pch file will only be used 1-3 times instead of many times, and
in Blink the pch files contain a lot of code so creating them
takes a long time.

This saves about 20% of the Blink build time on Windows.

Bug: 809010
Change-Id: Ia512646110572e4939e8e3cc1a9cd946b780cb97
Reviewed-on: https://chromium-review.googlesource.com/962785
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#543335}
fs
Refactor computed <paint> value handling
Combine all the fields that make up a <paint> into a class: SVGPaint.
Move the bulk of the style builder function for <paint> from the
template to StyleBuilderConverter. This should make future work on
<paint> resolution easier.
Also split the existing setters on {SVG,}ComputedStyle to avoid having
bools to indicate if the "visited" portion should be set or not. The
new way more closely resemble other color properties.
Add accessors to SVGPaint to both make code easier to read, and reduce
the dependence on SVGPaintType.

Bug: 769774
Change-Id: Ifad043c9e423f0fc7aa79fef78e635b2abb4636c
Reviewed-on: https://chromium-review.googlesource.com/961062
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#543333}
bratell
Drop a couple of unused files that broke certain jumbo builds.
A completely unused object file in a static library will be
ignored by the linker, but with jumbo builds unused cc files will
be grouped with used cc files and the object file will no longer
be ignored.

If the cc file contains code that is bad it can then trigger followup
linker errors which happened in this case where debug component
windows builds had too many constructors and destructors for
WebAssociatedURLLoader when building webkit_unit_tests.exe

Change-Id: I16a0332b9e16903481c2995f2176e59a1ba8e53e
Reviewed-on: https://chromium-review.googlesource.com/955850
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#542843}
fs
[CI] Transition ReferenceFilterOperation to SVGResource
This CL transitions the ReferenceFilterOperation (used for 'filter')
from SVGElementProxy to SVGResource. It introduces ExternalSVGResource
as a new subclass of SVGResource.
ExternalSVGResource handles loading of an external document, and
notifies clients as needed when said document finishes loading.

Since this leaves SVGElementProxy unused, it is removed together with
some related structures. This also allows some code to be simplified
because we no longer need a TreeScope (or Node) in some places.

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: If6cbbf32e0269878bdea897fcf0b8e41c062b0f6
Reviewed-on: https://chromium-review.googlesource.com/955684
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#542822}
bratell
Give some g_delegate variables unique names
In jumbo builds, many files share the same anonymous namespace
so having a file local symbol name might still clash with other
files having the same file local name.

This patch renames a couple of g_delegate variables that caused
clashes in some (non-default) jumbo configurations.

Bug: 746957
Change-Id: I732d7223be88d4871a4ae7294377bc558a2ac2ca
Reviewed-on: https://chromium-review.googlesource.com/957727
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#542767}
ppluciennik
Improved GN code related to resolving paths.
Moved most of the logic related to resolving paths
to ResolvePath and ResolveRelative in filesystem_utils.cc.
Improved SourceDir class to return std::string with resolved path
for cases when returning SourceDir or SourceFile wasn't really needed.

R=brettw@chromium.org, dpranke@chromium.org

Bug: 819720
Change-Id: Ia59da00e83de45431762ebb19a9153471f7e91e3
Reviewed-on: https://chromium-review.googlesource.com/953422
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542692}
fs
Use the same initial type for both 'fill' and 'visited fill'
The initial value used here shouldn't make a difference, so use the
initial value of 'fill' since that looks less confusing. It will also
simplify conversion to a different computed <paint> representation.

Bug: 769774
Change-Id: I5a08f73d4affc28f5804f3c3164051197721b2a4
Reviewed-on: https://chromium-review.googlesource.com/959009
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#542552}
bratell
Add an llvm work directory to .gitignore
Change-Id: I2a22b99caa64cc0d1c3b8d74425375b76b1dca67
Reviewed-on: https://chromium-review.googlesource.com/957737
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#542511}
fs
Don't invalidate client in SVGResourcesCache::ClientDestroyed
We're just about to destroy said object, and since this is only issuing
"local" (client-only, no ancestors) invalidations they will have no
effect.

Bug: 769774
Change-Id: Ib8d0afecb65a80bd89990906940e792cadcc2dcb
Reviewed-on: https://chromium-review.googlesource.com/958903
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#542505}
bratell
Update clang docs since the old text was pre-Win-clang

Change-Id: I9ce1985082125ab6099f3576d6742aaed73d21d7
Reviewed-on: https://chromium-review.googlesource.com/958165
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#542487}
bratell
Fix mixup in expected/got in include guard presubmit check
Bug: 814776
Change-Id: If68e4015c54a0b60f9a68b7941fb3e5d14b58502
Reviewed-on: https://chromium-review.googlesource.com/958466
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#542469}
fs
[PE] Add "image/apng" to supported image MIME types
Supported for animated PNG (APNG) was added via crbug.com/437662 (commit
7d2b8c45afc9c0230410011293cc2e1dbb8943a7.) The "image/apng" MIME type is
included in the "Accept" header for image requests.

Add "image/apng" to kSupportedImageTypes to allow things like the
<picture> element to work (select an appropriate image based on 'type'.)

Add "image/apng" to kPrimaryMappings to allow the MIME type to resolve
to a reasonable file extension.

Bug: 730588
Change-Id: I070e8b16dc8312552b11dc32e776493b3a5be669
Reviewed-on: https://chromium-review.googlesource.com/957092
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Asanka Herath <asanka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542113}
bratell
[jumbo] Windows build fix related to INITGUID
Generating GUID objects in a binary requires careful juggling
of includes and the define INITGUID (or the header <Initguid.h>).

Jumbo builds are not that careful so the simplest/best solution
is to remove the file doing INITGUID from jumbo compilation.
This manifested itself in jumbo fyi builders building
catalog_viewer_service.exe.

TBR=dtapuska@chromium.org

Bug: 657623
Change-Id: I1457727a0b3a68f82726a2e73c1ae3dedb06f12d
Reviewed-on: https://chromium-review.googlesource.com/955690
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#542108}
bratell
Fix jumbo+Win compilation error related to the PostMessage macro
PostMessage is a macro in Windows and depending on whether Windows
headers have been included or not, PostMessage will either be
treated as PostMessage or PostMessageW. We use a special header
windows_types.h to ensure that the macro is always defined
so that there will be no compilation or linking issues missing
either PostMessage or PostMessageW objects.

Bug: 772713,813749

TBR=leon.han@intel.com

Change-Id: I0012774f347ef2e257bc87b4492f58c7be464f78
Reviewed-on: https://chromium-review.googlesource.com/957028
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#542092}
fs
[CI] Split out LocalSVGResource from SVGResource
In preparation for adding an SVGResource subclass for external resources
this splits out a LocalSVGResource subclass from SVGResource and renames
usages appropriately. This is mostly to eliminate "noise" from a follow-
up CL.

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I479ca0445e4eba5f0ba2b727460dfcda776347b8
Reviewed-on: https://chromium-review.googlesource.com/955463
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#542075}
fs
Transition ReferenceClipPathOperation to SVGResource
This CL replaces the use of SVGElementProxy in
ReferenceClipPathOperation with SVGResource. The main change between the
two is when the element reference is resolved ("when used" versus
"when computed".)

This also, by extension, adds infrastructure for invalidation and other
things required to make SVGResource work.

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia43f76256a251a15c4dc100461cff9bf728eb188
Reviewed-on: https://chromium-review.googlesource.com/951613
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541771}
fs
[SPv175][PE] Antialias clips for PaintChunks (and FloatClips)
ClipDisplayItems would use/generate antialiased clips, so it makes sense
to carry that bit (literally) forward.
Also update the FloatClip display item code-path for consistency.

Bug: 814876, 819617
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I1433804bd5734857116e613c2342c49d42499ecb
Reviewed-on: https://chromium-review.googlesource.com/934450
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541482}
bratell
Rename devtools GetCommandLine (A Win32 macro)
GetCommandLine is a win32 API macro defined to GetCommandLineW.
Depending on whether <windows.h> is included of not, code using that
name will either get the intended name or GetCommandLineW.

In some build configuration this caused problems when a base class had
GetCommandLine() but the sub class by accident defined
GetCommandLineW.

This patch renames it to GetBrowserCommandLine() which also matches
its more exact documentation.

Change-Id: I882b3f650c97802ec7618a797f93f22e9788078f
Reviewed-on: https://chromium-review.googlesource.com/951584
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#541406}
mharanczyk
Fix linking problems caused by //content/test:test_support target on win.
//content/browser/accessibility/accessibility_event_recorder_win.cc in
this target is missing required lib on win in component builds.
In non-component oleacc.lib is added indirectly through
//content/browser:for_content_tests -> //content/browser dependency chain.

The change fixes missing AccessibleObjectFromWindow symbol linking error
for content_unittests and webkit_unit_tests in component build.

BUG: 818856
Change-Id: I1253bbbff5ca346f2fe4f81d0fc71834bb158222
Reviewed-on: https://chromium-review.googlesource.com/951383
Commit-Queue: Marek Haranczyk <mharanczyk@opera.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541396}
bpiekny
Remove time dependency from NavigationSimulator
This commit solves issues related to low resolution timers in
content_unittests.

Bug: 791910
Change-Id: If572f967034354ab3d1261c4a576736bc7ba9ac5
Reviewed-on: https://chromium-review.googlesource.com/808586
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Bartosz Piękny <bpiekny@opera.com>
Cr-Commit-Position: refs/heads/master@{#541386}
fs
[CI] Make SVGResource have an IdTargetObserver rather than be one
This switches SVGResource away from inheriting IdTargetObserver, and
makes it have one as a member instead. This should make future
subclassing of SVGResource easier (avoiding GC mixins.) It also has the
side-effect of allowing the SVGURIReference framework to be reused.

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I77fed36a06b846f3cd4cbb7722faa3de1b081f59
Reviewed-on: https://chromium-review.googlesource.com/947956
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#541205}
bratell
Resolve conflict between base::StrCat and Win32 StrCat
StrCat is a Win32 API function and it uses a macro to redirect
StrCat calls to StrCatW. That macro will be available when
shlwapi.h has been included but not otherwise so mentions of
StrCat will sometimes refer to StrCat, and sometimes to StrCatW.

This patch makes it always be StrCatW as in many other functions.

Alternatives are to rename base::StrCat or undef StrCat whenever
shlwapi.h is included.

Bug: 817738
Change-Id: I6fca88d7514867ef15e63c8498ddac6a5e9f43dc
Reviewed-on: https://chromium-review.googlesource.com/950923
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#541122}
bratell
Hide AddToList from X11 headers since dom_distiller uses that name
components/dom_distiller uses the name AddToList which makes it hard
to combine with X11 headers. It doesn't happen in Chromium but it
happens in jumbo builds in Opera (any maybe in Chromium in the
future).

Bug: 782184
Change-Id: I546c254ed85fbfa86cd0ba06ddd294884c8ba6de
Reviewed-on: https://chromium-review.googlesource.com/950780
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#541120}
fs
[CI] Move invalidation out of SVGResources::RemoveClientFromCache
This pushes the actual call to MarkClientForInvalidation out of said
function, leaving it to callers to perform the invalidation.

Bug: 769774
Change-Id: Ib9063899da132a8f31290205ace6a52d5fc8457b
Reviewed-on: https://chromium-review.googlesource.com/946092
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540903}
fs
[CI] Split kLayoutAndBoundariesInvalidation into two flags
Since we already have a kBoundariesInvalidation flag, this means we just
need to rename kLayoutAndBoundariesInvalidation and convert all uses to
bitwise-or the two flags.
The mask/bit checks in MarkAllClientsForInvalidation are adjusted to
reflect this change as well.
A typedef is added to try to better convey that something is a mask and
what of.

Bug: 769774
Change-Id: I30b69458aea8eaea1a3b6b3d023f18d21f2f51f4
Reviewed-on: https://chromium-review.googlesource.com/945928
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#540854}
bratell
Compile fix: Remove chrome_proximity_auth_client.cc
chrome_proximity_auth_client.cc uses easy_unlock_service which
was just moved to be ChromeOS only so chrome_proximity_auth_client.cc
needs to be as well.

If it's compiled and not completely ignored by the linker (most of
the time but not in jumbo builds), it will break the build.

TBR=jhawkins@chromium.org

Bug: 817115
Change-Id: I606cf0958beb6a736bf0717471a6542adde4dc73
Reviewed-on: https://chromium-review.googlesource.com/947962
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#540751}
bratell
Made some ui/gl ValidFormat functions into static methods
gl_image_memory.cc and gl_image_native_pixmap.cc would compile
together in a ui/gl jumbo build (not yet supported) and then the
ValidFormat methods would clash and prevent compilation.

This patch moves the functions into the classes that use them.

Bug: 773275
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I6f031d0897fd0ef96c536e3e4c97245aa108a024
Reviewed-on: https://chromium-review.googlesource.com/939475
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#540553}
bratell
Use a more unique variable name than g_display
In ui/gl there are three different global variables named
g_display. As a preparatory change for jumbo support this patch
renames them g_glx_display, g_egl_display, g_wgl_display.

Bug: 773275
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ic469a886632be8bc711bec8359aa5e4fae5ea6a4
Reviewed-on: https://chromium-review.googlesource.com/939479
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#540552}
bratell
Add presubmit check for include guards
Missing include guards tend to break jumbo builds and makes
everyone involved sad so better to have a presubmit check for it.

There is a risk that this triggers on correct code so it includes
a way to disable it per source file. Include the string
"no-include-guard-because-multiply-included" and there won't
be any warning for that file.

By popular demand there will also be a warning if the name of
the include guard doesn't follow the coding standards, but since
mistakes are common, that check is only enabled for new files.

Bug: 814776
Change-Id: Id18b3d43288b9a064e537460d667957b355bbd33
Reviewed-on: https://chromium-review.googlesource.com/931761
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540526}
bratell
Updating jumbo documentation.
The default chunk size is not 200 anymore, for a number of
months.

Change-Id: I8370e472628ddcf1c49bdc09d989bdadf3ea78b3
Reviewed-on: https://chromium-review.googlesource.com/946097
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#540517}
bpiekny
Make IsPatternValid available in site_settings_handler
Currently we have IsOriginValid available (AllowJavaScript) but
IsPatternValid doesn't have such call. Looks like we don't need
to have any specific state to call this method

Change-Id: I19c8747f09b5bdd332fb2ce7a209b584023c6a03
Reviewed-on: https://chromium-review.googlesource.com/941950
Reviewed-by: Dave Schuyler <dschuyler@chromium.org>
Commit-Queue: Bartosz Piękny <bpiekny@opera.com>
Cr-Commit-Position: refs/heads/master@{#540475}
fs
[CI] Sink invalidation out of LayoutSVGResource*::RemoveClientFromCache
This splits the various RemoveClientFromCache implementations into two
parts:

 1) removal of cached data from the resource, and
 2) invalidation of the client.

This avoids triggering invalidations as a side-effect of cache-
invalidation, and separates concerns to help future refactorings. This
also means that resources that perform no caching, or no per-client
caching, need not override RemoveClientFromCache, but can use a default
implementation.

Since a kParentOnlyInvalidation argument to MarkClientForInvalidation is
a no-op, it is removed in the relevant code-paths.

LayoutSVGResourceContainer::MarkClientForInvalidation is made static to
enable its use outside resource containers themselves.

RemoveClientFromCache gets a new semantic in that it returns a bool
indicating if anything was cached for the client (this is currently
needed for invalidation of clients of filters.)

Bug: 769774
Change-Id: I8deeaef8fdd46e6dcc171100e8d6394df483e232
Reviewed-on: https://chromium-review.googlesource.com/941332
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#540193}
fs
[PE] Pixel snap fragment clips
Noticed while enabling AA for clips (in general.) This should prevent
regressing a few multicol tests when enabling AA clips.

Bug: 814876
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I06ad3aa535e7ba0781f0f78fb80e43d8b68d70e4
Reviewed-on: https://chromium-review.googlesource.com/937518
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539838}
bratell
Corrected reused include guards
If the same include guard is used twice, it becomes impossible
to include both those headers in the same translation unit and
that can be hard to debug and understand. This patch renames
some include guards that have the same names (copy/paste) as
existing include guards.

Found while working on a PRESUBMIT test for include guards. It will
not warn for these things, but it was easy to add that test locally.

There are another few thousand files that have wrongly named
include guards. Left as an exercise to the reader.

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ic7ba08558d3fbae0d3bee843f3092d472f8c643b
Reviewed-on: https://chromium-review.googlesource.com/937712
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#539800}
fs
[PE] Make SVGGeometryElement handle 'pathLength' mutations
Since the 'pathLength' attribute moved to SVGGeometryElement, so should
the attribute mutation handling.

Bug: 815170
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I04bc19988f80f3c3fe4810897e3003403c6997c6
Reviewed-on: https://chromium-review.googlesource.com/939625
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539794}
bratell
Jumbo build fix: wincrypt.h and openssl clash
wincrypt.h and OpenSSL headers define the same macros (until
a later version of OpenSSL at least) so therefore we need to
include crypto/wincrypt_shim.h instead which hides the clashing
macros.

TBR=pmonette@chromium.org

Bug: 746957
Change-Id: I629859f8e381ccadfdf9b6d811330bd8fc35be95
Reviewed-on: https://chromium-review.googlesource.com/940225
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#539791}
fs
[CI] Referencify MarkForLayoutAndParentResourceInvalidation
Cleanup some (now) unnecessary explicit 'this' dereferences as well.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I49238bf7b32760e5a05f6b6ce41557d34423ea45
Reviewed-on: https://chromium-review.googlesource.com/931508
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#539775}
fs
[CI] Share invalidation code for geometry presentation attributes
Much like for geometry attributes - of which these are a subset. Also
push the InvalidationGuard into the invalidation function.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ib9254d8ad930ef132c8074a7636eb57f18ae22d5
Reviewed-on: https://chromium-review.googlesource.com/932122
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539460}
bratell
Fix broken forward declaration that introduced a clashing namespace
A forward declaration claimed there was a ::viz::cc:CompositorFrame
class, and that introduction of a namespace ::viz::cc caused
confusion with the ::cc namespace and compilation errors in
some jumbo build configurations.

The real CompositorFrame is in viz::CompositorFrame so fixing
the forward declaration also removed the namespace clash.

Change-Id: I1cd4fe729591855172f5a07aca2e2c7f3e8db9fa
Reviewed-on: https://chromium-review.googlesource.com/939390
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#539441}
fs
Remove ImageElementBase::SourceDefaultObjectSize
After https://chromium-review.googlesource.com/716679, this method has
no callers. Remove it.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I3e2f427c8349bfa410718cd24782f64c7ad2e0e0
Reviewed-on: https://chromium-review.googlesource.com/735861
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#539306}
fs
[CI] Factor out common "geometry attributes invalidation" code
All the SVGGeometryElements share the same code-sequence for
invalidation of attributes that define the geometric shape.
Move this code to SVGGeometryElement::GeometryAttributesChanged.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I78eabe6245eff618dff810d7bcfc120b9a99f545
Reviewed-on: https://chromium-review.googlesource.com/931802
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#539218}
bratell
Correct some include guards found by PRESUBMIT test
There is a PRESUBMIT test coming for include guards and these
are some of the files that trigger that test. Both because of
code outside the include guard (bug) and slightly wrong syntax
for the #define (irrelevant).

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr;master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I486fd56d6ef506064cda38504728771549ebc6fb
Reviewed-on: https://chromium-review.googlesource.com/937709
Reviewed-by: Christopher Grant <cjgrant@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#539210}
fs
[CI] Reduce LayoutSVGResourcePaintServer dependencies on LayoutObject
In preparation for passing/using an SVGResourceClient as the 'client',
make sure the LayoutObject& is only used as a cache key by extracting
and passing the object bounding box as a separate argument.

Bug: 769774
Change-Id: I673ef74f2e65d645037a65d85e75846f37d3859b
Reviewed-on: https://chromium-review.googlesource.com/931465
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#539206}
bratell
Fix "shadow" warning/error in jumbo builds
There are local variables named next_id so having a global
variable with that name triggers -Wshadow warning. This
patch renames the global next_id -> g_next_indexed_db_connection_id.

Change-Id: I31925418e69999ea789fef856058ab66125f60fa
Reviewed-on: https://chromium-review.googlesource.com/937206
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539184}
bratell
Correct some broken include guards.
Found while working on a PRESUBMIT test for include guards.

Change-Id: Ib622cbaae28c48a469337076b57f5139971baff5
Reviewed-on: https://chromium-review.googlesource.com/932662
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539155}
yorenault
[Linux] Only mark event as handled when it is actually handled
views::View that don't have a context menu controller
still mark the click event as handled,
forbidding further processing of this event.

Bug: 814666
Change-Id: Ie9ab6e0f0e573a4d653a52995421ac1075c686fb
Reviewed-on: https://chromium-review.googlesource.com/925269
Reviewed-by: Elliot Glaysher <erg@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538835}
bratell
Rename a couple of g_instance to allow extreme jumbo
We just got two g_instance in //base and to allow the whole of
base to compile in a single translation unit (not a default
configuration even among jumbo users) it's better if they
have unique names.

Bug: 775547
Change-Id: Ie1a1a856932ae46bde754878108097a94e6e00c6
Reviewed-on: https://chromium-review.googlesource.com/931121
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#538512}
bratell
Add include guard to WebFontTypefaceFactory.h
Newly added header missing include guard. There is a presubmit
check coming to catch these since they break some builds.

TBR=drott@chromium.org

Change-Id: Ie705b6b3404bcb67d829bcc1a7ba449daf1cb277
Reviewed-on: https://chromium-review.googlesource.com/931881
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#538503}
bratell
Removed unused line of code in merge_for_jumbo.py
Change-Id: I27525f1c02214fdb6fc04564abc417cdb472ee53
Reviewed-on: https://chromium-review.googlesource.com/931464
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538479}
bratell
Be explicit when mixing ::switches and ::headless::switches
There is both a ::headless::switches and a ::switches
namespace and if they are both known then "switches" inside
::headless will refer to ::headless::switches. This happens
in some jumbo build configurations.

with the same name as a top level namespace for this reason but
there are some such cases in the code that would be non-trivial
to change.

Note: The style guide strongly discourages using sub namespaces
Change-Id: I0c35abbb43caa53e725cc44a80b93083123374fa
Reviewed-on: https://chromium-review.googlesource.com/931125
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538424}
jl
Reland "Enable jumbo/unity build for //content test support targets"
This is a reland of a20415fc04f992b5e7e0d600572589c0317fdd95.

Original change's description:
> Enable jumbo/unity build for //content test support targets
> 
> Change-Id: Ibc5e0d946c57a4a3be7fc24a9c0773ec830514f0
> Reviewed-on: https://chromium-review.googlesource.com/922822
> Reviewed-by: Scott Violet <sky@chromium.org>
> Commit-Queue: Jens Widell <jl@opera.com>
> Cr-Commit-Position: refs/heads/master@{#537257}

Change-Id: I09ad8c813e0b2f7dfec9a867f4b4b1a5e9092b12
Reviewed-on: https://chromium-review.googlesource.com/925604
Reviewed-by: Dave Schuyler <dschuyler@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#538118}
jl
Rename one BlobStorageContextGetter function
In jumbo/unity builds, it conflicts with the function with the same
name that is declared in content/browser/download/download_utils.h.

Change-Id: I6e19c76dca926fbd13ae2c804b92ab454fe2d0dc
Reviewed-on: https://chromium-review.googlesource.com/926343
Reviewed-by: Nick Carter <nick@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#538093}
fs
[CI] Use color enumeration in SVGPaintContext::PaintForLayoutObject
The code in its current form gives the impression that there's a
dependency on the initial value of the 'fill' property, while all we
really want to say here is 'black'. Use a more direct approach.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ib75ba965c585771e9a009f91f0055a592a37c1b0
Reviewed-on: https://chromium-review.googlesource.com/926845
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#537861}
jl
Enable jumbo/unity build for various //extensions targets
Change-Id: I4685aaade618b0ea68750688eeca2fc0d24364c9
Reviewed-on: https://chromium-review.googlesource.com/922821
Commit-Queue: Jens Widell <jl@opera.com>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537786}
bratell
Remove unused includes that collide with OpenSSL includes.
wincrypt.h and OpenSSL can't be in the same translation unit
since both define X509_NAME. There is a crypto/wincrypt_shim.h
to use instead of wincrypt.h but in this case the includes were
left by mistake when code moved elsewhere and can be removed.

This fixes jumbo build in Windows.

TBR=pmonette@chromium.org

Bug: 746957
Change-Id: I3fa0dadaf8e423302c353bfb7bc7e5484b58ff68
Reviewed-on: https://chromium-review.googlesource.com/924223
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#537625}
jl
Generate jumbo source files into `invoker.target_gen_dir`
This typically means a path based on the directory containing the
BUILD.gn file that defined the jumbo target, which generally makes
sense.

The old solution of finding a suitable directory by looking at the
directories containing the target's source files can generate the
same name for multiple targets, meaning such targets can't all be
jumbo enabled. This is rare, but is the case for the targets

  //extensions:test_support

and

  //extensions/browser:test_support

since the former has source files from //extensions/browser/ that
end up being used as the target directory.

Change-Id: Ie0c9ee2fcef25c6b0705e0fed3f1dce060459537
Reviewed-on: https://chromium-review.googlesource.com/924023
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#537623}
bratell
Prevent OpenSSL and msi.h clashes by setting _MSI_NO_CRYPTO
third_party/OpenSSL and msi.h both indirectly define X509_NAME so
to have avoid them clashing, tell msi.h to not include wincypt.h where
X509_NAME is set.

This became a problem in jumbo builds where msi_util_win.cc was grouped
with code using browser_process.h which includes openssl headers.

Bug: 746957
Change-Id: Ibaaf60ab6b5b46f9a86e90e0f5a7de9d4ecd57d7
Reviewed-on: https://chromium-review.googlesource.com/924072
Reviewed-by: Patrick Monette <pmonette@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#537304}
bratell
Support jumbo in chrome/browser, saving another 10% compile time
Of the code pieces left to add jumbo support to, the one which benefit
the most from jumbo is //chrome/browser:browser which goes from 90 to
10 CPU minutes, a reduction of more than a CPU hour. This is about 10%
of the total effort compiling chrome+content_shell+blink_tests.

In jumbo builds many cc files compile in the same translation unit
which reduces the time spent generating debug data and machine code
for headers, as well as the time to actually process the headers.

Bug: 746957
Change-Id: I856f3fca1f16fa2b0738678444c455c303985962
Reviewed-on: https://chromium-review.googlesource.com/899368
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#537284}
jl
Enable jumbo/unity build for //content test support targets
Change-Id: Ibc5e0d946c57a4a3be7fc24a9c0773ec830514f0
Reviewed-on: https://chromium-review.googlesource.com/922822
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#537257}
fs
Simplify/improve ElementStyleResources "is sprite" heuristic
The HasBackgroundImage check is redundant because the helper function is
called within an equivalent check.
Also change so that current layer is checked, rather than always
checking the first (top-most) layer. Update the test to include a case
where doing this will help.
Rename the helper method to BackgroundLayerMayBeSprite since it's no
longer operating on a ComputedStyle.

Change-Id: Ibfabfc4a3c68d042ab356f43cb6031697d4daf98
Reviewed-on: https://chromium-review.googlesource.com/852255
Reviewed-by: rajendrant <rajendrant@chromium.org>
Reviewed-by: Scott Little <sclittle@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#536998}
bratell
Jumbo compile fix: renamed two content/browser symbols
Recent additions created duplicate symbols in content/browser
of the variable g_url_loader_factory_callback_for_test and of
the method BlobStorageContextGetter. BlobStorageContextGetter is
a duplicate method but small enough that it's probably ok.

This renames one BlobStorageContextGetter to
BlobStorageContextGetterForStorage (lacking a suitable place for
sharing the method) and one of the
g_url_loader_factory_callback_for_test variables to
g_create_network_factory_callback_for_test to better describe what it
contains.

These errors don't appear in the jumbo configurations covered by
the bots because the files are far enough apart in file lists
to normally not be grouped with each other.

Change-Id: I17ecc36d2271c71f6b7affcc41ef4935b107743f
Reviewed-on: https://chromium-review.googlesource.com/915367
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536987}
bratell
[jumbo] Stop complaining about strange files in sources
People put lots of files in gn's sources lists. Rather than
being upset, jumbo should just live with it. They do no harm
and can be safely ignored.

Change-Id: I15c3930cfeb50e5bd7ce121ca7b7c17db088b63f
Reviewed-on: https://chromium-review.googlesource.com/916246
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#536978}
fs
Setting "" as <track> 'src' should fail the first time
When setting a track .src to "", we would resolve the URL to a null URL,
which matched the default initialized HTMLTrackElement::url_, meaning
that readyState was not advanced and no 'error' event fired in this
case.

Extend the "url == url_" check with a check for readyState differing from
'none'. Also rewrite HTMLTrackElement::getReadyState to avoid using
EnsureTrack().

Bug: 811713
Change-Id: Icd190492639c53e09a7e018202b69ac6e919a94c
Reviewed-on: https://chromium-review.googlesource.com/916004
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: srirama chandra sekhar <srirama.m@samsung.com>
Cr-Commit-Position: refs/heads/master@{#536685}
bratell
Renamed an enum value DEBUG->DEVTOOLS to avoid a Windows macro
Windows's ATL headers (atldef.h) does
#ifdef _DEBUG
#define DEBUG
#endif

which makes it hard to also use the word DEBUG in code that might
intentionally or accidentally be compiled with that header. This
happened in jumbo build experiments where many cc files are compiled
in the same translation unit for dramatically faster compilation.

This preparatory patch for jumbo in chrome/browser renames an
enum value from WebappInstallSource::DEBUG to
WebappInstallSource::DEVTOOLS.

Bug: 746957
Change-Id: I128018246b94310c0cee67eaa404ab7749bd3ae0
Reviewed-on: https://chromium-review.googlesource.com/902042
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#536325}
fs
[CI] Add SVGGradientElement::InvalidateGradient
Add a new helper method on SVGGradientElement that encapsulates the code
that invalidates the gradient data/cache. Use this method where
appropriate.

Add an InvalidateCacheAndMarkForLayout overload taking a
LayoutInvalidationReason to LayoutSVGResourceContainer, and use it in
SVGElement::InvalidateRelativeLengthClients and the new method, which
also takes a LayoutInvalidationReason to improve fidelity of reporting.

The change to use SVGGradientElement::InvalidateGradient in
ChildrenChanged constitutes a minor change in behavior since it
previously didn't have the SelfNeedsLayout() check. Said check should be
reasonable to have in this code-path as well though.

Bug: 661598, 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia5c318a4df958960aabb56f71ad3c384791a46b0
Reviewed-on: https://chromium-review.googlesource.com/913688
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#536107}
fs
[CI] Move SVGTreeScopeResources::Resource to its own file
Make it no longer be an inner class and rename to it SVGResource.

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ifb60050cf6d3ebea360f00209031dbc7b0995d23
Reviewed-on: https://chromium-review.googlesource.com/911112
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#535780}
bratell
Added base::TimeToISO8601 and deleted all other instances
It is not uncommon to want to convert from base::Time to an
ISO-8601 string so instead of having half a dozen implementations,
it's better to have one implementation.

This was noticed in the jumbo project because two of
the implementations ended up in the same translation unit.

Bug: 746957
Change-Id: Ib88832c53930aff7a6c24a0df81afc28cbbecc35
Reviewed-on: https://chromium-review.googlesource.com/895456
Reviewed-by: Yuri Wiitala <miu@chromium.org>
Reviewed-by: Yoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#535691}
mpichlinski
Fixed missing mojo interfaces dependencies for bindings_modules_impl.
Bug: 803441
Change-Id: Ie076c368a0dbfb8178362bb8a79e29f0feff9197
Reviewed-on: https://chromium-review.googlesource.com/873642
Commit-Queue: Colin Blundell <blundell@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534968}
bratell
Jumbo build fix: Use unique names of constants in message_center
A recent CL got rid of the shared constants and instead copied
them to relevant files. To work in jumbo builds they must then
have unique names.

(The alternative to find a shared location for the constants
seems not applicable in this case)

Bug: 783018,723882
Change-Id: I8e64dcf56bfe74d30279549291e89bdec80bc3d2
Reviewed-on: https://chromium-review.googlesource.com/905304
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Mostyn Bramley-Moore <mostynb@vewd.com>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534793}
fs
[CI] Reference-ify SVGResources/SVGResourcesCache
Make the SVGResources and SVGResourcesCache interfaces take a
LayoutObject& instead of a LayoutObject* where appropriate, and then
update users (transitively) as reasonable.

Bug: 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Idfa28bb01551332064ca1ab6d6260d29d3264145
Reviewed-on: https://chromium-review.googlesource.com/904529
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#534789}
bratell
Avoid using the Windows type SpeechRecognizerState
SpeechRecognizerState is an enum in the Windows platform
API for speech so using that name for a Chrome internal
type means that you get compilation errors if the platform
headers and the internal headers end up in the same
translation unit.

In jumbo builds that could happen (and in general it can also
happen) so this renames
SpeechRecognizerState -> SpeechRecognizerStatus
to avoid that.

An alternative would be to move the enum to a different, more
limited, scope.

Bug: 746957
Change-Id: I479470340ea2c582480b2692424a15bc6fb4581a
Reviewed-on: https://chromium-review.googlesource.com/901247
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534709}
bratell
Moved some duplicate password_manager constants into shared code
chrome/browser/password_manager had a couple of trivial constants
and helper functiosn defined multiple times.

In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. With multiple
definitions of a constant, with the same name, you get compilation
errors.

In preparation for jumbo in chrome/browser, this patch moves the
constants into the shared file and it removes a random
constant for "". The code doesn't normally use constants
for "".

Bug: 746957
Change-Id: I069e6c9e18b23ce4597c9f23aee829f85e2d17a1
Reviewed-on: https://chromium-review.googlesource.com/897814
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534438}
bratell
Only compile notification test code into tests
The file mock_itoastnotification.cc was compiled for the
chrome.dll binary instead of being in the test_support section
with the test-only code.

Noticed in jumbo build experiments since it ended up in a larger
obj file where the code was no longer ignored as before, ending
with a linker error because of inconsistent settings.

Bug: 746957
Change-Id: Ibf259cb729889f26226ff87b068fa1051898b11d
Reviewed-on: https://chromium-review.googlesource.com/901627
Commit-Queue: Peter Beverloo <peter@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534425}
bratell
Deduplicate some lookup keys in the profile keys
Some lookup keys were defined multiple times which caused problems
for jumbo build experiments.

In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
many variables with the same name will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch moves the
common constants into ProfileAttributesEntry so they can be used
by all the callers.

Bug: 746957
Change-Id: I58a4d4fb10834c50ec3dd0a6b03e10f284120bce
Reviewed-on: https://chromium-review.googlesource.com/895367
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534419}
bratell
Inlined a small media_galleries helper function
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. With multiple
definitions of an albeit small helper function, you get collisions
and compilation errors.

In preparation for jumbo in chrome/browser, this patch inlines the
helper function GetMTPDeviceDelegate since it's small, and could be
made smaller

Bug: 746957
Change-Id: I492606b21595c3ae5d961e260befdee2e0df0b5c
Reviewed-on: https://chromium-review.googlesource.com/901183
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534408}
bratell
Remove dead enum BrowserProcess
Nobody is using the BrowserProcess enum in
chrome/browser/memory_details_win.cc and in jumbo builds
it clash with the BrowserProcess class in
chrome/browser/browser_process.h.

Bug: 746957
Change-Id: Ib946dd4a05b36e99df070726e20672ca687393f2
Reviewed-on: https://chromium-review.googlesource.com/901602
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534393}
bratell
Renames two GetScoreDictForSettings methods
When building with jumbo many files are compiled in the
same compilation unit and then they will share the same
namespaces, including the anonymous namespace. If code
use the same names those will clash and cause compilation
errors.

There are two more or less identical GetScoreDictForSettings
methods, one in site_engagement_score.cc, one in
media_engagement_score.cc but since there is no
good place to merge them, this just renames them. These
files are now on a list to be refactored to solve the
code duplication.

Bug: 746957
Change-Id: I8e853e761df1c8c0a31c7f2064c0d70f0610d5f8
Reviewed-on: https://chromium-review.googlesource.com/868438
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Mounir Lamouri (slow) <mlamouri@chromium.org>
Commit-Queue: Mounir Lamouri (slow) <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534386}
bratell
Avoid using the Windows macro PLATFORM_UNKNOWN
windows.h defines a macro PLATFORM_UNKNOWN (value 0) which
means that if that word is used in a header, that header can't
be mixed with windows.h and still compile successfully.

This collision happened in jumbo experiment so to avoid that
this patch renames PLATFORM_UNKNOWN -> PLATFORM_UNSPECIFIED

Bug: 746957
Change-Id: Id2045a7682d499181d5ea53c4ceb3ed98236005b
Reviewed-on: https://chromium-review.googlesource.com/901266
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534382}
fs
[PE] Update/fix UA stylesheet for SVG roots in shadow trees
The the UA stylesheet would not set 'transform-origin' correctly for
<svg> outermost roots being direct descendants of the shadow root.

Update the UA stylesheet to fix this, and also match what's currently
specced by CSS transforms [1]. Removing prefixes as appropriate.

[1] https://drafts.csswg.org/css-transforms/#transform-origin-property

Bug: 808228
Change-Id: Ic36ce331797eb7ba80a046af88d22c08fe76d6fc
Reviewed-on: https://chromium-review.googlesource.com/901263
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534371}
bratell
Prevent FocusIn and FocusOut from leaking from x11.h
FocusIn and FocusOut are function names in parts of the code. To
make sure that X11 headers don't cause problems, even in jumbo
builds, this patch moves those constants to the x11 namespace.

Bug: 782184
Change-Id: I6c694557653c7c1119a134960a59a38a2670b103
Reviewed-on: https://chromium-review.googlesource.com/891322
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534270}
bratell
Deduplicate a helper function in android/ntp
The function GetRemoteSuggestionsScheduler was defined
twice which caused some problems for jumbo build experiments.

In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
a function twice (with the same name) will then result
in compilation failures.

In preparation for jumbo in chrome/browser, this patch moves the
helper function to its own file because no existing place seemed
to work fine.

Bug: 746957
Change-Id: I581c5f3815949081989156701c3591bcbf866782
Reviewed-on: https://chromium-review.googlesource.com/897613
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534269}
bratell
Inlined some kZeroTime constants in metrics/desktop_session_duration
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
the same constant twice with the same name will then result
in compilation failures.

In preparation for jumbo in chrome/browser, this patch inlines
the constants in chrome_visibility_observer.cc and
desktop_session_duration_tracker.cc.

Bug: 746957
Change-Id: I1b7d4b2f4a83a8a75c248f07199af6f4e72e87f5
Reviewed-on: https://chromium-review.googlesource.com/897533
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Gayane Petrosyan <gayane@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534198}
bratell
Gave three OnAcquireFileAccessPermissionDone their own names
In jumbo builds many cc files compile in the same translation
unit and if that causes there to be overloaded functions,
the address operator won't know what function's address the
code refers to. This happens in base::Bind, and results
in compilation failures.

In preparation for jumbo in chrome/browser, this patch renames
the three OnAcquireFileAccessPermissionDone to
OnDownloadAcquireFileAccessPermissionDone
OnThrottleAcquireFileAccessPermissionDone
OnOfflinePageAcquireFileAccessPermissionDone

Bug: 746957
Change-Id: I6bd1fa44e9cc1ab44d9bdb653dd8117280ff9325
Reviewed-on: https://chromium-review.googlesource.com/897943
Reviewed-by: Cathy Li <chili@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534197}
bratell
Deduplicate some chrome/browser/android constants and helpers
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
the same constants and helper functions in several files will
then result in compilation failures.

In preparation for jumbo in chrome/browser, this patch
deduplicates the GetWebContents() helper function and the constants
kOMADrmMessageMimeType, kOMADrmContentMimeType,
kOMADrmRightsMimeType1, kOMADrmRightsMimeType2.

Bug: 746957
Change-Id: Ie268f77c7a099a8de01ae08c70870306f38fc05a
Reviewed-on: https://chromium-review.googlesource.com/897612
Reviewed-by: David Trainor <dtrainor@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534182}
bratell
Deduplicated or renamed supervised_user variables
This is a preparatory patch for jumbo compilations where several
cc files are compiled in the same translation unit. Then you get
compilation errors if they all define their own kNumRetries and
kBackoffPolicy, kApiPath and so on.

This patch gives the 5 different kNumRetries variables and 3
different kBackoffPolicy variables in chrome/browser
their own name. It also renames kApiPath, kApiUrl and kApiScope.

It also deduplicates a kAuthorizationHeaderFormat string that had
4 different instances.

Bug: 746957
Change-Id: Ib14ccaa372d3b28cd505b2e7cec519a5635e3173
Reviewed-on: https://chromium-review.googlesource.com/868335
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Reviewed-by: Cathy Li <chili@chromium.org>
Reviewed-by: Marc Treib <treib@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#534084}
jl
Drop conflicting `kIgnoreRoutingId` constant
In jumbo/unity builds, it conflicts with another constant in bindings/
api_event_listeners.cc (that has a different value.)

This particular constant didn't seem to add too much. It was only used in
one place; in a function with a comment that talks about the constant's
value. It could be argued that the code is easier to follow if the (very
simple) function implementation then uses the value directly. (In
particular since the "value" is in fact the name of another constant.)

Change-Id: I728a34b0a8b43382e742c6b640ace3baadc4d2db
Reviewed-on: https://chromium-review.googlesource.com/897489
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#534008}
jl
Rename conflicting `ReadAndDeleteFile()` functions
They conflict in jumbo/unity builds.

Since one read a file as binary data (into a `std::vector<uint8_t>`) and
one as text (into a `std::string`), it seems reasonable to change the
names to `ReadAndDeleteBinaryFile()` and `ReadAndDeleteTextFile()`.

Change-Id: I8d8402c64cfe45132df9640bd5664df28742d6d7
Reviewed-on: https://chromium-review.googlesource.com/897603
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#534007}
jl
Rename conflicting `g_client` variables in anonymous namespace
They conflict in jumbo/unity builds.

Change-Id: Ie5eae8aa303f5a163eabb74ff931f696127ff032
Reviewed-on: https://chromium-review.googlesource.com/897602
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#534005}
jl
Declare string constants in named namespace instead of anonymous
In jumbo/unity builds, some of the constants conflicted with (identical)
declarations in the anonymous namespace in verified_content.cc.

Change-Id: I66e9ecb180e99cfd468c914ddce44613a5013242
Reviewed-on: https://chromium-review.googlesource.com/897604
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#533999}
jl
Rename conflicting `Static` classes/structs
They conflict in jumbo/unity builds.

Also rename the overly generic `g_static`/`g_lazy_instance` variables.
They did not conflict with anything currently, but generic names in the
anonymous namespace are likely to become a problem eventually, sadly.

Change-Id: Ie90ca3c7eee3d357c3aca205a5551034b768eb77
Reviewed-on: https://chromium-review.googlesource.com/897488
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#533993}
bratell
Rename some history_report functions to have unique names
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
the functions with the same names will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch renames
a number of helper functions in chrome/browser/android/history_report
to have unique names.

An alternative would have been to make the functions static private
functions inside the classes.

Bug: 746957
Change-Id: I2df32461d170c5411418cab78abc3020dc0a8109
Reviewed-on: https://chromium-review.googlesource.com/897536
Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533841}
bratell
Use the right ref count macros for base::Bind call
chrome/browser/android/cdm/media_drm_credential_manager.cc sent
a g_browser_process->system_request_context() into a Bind call
without using any ref counting macros. That is prohibited by the
bind system but the code got away with it when the pointer
was just forward declared so that Bind didn't know that it was
a ref counted type.

In jumbo builds the compiler knew more about the return type of
g_browser_process->system_request_context() and failed to compile
because of static_asserts in bind_internal.h.

This patch adds base::Unretained() since that seems to be the
right macro for this type of value.

Bug: 746957
Change-Id: Idfc3ad9bd6708dbc5ef4f295397d05d961595b4a
Reviewed-on: https://chromium-review.googlesource.com/897535
Reviewed-by: Chrome Cunningham <chcunningham@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533839}
bratell
Use different names for two offline_pages delegate classes
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
two classes with the same name will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch renames
two classes named DefaultDelegate so that they have different names.

Bug: 746957
Change-Id: I15cdab5fd9e51223a76d295991513e6e815e3c51
Reviewed-on: https://chromium-review.googlesource.com/897942
Reviewed-by: Cathy Li <chili@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533765}
bratell
Have one kMHTMLExtension constant instead of two
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
the same constant several times will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch
deduplicates the kMHTMLExtension constant and puts it in the
utility class.

An alternative would be to use the literal string "mhtml" without
going through a constant at all.

Bug: 746957
Change-Id: I869f15c17bcf14a633a3e0711c7e469159e3083f
Reviewed-on: https://chromium-review.googlesource.com/897944
Reviewed-by: Cathy Li <chili@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533764}
bratell
Gave three constants in feature_engagement unique names
In jumbo builds many cc files compile in the same translation
unit and then they all share the same anonymous namespace. If
two or more variables have the same name, they will cause
compilation errors and that happened with the three
kDefaultPromoShowTimeInHour constants.

As a preparatory patch to jumbo in chrome/browser this renames
those by adding a relevant prefix to each of them.

Bug: 746957
Change-Id: If17d8103a6916c14b493e203e445208bb1b1b2d6
Reviewed-on: https://chromium-review.googlesource.com/893273
Reviewed-by: David Trainor <dtrainor@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533728}
fs
[PE] Support 'pathLength' for <path>s referenced from <textPath>
A 'pathLength' attribute on a <path> referenced from <textPath> will
affect the starting offset on the path as computed from 'startOffset'
attribute.
Refactor the PathPositionMapper setup a bit so that the start offset is
computed together with all the other path related state.

Bug: 803127
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Id12c88580dd74db403598d2aa05ac9764ad68cdb
Reviewed-on: https://chromium-review.googlesource.com/897626
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#533712}
bratell
Give all the different kTrafficAnnotations unique names
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
many variables with the same name will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch renames
all the chrome/browser kTrafficAnnotation variables so that they
don't share the same name. This is an equivalent change
to what was already done in //content a couple of months back.

Bug: 746957
Change-Id: I4972cbb767720ac8114b9a01878df1f3ea32a735
Reviewed-on: https://chromium-review.googlesource.com/895369
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ramin Halavati <rhalavati@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533610}
bratell
Use different names for two settings lookup functions
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
many variables with the same name will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch renames
two functions that fetch a DictionaryValue settings object so that
they have different names.

Bug: 746957
Change-Id: I109751abd13397b61e2eceaccbd95decf493d0c4
Reviewed-on: https://chromium-review.googlesource.com/895368
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533609}
bratell
Giving some ssl metrics functions unique names
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
two methods with the same name will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch renames
some functions and metrics related to ssl interstitial pages.

Bug: 746957
Change-Id: If8218168d38a7ddae9f2fcdb09b2956018aacd8f
Reviewed-on: https://chromium-review.googlesource.com/895370
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533608}
bratell
Use different names for different histogram constants
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
many variables with the same name will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch renames
some page_load_metrics constants so that they have unique names.

Bug: 746957
Change-Id: Ibfad7c1dbb7b193a2afca5998e5265ec7f8df896
Reviewed-on: https://chromium-review.googlesource.com/895455
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533427}
bratell
Gave two tracing OnUploadComplete methods unique names
In jumbo builds many cc files compile in the same translation
unit and then they share the same anonymous namespace. Having
two methods with the same name will then result in compilation
failures.

In preparation for jumbo in chrome/browser, this patch renames
two OnUploadComplete methods. They are identical so an alternative
is to find a common definition for them but they are also tiny,
really just 1-2 lines of code, so it is not a big thing to have
two of them.

Bug: 746957
Change-Id: I39835ee002fb48216211c37c4c3d047c1dff2eaa
Reviewed-on: https://chromium-review.googlesource.com/895457
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#533398}
fs
[PE] Fix edge-cases in SVGGeometryElement::PathLengthScaleFactor
Update the computation of the scale factor to match what the spec [1]
has to say about a value of zero: i.e yield (near) infinity rather than
zero. Also update the case where the computed path length is zero.

[1] https://svgwg.org/svg2-draft/paths.html#PathLengthAttribute

Bug: 803127
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I6816b6bdd47cbaee90e8ad22e16d1dcf44498c7d
Reviewed-on: https://chromium-review.googlesource.com/893184
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#533003}
fs
[CI] Remove broken IsSVG*Element overload
The:

 template<typename T> bool IsSVG*Element(const T*)

overload is a remnant after RawPtr<T>, but in its current form it would
only produce infinite recursion.

Also update some nearby documentation and rewrite the const Node&
overload to use the same form of condition as the other ones.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Iecbc75423010bf26383dfd7504831bf1768a722d
Reviewed-on: https://chromium-review.googlesource.com/893270
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#533001}
bratell
There is both ::prefs and ::metrics::prefs so be explicit
When code inside metrics say "prefs" the default assumption is
that it means "::metrics::prefs", *if* the compiler knows that
::metrics::prefs exists. This code wants to use ::prefs which
failed in jumbo build experiments where the compiler knew
that ::metrics::prefs exists.

This patch makes the namespace lookup explicit by writing
::prefs instead of just prefs.

Higher level: The coding standard discourages sub namespaces with
the same name as a top level namespace so it is possible
::metrics::prefs should change name at some time.

Bug: 746957
Change-Id: Ia68378e6a3e7937f5d1b2ebcc960b9111e426fe6
Reviewed-on: https://chromium-review.googlesource.com/890455
Reviewed-by: Gayane Petrosyan <gayane@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#532934}
bratell
Gave two BindConnectorRequest methods unique names
In jumbo builds, many cc files share the same anonymous namespace
since they are compiled in the same translation unit. Then
methods that would otherwise not clash cause symbol collisions.

This patch renames two identical BindConnectorRequest methods.
A better fix may be to find a shared location but there is no
obvious shared location between media/casting and pepper/flash.

Bug: 746957
Change-Id: I80b4806140720824fefd1d0019537b6fd89683da
Reviewed-on: https://chromium-review.googlesource.com/878363
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532181}
bratell
Correct include guard in aom_context_ax_tree.h
A trailing "}" was not included in the include guard so if
included multiple time, you would get "extraneous }" errors.

Change-Id: I32582e928220ee9428acbefa9a4833d9d36d2eec
Reviewed-on: https://chromium-review.googlesource.com/888581
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#532172}
fs
Fix operator precedence in SizesCalcParser
Pop all operators with greater/equal precedence rather than just the
top-most.

Bug: 803824
Change-Id: I5f106a0e82ed98ba2510c86ed157bf4b133cb5b8
Reviewed-on: https://chromium-review.googlesource.com/888919
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Cr-Commit-Position: refs/heads/master@{#532100}
bratell
Allow error free multiple inclusion of print_messages.h
In jumbo builds, there is no careful inclusion of headers
so files that require very careful handling of when they are
included cause problems. One such file was print_messages.h
because of an undef it did of another include guard.

This patch moves the undef one layer out of print_messages.h
so that print_messages.h itself can be included many time.

Bug: 746957
Change-Id: Ie44fe5dbd4665cc487788fe7b6e42ebcd20cc50f
Reviewed-on: https://chromium-review.googlesource.com/878325
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532092}
Avoid loading v8_context_snapshot.bin if it's disabled at build-time
Don't list the context snapshot in the mojo manifest's required_files
in builds with use_v8_context_snapshot=false. Tweak existing manifest
overlay functionality to allow merging of required_files lists from
multiple manifests.

This avoids an "Ignoring invalid file v8_context_snapshot.bin" warning
on each browser stratup in use_v8_context_snapshot=false builds.

Bug: 804293
Change-Id: I0f4731811044980b7466887bedcaf115ee1fb288
Reviewed-on: https://chromium-review.googlesource.com/878371
Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Tomasz Śniatowski <tsniatowski@vewd.com>
Cr-Commit-Position: refs/heads/master@{#532088}
fs
[CI] Avoid using FillLayer::Size() in BackgroundImageGeometry
FillLayer::Size() returns a FillSize, which is made up of a copy of the
FillLayer's |size_length_| and |size_type_| fields.
This is unnecessarily costly (both in cycles and bytes/footprint), so
use the appropriate (const) accessors instead.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I678095d4d9cb8a1b44a7fad7c7e7cf25c4557225
Reviewed-on: https://chromium-review.googlesource.com/883345
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#531529}
msimonides
Add support for include_dirs to gn check.
With this change "gn check" no longer assumes all #include paths are
relative to the source root. Instead it searches for the includes by
checking each of the directories listed in include_dirs for the target.

A number of new issues have been discovered. The trivial ones have been
fixed, the larger and more complex ones have been reported and the related
parts of the project have been excluded from the default gn check run.

BUG=794926

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I39c17a7ac47dc024dd374c8891ce4911809195cb
Reviewed-on: https://chromium-review.googlesource.com/827014
Commit-Queue: Brett Wilson <brettw@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Greg Thompson <grt@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531334}
bratell
Give some kFilteredMessageClasses variables unique names
In jumbo builds multiple cc files are compiled in the same
translation unit and then they will all share the
anonymous namespace which can cause collisions if
variables have the same name. That was the case for two
kFilteredMessageClasses variables.

This renames them to:
kExtensionFilteredMessageClasses
kRenderFilteredMessageClasses

This is a followup to an equivalent change done in //content
https://chromium-review.googlesource.com/721279

Bug: 746957
Change-Id: I959600adcc81dbd6e405c25aa0272acefc0387d9
Reviewed-on: https://chromium-review.googlesource.com/878362
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#531325}
bratell
Gave two kNotificationPrefix strings unique name
In jumbo build experiments, two kNotificationPrefix variables
ended up in the same translation unit and clashed. This patch
gives those two variables unique names.

Bug: 746957
Change-Id: I200e9cb47129a1f20b8edec91ff0ff432a3c22d9
Reviewed-on: https://chromium-review.googlesource.com/874072
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Drew Wilson <atwilson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531324}
fs
[CI] Move SVG dependency graph notification into SVGElement
This moves a chunk of code pertaining to notifications of dependent
elements from a helper LayoutSVGResourceContainer.cpp, thus collection
all such operations within the realms of the SVGElement DOM.

Bug: 454767, 661598, 769774
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I18b9a982b43767f2d8f0b8f458ea93e5bdd5e786
Reviewed-on: https://chromium-review.googlesource.com/881502
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#531285}
fs
[CI] Use TransformationMatrix::Zoom in SVGElement::CalculateTransform
Replaces Scale(1 / zoom) and Scale(zoom) with Zoom(1 / zoom), and merges
the two ApplyTransform calls into one.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: If36fe60292adf4ac0a02030415e6756fc7305ea8
Reviewed-on: https://chromium-review.googlesource.com/880959
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531268}
fs
[CI] Use FloatSizeForLengthSize and FloatPointForLengthPoint some more
Some callsites that are currently using FloatValueForLength would be
better suited using the "pair" helpers (either LengthSize or
LengthPoint.) Also remove an almost-duplicate and use the one from
LengthFunctions.h instead.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ic628bfe32b07f000054a9da3bf58c3eb6894d241
Reviewed-on: https://chromium-review.googlesource.com/881341
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#531264}
bratell
Removing dead engine_ field i libjingle_xmpp
Jumbo build experiments noticed that no code ever read engine_
in XmppIqEntry in libjingle_xmpp. Normal build didn't because
"friend class XmppEngineImpl" required the compiler to know
what XmppEngineImpl does as well.

Bug: 777434
Change-Id: I661a5346617a92ee912060bebf35801dbe1a8797
Reviewed-on: https://chromium-review.googlesource.com/873371
Reviewed-by: Tommi <tommi@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531039}
bratell
Have only one function named DidStartWorker
Both content/browser/background_sync and
content/browser/service_worker had local functions named
DidStartWorker. If those ended up in the same translation unit,
which can happen in extreme jumbo configurations
(jumbo_file_merge_limit = 999999999) there would be a collision.

This renames them to unique names, just to make things easy.

Change-Id: I33dbc5ad2f5eee6a8e89e0e7624ba033774e3fdb
Reviewed-on: https://chromium-review.googlesource.com/873926
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530938}
fs
[CI] DOM-based SVG resource tracking (1/n)
This starts the transition away from tracking SVG resources based on LayoutObjects.
In the new (probably transitional) model, the resources are track via a Resource
object (inner class) on SVGTreeScopeResources. These Resource objects are
IdTargetObservers, meaning that id mutations no longer are tracked via hooks in
SVGElement. The "pending resource handling" mechanism is also moved to the Resource
objects in the form of a "pending clients" set. The old mechanism (i.e
NeedsPendingResourceHandling() and BuildPendingResourcesIfNeeded()) are no longer
needed and hence removed.

Next step will be to eliminate all remaining tracking logic from
LayoutSVGResourceContainer.

Somewhat independently, a new entry point ResourceReferenceChanged is added to
SVGResourcesCache, codifying the sequence that previously involved calls to
ClientStyleChanged and MarkForLayoutAndParentResourceInvalidation.

Bug: 454767, 661598, 769774, 784435
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I268f2e2a2a5e2e01f077a6b0a5b6270f668a2a6f
Reviewed-on: https://chromium-review.googlesource.com/689998
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#530930}
bratell
Gave two kUrlKey variables unique names
In jumbo builds, two kUrlKey constants (with the same string value)
ended up in the same translation unit and this renames them to
avoid colliding. A better fix would be to find a good common
location.

Bug: 746958
Change-Id: I7c0f0e19455c5ab070a8e0e16714f84ee205133d
Reviewed-on: https://chromium-review.googlesource.com/874071
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Marc Treib <treib@chromium.org>
Reviewed-by: Drew Wilson <atwilson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530897}
tmoniuszko
Make sure LayoutScrollbarPart margins are integers
Bug: 801123
Change-Id: I875cd6431b9ac5e9cded7ab947242d451e889d04
Reviewed-on: https://chromium-review.googlesource.com/860929
Reviewed-by: Steve Kobes <skobes@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#530885}
bratell
Move and deduplicate ProfileLoadedCallback
There were 4 identical ProfileLoadedCallback methods and a TODO
to move them somewhere. This makes it one shared method in
NotificationDisplayServiceImpl.

This change was triggered by a jumbo symbo collision between these
ProfileLoadedCallbacks and one in profiles/profile_window.cc

Bug: 746957
Change-Id: Ic30c5883d9741b6cf5829ec4fe1481e7d32655dc
Reviewed-on: https://chromium-review.googlesource.com/878222
Reviewed-by: Peter Beverloo <peter@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#530875}
bratell
Inline a duplicated kCrlfLineEnding constant
A kCrlfLineEndine constant was recently copied from
QuotedPrintable.cpp to MHTMLArchive.cpp which caused problems
in certain non default jumbo build configurations because of
the symbol clash.

MHTMLArchive.cpp already uses the literal string "\r\n" all over
the place and no other code in Blink uses a constant for CRLF
so inlining the constant both makes the code consistent and
solves the symbol clash.

An alternative would be to create a shared kCrlfĹineEnding constant,
for instance in platform/test/LineEnding.h, and use it all over
Blink.

Change-Id: I280e9f6217e68d79f764397c469f2022d0f9dc04
Reviewed-on: https://chromium-review.googlesource.com/878219
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#530842}
tmoniuszko
Add missing includes to hwnd_message_handler_delegate.h
Bug: 796644
Change-Id: I9c0b2ecc77eb72e97dec373297d2b2031ad68c82
Reviewed-on: https://chromium-review.googlesource.com/873648
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#530826}
fs
[CI] Remove LayoutObject dependency from CSS*GradientValue
Rather than passing a LayoutObject around we can pass around the
<Document, ComputedStyle> tuple that is the bits of data that is needed.

While a it, change CSSGradientValue::GetStopColors to return the vector
of Colors instead of using an out-variable.

Bug: 803224
Change-Id: Ib89bf3c0e47495886b5b715504a90b262348c6f2
Reviewed-on: https://chromium-review.googlesource.com/875925
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#530626}
fs
[CI] Share more text-clip masking code between NG and non-NG painters
Split out a PaintTextClipMask method and make that virtual instead of
PaintFillLayerTextFillBox. Move PaintFillLayerTextFillBox to
BoxPainterBase and call PaintTextClipMask for the bits that differ.

Bug: 803382
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ie44a64a6e70eac8a5a1029650fd206fc9b2852f7
Reviewed-on: https://chromium-review.googlesource.com/874074
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530573}
fs
[CI] Remove unused argument from CSSImageGeneratorValue::AddClient
An "empty" size is always passed to AddClient, so the argument can be
removed. This also allows simplifying the caching logic (since the
size is always empty, which won't create a cache entry.)

Also change the find()+insert() sequence for |clients_| to use
only insert() instead, saving a hash lookup. Simplify the SizeAndCount
constructor since it never needs any non-zero initialization.

Bug: 803224
Change-Id: I7efc7a130e8e93c1e2680116c429cb93e57d2d3f
Reviewed-on: https://chromium-review.googlesource.com/876086
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#530547}
bratell
Inlined a GetLocalState() method
The GetLocalState() method in cryptauth clashes with another
GetLocalState() in jumbo builds, and since there is only one
caller off this one, it might as well be inlined.

Bug: 746957
Change-Id: I63e33c5c94930cd0dfeaa27c1421ce81c9865feb
Reviewed-on: https://chromium-review.googlesource.com/873922
Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#530357}
bratell
Deduplicated a usb helper function, GetBrowser()
Two files both used identical helper functions, GetBrowser(). This
patch moves that function to a common utility file so that
there is only one.

This was noticed while doing jumbo compilation experiments, where
the double GetBrowser() ended up in the same translation unit.

Bug: 746957
Change-Id: I8ceaab0d4bd08395821b296dbd1bbda13c1aef78
Reviewed-on: https://chromium-review.googlesource.com/873921
Reviewed-by: Jun Cai <juncai@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#530344}
fs
[CI] Rework size-based caching logic in CSSImageGeneratorValue
Rather than (ab)using AddClient/RemoveClient when updating the
cache for a client, move the actual cache to a helper class
(GeneratedImageCache) and then call the appropriate methods on
that object instead.

Bug: 803224
Change-Id: Ifbb3edf8f25dbeef2f9f1fdd9840a0b32991e274
Reviewed-on: https://chromium-review.googlesource.com/873875
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#530261}
fs
[PE] Fix background-blend-mode interaction background-clip: text
When applying background-blend-mode to a background layer that uses
"background-clip: text", perform the blending after the background has
been clipped by the text.

Bug: 803382
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ie834b1503ec90341aec846f4d2dfc8c94732fe12
Reviewed-on: https://chromium-review.googlesource.com/873636
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#530232}
bratell
Avoid "using base::Time;" because of X11 Time typedef
if any X11 header has been included, there is an unavoidable
Time typedef in global scope. When there is also a
"using base::Time;" both end up in the global scope which
cause compilation issues. Specifically this happened in
jumbo build experiments.

Bug: 803406
Change-Id: Ib7cd99b98552a209d1432ecb4ee060d16c9da39f
Reviewed-on: https://chromium-review.googlesource.com/873976
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Michael Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530215}
bratell
Avoid "using base::Time;" since Time is an X11 typedef
X11 headers have an unavoidable typedef that creates the
type ::Time. "using base::Time" in the global scope will
clash with that one if X11 headers are included in the
translation unit.

A few files in the chrome/browser target has "using base::Time"
and those cause issues if you try to use jumbo (unity) compilation
for chrome/browser. This patch changes the code to be more
explicit.

Bug: 746957
Change-Id: I619c589071a01302086d81fdce35e0c779b121a0
Reviewed-on: https://chromium-review.googlesource.com/866838
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#530109}
bratell
Gave two OnFetchComplete methods more descriptive names
When experimenting with jumbo (unity) builds in Chromium
two overloaded OnFetchComplete ended up in the same
translation unit and then Bind() could not determine which
one to use.

This patch gives two OnFetchComplete methods more unique and
descriptive names: OnCookieFetchComplete and
OnAppCacheInfoFetchComplete.

Bug: 746957
Change-Id: Ie165f6dd8365257181ba7f48b9b5809043ec25f3
Reviewed-on: https://chromium-review.googlesource.com/860462
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529797}
bratell
Removed "using namespace" from a password_manager file
"using namespace" is not allowed by the coding style, and also
it is not compatible with jumbo builds. This patch removes
using namespace and gives the three symbols namespace prefixes
instead.

Bug: 746957
Change-Id: Ibf3810287deb370ad1ac90968ba0e24020f681fb
Reviewed-on: https://chromium-review.googlesource.com/868334
Reviewed-by: Maxim Kolosovskiy <kolos@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529757}
bratell
Fix erroneous DictionaryValue forward declaration
Claiming that there is a ::DictionaryValue is not true and
it clashes with other code doing using base::DictionaryValue.

Fix is to do the forward decalaration in the right namespace.

Bug: 746957
Change-Id: I777dd92baaec876cd2085911e00a96c74efe58f2
Reviewed-on: https://chromium-review.googlesource.com/866843
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Matt Giuca <mgiuca@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529716}
bratell
Gave kUploadContentType and kCrashMultipartBoundary unique names
crash_service_uploader.cc and webrtc_log_uploader.cc are similar
and use variables named the same. If those files end up in the
same translation unit in a jumbo build, they will clash and break
the compilation.

Since there is no good place to share the two strings, this patch
gives them unique names.

Bug: 746957
Change-Id: Ic349606814cff229529b135f3c1da11ac2279158
Reviewed-on: https://chromium-review.googlesource.com/867918
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529710}
bratell
Gave three kDefaultUpdatePeriod variables unique name
This is a preparatory patch for adding jumbo support to
chrome/browser. If more than one kDefaultUpdatePeriod variable
ended up in the same translation unit, they would clash and
cause compilation errors.

Bug: 746957
Change-Id: Iff2579b15fa00648823a4a3bf890b40252856028
Reviewed-on: https://chromium-review.googlesource.com/868155
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529706}
bratell
Replacing custom http status constants with net::HTTP_*
A couple of places defined their own kHttpResponseOk which
is a bit unnecessary when there already is a net::HTTP_OK which
the rest of the code uses.

This was noticed in jumbo build experiments because two
kHttpResponseOk ended up in the same translation unit and caused
compilation errors.

Bug: 746957
Change-Id: Ia5cf32636bbcf8e0e1d7b8e1c161c5b4a5cdcbdf
Reviewed-on: https://chromium-review.googlesource.com/868156
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529705}
bratell
Give each ShutdownNotifierFactory class its own class name
In jumbo builds many cc files are compiled in the same translation
unit and then classes with the same name, that are normally
shielded from each other, can start clashing and causing
compilation errors.

One observation is that there are many ShutdownNotifier classes and
this patch gives each a long and unique name following the typical
naming standard.

Bug: 746957
Change-Id: I2bcca0ac41685fdf78c491ed969b91669e520772
Reviewed-on: https://chromium-review.googlesource.com/867919
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529504}
bratell
Remove erroneous UsbDevice forward declaration
There is no ::UsbDevice so forward declaring such a class confused
other code trying to import ::device::UsbDevice into the global
scope with using device::UsbDevice. This happened in jumbo build
experiments.

Bug: 746957
Change-Id: If1073d24b9e4c302b0873e91df386039c526c49f
Reviewed-on: https://chromium-review.googlesource.com/868331
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529429}
bratell
Give two GetAllOriginsInfoCallback methods unique names
In jumbo build experiments the two very similar files
browsing_data_cache_storage_helper.cc and
browsing_data_service_worker_helper.cc were compiled in the same
translation unit and then the methods with the same name
collided.

This gives the methods unique names to avoid that.

Bug: 746957
Change-Id: I261c61fb178178c91d3a6aac8800e21510038ed8
Reviewed-on: https://chromium-review.googlesource.com/868333
Reviewed-by: Christian Dullweber <dullweber@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529426}
fs
[PE] Fix offset computation for multi-line flow box 'background-clip: text'
Since the background of a flow box is painted in a 'sliced' fashion, the
paint rect/offset will be offset based on the "virtual" position of the
line box relative to the first line box in the flow.
When painting text for 'background-clip: text', adjust with this offset.

Bug: 658326
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia12c3d65025199fbcdeb1df647df08174ae88c24
Reviewed-on: https://chromium-review.googlesource.com/868151
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529425}
fs
Fix offset-anchor alignment for offset-path
The anchor point should align with the point on the path/shape/...

Also avoid recomputing transform-origin in ApplyMotionPathTransform
since the function takes origin_x/y as arguments, so those can be used
rather than recomputing the value(s).

Change-Id: I3c173cdc3d307057a37564a37b0e87044dbeaf9d
Reviewed-on: https://chromium-review.googlesource.com/808885
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#529282}
bratell
Deduplicate IsScaleAndIntegerTranslate
There are two identical implementations iof IsScaleAndIntegerTranslate() in
components/viz/service/display. One in skia_renderer.cc and one in
software_renderer.cc.

When building components/viz with jumbo (not yet on master) those end
up in the same translation unit and cause compilation errors.

This CL deduplicates the functions and puts it in a shared utility file,
renderer_utils.cc.

Bug: 801580
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: Ifcc39032bffcfcb752cee60719689d94dfbd2df6
Reviewed-on: https://chromium-review.googlesource.com/864643
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#529245}
bratell
Restore the UNICODE macro after third_party/ced has undefined it
third_party/ced (more specifically
third_party/ced/src/util/encodings/encodings.h) undefs UNICODE
which is a central define in Windows. It controls whether
Windows SDK headers should have 2 byte or 1 byte strings and must
always be set in a modern application.

In Jumbo builds this include of the dangerous ced header happen
in the same translation unit as the include of Windows headers
which will then fail to do the right thing.

Restoring the UNICODE define is a workaround.

This change is to make every include of the header do the same
thing. There is not currently any known problem from this instance of
the include.

Change-Id: Ic4a5386e61390533061e0021dddfb0fc4dad8e7e
Reviewed-on: https://chromium-review.googlesource.com/862402
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#528919}
bratell
Restore the UNICODE macro after third_party/ced has undefined it
third_party/ced (more specifically
third_party/ced/src/util/encodings/encodings.h) undefs UNICODE
which is a central define in Windows. It controls whether
Windows SDK headers should have 2 byte or 1 byte strings and must
always be set in a modern application.

In Jumbo builds this include of the dangerous ced header happen
in the same translation unit as the include of Windows headers
which will then fail to do the right thing.

Restoring the UNICODE define is a workaround.

Bug: 775547
Change-Id: I7323cf6f9fff3efe2780c3125b9b099a8f9faa09
Reviewed-on: https://chromium-review.googlesource.com/861883
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#528803}
fs
[PE] Fix hit-test of zoomed <clipPath> 'clip-path'
<clipPath> geometry is not subjected to zoom, so the hit-test location
and reference box has to be adjusted to make the coordinate spaces
match.

Bug: 800605
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ic03e24f0289a5019ea722e3931f6217d918a1b56
Reviewed-on: https://chromium-review.googlesource.com/859784
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#528743}
jl
Share implementations of `GetPerContextData()`
There were some largely duplicated functions that fetched per-context
data objects, optionally creating them if missing. Replace them with a
template function.

This also fixes the issue in jumbo/unity builds that the different
GetPerContextData() functions collided.

Change-Id: I04197a01aa647a07c026eca1ba9c158742fedf3e
Reviewed-on: https://chromium-review.googlesource.com/850115
Commit-Queue: Jens Widell <jl@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528739}
jl
Rename conflicting `CallbackHelper` functions
They conflict in jumbo/unity builds.

Change-Id: I29da5bde4bb2d99b6fa93aaf163c79d160b30c69
Reviewed-on: https://chromium-review.googlesource.com/860650
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#528736}
bratell
Don't compile unused multiprocess_test.cc for ios and nacl
The file multiprocess_test.cc was being compiled for ios and nacl
and then, normally, discarded by the linker since nothing in the
object file was referenced. In jumbo builds the unused code
piggy-backed on used code and then the linker noticed that
multiprocess_test.cc referenced non-existing symbols and linking
failed.

Change-Id: Id14e125d1f62fc0cefeb919ad63e8457bb680407
Reviewed-on: https://chromium-review.googlesource.com/860064
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#528713}
bratell
Include tcmalloc's config before tcmalloc.h
Certain things in tcmalloc.h depend on tcmalloc's config.h file,
for instance whether struct mallinfo exist or not. Depending
on how the functions are used, it may or may not work correctly
without including config.h, but to be safe, always include it.

This was an issue in jumbo builds if base/process/memory_linux.cc
and base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc
were compiled in the same translation unit. The wrong includes from
memory_linux.cc caused the other file to fail to compile.

Bug: 775547
Change-Id: Iab9b8172281c55b8cbfbc8c21a79f95d2bae5847
Reviewed-on: https://chromium-review.googlesource.com/860646
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#528704}
fs
[CI] Add intrinsic-dimensions-changed notifier to FrameOwner
This CL adds a notifier callback that is called whenever a property or
attribute that may affect the intrinsic dimensions of an <svg> is
changed - this includes 'width', 'height' and 'viewBox' as well as
'writing-mode' and font properties.
At present this callback doesn't do anything, but is expected to
eventually schedule a layout on the embedding object.

Bug: 442939, 798974
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I761ccaaec6b5dec20c2bfa4b5f06cf16d6c7eb24
Reviewed-on: https://chromium-review.googlesource.com/860932
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528689}
bratell
Give two PrefixTitle functions more unique names
When experimenting with jumbo builds (Chromium unity builds) in
chrome, the compiler ended up with two PrefixTitle in the same
translation unit. By using more unique names, that is not a
problem anymore.

The methods are similar and there are other methods building
titles that share similar patterns but there does not seem
to be any useful refactoring that reduces the number of methods.

Bug: 746957
Change-Id: I82f3ce3dd88ef024bb935d09895befda3e5bf76b
Reviewed-on: https://chromium-review.googlesource.com/860461
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#528688}
amlynarczyk
Cleanup extensions unittests to use constant for extensions settings preference
Bug: 
Change-Id: I00d7ff48486400e111150cad2b654dd2700a90b6
Reviewed-on: https://chromium-review.googlesource.com/861625
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Finnur Thorarinsson <finnur@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528620}
fs
[CI] Refactor replaced element nested intrinsic sizing info extraction
This moves the access to a nested layout contexts (either a frame
embedded via LayoutEmbeddedObject or an SVG image via LayoutImage)
LayoutReplaced (LayoutSVGRoot) from LayoutReplaced to the relevant
subclasses (LayoutEmbeddedObject or LayoutImage.) The goal with this is
to eliminate the use of EmbeddedReplacedContent in LayoutReplaced.

Rather than accessing EmbeddedReplacedContent() and calling
ComputeIntrinsicSizingInfo() on the returned LayoutReplaced, a new
method GetNestedIntrinsicSizingInfo is added instead, and implemented in
the relevant subclasses. In LayoutImage the EmbeddedReplacedContent()
method is kept around (for now), but in LayoutEmbeddedObject it's
removed, and instead rerouted via LocalFrameView.

NeedsPreferredWidthsRecalculation is moved from LayoutEmbeddedContent to
its subclass LayoutEmbeddedObject since this is the only subclass that
can modify its behavior - i.e can represent content that may can affect
the size of its embedder.

The IntrinsicSizingInfo struct is moved out from being an inner class of
LayoutReplaced.

Bug: 798974
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ia617a40d631e6b2e6bb2c9f39a1799766d7f58d6
Reviewed-on: https://chromium-review.googlesource.com/860140
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528524}
bratell
Avoid exporting read_buf renaming from zlib
zlib.h includes a macro that renames read_buf->Cr_z_read_buf. Since
read_buf is a common name in other parts of the code, it causes
some random confusion depending on whether zlib.h has been
included or not.

The renaming macro is a side effect of the 0001-simd.patch that
exposes an internal read_buf method to other files in zlib. This
patch renames read_buf as it is exposed so that it has the less
common name deflate_read_buf.

Bug: 799448
Change-Id: Icdc4eba973891dfd28d82017415048eded62d577
Reviewed-on: https://chromium-review.googlesource.com/852257
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528512}
bratell
Changed g_instance and g_factory to more unique names
Jumbo, the Chromium unity build system, combines many cc files
in the same translation unity. Those cc files will share the
same anonymous namespace so there can be clashes if names
are not unique enough.

In //chrome there is a lot of variables named g_instance or
similar and in jumbo builds some of them collide. This patch
gives all of the g_instance* variables more specific names, in
a very similar fashion to what was done in //content.

Bug: 746957
Change-Id: Idb2c64b2289aa0487fd62fd140498af909986079
Reviewed-on: https://chromium-review.googlesource.com/846769
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528489}
bratell
Fixing include guards for MetricsHelper include files
Newly added file had no include guards which made it be included
many times in jumbo builds, breaking those builds and two other
header files had the same include guard so you could only include
one of them.

TBR=altimin@chromium.org

Change-Id: I6dc277b6c3a1129a640fd15d2743f875a021925a
Reviewed-on: https://chromium-review.googlesource.com/860038
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#528410}
fs
[CI] Remove unused arguments to CSSImageGeneratorValue::GetImage
The Document and ComputedStyle are not used. (This also makes it look
less like the other GetImage method on this object.)

Change-Id: I920497b6c835223bcc558669f1014d832787da9c
Reviewed-on: https://chromium-review.googlesource.com/860100
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528400}
bratell
Changed an html code constant kDefaultWidth to have a unique name
In certain jumbo configurations HTMLCanvasElement.cpp and
track/vtt/VTTRegion.cpp end up in the same translation unit
and then the two different kDefaultWidth clash.

This patch gives kDefaultWidth more specific names and
changes the constants to be constexpr and be in an
anonymous namespace to better match the current coding style.

Change-Id: I116171382d172ff00c20eec13210494393190fc9
Reviewed-on: https://chromium-review.googlesource.com/859781
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#528323}
bratell
Deduplicate two dom helper methods.
There were two ShadowFor and two CanBeDistributedToV0InsertionPoint
methods which clashed in certain jumbo build configurations
(when FlatTreeTraversal.cpp and flag_tree_traversal_ng.cc ended
up in the same translation unit).

If this knowledge is widely needed, maybe the methods should move
to Node, but this just makes the old code use the method in the
new code.

Change-Id: Ia26f6fa2631e72ddf5bfdcb5150486025bb1d4a8
Reviewed-on: https://chromium-review.googlesource.com/859759
Reviewed-by: Hayato Ito <hayato@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#528309}
bratell
Deduplicate printing HoldRefCallback helper
Both print_job.cc and print_job_worker.cc wanted a helper
function for certain callbacks. Rather than having two of them,
let us have one.

Bug: 746957
Change-Id: If770b8f18479847489d9c2a28ba1b1d75bdc11e1
Reviewed-on: https://chromium-review.googlesource.com/857501
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528083}
jl
Use ':' directly instead of declaring a `kColon` constant
In jumbo/unity builds the constant declarations conflicts with an identical
declaration in socket_permission_entry.cc.

Change-Id: Ib5d2770caa327119407f618073ac2316bc1a5a9c
Reviewed-on: https://chromium-review.googlesource.com/849213
Commit-Queue: Jens Widell <jl@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527981}
bratell
Correcting include guard for safe_browsing/features.h
Change-Id: Ie3bbe6779eeb321c72b76a255549afd10d9eb460
Reviewed-on: https://chromium-review.googlesource.com/853869
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#527955}
bratell
Deduplicate a CreateExtensionPrefStore helper function
Noticed while experimenting with jumbo in chrome/browser. Symbols
that are duplicated cause compilation problems if they end up
in the same translation unit.

Bug: 746957
Change-Id: I07a5bcb690026359e7d74be81a0a26ce9f40958b
Reviewed-on: https://chromium-review.googlesource.com/846747
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527631}
bratell
Deduplicate some icon handling code and symbols in task_manager
Jumbo build experiments handled the multiple GetDefaultIcon
and g_default_icon pointers badly and since the code was more
or less identucal, this patch moves the code to a shared location
and leaves just the icon constant and the icon cache in
each task_manager Task class.

Bug: 746957
Change-Id: Ib7dc221113b29b5e6d17c22539ccb47da1b6a5ce
Reviewed-on: https://chromium-review.googlesource.com/852216
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527518}
fs
Clean up includes in Style*Image.cpp
Get rid of includes of LayoutObject.h and StyleResolver.h, replacing
them with something more appropriate (layering-wise for the former.)

Change-Id: I759c371d557d008bdb385fc3bdcfa440bff33c9d
Reviewed-on: https://chromium-review.googlesource.com/852493
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#527374}
jl
Rename conflicting `g_instance` variables
They conflict in jumbo/unity builds.

Change-Id: Ia1a1bb20873e4695e742ab485027a5185415d175
Reviewed-on: https://chromium-review.googlesource.com/849932
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#527966}
bratell
Give each kPublicSHA256 variable a unique name
This patch is preparing for jumbo build support in
//chrome/browser. Since each component has its own
kPublicSHA256 variable with its own public key, and those
variables clash in jumbo builds where all installers are combined
in a single translation unit, they are here given unique and
descriptive names.

Bug: 746957
Change-Id: I7fe1c927d58fd323e8a80897c45d639e24f8a38d
Reviewed-on: https://chromium-review.googlesource.com/850558
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#527287}
jl
Improve jumbo chunk generation code
The main improvement is that source files with unhandled extensions
other than .h, for example .json and .idl, are not counted towards the
merge limit, and thus can't lead to too many chunks being generated.

By restructuring, the code also iterates the source file list once
instead of twice, and calls get_path_info() once per source file instead
of twice.

Change-Id: I130c815c84fff08b6ad2d6f36434140efbeb2d29
Reviewed-on: https://chromium-review.googlesource.com/850397
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#527099}
jl
Use a fully qualified name to access the `::switches` namespace
In jumbo/unity builds, `::extensions::switches` comes into scope, which
changes the meaning of the "relative" `switches::` qualifier used inside
the `extensions` namespace.

Change-Id: I49757b132e51bb4207a6fac4dac1e8d2237d5801
Reviewed-on: https://chromium-review.googlesource.com/849212
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#527967}
bratell
Renamed one of the HeaderFlattener classes
There are two HeaderFlattener classes that do similar things
but not identical things. If they end up in the same
translation unit (can happen in some extreme jumbo configurations)
there will be a clash so this patch renames one of them to
HeaderToString.

Bug: 746953
Change-Id: I1fa37f86bcf13487fd8b18da766f440b3ad85545
Reviewed-on: https://chromium-review.googlesource.com/848915
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527078}
jl
Drop some jumbo-incompatible namespace aliases
Many source files declare a namespace alias `errors` for a specific
namespace containing error constants. This practice is incompatible with
jumbo/unity builds, when different namespaces are aliased.

The by far most common namespace to alias is `manifest_errors`. These
aliases are kept, since they are not a problem as long as there are no
other conflicting aliases. Other aliases are simply dropped, and the full
namespace is used instead.

Change-Id: Ie90f7e7a8f8be52b811b0b1e9c9839970669d96c
Reviewed-on: https://chromium-review.googlesource.com/848918
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#526952}
bratell
Rename GetRestrictedCookieManager for more uniqueness
There are two overloaded GetRestrictedCookieManager functions in
different files which in certain non-standard jumbo configurations
end up in the same translation unit. When that happens,
base::Bind doesn't know which one to use and there is a compilation
error.

This patch renames one of them
GetRestrictedCookieManagerForWorker so that there will never be
any confusion.

Bug: 746953
Change-Id: I7b3e6ba32aed44e575ee108111871e45b5e2689c
Reviewed-on: https://chromium-review.googlesource.com/847010
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Sam McNally <sammc@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526754}
bratell
Avoid importing base::Time into the global scope because X11
base::Time in the global scope collides with X11 headers which
have a global typedef of Time to int. This patch moves the code so
that the symbols are imported into the local namespace (content)
instead.

X11 headers appear in some non-standard jumbo configurations
(extremely large jumbo chunks) but could happen at any time
otherwise as well.

Bug: 746953
Change-Id: Iadc929ca4eb7d556490d58c791bbe8b2ef119726
Reviewed-on: https://chromium-review.googlesource.com/848916
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526731}
bratell
Avoid collision between two ScriptExecutionCallbackHelper
ScriptExecutionCallbackHelper is the name of two different
helper functions which in some non-standard jumbo configurations
(huuuge jumbo chunks) end up in the same translation unit. This
patch changes the scope of one of the classes to not clash.

Bug: 745732
Change-Id: Ifed9bcd247c43afb110c9b008062383a2a7d74df
Reviewed-on: https://chromium-review.googlesource.com/848835
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526690}
bratell
Changed some test code to avoid jumbo problems
In certain non-standard jumbo configurations (very large
jumbo units) there were some symbol clashes that do not
appear in normal jumbo builds. This resolves them by
renaming one test class to better match the test, and by
wrapping the other test in a custom namespace as done in other
places in blink tests.

Bug: 745732
Change-Id: Ic0388e9abd19b24366133c577059f59ef63a6b6b
Reviewed-on: https://chromium-review.googlesource.com/847009
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526543}
bratell
Hide DeviceMode from X11 headers
X11 headers create a lot of macros using fairly normal names which
causes collisions in code that was written without X11 headers in
mind.

DeviceMode is also a type in components/policy and if that and
X11 includes end up in the same translation unit, there will be
compilation errors.

This was encountered in non-standard jumbo configurations and will
not affect currently supported code.

Bug: 782184
Change-Id: I84f9874d2858fc60c7e7c0e017d028dc8b710661
Reviewed-on: https://chromium-review.googlesource.com/847577
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526524}
bratell
Rename one set of kDataPrefix/kMetadataPrefix to make them unique
There are two sets of kDataPrefix and kMetadataPrefix in
components/sync and they have different values. In non-standard
jumbo configurations (much larger jumbo chunks than normal) those
will end up in the same translation unit and clash.

This renames one set of constants, leaving the other one as is
since its name already matches the use well.

Change-Id: I3640f1c1e7bc599c7d20317cd60d2f1ac7d90b15
Reviewed-on: https://chromium-review.googlesource.com/847593
Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526522}
bratell
Rename ChildAt and Parent to get unique names.
To help jumbo compilations, this code has already renamed
Children -> LayerChildren so this follows the same pattern
to help some other jumbo configurations where the plurality
of ChildAt and Parent methods caused problems.

Bug: 786926
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I086022931622b1bb670bc1313987ff69182c0990
Reviewed-on: https://chromium-review.googlesource.com/847473
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526521}
bratell
Add include guards to highcontrast_classifier.h
Several files include highcontrast_classifier.h so jumbo builds
got duplicate instances of everything in the header file.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ibfe824f52d4b1f6046b75e4621f662ce0bf1d0c3
Reviewed-on: https://chromium-review.googlesource.com/847572
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526470}
bratell
Removed dead GetImageInfo() function noticed in jumbo builds
There are two identical GetImageInfo functions in the blink/html
code and only one of them is used. This patch deletes the unused
one.

This was noticed in a non-standard jumbo configuration because both
instances ended up in the same translation unit.

Change-Id: I4b0959fcc1bf9a0902a6d8574023e9b59de60375
Reviewed-on: https://chromium-review.googlesource.com/847474
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526467}
bratell
Undefine Win32 macros IsMinimized, IsRestored, IsMaximized
Names used in the BaseWindow class are also windows.h macros.
That the names are the same as in the Windows API is
no coincidence but for now we don't want the Windows macros
to interfere so we undef them.

There are already undefs in widgets.h but depending on the order
of includes they might not be effective.

Bug: 773275
Change-Id: I2be80c8a3f64f4741163def9c27e386c95753a40
Reviewed-on: https://chromium-review.googlesource.com/845582
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526694}
bratell
Make timeit.bat handle some non-US locales better
timeit.bat assumed the decimal separator was a period. Sometimes
it's a comma.

Change-Id: Id8d04f980907dda0d80af96be8568b1704b61399
Reviewed-on: https://chromium-review.googlesource.com/844322
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526285}
bratell
Be explicit about base::Time to not mix it up with X11 Time.
There is an X11 typedef for a type called ::Time so if becomes
complicated if code imports another type named Time into the
global namespace with "using base::Time". Better is to just
write base::Time whenever you mean base::Time.

This was an issue that hit the jumbo project, implementing
unity builds for Chromium.

Bug: 773275
Change-Id: Ic06f701eba210ef43899d0dc47ba5c891cb71866
Reviewed-on: https://chromium-review.googlesource.com/844695
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526360}
bratell
Move kWebURLsWithTitlesPboardType from global scope in ui/base
There is a kWebURLsWithTitlesPboardType in
third_party/mozilla/NSPasteBoard+Utils.h which causes confusion
with the kWebURLsWithTitlesPboardType in ui/base. This code
moves the definition to a tighter scope which makes symbol lookup
obvious to the compiler.

This caused issues with jumbo builds. Most likely the Mozilla
header doesn't get included in the same translation unit as
clipboard_util_mac.mm in non-jumbo builds.

Bug: 773275
Change-Id: I77e9cc6c7a3beaa600cb620bddc000b1846ab985
Reviewed-on: https://chromium-review.googlesource.com/844697
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526287}
bratell
Don't compile input_method_auralinux.cc in chromeos.
ChromeOS has an input_method_chromeos.cc which contains
for instance GetEngine(). With input_method_auralinux.cc
there will be two GetEngine() which is one too many.

Seen in jumbo builds where code ends up in the same translation
unit so that the compiler notices things like this.

Bug: 773275
Change-Id: I64598e346e0dcbbac5348bd6ec9d903d2041d298
Reviewed-on: https://chromium-review.googlesource.com/844676
Reviewed-by: Shu Chen <shuchen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526284}
bratell
Remove non-ios code from ui/base's ios build
Touch code isn't used by ios so should not be compiled.

In jumbo builds some touch symbols but not others ended up
in an object file and then the ios linker got unhappy. This
used to work by "luck" (i.e. if not a single symbol is used in
an object file, then it doesn't matter if that object file
refers to non-existing symbols).

Bug: 773275
Change-Id: I08ea7005665a62728aeac1bf7cce16bca8be8402
Reviewed-on: https://chromium-review.googlesource.com/844714
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526228}
fs
Remove SVGElementRareData::owner_
This appears to have been dead/unused since the complicated weak
handling for SVGCursorElement was removed in
https://codereview.chromium.org/2522443002 (together with
SVGCursorElement itself.)

Simplify SVGElement::EnsureSVGRareData a little while at it.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I0e29e2830bc20fd595d41d72eb9c3ec23c2df2ce
Reviewed-on: https://chromium-review.googlesource.com/843023
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#526071}
bratell
Add missing include guard to test_overscroll_delegate.h
Change-Id: I3a9785519bfe9d6b10972bbe7b70a3c9c3f5fdbc
Reviewed-on: https://chromium-review.googlesource.com/842803
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526029}
mpichlinski
Allow delegate to handle ContentMainRunner fatal initialization error.
Report ContentMainRunner fatal error during initialization to the delegate,
which may gracefuly exit with some message instead crashing.
Default behavior is CHECK(false).

Bug: 792839
Change-Id: I1e7c85c58f1a008e8818e2efb00dbba7f4774826
Reviewed-on: https://chromium-review.googlesource.com/815054
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527056}
bratell
Giving two different kDefaultTransationDurationMs unique names
The animation code has two different
kDefaultTransationDurationMs depending on what code is used.
This caused issues with jumbo builds where one of them
shadowed the other one (scary). This renames them so that they
have unique names, and also moves them into the same scope to
keep things consistent.

Bug: 773275
Change-Id: I77b5ab72e48a9c967105d8eb0b2610cfbd6f0b40
Reviewed-on: https://chromium-review.googlesource.com/841063
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#526028}
bratell
Deduplicate kInchInMm so that they don't clash in jumbo builds
There is one kInchInMm in the anonymous namespace in
fake_display_snapshot.cc and one in
chromeos/display_change_observer.cc. In jumbo builds they
end up in the same translation unit and have the same
anonymous namespace.

Since the constant is needed in more than one place, an easy change
is to move it to display_util.h.

Bug: 773275
Change-Id: I579a587786ea3fac5dd6dde85f51bd5ae1a62e69
Reviewed-on: https://chromium-review.googlesource.com/840024
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dan Erat <derat@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525814}
fs
[PE] Avoid integer overflows in EnclosingIntRect(const FloatRect&)
The size computation could potentially overflow, yielding an "empty"
result, which could have different consequences depending on the user.
In CullRect::UpdateCullRect for instance, the MapRect call could make
the cull rectangle appear empty causing visible elements to be culled.

Rather than using integers for the computing the enclosing rect, use
floats, and then cast that to an IntRect at the end. (The
IntRect(const FloatRect&) constructor clamps the input using clampTo.)

Adjust EnclosedIntRect similarly because it shares the same deficiency.

Bug: 793676
Change-Id: I63bcff3747dea7f29dac39a05d9cf179b0770030
Reviewed-on: https://chromium-review.googlesource.com/839521
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525812}
bratell
Renamed two g_lock in ui/gfx to have more unique names
Recently a second g_lock joined the first g_lock in ui/gfx and
then they clashed in jumbo builds. This patch renames them
to match their use.

Bug: 773275
Change-Id: I9b13a8f225d0ee22aca621fa32d4c6872429af0a
Reviewed-on: https://chromium-review.googlesource.com/839765
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#525771}
bratell
Give two different EnumMonitorCallback functions unique names
There are two classes in ui::display that enumerate monitors
to get information about them. They both used a local
callback named "EnumMonitorCallback" and those two functions
clashed in jumbo builds where they shared the same translation
unit.

Bug: 773275
Change-Id: Ibb0889705d28c0169a210bc3e83411adb66216c7
Reviewed-on: https://chromium-review.googlesource.com/836560
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525672}
bratell
Rename one of two DisplayInfoLists in ui/display
There is a display::DisplayInfoList in
display_manager.h so creating another one by the same name
inside display is confusing. At least that is what the
compiler thinks in the jumbo project where they end up
being known in the same translation unit.

Bug: 773275
Change-Id: I545cc9e8a64cbf3e61435da49c50cd72e360c61e
Reviewed-on: https://chromium-review.googlesource.com/837761
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#525512}
bratell
Use differently named functions for each jpeg codec.
In ChromeOS there are two JPEG decoders. They have the same API
structure so the helper functions look the same. Unfortunately
they also have the same names so they clash in jumbo builds.

The methods are also unfortunately not reusable since they work
on different types (one work on libjpeg_turbo types, the other
on the IJG jpeg decoder types).

This patch adds the Ijg prefix to the types and functions used by
the "robust" codec.

Bug: 773275
Change-Id: I73b44c019ca72adbc3db04011c61550a0034ec85
Reviewed-on: https://chromium-review.googlesource.com/836899
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525447}
bratell
Rename one of the two NOTIFY_OBSERVERS macros
There was still two NOTIFY_OBSERVERS macros and in jumbo builds
they triggered an error about macros being redeclared. This
patch renames the macro that implements observer handling
methods for Windows from NOTIFY_OBSERVERS to NOTIFY_OBSERVERS_METHOD.

Bug: 773275
Change-Id: Ie58fd1793b144b694a0a34bfa552569db3f8a200
Reviewed-on: https://chromium-review.googlesource.com/836611
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#525333}
bratell
Use large (non-goma) jumbo chunks for Jumbo Linux x64
When you build with goma jumbo uses smaller units (up to
8 files per jumbo chunk). This is to be more parallel and
take advantage of the -j 1000 hardware.

Unfortunately many problems are only detected if you combine
many files in a unit so default goma builds would not find
those problems.

This patch changes one of the three Jumbo fyi builders to use
jumbo_file_merge_limit=50 which is the normal value for
non-goma jumbo builds. This way we should notice more problems
through the fyi builders.

Change-Id: Id7d49148e778a92648a1871d15dbf1c8a958af7e
Reviewed-on: https://chromium-review.googlesource.com/832435
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524990}
jl
Rename conflicting `g_test_observer` variables
Two source files declared `g_test_observer` variables in the anonymous
namespace. In jumbo/unity builds, these conflict and cause compilation
errors. Give them more unique names to avoid the collision.

Change-Id: I904c5409039a9599480ca3a8fd7bbed4f48db1f6
Reviewed-on: https://chromium-review.googlesource.com/829173
Commit-Queue: Jens Widell <jl@opera.com>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524796}
jl
Drop `using namespace X` directives
They are not allowed by the Google C++ coding style.

Also, in jumbo/unity builds where the source files are included into a
larger translation unit, clang treats the them as header files, and warns
about such directives in the global namespace (-Wheader-hygiene).

Change-Id: I3079677651430f1fbeff2a79101aa7314a484488
Reviewed-on: https://chromium-review.googlesource.com/829135
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#524791}
bratell
Renaming one of the NOTIFY_OBSERVERS macros
ui/events/devices have two NOTIFY_OBSERVERS macros, similar but
not identical. This renames one of them NOTIFY_ANDROID_OBSERVERS
to avoid clashes in jumbo builds where they ended up in the
same translation unit.

Bug: 773275
Change-Id: I626bf809be342993bc9f455aab977e4918538446
Reviewed-on: https://chromium-review.googlesource.com/824882
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524752}
bratell
Deduplicated a kAnimationStartOrAfterHideOpacity constant
Both the floating keyboard container and the full width
keyboard container need kAnimationStartOrAfterHideOpacity
so instead of having two of them, this patch moves it to
container_behavior.h.

Bug: 773275
Change-Id: I1196570016881bd58e9f3c73f33f3a674d8fc607
Reviewed-on: https://chromium-review.googlesource.com/824274
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524746}
fs
[CI] Add SVGLengthContext::ResolveLengthPair helper
With geometric presentation attributes it's quite common to need to
resolve an <x, y> pair of Lengths to produce a point or a size.
Add a helper ResolveLengthPair() that accepts a pair of Lengths and
return a FloatPoint. Except for a reduction in LoC, it also amortizes
the cost of determining a viewport when percentages are used.

Use the new helper for 'cx' / 'cy' and 'rx' / 'ry' on <ellipse>,
'cx' / 'cy' on <circle>, 'x' / 'y', 'width' / 'height' and 'rx' / 'ry'
on <rect>, 'x' / 'y' and 'width' / 'height' on <image> as well as
'x' / 'y' on <use>.

Since this means using FloatPoint/FloatSize to a larger degree than
before, use the abilities (operators et.c) of these a bit more where
possible.

Bug: 400725
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I15f5c17190b060a7e8312d5e3e124846301804b9
Reviewed-on: https://chromium-review.googlesource.com/832606
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#524740}
fs
[PE] Invalidate <use> instances even when mutating from the parser
When a layout is triggered when the parser is interrupted, an instance
tree can be built for a <use> that references a subtree that contains
the insertion point of the parser. This <use> instance (or instances)
would then not be invalidated when the parsing resumed.

Invalidate instances of an element when its children changes even when
the mutation originates from the parser. (This condition was added in
3c2310f2e9e0947e390c25911b61cfe69e162a78 without further explanation
"Only invalidate SVGElementInstances when !changedByParser is set.". Due
to the lazyness of the shadow tree/instance rebuilding this will
hopefully not regress performance.)

Bug: 794594
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I58f3a74ef9812503c0111d3564dad8ee3527d27b
Reviewed-on: https://chromium-review.googlesource.com/832386
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#524726}
bratell
Compile fix jumbo builds, be specific about which testing to use
There are two namespaces named testing, there is ::testing
and there is ::blink::testing. Inside blink code you have to
write ::testing to be sure to get the root ::testing namespace.

Depending on how ignorant the compiler is, it might work anyway,
but in jumbo builds the compiler often knows about the
blink::testing namespace.

TBR=leon.han@intel.com

Change-Id: I7617e074dba5cabb813c3a823757e0ba0ce15008
Reviewed-on: https://chromium-review.googlesource.com/832607
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524711}
tmoniuszko
Fix bookmark importing from Firefox
Bug: 638977
Change-Id: I3336f64fc9497417831afa24f8403a63b77797bb
Reviewed-on: https://chromium-review.googlesource.com/817435
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524685}
wdzierzanowski
Avoid race in MSE_Widevine tests
When run with the stub Widevine CDM, these tests suffer from a race
between the result of a failed StubCdm::Decrypt() and a failed
StubCdm::UpdateSession().  The tests expect the latter, but the former
often arrives first.

By allowing the stub to InitializeVideoDecoder() successfully and
returning cdm::kNoKey upon DecryptAndDecodeFrame() attempt we avoid the
DecryptingDemuxerStream errors altogether, so there is no race anymore.

Bug: 768745
Test: 'browser_tests --gtest_filter=*MSE_Widevine*' pass when run with the stub Widevine CDM

Change-Id: I35a35d006d118f8f7f9a8a64cf9334017644f4ea
Reviewed-on: https://chromium-review.googlesource.com/831026
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Commit-Queue: Wojciech Dzierżanowski <wdzierzanowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#524663}
fs
[PE] SVG <use> 'x' and 'y' are presentation attributes
'x' and 'y' were turned into presentation attributes in
https://codereview.chromium.org/896773002 (r190180), but the property
values were not actually applied.
Apply the property values from ComputedStyle, cleaning up the
surrounding code a bit in the process by moving the "is a <use> element"
check into a method. Also fix the FIXME in SVGUseElement::ToClipPath by
using the computed transform from the LayoutObject, rather than
"manually" recomputing it. This code-path should already require a
LayoutObject for the element in question.

Bug: 400725, 697052
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Iff261e468c4476cfb98efbadd6989ada027e47ab
Reviewed-on: https://chromium-review.googlesource.com/829314
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#524385}
bratell
Prepare service_worker tests for jumbo compilation
To avoid clashes between test data variables and similar changes,
this patch puts tests that would collide in custom namespaces
following a pattern used successfully in Blink.

content unittests needs about 60 CPU minutes to compile normally.
With jumbo that can be brought down to 4-6.

Bug: 746953
Change-Id: Ic573361fed81bbd46a97823e9761f94088d51814
Reviewed-on: https://chromium-review.googlesource.com/826637
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524357}
jl
Undefine another ENUM_CASE macro after use
This avoids collisions in jumbo/unity builds.

Change-Id: Ibd47b3c0be950c6f9fb5baf206612203c99e9b35
Reviewed-on: https://chromium-review.googlesource.com/827132
Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#524351}
bratell
Prepare various storage tests in content for jumbo compilation
To avoid clashes between test data variables and similar changes,
this patch puts tests that would collide in custom namespaces
following a pattern used successfully in Blink.

Bug: 746953
Change-Id: I093f221ca2017c095f0751d52d70efa44e3fed31
Reviewed-on: https://chromium-review.googlesource.com/826636
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524271}
bratell
Deduplicate and rename some constants in X11 clipboard code
In jumbo builds symbols with the same name that end up in
the same translation unit might clash even if they don't
normally clash. That was the case with a couple of constants
in the ui/base clipboard code for X11.

This patch shares some of the constants (the ones with the same
value) and renames the remaining one.

Bug: 773275
Change-Id: I718cecdf5e490de17217962767322f3c847a3e53
Reviewed-on: https://chromium-review.googlesource.com/824522
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524067}
bratell
Add support for jumbo in content/renderer
Jumbo is a unity build system for Chromium, aimed at dramatically
reducing the compilation times.

So far support has been added to blink, v8, content/browser and
a few smaller targets, reducing the effort by about half. How
that maps to real time depends on hardware. It scales proportionally
for 4 core/8 thread machines, but not in 48 core machines or in
goma.

The effort to compile content/renderer in a use_jumbo_build=true
build is right now about 6% of the total effort when compiling
chrome+content_shell+blink_tests. That is about 51 CPU minutes
on the test hardware. With jumbo that can be brought down to 6-7
CPU minutes, saving about 5 minutes real time on a 4 core/8 thread
machine for every full compilation.

Part of the support is to split away IPC code generation since
its macro based design isn't compatible with jumbo. See
comment in the code for more information.

Bug: 746953
Change-Id: If0cfe05986cdfbdd4974f03119c46c3493f6c63e
Reviewed-on: https://chromium-review.googlesource.com/822417
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524063}
bratell
Prepare appcache tests for jumbo compilation
To avoid clashes between test data variables and similar changes,
this patch puts tests that would collide in custom namespaces
following a pattern used successfully in Blink.

Bug: 746953
Change-Id: I49b9d127c513ead92c4743d6e5701b80a91db69e
Reviewed-on: https://chromium-review.googlesource.com/824268
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524042}
bratell
Removing dead TransportDIB member sequence_num_
Nobody set or read the ui::surface::TransportDIB member
sequence_num_ and that made the compiler upset in jumbo builds
where the compiler sees more of the whole picture.

Change-Id: Ia59e824e9e6175870065336c6403958878d2dba0
Reviewed-on: https://chromium-review.googlesource.com/826063
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524031}
bratell
Renaming one of two g_linux_input_method_context_factory
Both the real and the testing version of
ui::LinuxInputMethodContextFactory were named
g_linux_input_method_context_factory which caused collisions
in jumbo builds. This renames the testing one to
g_linux_input_method_context_factory_for_testing

Bug: 773275
Change-Id: Ia11a8a16ce5a40ef4a6469fe5bdcfeab2323e068
Reviewed-on: https://chromium-review.googlesource.com/826064
Reviewed-by: Yuichiro Hanada <yhanada@chromium.org>
Reviewed-by: Shu Chen <shuchen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524030}
bratell
Gave two kClassIdentifiers unique names
In jumbo builds several cc files are compiled in the same
translation unit and then the different kClassIdentifier
symbols clashed. This renames them to
kPeerConnectionRemoteTrackIdentifier
and
kProcessedLocalAudioSourceIdentifier

Bug: 746953
Change-Id: I7fe95ebbef69f4dd3b47258417cc917ba441dd91
Reviewed-on: https://chromium-review.googlesource.com/822191
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#524029}
jl
Enable jumbo for //components/sync
This reduces basic compile time by approximately 90 % (from 830 CPU
seconds to 83 CPU seconds on a pretty standard machine.)

Change-Id: I75a8c0d9e2d057380f89628891987f0acbaa86e5
Reviewed-on: https://chromium-review.googlesource.com/823033
Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#526224}
bratell
Declare //ui template instantiations so that all know about it
There were code in ui/views that didn't know about the class
property type specialization for ::wm::ShadowElevation. This was
solved by the linker later since there was other instances
of the right template.

In jumbo builds the compiler noticed that there was code
trying to access the template before the specialization was known
and that is a C++ error so the code did not compile.

The fix is to declare the specialization so that all code knows
about it.

Bug: 773275
Change-Id: Ifa4bc0088a8525a7a9907037d746ecb542dfbf71
Reviewed-on: https://chromium-review.googlesource.com/824665
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523903}
bratell
Removing "using namespace" from ui/events code
using namespace includes a full other namespace into the
global scope and that doesn't work well with jumbo builds for two
reasons: Too many symbols, and "using namespace" isn't allowed
in something that is included.

It is also not allowed by the style guide.

This patch removes the using namespace and uses explicit
namespaces instead. It also changes some repetitive code
to use macros to make it less repetitive and easier to read.

Bug: 773275
Change-Id: If45f81b435920bd9048567ec65f9b142046e86ea
Reviewed-on: https://chromium-review.googlesource.com/824843
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523808}
fs
[PE] Fix text selection of <svg:text> subject to 'textLength'
With 'textLength' and 'lengthAdjust' with the value 'spacingAndGlyphs',
each SVGTextFragment is subject to an additional scale factor that
stretches the glyphs along the x- or y-axis.
This scale factor was not (any longer) taken into account by
SVGInlineTextBox::OffsetForPositionInFragment, which resulted in the
incorrect offset being calculcated.
Apply the (inverse) length_adjust_scale from SVGTextFragment before
querying the font for an offset.

Remove the |include_partial_glyphs| argument from
SVGInlineTextBox::OffsetForPositionInFragment since it's always true,
and also use 'float' rather LayoutUnit for the position.
Remove the dead |horizontal_glyph_stretch_| member variable from TextRun
since it's no longer used (since the simple shaper path was removed.)

Bug: 793075
Change-Id: Ia7d369d914f5afd87d198b7b21077e180fc8bc59
Reviewed-on: https://chromium-review.googlesource.com/824162
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523787}
bratell
Moved two kSlopEpsilon constants that clashed in jumbo builds
Both gesture_detector.cc and scale_gesture_detector.cc have
a local constant kSlopEpison with the same value. Since
I could find no suitable shared place for it, I moved them
into a tighter scope. That way they will not clash in jumbo
builds where several cc files share the same translation
unit.

Bug: 773275
Change-Id: I22c6a452532fbe0b2be3fddb29388a2d65aa901a
Reviewed-on: https://chromium-review.googlesource.com/824241
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523784}
bratell
Rename one of two ItemView classes
There is one ItemView class in notification_view_md.h so if that
header is in the same translation unit as notification_view.cc
then the local ItemView class will fail to compile. That happens
in jumbo builds.

Bug: 773275
Change-Id: I2911c4cbcc73df186d9520d4182a186a76d2ce34
Reviewed-on: https://chromium-review.googlesource.com/824364
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523774}
mharanczyk
Add missing blink_header dep to //third_party/WebKit/Source/platform/heap.
Bug: 794207
Change-Id: Icc7a0654a643c53ecc6cd68d2c3a73e6bd394a81
Reviewed-on: https://chromium-review.googlesource.com/823030
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523749}
bratell
Give some ServiceWorker and TLS related symbols more unique names
In jumbo builds more code compile in the same translation unit
so it's more important to keep the names unique to avoid
compilation clashes.

Bug: 746953
Change-Id: I649731d0725a9c5b5ab0ec72775cc81ea54434a9
Reviewed-on: https://chromium-review.googlesource.com/819556
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523737}
bratell
Gave 3 kMaxMessageChunkSize constants unique names.
There are three very similar pieces of code with identical
constants controlling and this patch renames them so
that they don't clash in jumbo builds.

Jumbo builds compile multiple cc files in the same translation
unit which means that those cc files will share the same
anonymous namespace.

Bug: 746953
Change-Id: I85462687798819212b78926c92d3351f44039583
Reviewed-on: https://chromium-review.googlesource.com/822474
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523723}
bratell
Avoid importing the symbol name "Result"
There are many types in Chromium named Result. When importing
that name into the global (or content) namespace with a
using statement, you run the risk of clashing with another
Result type. That happened in jumbo builds where more code
is compiled per translation unit.

This patch uses the fully qualified name instead of just
Result instead.

Bug: 746953
Change-Id: I5ccfb5e6b70712372a764c89b40a2a9340cc33fb
Reviewed-on: https://chromium-review.googlesource.com/822335
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Takashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523722}
bratell
Renamed local BindInterface since it clashed with template
There is a template named BindInterface in
content/public/common/bind_interface_helpers.h so to avoid
compilation failures when that header is included directly
or indirectly (as in jumbo builds), it's better to call
local functions something else than BindInterface.

This renames BindInterface -> BindNamedInterface.

Bug: 746953
Change-Id: Ib595232b8c6c9ae58b5321ff58ad1c2927787631
Reviewed-on: https://chromium-review.googlesource.com/822433
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523721}
jl
Stop importing syncable::WriteTransaction into syncer namespace
In jumbo/unity builds it conflicts with syncer::WriteTransaction defined
in components/sync/syncable/write_transaction.h.

Change-Id: I19a325af6299d955577aec10d36f21b948859035
Reviewed-on: https://chromium-review.googlesource.com/822091
Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#523502}
jl
Stop importing crypto::Encryptor into syncer namespace
In jumbo/unity builds, it conflicts with syncer::Encryptor defined in
components/sync/base/encryptor.h.

Change-Id: I0b9c4e6eafd88eae46892ff97f2ade41f8c0b99a
Reviewed-on: https://chromium-review.googlesource.com/822090
Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#523491}
jl
Undefine ENUM_CASE macro after use
Multiple source files in components/sync/ define and use a macro named
ENUM_CASE. Some already undefine it afterwards, but some don't and that
causes issues in jumbo/unity builds where all the source files are
compiled in a single translation unit.

Change-Id: I0ce5d1d0e2008f52c68c8dd174d537b7ef1a42f1
Reviewed-on: https://chromium-review.googlesource.com/817280
Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
Commit-Queue: Jens Widell <jl@opera.com>
Cr-Commit-Position: refs/heads/master@{#523378}
bratell
Rename one of the FrameMaps to FrameProxyMap
There are two types named FrameMap, one in render_frame_impl.cc
and one in render_frame_proxy.cc. As long as the type isn't
exported that works, but in jumbo builds the cc files are
compiled in the same translation unit which causes collisions.

Bug: 746953
Change-Id: I582d7f032caba1a201ac72c8181eb4c2432cc5bf
Reviewed-on: https://chromium-review.googlesource.com/819636
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523369}
bratell
Renamed two identical methods that checked hwacc state
There is two identical methods named
PP_HardwareAccelerationCompatible and I'm not sure what is
a good place to deduplicate them so this patch only renames
them to unblock jumbo work in content/renderer. The methods
with the same name clashes in jumbo builds where many
cc files are compiled in the same translation unit.

Bug: 746953
Change-Id: I12361f3226bdc7a3c6113201183ec26b263917f4
Reviewed-on: https://chromium-review.googlesource.com/819950
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523221}
bratell
Rename two of the ReleaseOriginalFrame methods
In jumbo builds, the three different ReleaseOriginalFrame
methods in content/renderer/media ended up in the same
translation unit and then Bind() didn't know which one to use

Bug: 746953
Change-Id: I584df28230d29bbc80d9d6cd2884300b7a3d9409
Reviewed-on: https://chromium-review.googlesource.com/819611
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523213}
bratell
Remove the last X11 includes in //ui outside ui/gfx/x/*
X11 header files are infamous for creating macros with common
names such as None, True, False, Status, Bool, ...

To save oursaves the mess that creates, they are now wrapped
in a header, ui/gfx/x/x11.h, which puts those symbols in the
x11 namespace and removes the global macros.

This means we can remove various undefs in files that have had
problems in the past.

Bug: 782184
Change-Id: Ie48fe619e3101344d53ea837b0b21570516185ca
Reviewed-on: https://chromium-review.googlesource.com/814676
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523149}
bratell
[jumbo] Too many CurrentWorkerId()
cache_storage and notifications both had "CurrentWorkerId()" with
the same (trivial) implementation but used differently. For
jumbo builds to not have those clash, this patch renames the
one in notifications -> NotificationWorkerId()

Bug: 746953
Change-Id: Ic00a4e23448bd2d50315a5561f798ed40be56fdc
Reviewed-on: https://chromium-review.googlesource.com/819558
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523146}
bratell
[jumbo] Avoid using the same kMaxNumberOfBuffer name everywhere
In jumbo many files compile together in the same translation
unit and then they share anonymous namespace so if they
use the same constant name, such as kMaxNumberOfBuffers or
kDefaultNumberOfBuffers, they will clash.

Bug: 746953
Change-Id: I0ce707eac13d4f928e482ee62f0d112c69900dae
Reviewed-on: https://chromium-review.googlesource.com/819830
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523142}
fs
[PE] Fix transform-origin on SVG <text>
LayoutSVGText would not compute the correct transform if subjected to a
transform-origin (or transform) with percentages, since the transform
had to be computed early in UpdateLayout in order to allow a font to be
chosen based on the current transform.

Rearrange the code in LayoutSVGText::UpdateLayout a bit to allow the
transform computation to use the correct bounding box, but also compute
a tentative transform before updating the font and its metrics.

Remove the special-case in SVGElement::CalculateTransform and simplify
accordingly.

Bug: 225799
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I34728dfeaafba72c9f3195a29fbdd14673d186c2
Reviewed-on: https://chromium-review.googlesource.com/817734
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#523141}
bratell
Remove X11 includes and replace with the ui/gfx/x/x11.h wrapper
X11 headers pollute the global namespace with macros with
common words like None, Status, False. To avoid problems
because of that we now wrap X11 includes in ui/gfx/x/x11.h
and move all problematic words to the x11 namespace.

Bug: 782184
Change-Id: I81859c8aabae677c40614d3c26036c5d4d1e715a
Reviewed-on: https://chromium-review.googlesource.com/819731
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523121}
bratell
[jumbo] undef STATIC_ASSERT_ENUM after use
Many files define their own STATIC_ASSERT_ENUM macro. When
those files, in a jumbo build, end up in the same translation
unit, there will be clashes.

For macros that clash, the simplest fix is to undef them after
use to reduce the scope where the symbol is available.

Bug: 746953
Change-Id: Id0d22ed46663c79ce5a43e5f09420b1758bf1d88
Reviewed-on: https://chromium-review.googlesource.com/819633
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523116}
bratell
Avoid using GetMessage in Windows since its a Win macro.
Depending on whether certain headers had been included,
GetMessage was a macro that expanded to GetMessageW. This
caused later linker errors in jumbo builds.

This patch renames the function GetIpcMessage to avoid any
confusion.
Alternatives are:
* #undef the macro (can cause problems with later code)
* Make sure that everyone that includes dwrite_font_fake_sender_win.h
also has Windows.h included so that the macro is always there.

Bug: 746953
Change-Id: Ia172ee74dc430c5fb25d676f018695dc001f3470
Reviewed-on: https://chromium-review.googlesource.com/819552
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523107}
bratell
Windows jumbo compile fix. NO_ERROR is a macro in Windows
Windows headers define a macro named NO_ERROR so it is
best to avoid that name. This renames the new NO_ERROR
enum value to CBOR_NO_ERROR, similar to GL_NO_ERROR.

Bug: 780504
Change-Id: I83aa3b83b9239659c296687a9109f255b272a1ce
Reviewed-on: https://chromium-review.googlesource.com/819251
Reviewed-by: Balazs Engedy <engedy@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#523097}
fs
Remove local BlendFloatPoint from SVGPathBlender.cpp
AnimationUtilities.h has a Blend(...) overload for FloatPoints - which
differs only by the type of the |progress| argument (double vs. float),
so use the one from AnimationUtilities.h.
Also reduce type-impedance by making |progress_| and |add_types_count_|
from SVGPathBlender::BlendState double and float respectively, since these
conversions are otherwise done over and over.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I34801971030ba082a2b2ebe66c1227314b6a5709
Reviewed-on: https://chromium-review.googlesource.com/816799
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#522777}
bratell
[jumbo] Ignore some more file types people put in sources lists
*.js and *.css files (used in //extensions) are not dangerous
to have in sources lists so silently let them be.

Bug: 787836
Change-Id: I8dc2c16505594ed5342cad008dc1ca8b5a499b73
Reviewed-on: https://chromium-review.googlesource.com/814554
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#522731}
bratell
Add support for jumbo builds to ui/views
Jumbo is unity build system for Chromium, where files are
merged before compilation. This gives a much lower resource
requirement for compiling since headers only have to be
compiled once and only one set of template instances has to
be generated (and because of some other reasons).

This is expected to lower the resource usage for compiling
chrome+content_shell+blink_tests by 1%.

Bug: 773275
Change-Id: I6db13afe6147a9186d48c6796b7331d502ea939c
Reviewed-on: https://chromium-review.googlesource.com/786471
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#522724}
bratell
Replace X11 includes in media with ui/gfx/x/x11.h
X11 header files are infamous for creating macros with common
names such as None, True, False, Status, Bool, ...

To save oursaves the mess that creates, they are now wrapped
in a header, ui/gfx/x/x11.h, which puts those symbols in the
x11 namespace and removes the global macros.

I believe the references to min and max came from an include of
<X11/Xlibint.h>. I can't find such an include anymore and
the one in user_input_monitor_linux.cc doesn't seem needed so
I removed all undefs of min and max and all includes of that
header.

Bug: 782184
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I3a09cccee04eb312ab6b2575be01753df8a1f137
Reviewed-on: https://chromium-review.googlesource.com/806217
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Fredrik Hubinette <hubbe@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#522723}
bratell
Remove a dead code block in content/common/BUILD.gn
A code block for linux without use_seccomp_bpf tried to
remove files that were never added. Since it doesn't
crash, the code is unused.

Change-Id: Ib0bd9d3c9dffa400f3be5c5027c9f959e62124d2
Reviewed-on: https://chromium-review.googlesource.com/814398
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#522561}
bratell
Inline ConvertSyncSocketHandle to avoid duplicate symbols
The symbol name ConvertSyncSocketHandle is longer than the
code so inlining it makes the code shorter and possibly smaller.

This is primarily triggered by jumbo build errors.

Bug: 746953
Change-Id: I661209ae56c7c4605ed0ba7426d19eecc095f6e9
Reviewed-on: https://chromium-review.googlesource.com/814674
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#522558}
bratell
Be explicit about the testing namespace because there are two
There is both a ::testing and ::blink::testing namespace and if
you refer to just "testing" inside the ::blink namespace you can
get either one depending on what the compiler knows.

This broke jumbo builds where the compiler knew about
::blink::testing and thought "testing" meant ::blink::testing
instead of ::testing.

The fix is to use the :: prefix.

Change-Id: I15b2502a5b15ef585816faae843a97b3d2d73c93
Reviewed-on: https://chromium-review.googlesource.com/813775
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#522401}
fs
Remove dead Blend() code
(last use probably removed by https://codereview.chromium.org/2750293003
and similar earlier CLs.)

ShadowList: :Blend and BasicShape::Blend/CanBlend are no longer used
Change-Id: I3d9690768f64fa8c602b55cb1a0bf8654100e04c
Reviewed-on: https://chromium-review.googlesource.com/809012
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#522104}
bratell
Declare //ui template instantiations so that all know about it
There were code in ui/views that didn't know about the class
property type specialization for gfx::Insets* and Views* so they
got the default template implementation.

In jumbo builds the compiler noticed that there was code
using the default implementation before the specialization
appeared and it triggered a compilation error.

The fix is to declare the specialization so that all code uses it.

Bug: 773275
Change-Id: Ifa925a2002ba930af16dc6940a04b2a480721438
Reviewed-on: https://chromium-review.googlesource.com/786190
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#521803}
fs
Make the Length(LengthType) constructor explicit
Per coding style:

https: //google.github.io/styleguide/cppguide.html#Implicit_Conversions
Change-Id: Ic7a05422e72b3e445236b054d887b5467f79ab6c
Reviewed-on: https://chromium-review.googlesource.com/809010
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#521786}
bratell
Replace X11 includes in viz with ui/gfx/x/x11.h
X11 header files are infamous for creating macros with common
names such as None, True, False, Status, Bool, ...

To save oursaves the mess that creates, they are now wrapped
in a header, ui/gfx/x/x11.h, which puts those symbols in the
x11 namespace and removes the global macros.

Bug: 782184
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: Ida4d26422f44edda1a0120f52ffbaa4e437ab012
Reviewed-on: https://chromium-review.googlesource.com/805814
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#521740}
bratell
Replace X11 includes in //gpu with ui/gfx/x/x11.h
X11 header files are infamous for creating macros with common
names such as None, True, False, Status, Bool, ...

To save oursaves the mess that creates, they are now wrapped
in a header, ui/gfx/x/x11.h, which puts those symbols in the
x11 namespace and removes the global macros.

Bug: 782184
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I10a9acecb8e7adacd170d1080a411bc9d1e49f79
Reviewed-on: https://chromium-review.googlesource.com/806275
Reviewed-by: Victor Miura <vmiura@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#521659}
fs
Eliminate some unnecessary copies of Lengths
Using the Length store directly should work fine most of the time, and
avoids the fairly bloaty Length copy constructor and destructor pair.

Some minor massaging of ValueForPositionOffset required, but otherwise
straightforward.

Change-Id: I1b1d0b14f3897fc4173eab123cc3b241b28c70d3
Reviewed-on: https://chromium-review.googlesource.com/806834
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#521473}
fs
Simplify some Length comparisons with 'auto'
Using Length::IsAuto() is more efficient (and generates significantly
less code) than constructing a new Length and comparing with that.

Also replace some open-coded "is auto" checks with said method, and
simplify the surrounding code a bit.

Change-Id: I974a28a0eef969b56557428eb019f7cf1dac18c1
Reviewed-on: https://chromium-review.googlesource.com/806170
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#521456}
bratell
Support jumbo in content/{utility,public,gpu,network}
Jumbo is a unity build system aimed at dramatically reducing
compilation times by merging cc files into larger translation
units.

This change will remove about 6 CPU minutes from the effort to compile
chrome+content_shell+blink_tests on the reference hardware. This is
slightly less than 1% of the total effort in a jumbo build.

Bug: 746953
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I19856815c50724004d11a7e5342e84bff802e6f4
Reviewed-on: https://chromium-review.googlesource.com/801013
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521317}
bratell
Clear //remoting from direct X11 includes
X11 headers pollute the global namespace. Instead we use a
wrapper header (ui/gfx/x/x11.h) that puts important symbols
in the x11 namespace and removes them from the global namespace.

Bug: 782184
Change-Id: I3173f2dde17e6991cc31bd89ceaee8e651ccaf3f
Reviewed-on: https://chromium-review.googlesource.com/801390
Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#521303}
bratell
Adding jumbo to blink/common.
All of blink already supports blink, except for code that has been
overlooked. This directory, third_party/WebKit/Source/common,
was such an overlooked piece of code.

Change-Id: Ifc9cd0ab64f99d686d3139c367d576a7390408d3
Reviewed-on: https://chromium-review.googlesource.com/796793
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520918}
mpichlinski
CHR-6375: [Windows] Fixed crash on fallback from ANGLE to SwiftShader.
During fallback from ANGLE to SwiftShader it is required to unload
ANGLE libraries, otherwise SwiftShader will fail to load its own
libGLESv2.dll.

Fixed ANGLE platform reset.

Fixed order in ShutdownGL.

Bug: 760063
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: If8797b49f2b5d04cb610302f96c82011dee9b3a9
Reviewed-on: https://chromium-review.googlesource.com/774296
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520730}
bratell
Change X11/* includes to ui/gfx/x/x11.h includes
Includes from the X11 system libraries declare macros with common
names such as None, True, False, Status and those complicate
the life for other code. To avoid that complication we have
moved the common symbol names to the namespace x11 and changed
so that you include "ui/gfx/x/x11.h" instead.

Bug: 782184
Change-Id: I3d2893425bb79cb29d6c5a602512a0e8d3cc30cd
Reviewed-on: https://chromium-review.googlesource.com/800550
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#520671}
bratell
Support jumbo in third_party/WebKit/Source/platform/instrumentation
Jumbo is a unity build system for Chromium, aimed at reducing
compilation times by merging cc files into larger
translation units.

This is 0.1% of the total build time so not very much but also
the final remaining part of blink/platform. And all the CPU
minutes add up.

Bug: 761475
Change-Id: Id0643d869960a660a91a4f3a9a23b4585f9e0073
Reviewed-on: https://chromium-review.googlesource.com/785678
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#520656}
bratell
Forward declare WebUIMessageHandler in the right namespace
A header forward declared a WebUIMessageHandler in the global
namespace which seriously confused jumbo builds since the
actual WebUIMessageHandler is in the content namespace.

Change-Id: I623b2f729d03dbea199c27f62790f8119d0e3926
Reviewed-on: https://chromium-review.googlesource.com/800933
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520646}
wdzierzanowski
Prevent flakiness of histogram tests in //media
Initialize base::StatisticsRecorder early in the test suite to ensure
histogram pointers created at any moment during test execution are
available globally.

See https://codereview.chromium.org/2901703002 for a more complete
explanation.

Change-Id: Ib2c81dd8ef960168355c53dbc80f2a7833153483
Reviewed-on: https://chromium-review.googlesource.com/800431
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520632}
bratell
Fix include guard for test_fileapi_operation_waiter.h
Change-Id: Iaa408e8195368c736370a8aee78fe3ceec741a59
Reviewed-on: https://chromium-review.googlesource.com/788050
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#520346}
bratell
Clearing content from include <X11/*>
X11 headers leak a lot of macros named things like None, Status, True,
False and they cause problems with normal code. To avoid that we now
wrap all commonly named symbols in an x11 namespace and include
"ui/gfx/x/x11.h" instead of <X11/*>.

Bug: 782184
Change-Id: I37bf100f2d2acc5d51ec62051e90939b56d9f690
Reviewed-on: https://chromium-review.googlesource.com/797034
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#520344}
bratell
Add support for jumbo builds to ui/aura
Jumbo is unity build system for Chromium, where files are
merged before compilation. This gives a much lower resource
requirement for compiling since headers only have to be
compiled once and only one set of template instances has to
be generated (and because of some other reasons).

This is expected to lower the resource usage for compiling
chrome+content_shell+blink_tests by 0.5%.

Bug: 773275
Change-Id: I1be67ab58e42ea8fbe8537f719b05ca3082aa3c5
Reviewed-on: https://chromium-review.googlesource.com/786470
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#520297}
fs
Update the computed transform when the reference box changes
When the object bounding box (for 'fill-box') or the viewport (for
'view-box') changes, we need to update the transform as well.
Add a bool to LayoutSVGShape to track if the transform depends on the
reference box, to make checking this quicker.

Bug: 595829
Change-Id: Ie7429553e78b08f7a574b1e7beae30c738250078
Reviewed-on: https://chromium-review.googlesource.com/796271
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520259}
fs
A 'transform-box' change can yield a different transform
We wouldn't invalidate as needed if the 'transform-box' property changed
its value.

Bug: 595829
Change-Id: Ibcaa9e94b54b99724f2d3e1ca5dedd868d85b776
Reviewed-on: https://chromium-review.googlesource.com/796213
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#520211}
bratell
Adding include guard to mock_leveldb_wrapper.h
Change-Id: Idf7504a625141e1177b4fe2457608847e7120fc4
Reviewed-on: https://chromium-review.googlesource.com/797031
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520139}
fs
WPT tests for the 'transform-box' property
Basic tests for 'fill-box' and 'view-box' with various viewport
configurations.

Bug: 595829
Change-Id: I81ec92e958c5ec240c7932219371b6c5369f5ac5
Reviewed-on: https://chromium-review.googlesource.com/796211
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#520111}
fs
Make stroke bounding boxes for <line> tighter
Since <line> elements are just a two point line segment, it does not
have any line joins and thus needn't apply any correction for the miter.

Bug: 435097, 788340
Change-Id: Ie7e9d89e0f7c741cf7cf40b3af82521869bb5b54
Reviewed-on: https://chromium-review.googlesource.com/790294
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#519779}
bratell
Renaming the Mac specific MenuController -> MenuControllerCocoa
There were two public classes, both in //ui, named MenuController
and they clashed in jumbo builds and probably contributed to
some confusion.

This patch renames the one for Mac MenuControllerCocoa

Bug: 773275
Change-Id: I3d0d3e98a120c0df3da47cc691b48cdf89e51d6f
Reviewed-on: https://chromium-review.googlesource.com/791610
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519414}
fs
Override CanRender in StyleInvalidImage
A StyleInvalidImage can never be rendered (GetImage always return
nullptr), so returning true - like the base class does - seems to be
sending the wrong signals.

Bug: 773272
Change-Id: I5ca20db512ce8b0e92546d626a4a6a2d85ed7908
Reviewed-on: https://chromium-review.googlesource.com/785651
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#519390}
fs
Add documentation to the StyleImage hierarchy
Bug: 773272
Change-Id: I643ef81395c1f5aa051265bb6fe90073289948c4
Reviewed-on: https://chromium-review.googlesource.com/785650
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519355}
bratell
Jumbo compile fix: Rename one of the TaskQueueManagerForTest
There are two (identical but small) TaskQueueManagerForTest
classes in renderer_scheduler_test_support.cc and
create_task_queue_manager_for_test.cc.

In jumbo builds where these files are compiled in the same
translation unit, they will clash and cause compilation errors.

This patch renames on of them
TaskQueueManagerForRendererSchedulerTest

(Followup to

https: //chromium-review.googlesource.com/c/chromium/src/+/763511 )
Change-Id: Ia282d00e2982744d8842df17455eaf599f2bd280
Reviewed-on: https://chromium-review.googlesource.com/790514
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#519318}
bratell
Jumbo build fix: Too many Mixin classes in oilpan tests.
Both HeapTest.cpp and IncrementalMarkingTest.cpp use local
test classes named Mixin. When compiled together in the
same translation unit, it will not compile.

TBR=haraken@chromium.org

Change-Id: Idfdfae3a9d81c5a1ad7d039818e06e11157806ef
Reviewed-on: https://chromium-review.googlesource.com/789863
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#519292}
bratell
Gave two global instance variables unique names
in jumbo builds two files with global variables named
instance clashed. This renames them to
g_transient_window_client_instance and
g_window_stacking_client_instance

Bug: 773275
Change-Id: I29dd9ef7e792959b128e99242b6ec6e13be183a8
Reviewed-on: https://chromium-review.googlesource.com/786236
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#519277}
fs
A stroke-width of zero should not generate geometry
A stroke-width of 0 is a valid value, but "is not painted" according to
spec. This can be interpreted as not generating any geometry, and so not
even "pointer-events: stroke" would cause anything to be hit.

Check for a zero stroke-width in LayoutSVGShape::StrokeContains and fail
the hittest in that case. This matches what the painting code-path does,
except we don't check for the existence of a stroke here, because we
need to handle the !has-stroke case too.

Bug: 459640
Change-Id: I508fae7c43873027331ffaa4b9e20783d949fc15
Reviewed-on: https://chromium-review.googlesource.com/788853
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519143}
bratell
Add include guard for video_capture_jpeg_decoder.h
Change-Id: Ibd90d0f605121acfe707d27090497c97f905a312
Reviewed-on: https://chromium-review.googlesource.com/787972
Commit-Queue: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519102}
bratell
Let jumbo ignore known strange files in sources lists
Many targets end up with stray files in their sources list,
files which trigger no toolchain. Jumbo used to assert that this
was bad but since other tools handle it silently, jumbo
should also be a bit more forgiving.

Bug: 787836
Change-Id: Ib70c3c5a053621de656af15fb4fcc413673db93c
Reviewed-on: https://chromium-review.googlesource.com/785811
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518979}
fs
Simplify SetNeedsResizeObserverUpdate invocations in LayoutSVG*
We can avoid calling this method for cases where we know the bounds have
not changed. Sink calls in the LayoutSVGShape hierarchy out of
UpdateShapeFromElement to a single callsite in
LayoutSVGShape::UpdateLayout. Also, no need to null-check the Element.

Bug: 435097
Change-Id: I2aca3056c9d016a30f6a54da29a719c9c9f3710c
Reviewed-on: https://chromium-review.googlesource.com/787650
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#518952}
fs
Use the same bounding box computation even with fallback path
LayoutSVGShape::UpdateShapeFromElement() creates a Path for the shape as
well as update the bounding box (fill/object and stroke.)
When we fallback to using a Path rather than the fast path
representation for the shape, we can still use the same code for
computing the bounding boxes. So instead of calling LayoutSVGShape's
UpdateShapeFromElement from LayoutSVGRect and LayoutSVGEllipse, just
call CreatePath() in the codepaths that transitions to the fallback/Path
codepath. Non-scaling stroke still require a "precise" stroke bbox.

This should make stroke bounding boxes for <rect>, <circle> and
<ellipse> tighter again.

Bug: 435097
Change-Id: I5361689371cb78eb405e0403f3be165bd254aab2
Reviewed-on: https://chromium-review.googlesource.com/779460
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#518880}
bratell
Typo fix in sources list. File missing .h.
Adding the missing .h.

Change-Id: Ie2d4f9df6c48ba73180cb6bdec8d55b352865928
Reviewed-on: https://chromium-review.googlesource.com/786015
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518877}
bratell
Rename one of two "UseMd()" in ui/views
Both bubble/bubble_border.cc and controls/combobox/combobox.cc
have help functions "UseMd()" (that only calls
ui::MaterialDesignController::IsSecondaryUiMaterial() )

Since I cannot find a common location and the methods are small,
I just renamed one of them to UseMaterialDesign()
to avoid clashes in jumbo builds.

Bug: 773275
Change-Id: Ic5a99af09044fe46ac9aab3f858914a53399ca24
Reviewed-on: https://chromium-review.googlesource.com/786234
Reviewed-by: Michael Wasserman <msw@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518757}
bratell
Rename one of two kThumbStroke in ui widget controls
Both the scrollbar and slider code have a kThumbStroke and
they are not the same. In jumbo builds those clash so this
patch renames the slider version to kSliderThumbStroke.

Bug: 773275
Change-Id: I53f7720bc34a3d71c9a0bb7061e0d185e1c8e68c
Reviewed-on: https://chromium-review.googlesource.com/786235
Reviewed-by: Michael Wasserman <msw@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518743}
bratell
Support jumbo in //cc
Jumbo is the Chromium implementation of a unity build system where cc files are combined
before they are compiled. This adds support for that in //cc which can make it compile 8-9x
times "faster" by saving 10-15 CPU minutes (1-2% of the effort to
compile chrome+content_shell+blink_tests).

The mapping to wall time depends on the exact hardware. More parallel computers benefit less.

Bug: 786926

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I687873c09abbd27f7525426c943e5bb4e64748b4
Reviewed-on: https://chromium-review.googlesource.com/776801
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518730}
bratell
Remove jumbo_excludes triggered by too many Init()
The Android JNI generator generated code that cause there to be a
lot of Init() methods in Android code. The JNI generator has now
been changed to add a class name prefix to the function names
so these excludes are no longer needed.

This will speed up Android jumbo builds by a couple of seconds or so
(not measured).

Bug: 779013,746953
Change-Id: I24e550d6e493f87022e9887f7a957dc557233b20
Reviewed-on: https://chromium-review.googlesource.com/783212
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518728}
bratell
Add jumbo support for heap and heap unit_tests (-0.75 CPU minutes)
This adds support for jumbo compilation in oilpan which saves about
0.75 CPU minutes of effort (about 10% of blink/platform or 0.1% of the
total remaining compilation time).

Bug: 761475
Change-Id: Id7606583d5a97e9f6692b756acc062c73b27dbe3
Reviewed-on: https://chromium-review.googlesource.com/693098
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518718}
bratell
Replace system header includes with gfx/x/x11.h in ui/views
X11 system headers define macros that easily clash with other code.
For instance None, True, False. To avoid that, which becomes
critical for jumbo builds, we instead have a x11.h wrapper
that protects the code from the dangerous macros.

Also removes use of the "Time" type in global scope since Time
is an X11 typedef and can't be protected by x11.h.

Bug: 782184
Change-Id: I1a605bddd8c5e4fe2f83c8432509915dc00b3700
Reviewed-on: https://chromium-review.googlesource.com/785170
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518648}
fs
Use approximate stroke bounding boxes for SVG shapes
This moves the stroke approximation code from
LayoutSVGPath::HitTestStrokeBoundingBox to a helper in LayoutSVGShape,
and then makes use of it in LayoutSVGShape::CalculateStrokeBoundingBox()
(which is the generic "stroke bounds" computation for shapes) as well.

This makes stroke bounding box computation O(1) (assuming a fill bbox
exists), avoiding the generation of a stroke path, which can be
expensive for the more "complex" parametrizations (primarily dashes.)

The downside is of course lower fidelity, and the approximation will
always be both larger than the fill bbox and larger than the "exact"
stroke bbox.

Also fix an issue where a miter-limit < 1 would incorrectly shrink the
resulting bounding box in some cases.

Bug: 435097
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Id0228bc78bb7d8db223be082106f3c3d2bcb038a
Reviewed-on: https://chromium-review.googlesource.com/774746
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518392}
bratell
Use "gfx/x/x11.h" instead of system headers in ui/events
By using x11.h instead of X11 system headers we prevent spreading
some common macros named None, Status, True, False, ... in the
global namespace. These macros forced various workarounds in
innocent code and made jumbo builds harder.

This moves a lot of X11 configuration and defines from ui/event
headers into ui/gfx/x/x11.h to make sure no code has to manually
include X11 headers.

Bug: 782184
Change-Id: Iab069db82d71cd27df395afefa34a54c252b874d
Reviewed-on: https://chromium-review.googlesource.com/779144
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518334}
bratell
Rename two ImageDecodeTaskImpl classes
There were two ImageDecodeTaskImpl classes in cc, one for the
GPU image handling and one for the Software image handling they
were small and slightly different so no reason trying to merge them
Instead this renames them so that their names don't clash in
jumbo builds where cc files are merged into large translation units.

Bug: 786956
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I9e481a969d9a897665855f05a5dedbc86e194eb1
Reviewed-on: https://chromium-review.googlesource.com/779194
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518313}
bratell
Add the classname to JNI method names to make them unique
Our JNI code generator generated a lot of Init(...) methods which
collided in jumbo builds. This patch adds a class name prefix to
them, and all other JNI methods, so that they have locally unique names.

TBR=erikchen@chromium.org,fgorski@chromium.org,sergeyu@chromium.org,dtrainor@chromium.org,rouslan@chromium.org,vakh@chromium.org,rogerta@chromium.org,holte@chromium.org,bajones@chromium.org

Bug: 779013
Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.linux:linux_site_isolation;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I86b6ac83c8e0a3507bd1d0efc48d625c12b4bb2b
Reviewed-on: https://chromium-review.googlesource.com/765973
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Sky Malice <skym@chromium.org>
Reviewed-by: Lambros Lambrou <lambroslambrou@chromium.org>
Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Reviewed-by: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Paul Jensen <pauljensen@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518300}
bratell
Wrap test in namespace to avoid jumbo collisions
Tests often use the same symbols because of copy/paste or
the repetitive nature of testing and

flat_tree_traversal_ng_test.cc has a TestCommonAncestor, same as
FlatTreeTraversalTest.cpp. Since tests don't export any symbols
wrapping them in a namespace is a simple way to avoid jumbo
clashes.

Bug: 745732
Change-Id: I91f7e732a28d67ebe5495791cb632a06c87534cc
Reviewed-on: https://chromium-review.googlesource.com/781779
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518236}
bratell
Renamed some cache size constants that shared names.
Both the GPU image cache and the software image cache
used the same name for its cache size constants. This caused
collisions in jumbo builds where the cc files were
compiled together in the same translation unit.

Bug: 786956
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: Ic6a66f45daacc94040e1cc11410b85d674651548
Reviewed-on: https://chromium-review.googlesource.com/779401
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518228}
bratell
Rename one set of Children() -> LayerChildren()
There are two template based iterators in
trees/property_tree_builder.cc and layers/layer_list_iterator.cc
that both use static |Children()| functions to define what the
template instances will do. If these end up in the same
translation unit in a jumbo build (where cc files are merged into
the same translation unit), then they will clash.

Since the functions are small and I don't know where a good place
would be, this CL does not merge them. Instead one of the instances
is renamed LayerChildren().

Bug: 786956
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I076ad4725ce571a667344145fd4a995be1edafff
Reviewed-on: https://chromium-review.googlesource.com/779140
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518222}
bratell
Add presubmit test that Blink doesn't expose -blink.h headers
mojo's -blink.h headers are for internal use in Blink. There
are -shared.h headers for use outside blink.

Change-Id: I2539a6ddab9cf878ddd8e31d27497dbedede6a76
Reviewed-on: https://chromium-review.googlesource.com/753451
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518215}
bratell
Rename two RasterBufferImpl to make the names more unique
In jumbo builds (use_jumbo_build=true), cc files are merged so local
symbols, such as these RasterBufferImpl, will end up in the same
translation unit and prevent the code from compiling.

Having unique names have other benefits as well in debugging and
documentation so this CL renames them ZeroCopyRasterBufferImpl
and BitmapRasterBufferImpl.

Bug: 786926
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I0b0af89cc1c0b3581a18a685742ad3e8c6e6b429
Reviewed-on: https://chromium-review.googlesource.com/779119
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518210}
bratell
Rename two different kInitialResourceId
In jumbo builds two different kInitialResourceId constants
(one with value 1 and one with value 2) ended up in the same
translation unit which then would not compile.

This renames them to kDisplayInitialResourceId and
kLayerTreeInitialResourceId.

Bug: 786956
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I00cba4916459598d2240510f2c4c12fd18787538
Reviewed-on: https://chromium-review.googlesource.com/779260
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518209}
bratell
Inlined two RoundOutRect to avoid jumbo clash
Two identical helper functions named RoundOutRect clashed
in jumbo builds where they ended up in the same
translation unit. If they had been larger it would have been
better to find a common place to define the, then shared, function
but since they are small, inlining works.

Bug: 786926
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: I11fdeb9ab1a9d063cb4f8b91f17c12ab250627a3
Reviewed-on: https://chromium-review.googlesource.com/779198
Reviewed-by: enne <enne@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#518207}
bratell
Use the X11 header wrapper in ui/gl
The X11 header wrapper prevents us from polluting the global
namespace with risky macros such as None, True, False, Status.
This is in particular necessary for jumbo builds since they
are more vulnerable to headers doing unexpected things.

Bug: 782184
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Icd39a959c24a6b8f5a74e044e3fd1e6b959c6280
Reviewed-on: https://chromium-review.googlesource.com/771195
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#517799}
karlo
[LayoutNG] Implement support for text-align: -webkit-*
Add NG support for the -webkit-center/right/left properties, and
implicitly the ALIGN html attribute.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I9c90e4ded306f2560dd82e4ed17b876a592e599e
Reviewed-on: https://chromium-review.googlesource.com/763249
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517568}
fs
Remove expectations for a few media/track tests
After https://chromium-review.googlesource.com/756848 and
https://chromium-review.googlesource.com/757102 these tests appear to
have stabilized.

TBR=srirama.m@samsung.com

Bug: 664844
Change-Id: Ie97611e52a579e6d2f18833f5faaedef662038fc
Reviewed-on: https://chromium-review.googlesource.com/771794
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#516732}
fs
Specify fill-box transform-box for circle.animation-{end,keyframe-}point
The transform-origin is supposed to be relative to the fill-box (the
object's/circle's bounding box) and not the viewport (which is the
initial value.)

Bug: 783985, 595829
Change-Id: I80b5b64a3bbeaca1d305972733820d361a7c064e
Reviewed-on: https://chromium-review.googlesource.com/765887
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#516671}
fs
Tidy ImageResourceContent Image accesses and related code
Make better use of local variables to make the code a bit more compact
and improve readability. Also rename variables to attempt to better
differentiate between ImageResourceContent and Image. In general call
the former |image_content| and the latter |image|.

Bug: 773272
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I0c1a1a1020cfc3a515459104e1bdb37827553455
Reviewed-on: https://chromium-review.googlesource.com/768819
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#516511}
bratell
Add jumbo support to //content/browser (-66 CPU minutes)
Enables support for jumbo in //content/browser so that if you build
with use_umbo_build=true, content/browser will jumbo compile. Jumbo is
Chromium's unity build implementation and is already supported in Blink
and v8.

Building content/browser with jumbo is 66 CPU minutes faster than
without jumbo. How that maps to wall time depends on the hardware. On
a 4 core/8 thread machine that is about 8-9 minutes.

It took 50 cleanup patches to get here, and there is 1 remaining issue
(see patch) that we will try to solve after this has landed.

Bug: 746953
Change-Id: I14f9d340abdba387e6520f8c255ebe7395565439
Reviewed-on: https://chromium-review.googlesource.com/768745
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#516450}
fs
Reimplement ImageElementBase::IsOpaque
Don't use Element::ImageContents(), which is a method primarily meant
for the WebElement interface (and not actually implemented by
SVGImageElement.) Use the local ImageLoader and related helpers instead.

Bug: 773272
Change-Id: Idbbf8a85b6905e072db2bf4ac12e38ff9756025d
Reviewed-on: https://chromium-review.googlesource.com/768872
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#516437}
tmoniuszko
Allow consulting ThemeProvider when asking TypographyProvider for color
Any custom View may provide ThemeProvider. TypographyProvider
implementation should have possibility to consult the ThemeProvider in
similar way NativeTheme can be consulted.

Bug: 691891
Change-Id: I4d67dfa870d9c439292f74c96e408bb7a9471059
Reviewed-on: https://chromium-review.googlesource.com/730583
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516308}
bratell
Avoid using the name SendMessage because of Windows
In Windows SendMessage is a macro that maps to either
SendMessageA (Ascii) or SendMessageW (Unicode) so if you have
a local function SendMessage it can be magically renamed.

The code tried to avoid SendMessage problems by removing the
macro, but in jumbo builds that made other headers in Windows
fail because that code tried to use SendMessage.

Instead the method is renamed SendIpcMessage for lack of
better imagination.

Bug: 784443
Change-Id: I75651542f0dae2a4df0f0dec1ca253de8c1def9b
Reviewed-on: https://chromium-review.googlesource.com/766374
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#516269}
bratell
Rename the different LevelDBStatusToStatus functions to help jumbo
In jumbo builds (use_jumbo_build=true) the two different
LevelDBStatusToStatus could end up in the same translation unit which
would then cause compilation errors since they only differed by return
value.

This CL gives them unique names, ToServiceWorkerStatus() and
ToNotificationDatabaseStatus().

Bug: 746953
Change-Id: Iceaf6facc3142990d62769f693eb57bfc5c5f143
Reviewed-on: https://chromium-review.googlesource.com/760358
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#515974}
fs
Avoid track 'load' race in a few media/track/ tests
In media/track/, the following tests seemed to exhibit the same timeout
behavior as track-kind.html:

  track-default-attribute.html
  track-load-error-readyState.html
  track-load-from-element-readyState.html

The default track could finish loading before the event handler was
added. Move the external <script>s earlier (to within <head>) and attach
event handlers before </video>.

Bug: 782095
Change-Id: I103e6d24a20f8b164a38a9014eae98528a6caf92
Reviewed-on: https://chromium-review.googlesource.com/757012
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: srirama chandra sekhar <srirama.m@samsung.com>
Cr-Commit-Position: refs/heads/master@{#515925}
fs
Explicitly reset preferred lang and text track state in media/track
Add cleanup handlers that resets "user preferred languages" and "text
track kind user preference", or just reset them outright, to see if this
has any bearing on the problem (works locally.)

Bug: 664844
Change-Id: I6237ace717fbaf6f5203d8a051950763547e191f
Reviewed-on: https://chromium-review.googlesource.com/757102
Reviewed-by: srirama chandra sekhar <srirama.m@samsung.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#515919}
fs
Make TextTrackCue::CueDidChange ordering updates fine-grained
Only do an remove-add cycle for the cue when the start or end time is
updated. This will avoid changing the cue order for cues which need to
make use of the "tie-breaker" (have same 'startTime' and 'endTime'.)
It should also make non-time updates to a cue faster.

Remove media/track/opera/interfaces/VTTCue/snapToLines.html since it's
a duplicate of the WPT test.

Bug: 783779
Change-Id: I919b0acdb6ec2e6f0b6e11fb75996e7292168f95
Reviewed-on: https://chromium-review.googlesource.com/763527
Reviewed-by: srirama chandra sekhar <srirama.m@samsung.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#515845}
fs
Fix target reference update for "absolute local" 'href's
When the <use> 'href' was specified as an absolute URL, we would not
consider it local and attempt to request and use the URL as an "external"
resource instead. Because of state inconsistencies and the resource
requested being of the wrong type, this would make shadow tree expansion
fail for nested <use>.

Bug: 783761
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ic4ee946c17e16d5dac96263874792ec3f1d882ea
Reviewed-on: https://chromium-review.googlesource.com/763459
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#515664}
bratell
Made some constant names more unique for jumbo
In jumbo builds cc files are compiled together as one translation
unit to local constants need to not have the same names as other
local constants or there will be a compilation error.

This patch renames
kCurrentSchemaVersion ->
  kCurrentLocalStorageSchemaVersion
  kCurrentServiceWorkerSchemaVersion

kKeySeparator ->
  kNotificationKeySeparator
  kServiceWorkerKeySeparator

Bug: 746953
Change-Id: I1cc52eebe8979ea83746f4aad00c7dd063791b94
Reviewed-on: https://chromium-review.googlesource.com/758869
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#515604}
bratell
Don't expose blink internal types from public headers
Mojo's -blink.h headers expose all the cool internal
Blink types which means they can't be used in public headers.
Instead use the -shared.h versions.

(There is a presubmit coming to prevent accidents like this)

Change-Id: I6e27c66aba3b625a96885c6261fd481bdaa50cf0
Reviewed-on: https://chromium-review.googlesource.com/763227
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#515568}
bratell
Avoid clash between two NSAccessibilitySelectedTextMarkerRangeAttribute
There are two
NSString* const NSAccessibilitySelectedTextMarkerRangeAttribute =
    @"AXSelectedTextMarkerRange";
and in jumbo builds they will end up in the same translation unit
and trigger compilation errors.

This patch moves one of them to where its used which will prevent
the clash and let the compilation proceed.

Bug: 746953
Change-Id: Iaf440412f7780141f8d22f648dfef59358ef610c
Reviewed-on: https://chromium-review.googlesource.com/758845
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#515515}
bratell
Wrap X11 headers in ui/gfx/x/x11.h
X11 headers define a lot of common symbols and that will interfere
with other code, in particular in jumbo builds where the X11 headers
get wider visibility. This wraps common X11 headers in
ui/gfx/x/x11.h and adds the necessary symbols to the namespace x11
instead.

So instead of writing

XAtom prop_type = None;

you now write

XAtom prop_type = x11::None;

and the same for True, False, Status and a few others.

Bug: 782184
Change-Id: I0d1b83720da615c808a2f7a291ddbf7664b26cd8
Reviewed-on: https://chromium-review.googlesource.com/756711
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Elliot Glaysher <erg@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515373}
bratell
Make kMaxRedirects into a C++ constant
Followup from https://chromium-review.googlesource.com/c/chromium/src/+/751744
Make the value a C++ constant instead of an enum.

Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I996f05877f7d68f468cdb41b4c7c1a5dcc1c62fc
Reviewed-on: https://chromium-review.googlesource.com/757398
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Ryan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515328}
bratell
Rename two kTrafficAnnotation variables that clash in jumbo builds
In jumbo builds several cc files are merged into one
translation unit and then a variable that is intended to be local
can collide. That happened with kTrafficAnnotation.

This patch renames them
kTrafficAnnotation ->
  kAppCacheTrafficAnnotation
  kNavigationUrlLoaderTrafficAnnotation

Bug: 746953
Change-Id: Ia46c25b80956ed04aa081348167883264c57b894
Reviewed-on: https://chromium-review.googlesource.com/758782
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#515327}
karlo
[LayoutNG] Change table cells to use NG layout.
Switch table cells over to use NG layout, so they can establish
NG block formatting contexts.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I08bbe28bb14d7b4041cc207ef499cf2d426ce219
Reviewed-on: https://chromium-review.googlesource.com/649698
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#515308}
fs
Ship the CSS 'transform-box' property
Intent-to-ship thread:

 https://groups.google.com/a/chromium.org/d/topic/blink-dev/4ZWHz8tCONI/discussion

Bug: 595829
Change-Id: I8b25037046efeeffcc52bf3835aff06c8d110549
Reviewed-on: https://chromium-review.googlesource.com/759040
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#515282}
bratell
Fix jumbo compilation for Android in //base
The define of "Long" to "long" ended up changing some "Long"
strings in jni code to "long" which broke compilation.

Bug: 775547
Change-Id: If9dab9f193b0cad5067903f46ade98155254c7de
Reviewed-on: https://chromium-review.googlesource.com/758366
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#514883}
fs
Remove media/track/track-kind.html
Remove this test in favor of the existing and overlapping coverage in
Web Platform Tests:

  html/semantics/embedded-content/media-elements/interfaces/
    HTMLElement/HTMLTrackElement/kind.html
    TextTrack/kind.html

Bug: 782095
Change-Id: Iff866ddabaa69a30e24f6126f202c6cbd431425a
Reviewed-on: https://chromium-review.googlesource.com/756752
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: srirama chandra sekhar <srirama.m@samsung.com>
Cr-Commit-Position: refs/heads/master@{#514817}
bratell
Merge all KMaxRedirects=20
Too much code took upon itself to define 20 as the constant
for number of redirects. If it's going to be a constant, let it
be a single constant, in this case in the network URLRequest class.

This was noticed because the multiple kMaxRedirects in
content/browser collided in jumbo experiments.

Cq-Include-Trybots: master.tryserver.chromium.android:android_cronet_tester;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ib11c1ea77ea0f1da0adb5966eb992a8f82e31177
Reviewed-on: https://chromium-review.googlesource.com/751744
Reviewed-by: Ryan Hamilton <rch@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Makoto Shimazu <shimazu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#514791}
fs
Fix media/track/track-cue-rendering-tree-is-removed-properly.html
The way media/track/track-cue-rendering-tree-is-removed-properly.html is
using assert_throws is no longer valid, so replace it with a different
construct.
Also, <track> does not have a 'mode' content attribute. Using 'default
here seems like it should DTRT.

Bug: 664844
Change-Id: I7cf035dc262160f4748a22f7f92fbc45c2bfe13b
Reviewed-on: https://chromium-review.googlesource.com/756848
Reviewed-by: srirama chandra sekhar <srirama.m@samsung.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#514789}
bratell
Deduplicate InputEventDispositionToAck
There were two identical InputEventDispositionToAck in
input_handler_manager.cc and widget_input_handler_manager.cc and
in jumbo builds those clashed. This exports the function from
input_handler_manager.cc/.h so that it can be used in
widget_input_handler_manager.cc

Bug: 746953
Change-Id: I8c032a4f283b0eeb601b75e3d15efddbff360578
Reviewed-on: https://chromium-review.googlesource.com/753325
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#514239}
bratell
Rename one of two different ClampToValidDimension
There are two ClampToValidDimension in content/render and in
jumbo builds where files are merged those functions clashed.

This patch renames one of them ClampToValidScreenCastDimension
which is a more unique, and descriptive, name.

Bug: 746953
Change-Id: Ib331422044e87b683dde1fb20cffd0395e79a6ea
Reviewed-on: https://chromium-review.googlesource.com/753369
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#514225}
bratell
Avoid leaking mojo -blink.h headers outside blink
mojo's -blink.h headers are for use inside blink. For the rest there
is -shared.h headers.

Change-Id: Iffb6bd56656545c35056ba49badfe06e8519ec29
Reviewed-on: https://chromium-review.googlesource.com/753884
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#514111}
fs
Special-case the 'is2D' case in DOMMatrix::invertSelf
When the DOMMatrix is supposedly well-formed according to the 'is2D'
restrictions, we can perform the inversion on the relevant submatrix
rather than the full matrix. This should avoid some numerical errors
sneaking in, breaking the 'is2D' invariant. It is probably a bit faster
as well.

Bug: 781172
Change-Id: I0e7678ccaf2baae9c40cff0acebb9d0fc498be11
Reviewed-on: https://chromium-review.googlesource.com/753685
Reviewed-by: Jinho Bang <jinho.bang@samsung.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#514044}
fs
Handle failed dictionary conversion in DOMPointReadOnly::matrixTransform
DOMMatrixReadOnly::fromMatrix can fail, returning null and generating an
exception.

Bug: 781172
Change-Id: If77e4cd57d02e8a09d79875aa96f0bc243f08b40
Reviewed-on: https://chromium-review.googlesource.com/753485
Reviewed-by: Jinho Bang <jinho.bang@samsung.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#514041}
bratell
Don't leak blink headers outside Blink.
WebCORS.h leaked internal Blink headers that could collide with
other code in for instance content (noticed in jumbo).

Change-Id: Ic874d3b0bfaed843cf1209944685b8368bb56a1c
Reviewed-on: https://chromium-review.googlesource.com/753881
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#513828}
bratell
Avoid importing base::Time into global scope
X11 headers add a Time typedef to global scope and in jumbo builds
(where files are merges so more code and headers become visible), that
Time typedef and the "using base::Time" clashed.

This patch imports the constant the code wanted directly, which is less
code (fewer characters) as well.

Bug: 746953
Change-Id: I130cd78080eda80ffaf75ef22afab5b9a68d4e59
Reviewed-on: https://chromium-review.googlesource.com/753447
Reviewed-by: Max Morin <maxmorin@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#513804}
bratell
Use PostMessageW instead of PostMessage to avoid undefs
There are code that does #undef PostMessage to avoid
the win32 defines and if such code/headers get included in
render_widget_host_view_event_handler.cc, then there won't be
a PostMessage to call.

The easiest solution is to call PostMessageW instead (the Unicode
version of the API) since that is the function we want to call
anyway.

Bug: 746953
Change-Id: I6bb61404e2685846b4298223fe588d51fa0704d5
Reviewed-on: https://chromium-review.googlesource.com/753582
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513785}
bratell
Avoid clashing two IsUsingMus() functions in jumbo builds
In some jumbo configurations the two IsUsingMus would end up
in the same compilation unit and cause compilation errors.
The function is small enough (barely) to have in two copies so
this patch moves them to a tighter namespace.

Bug: 746953
Change-Id: I08b67606fd6dc68ee5ae9a8c91c79386051f8976
Reviewed-on: https://chromium-review.googlesource.com/749386
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#513732}
fs
Cleanup extraction of intervals for raster shapes
This restructures Shape::CreateRasterShape so that the raster data is
extracted, followed by the actual extraction of intervals from the
raster data. Move the size restriction from ShapeOutsideInfo to Shape.
The code is generally left as-was with some minor exceptions, like
using IntSize::Area() and using size types for |max_image_size_bytes|.
The console messages previously emitted for "too large" images are
dropped.
This makes error handling slightly easier and hopefully also improves
readability.

Change-Id: I3e0a1bfb08f1c50d73f5ce7c909d98a6e31df5a0
Reviewed-on: https://chromium-review.googlesource.com/750962
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#513591}
bratell
Add missing include guard for VideoFrameSubmitter.h
Noticed in jumbo experiments.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ida9ad9a3dec791cca3992e5b68c1f3bc722ead5e
Reviewed-on: https://chromium-review.googlesource.com/749401
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#513491}
bratell
Replace the NOTIMPLEMENTED_POLICY macro with an explicit macro
NOTIMPLEMENTED_POLICY could be used to control what the
NOTIMPLEMENTED macro did, but *only* if set before the first
include of base/logging.h. That made it hard to use and
not at all compatible with jumbo builds.

There were only a few users of NOTIMPLEMENTED_POLICY and they all
set NOTIMPLEMENTED_POLICY to 5 so a better solution seems to be
to have NOTIMPLEMENTED and NOTIMPLEMENTED_LOG_ONCE for places
where spam is feared.

Bug: 777852
Change-Id: Id1b454200a64d43e27df39b2c9a02f07ba4710cf
Reviewed-on: https://chromium-review.googlesource.com/749143
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513481}
bratell
Add some missing include guards in third_party/WebKit/Source
Some of these are technically not needed, but to avoid future
accidents it's best to be consistent.

Note that there is another Forward.h but that one has WTF_Forward_h as
include guard so there won't be a clash.

R=pdr@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I6f42004c4810e960038c51f47d8e2714f00a7c2d
Reviewed-on: https://chromium-review.googlesource.com/749462
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#513460}
bratell
Unduplicate a kMaxListSize constant that broke jumbo builds
The two kMaxListSize constants collided in jumbo builds where
files are merged before compilation, for higher build performance.

This patch makes the constants be shared.

Bug: 777470
Change-Id: Idf90fcf389ba3895b4f0e28b4649f11ff5f8257e
Reviewed-on: https://chromium-review.googlesource.com/749142
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Ganggui Tang <gogerald@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513119}
fs
Fold ImageResourceContent::{Uses,}Image{Container,HasRelative}Size
These methods - UsesImageContainerSize and ImageHasRelativeSize - are
only simple wrappers for similarly named methods on Image. Callers have
access to Image without any hoop-jumping, so just fold these methods.

Bug: 773272
Change-Id: Ie6a02b7e1c4643c5ebfafa0b6281503194904852
Reviewed-on: https://chromium-review.googlesource.com/747102
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#512912}
fs
Percent-decode fragments before using them for SVG references
We were using the "raw" form of the fragment, meaning that any percent-
encoded fragments would not resolve correctly.

Bug: 779420
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ic091e775589fd59d25ad1878115f2ad2593bc733
Reviewed-on: https://chromium-review.googlesource.com/746885
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#512895}
fs
The empty string is a not a valid <length> for SVGLength
SVGLength::SetValueAsString was allowing "" to "reset" the value without
signaling an error. Because of how the handling of removeAttribute works
we can't shut down this entirely, but still need to handle the null
string resulting from that.

Convert svg/custom/invalid-length-units.html to testharness.js. (This
test had one item for "" and " ".)

Bug: 779454
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I055b77b07d833a252b325df8fc1a908271c86005
Reviewed-on: https://chromium-review.googlesource.com/746707
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#512871}
bratell
Adding include guards for print_messages.h
We have had IPC headers where it was up to the user
to carefully only include them once. Jumbo builds where
cc files are compiled together are not that careful so they
need include guards.

This is a followup to equivalent work done in chrome and content.

Bug: 746953
Change-Id: I3dc4067e2c4e23ee41be0def78a34bf4f7cd4b96
Reviewed-on: https://chromium-review.googlesource.com/741597
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#512844}
bratell
Rename an empty function to be more unique.
There were two empty functions named "IgnoreError" and this
caused clashes in jumbo build experiments. This patch renames
one of them "EmptyErrorHandler" which is also a good name.

There is no natural place to share the functions, and being empty
there is not that much value in sharing them either.

Bug: 746953
Change-Id: I7c7507cf485710159e64b3945eeea558e2e4f901
Reviewed-on: https://chromium-review.googlesource.com/743786
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#512555}
msimonides
Express the last scroll offset in DIPs.
The RWHVAura::GetLastScrollOffset() method should return values in view
coordinates (device independent pixels) as do other implementations of
RWHV.

When zoom-for-DSF is enabled the coordinates from compositor are
expressed in pixel coordinates which are different from view coordinates
on HiDPI screens.  Therefore the last_scroll_offset_ value needs to be
scaled to view coordinates

BUG: 778228
Change-Id: Ic8da1fdbf821d0073fb2a22a75ecbc40441ce00e
Reviewed-on: https://chromium-review.googlesource.com/610148
Commit-Queue: David Bokan <bokan@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512549}
bratell
Disable //base jumbo for iOS
Something with allocators goes wrong in iOS (similar to nacl) and
not having a good way to debug it, and not very mich interest for
jumbo on iOS, it's easiest to just disable it.

Bug: 776313
Change-Id: Ifc8c77fd19aa6fc5bcd790cc8c7056fd8a57640a
Reviewed-on: https://chromium-review.googlesource.com/741804
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#512263}
bratell
Adding include guard to debugging_client.h header
A header missing include guards caused problem in jumbo
build experiments.

Change-Id: Ibef82467108600c566ed71cec00970ec6301f012
Reviewed-on: https://chromium-review.googlesource.com/741504
Reviewed-by: David Trainor <dtrainor@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#512257}
fs
Deduplicate PaintScrollbar
CompositedLayerMapping.cpp and PaintLayerCompositor.cpp has almost
identical (differs by a null-check) PaintScrollbar helpers.
Move a cleaned up version to ScrollableAreaPainter (being the least bad
common location.)
This fixes Jumbo compilation.

Bug: 713137
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Icc36e57ed364b18716fd56b0363431f352ef0d72
Reviewed-on: https://chromium-review.googlesource.com/741595
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#512224}
bratell
Removed IsOriginSecure clone and removed "using namespace"
Importing namespaces with "using namespace" can have surprising
results (which is why the coding standard disallows them).

This patch's main motivation is to remove a "using namespace content"
which made indexed_db code unable to distinguish between ::indexed_db 
and ::content::indexed_db in jumbo builds, but in the process it
was realized that the local IsOriginSecure was only partly used
and also seemed to be close enough to content::IsOriginSecure that
one of them should suffice.

There were two IsOriginSecure(). One in {anon ns}::IsOriginSecure() and
one in content::IsOriginSecure(). In mixed_content_navigation_throttle.cc
there are two calls to unqualified "IsOriginSecure()". One was 
supposed to resolve to {anon ns}::IsOriginSecure() and
the other one to content::IsOriginSecure().

After this patch both calls will go to content::IsOriginSecure().

Bug: 629059, 746953
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Id572c05707545e6303f63f2c4a18acf7fda2a4c4
Reviewed-on: https://chromium-review.googlesource.com/738175
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#512174}
fs
Update baselines after Skia SkOffsetImageFilter change
TBR=mtklein@chromium.org,senorblanco@chromium.org

Bug: 778204
Change-Id: I7e531d55d2e8c3daf19ed93226c21d9698037d05
Reviewed-on: https://chromium-review.googlesource.com/741233
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#512162}
bratell
Fix for reference counted variable being passed the wrong way
Passing pointers to reference counted variables as raw pointers in
bind is disallowed so this wraps it in base::Unretained like the
other types.

This was discovered while making the code able to be jumbo
compiled because in jumbo builds the type URLRequestContextGetter
was no longer a undefined forward declared type. As long as it
was a pointer to something "unknown" bind.h was fine with it.

Bug: 746953
Change-Id: I72a0d2c2957b885f967c246b1575f6609ae8c9c3
Reviewed-on: https://chromium-review.googlesource.com/739861
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#512155}
bratell
Deduplicate UMALogDeviceAuthorizationTime
There were two implementations of UMALogDeviceAuthorizationTime and
in jumbo builds those clashed. This makes it one implementation and
moves it to AudioOutputAuthorizationHandler since it also
has Authorization in the name.

Bug: 746953
Change-Id: I63159187bd81b355ad6c94398a44e2ce188464bb
Reviewed-on: https://chromium-review.googlesource.com/739901
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#512126}
bratell
Let jumbo use root_build_dir relative paths
Up until now include paths have been relative to the location
of the generated jumbo files. That can make paths rather long 
with many "../../.." in them.

In some circumstances, the paths are now too long for some
Win32 APIs (260 chars) so let us try with 
root_build_dir relative paths instead.

Bug: 778627
Change-Id: Ic7202789f75caf5134b38b174cb5b24a217d0035
Reviewed-on: https://chromium-review.googlesource.com/737836
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511920}
fs
Rework computed style handling for 'width' and 'height'
getComputedStyle(...) for 'width' and 'height' would always return
'auto' for layout objects to which said property did not "apply" (by
some fuzzy heuristic.) This specifically broke for some SVG elements
where 'width' and 'height' apply (<rect>, <image> and <foreignObject>),
but is also wrong more generally - per CSSOM [1].

Rework the relevant parts of ComputedStyleCSSValueMapping::Get to
consider if the used value or the computed value should be used for the
respective property. The new helper
(WidthOrHeightShouldReturnUsedValue) replaces the old
WidthOrHeightPropertyAppliesToObject, while removing the explicit return
of an 'auto' identifier. 'auto' (or any other computed value) will now
be returned via ZoomAdjustedPixelValueForLength if the resolved value is
not the used value.

This is a behavioral change, and matches the behavior of Gecko.

Fold the old svg/css/getComputedStyle-svg-text-width-height.html test
into a new one that cover more (SVG) cases.

[1] https://drafts.csswg.org/cssom/#resolved-value

Bug: 708888, 772707
Change-Id: I573362a03c9e0d98251bdbcf4e9854a5a5d8dd67
Reviewed-on: https://chromium-review.googlesource.com/707103
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#511848}
fs
Temporarily suppress some feOffset tests
The following tests

 * svg/W3C-SVG-1.1/filters-offset-01-b.svg
 * svg/filters/feOffset.svg

show small differences (obvious progression for the former.)

TBR=mtklein@chromium.org
NOTRY=true

Bug: 778204
Change-Id: I3b7e8da7856181f920d7889d5f7ac21c764f1071
Reviewed-on: https://chromium-review.googlesource.com/739484
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#511829}
bratell
Rename two constants with the same name kVerboseLevel
In jumbo builds where cc files are merged before being
compiled, the two different kVerboseLevel clashed.

This patch renames when kJobVerboseLevel and
kWorkerVerboseLevel.

Bug: 746953
Change-Id: Id9cf152e3b5d9aeaa41990fb3fa6908c60baf43a
Reviewed-on: https://chromium-review.googlesource.com/738135
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511783}
bratell
Fix some typos in jumbo.gni documentation.
Copy+pasted documentation shows a bit too much of its origin.

Change-Id: Idb17d72c74bdff0c3544d7b5ecc23ab00c88e7c8
Reviewed-on: https://chromium-review.googlesource.com/738037
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#511772}
bratell
Deduplicate two constants kBlobStorageContextKeyName
We declared the key to lookup the chrome blob storage at
two places. This caused problems in jumbo builds where
cc files are merged and the symbols clashed.

Bug: 746953
Change-Id: Icc11b256026536983841b084f6d2a74358594a47
Reviewed-on: https://chromium-review.googlesource.com/738133
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511608}
bratell
Give two GetUniqueIdInConstructor() unique names
For jumbo builds where cc files are merged, function names need
to be a bit more unique for the code to compile. This patch chooses
two names: CreateUniqueEntryID() and CreateUniqueHandleID().

Bug: 746953
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I7058575bece926071d2b086c959ee08cd8023b68
Reviewed-on: https://chromium-review.googlesource.com/738369
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511574}
fs
Move ImageResourceContent::BrokenImage to LayoutImageResource
A "broken image" (fallback image) only make sense for "content images",
so LayoutImageResource seems like a better home for it. This also makes
it trivial to provide a decent device scale factor.
Fold the creation of a fallback image into LayoutImageResource too.

Bug: 773272
Change-Id: I3732f87ff8b433188920bfee9ab44acee255f6ae
Reviewed-on: https://chromium-review.googlesource.com/727904
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#511533}
fs
Simplify HTMLImageElement.currentSrc 'current request' heuristics
Rather than depending on whatever ImageResourceContent::GetImage()
returns (which is also always something non-null), just explicitly check
for there being an error or an actual image.

Bug: 773272
Change-Id: I1e71837ccdc4f9d2bf2a066cece6451154fecbf3
Reviewed-on: https://chromium-review.googlesource.com/730755
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#511517}
bratell
Give some storage size constants more unique name.
To avoid clashes in jumbo builds, let local_storage and
dom_storage use differently named constants for max area count
and max cache size.

Bug: 746953
Change-Id: I0acf3d02a938d670f67546830e3f17681b55bb0e
Reviewed-on: https://chromium-review.googlesource.com/735545
Reviewed-by: Michael Nordman <michaeln@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#511478}
fs
Remove reference for test that was removed
TBR=pdr@chromium.org

Bug: 595829
Change-Id: Ie93a136fbfb6e9425e9c48c89c8132f35ebfbc45
Reviewed-on: https://chromium-review.googlesource.com/738190
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#511439}
fs
The initial value for 'transform-box' should be 'view-box'
 https://github.com/w3c/csswg-drafts/issues/857#issuecomment-296024182

Drop support for 'border-box' for the time being, since it no longer is
just an alias for 'view-box'. Remove the test for it (which happened to
be using the wrong keyword even... Oops)

Bug: 595829
Change-Id: Ia2889848eb3355c18164ce6978a13bab9e40e698
Reviewed-on: https://chromium-review.googlesource.com/735560
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#511287}
fs
Tidy content box usage in HTMLCanvasElement::DoDeferredPaintInvalidation
Call LayoutBox::ContentBoxRect once and reuse the returned rect instead
of calling the method repeatedly (and mostly just tossing the result.)
Also cast the result to a FloatRect directly to avoid LayoutUnit<->float
impedance mismatches.
Rename some variables and update comments to reflect post-rename names.

Change-Id: Ie1a0bd1b955db7bf9e86e4e38d927c24d8e5ef4c
Reviewed-on: https://chromium-review.googlesource.com/733162
Reviewed-by: Justin Novosad <junov@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#511266}
bratell
Rename some socket buffer size constants with the same name
In jumbo builds, where cc files are merged before being compiled,
symbols that should be isolated can still clash and cause
compilation errors.

This patch renames
kReadBufferSize -> {kTcpReadBufferSize, kUdpReadBufferSize)
kRecvSocketBufferSize -> { kUdpRecvSocketBufferSize,
                           kTcpRecvSocketBufferSize}
kSendSocketBufferSize -> kTcpSendSocketBufferSize

Bug: 746953
Change-Id: I9fb6d06fa25e8a8ab02f922b247f1b76808daa94
Reviewed-on: https://chromium-review.googlesource.com/723305
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#511230}
bratell
Deduplicate GetEventAckName.
We had two GetEventAckName that both converted an
InputEventAckState to a string. This patch merges them and
moves them to input_event_ack_state.cc.

The two GetEventAckNames clashed in jumbo build experiments.

Bug: 746953
Change-Id: Ie07e8d500a0e3cfcc8a705300adc597760ea5751
Reviewed-on: https://chromium-review.googlesource.com/735155
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511178}
bratell
Add include guards to message headers in chrome and extensions
The solution without include guards isn't compatible with jumbo
builds and this is in general easier for code to manage. Now
nobody needs to be careful about where they include a message header

This is a followup to a similar patch in content (
https://chromium-review.googlesource.com/580868 )

Bug: 746953
Change-Id: I3ce252d02b9fc916cc8a2ad039214b1da08676bb
Reviewed-on: https://chromium-review.googlesource.com/735480
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#511154}
fs
Share content box rect in ImagePainter::PaintReplaced
Both of the drawing code-paths in said function use the full content box
rect, so we can compute it once and share it. This also avoids computing
the content size  twice.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I889f6440394fde75bafc8cc8ac0f6b3a1629c0c4
Reviewed-on: https://chromium-review.googlesource.com/733340
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510866}
fs
Use ContentSize() for content size stored for paint invalidation
LayoutBox::ContentSize() is more to the point than calling
LayoutBox::ContentBoxRect() and then do Size() on the result (ignoring
the position.) Hopefully it is also faster (4 vs 8 virtual calls.)

Change-Id: If8c370446fad49d976d1d7576ac7041cd8d78180
Reviewed-on: https://chromium-review.googlesource.com/733164
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510846}
fs
Move InterpolationQualityContext to platform/graphics
InterpolationQualityContext codifies a pattern that is used by all code
that alters the (default) image interpolation quality.
Move the tiny helper class to its own file, renaming it to
ScopedInterpolationQuality, and then use it where appropriate (which,
per above is "everywhere".)

In HTMLCanvasPainter.cpp, the FIXME referencing crbug.com/353716 is
removed, because the bug in question has been resolved as WontFix.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I8380cd4d20adcbc18dfa175e0d48e4947c51ca5b
Reviewed-on: https://chromium-review.googlesource.com/730205
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#510825}
fs
Tidy up SVGSVGElement::CurrentViewportSize
 * Put the LayoutObject pointer in a local variable.
 * Use ContentSize rather than the fullblown ContentBoxRect() since only
   the size is used.
 * Put the zoom in a local variable.
 * Use FloatRect::Size.

Change-Id: I7b150f53212f0b0cb2524b3867bfb90398ccf6e7
Reviewed-on: https://chromium-review.googlesource.com/733087
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#510788}
bratell
Hide Blink internal types from users of WebTappedInfo.h
A few internal types were accidentally exposed to the world.

Bug: 777366
Change-Id: I293070e479e88d76926c8c463a3bec4f04475a6f
Reviewed-on: https://chromium-review.googlesource.com/733082
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#510777}
karlo
[LayoutNG] Introduce LayoutNGMixin in preparation for LayoutNGTableCell.
This class holds code shared between LayoutNG subclasses of
LayoutBlockFlow.  Inheritance is parameterized, but only valid
for LayoutBlockFlow and subclasses.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I973193718d046ec6e8aa1a9bf548c5fef45aa149
Reviewed-on: https://chromium-review.googlesource.com/725346
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510749}
bratell
Reducing default jumbo chunk size from 100 to 50.
Bruce Dawson and I have mesaured what compile times you can expect
from different chunk sizes and it seems that the advantages of 100
over 50 is at best small so this patch reduces the default to 50.

It will mean that 100 becomes less likely to work without code fixing
since fewer people will compile with 100, but it should be an overall
better experience because smaller jumbo units means single-file changes
need to recompile less unchanged source.

Bug: 766294
Change-Id: I5347c39ad91fbdcd83ea975884ccdb60aa8bbe45
Reviewed-on: https://chromium-review.googlesource.com/671783
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510679}
bratell
Deduplicate the ShouldDuckFlash function
Two files had identical ShouldDuckFlash functions which clashed
in jumbo builds (chromium unity build implementation where
source files are merged).

This patch moves the function to media_switches so it can be used by
all code.

Bug: 746953
Change-Id: I0665384f82e8bb3f0dfd6a536d1535b57c9bfe78
Reviewed-on: https://chromium-review.googlesource.com/723468
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#510624}
karlo
[LayoutNG] Fix for painting legacy floats with margins.
The legacy painting code uses the margin box as the origin
for floats.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I00f4d3c4362af62555509d2512258bb243877aa2
Reviewed-on: https://chromium-review.googlesource.com/723339
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510613}
fs
Handle invalidation of SVG filters that are not in the layout tree
If a <filter> was not in the layout tree, we could not invalidate it
because doing that required going through the LayoutObject of the
<filter>.
If the <filter> does not have a LayoutObject associated, then invalidate
through the proxy-set directly.

Bug: 773811
Change-Id: I35612e3915a09b714b3aaa27e4b50ae344b6ff3f
Reviewed-on: https://chromium-review.googlesource.com/728001
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510397}
bratell
Renames two RecordCancelled functions to have unique names
In jumbo builds where source files are merged before compiled for
dramatically faster builds, functions that are intended to be local
will have a wider visibility and can clash.

This patch renames two similar, but not quite identical
RecordCancelled functions so that there will be no compilation
problems.

Bug: 746953
Change-Id: Ib31e3db19070f6cbbe0b7c383fcc5372ec02b90b
Reviewed-on: https://chromium-review.googlesource.com/727987
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#510390}
bratell
Giving a couple of HandleRequestCallback functions unique names
The different HandleRequestCallback functions clashed in jumbo
builds so this patch renames them.

Jumbo builds are builds where cc files are merged for dramatically
higher build performance.

Bug: 746953
Change-Id: Ie854181f45d8b7d8684ed1da4c96b8ac1b644646
Reviewed-on: https://chromium-review.googlesource.com/725700
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Bence Béky <bnc@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#510203}
bratell
Fix Windows jumbo compilation by excluding the jpeg decoder
The jpeg decoder uses libjpeg_turbo which uses a "boolean" type
defined to be int. At the same time Windows has "boolean" type
which is unsigned char. If those headers meet in a
translation unit you get compilation errors.

An alternative fix would be to redefine libjpeg_turbo to use
unsigned char for its boolean type.

Bug: 775979
Change-Id: I268e0890dfc2fae79d0abe54bbd7bf5c0c23226f
Reviewed-on: https://chromium-review.googlesource.com/727980
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#510155}
fs
Fold away ImageResourceContent::ImageSize
This moves scale-handling out into the (now former) consumers of the
ImageResourceContent::ImageSize method.

Bug: 773272
Change-Id: I08760b181a48f8a5dcc5ceff68a19c67eba3601a
Reviewed-on: https://chromium-review.googlesource.com/726087
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510061}
bratell
Refactored some buffer classes to avoid name collisions
There were three different DependentIOBuffer classes, three similar
kBufferSize constants, two similar InitializeResourceBufferConstants
functions and two identical GetNumericArg functions.

Besides being potentially confusing, it causes clashes in jumbo
build experiments (chromium unity build system in development).

This patch moves around GetNumericArg (to merge the two copies) and
InitializeResourceBufferConstants (to make them not clash).
It renames the DependentIOBuffer classes which are deceptively
similar as well as the kBufferSize contstants and some other
variables that were not actually constants.

Bug: 746953
Change-Id: Id7cfa4baac0aa67a7b086896701aeab931e23a96
Reviewed-on: https://chromium-review.googlesource.com/723302
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Reviewed-by: Michael Nordman <michaeln@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#510042}
mstensho
Remove mstensho@opera.com as core and core/layout OWNER.
I'm leaving Opera Software today.

TBR=eae@chromium.org
NOTRY=true

Change-Id: Id9e11f73d3a3cbc0f2a772f93945cff21e742933
Reviewed-on: https://chromium-review.googlesource.com/727981
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#510032}
fs
Introduce ImageResourceContent::IntrinsicSize
Most non-layout/paint users that query the size of an image are
interested in the intrinsic size of the image (usually the physical
pixel dimensions.) This is currently achieved by calling the ImageSize()
method with a multiplier of 1.
Split the ImageSize() method into a part that extracts the size of the
image (if any) and one that applies the multiplier (and follow-on
adjustments.) This should allow a future cleanup where the scaling is
moved closer to the layer that uses it - i.e layout and paint.

This also reduces the type-impedance a bit since IntrinsicSize can just
return an IntSize (like Image::Size()) rather than passing through a
LayoutSize.

Bug: 773272
Change-Id: I18a1c11e9fc891dc6f19c4b2c5bd5dc23c1a5da7
Reviewed-on: https://chromium-review.googlesource.com/718747
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#509770}
bratell
Jumbo for //base - disable jumbo when cross compiling for nacl
Jumbo builds with nacl fails in the linker because of too many
instances of memory allocator functions like valloc, realloc, mallopt
when linking libnacl.a.

TBR=thakis@chromium.org,dpranke@chromium.org,oysteine@chromium.org

Bug: 775547
Change-Id: Ibeeb1caa355aa8014c4b9179f4f26e303f13fbf8
Reviewed-on: https://chromium-review.googlesource.com/725284
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#509751}
fs
Fix size keyword comparison in CSSRadialGradientValue::Equals
Said function would ignore any size keyword or explicit size
specification if there was a shape keyword.
Adjust the comparisons so that first any explicit size checked, followed
by checking the size keyword and the shape value.

Also rewrite the if-ladder for the center point (|first_x_| and
|first_y_|) to just use two DataEquivalent.

Bug: 775201
Change-Id: I44686b54d3e02e1fd4682c4288eec3aca0e3e441
Reviewed-on: https://chromium-review.googlesource.com/723460
Reviewed-by: meade_UTC10 <meade@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#509718}
fs
Refactor <filter> invalidation to use the DOM structure
This changes the path used for invalidation of filter effects (SVGFE*)
from the layout tree to the DOM tree. This is done to allow invalidation
to work when the filter is not part of the layout tree. That change
will be done in a follow-up.

Also add casting helpers for SVGFilterPrimitiveStandardAttributes and
use it where applicable.

Bug: 773811
Change-Id: I275534e59eb285c0cab805f6c09d00b1f725e4f4
Reviewed-on: https://chromium-review.googlesource.com/719837
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#509478}
bratell
Make different g_observers and g_instances have unique names
This is preporatory patch to make content/browser able to do
jumbo compiles, i.e. compilation with many cc files merged into
one translation unit. For that to compile, names need to be a bit
more unique than they are today.

Bug: 746953
Change-Id: Ie7cb7445d3662d47372bde78df705aec7b130ed5
Reviewed-on: https://chromium-review.googlesource.com/721021
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509429}
fs
Propagate float rects further in SVGRootInlineBox::LayoutInlineBoxes
Compute the union of the children of a flow box using FloatRect too,
then convert to a LayoutRect for setting the InlineBox's logical rect.

Also restructure the physical->logical conversion a bit.

Bug: 757436
Change-Id: I6c8f3a781c3c02dfb28d87eafa3df6cd5fb864f3
Reviewed-on: https://chromium-review.googlesource.com/721320
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#509386}
rune
Remove rune@opera.com from core/OWNERS
Leaving Opera.

TBR=jochen@chromium.org,mstensho@opera.com
NOTRY=true

Change-Id: Ia6acfa96bc8a899b970cb4edd213cfb43a2abe2b
Reviewed-on: https://chromium-review.googlesource.com/721181
Reviewed-by: Rune Lillesveen <rune@opera.com>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#509353}
bratell
Renamed some global cache size constants
There were several different k*Cache*Size variables controlling
different caches but with the same name. These collided in jumbo
builds but also made it harder to discuss them and their values
so renaming them seems like a good improvement.

Bug: 746953
Change-Id: I1e8dc4f687c7b1e3ca8a9f9a5e80409029f8c4b0
Reviewed-on: https://chromium-review.googlesource.com/721205
Reviewed-by: Michael Nordman <michaeln@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#509341}
bratell
Give all different kFilteredMessages unique prefixes
There are 5 different kFilteredMessages arrays in content/browser
and some of them collide in jumbo (chromium unity builds)
build experiments.

This patch renames them to:
kCacheFilteredMessageClasses
kFileApiFilteredMessageClasses
kPepperFilteredMessageClasses
kRenderFilteredMessageClasses
kServiceWorkerFilteredMessageClasses

Bug: 746953
Change-Id: I3fc1b6f6ea3d0e5ccbb2ff47d4d476e02f5c2344
Reviewed-on: https://chromium-review.googlesource.com/721279
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Michael Nordman <michaeln@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#509321}
bratell
Give the different KDataFile variables unique prefixes
In the jumbo build experiment (chromium unity builds) there is a
collision between the two different kDataFile strings. This patch
renames them kNetworkErrorDataFile and kTargetsDataFile which also
matches their intended values.

Bug: 746953
Change-Id: Ib9f47fa4d358303c7cdbb65b54b40080521a915d
Reviewed-on: https://chromium-review.googlesource.com/721299
Reviewed-by: Bence Béky <bnc@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#509320}
mstensho
[LayoutNG] Update some test expectations for multicol.
When multicol support was introduced in NG, a lot of tests started to crash and
time out. I wanted to get rid of those as soon as possible, so I created a
separate bug report. It seems that all the crashes and timeouts introduced by
multicol are now gone.

Some caret-range-outside-columns tests still occasionally time out (they're
actually just very slow), but that doesn't seem multicol related.

Bug: 757767
Change-Id: I4827a090b23b5220e182759a458f3c5a05f115e7
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Reviewed-on: https://chromium-review.googlesource.com/720930
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#509123}
bratell
Add jumbo also for core/inspector generated files (-1 CPU minute)
Just clearing up minor targets that does not use the standard
templates for third_party/WebKit/Source/core and therefore did not get
jumbo automatically.

This removes about 1 CPU minute from the build effort, which is about
3% of the total cost of building blink/core (post-jumbo), and about
0.1% of the total effort building chrome+content_shell+blink_tests.

R=fs@opera.com

Bug: 713137
Change-Id: Iba18116c3da677dd0c530b8db98327e587187368
Reviewed-on: https://chromium-review.googlesource.com/720961
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#509050}
bratell
Rename CreateFileForProcess to be more unique.
There are two CreateFileForProcess functions (similar, both for webrtc
but not identical). This causes issues in jumbo builds since you
cannot easily take the address of an overloaded function.  The fix
here is to rename one of them to CreateEventLogFileForChildProcess
which is also more descriptive.

Bug: 746953
Change-Id: I8457adc2194fc24e191ed43e3fb78536c0bb87a3
Reviewed-on: https://chromium-review.googlesource.com/721022
Reviewed-by: Tommi <tommi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#509040}
fs
<iframe> 'sandbox' tokens are ASCII case-insensitive
Per https://html.spec.whatwg.org/multipage/#attr-iframe-sandbox, tokens
are ASCII case-sensitive.

Bug: 627682
Change-Id: I06784fc40e5561846cd5d6073614b67a5f4e7509
Reviewed-on: https://chromium-review.googlesource.com/718209
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#509023}
fs
Rename ImageLoader::GetImage() to GetContent()
This better reflects what it returns, avoiding some confusion.
Also take this opportunity to rename ImageLoader::image_ to
ImageLoader.
Also tidy up some code by putting the ImageResourceContent in a local
variable in some cases where it is used repeatedly.

ImageLoader: :image_content_ and similarly for local variables in
Change-Id: Idb8db822b1467b006a04ffd690df1f551ff3b7e9
Reviewed-on: https://chromium-review.googlesource.com/719098
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Hiroshige Hayashizaki <hiroshige@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509019}
mstensho
Fix jumbo build.
TBR=bratell@opera.com, cblume@google.com, wkorman@chromium.org

Bug: 745732
Change-Id: I04e2723d7da10a9021291e59d8edeeec87ee22e9
Reviewed-on: https://chromium-review.googlesource.com/720813
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#509011}
bratell
Jumbo for blink/platform unit_tests (-9 CPU minutes)
This adds support for jumbo compilation (merging cc files into larger
translation units for faster compilations) in blink's platform
unit tests.

It shaves 9 CPU minutes from the compilation time which is roughly half
of the remaining time needed to compile blink/platform.

Bug: 761475
Change-Id: Iaafdd9a4b00951a6274582a8e90707e7d3ee7028
Reviewed-on: https://chromium-review.googlesource.com/718203
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508947}
bratell
Organize all ClearSessionOnlyOrigins functions the same
There are 4 different ClearSessionsOnlyOrigins functions in
content/browser and 2 of them collided in jumbo build experiments.

This makes all 4 members of their logical class:
AppCacheStorageImpl::ClearSessionsOnlyOrigins
DOMStorageContextImpl::ClearSessionOnlyOrigins
IndexedDBContextImpl::ClearSessionOnlyOrigins
ServiceWorkerStorage::ClearSessionOnlyOrigins

Two of them (AppCache and IndexedDB) had to move for that to be
accomplished.

Bug: 746953
Change-Id: I9c8931b909fc78292e892dcff07d213abde2d8d1
Reviewed-on: https://chromium-review.googlesource.com/718753
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#508935}
bratell
Support jumbo builds in platform/wtf (-2 CPU minutes)
Support jumbo builds in platform/wtf for 2 CPU less effort when using
use_jumbo_build=true. This is about 0.3% of the remaining compilation
effort so don't expect any large change from this commit.

Bug: 761475
Change-Id: Ie3c4b6a4a23783b36a2e333abff457509a4534d3
Reviewed-on: https://chromium-review.googlesource.com/678954
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508874}
bratell
Jumbo for Blink core/editing unit_tests (-8.5 CPU minutes)
Final cleanup of parts of Blink core that had not been jumbified.
Some of the tests in core/editing are very similar so they have
been given custom namespaces.

Bug: 745732
Change-Id: I4db280458053cb31461247345cc2613b38eae884
Reviewed-on: https://chromium-review.googlesource.com/718207
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#508791}
fs
Replace CanvasImageSource::Source{Width,Height} with ElementSize
The ShapeDetector is the sole user of the SourceWidth() and SourceHeight()
methods on the CanvasImageSource.
For the current uses (and hopefully future uses) these should be identical
to the ElementSize() method on the same interface, so use that instead,
and remove the SourceWidth() and SourceHeight() implementations.

Change-Id: Ib4506d567b6f703688ab31873df0a8d23f9ac773
Reviewed-on: https://chromium-review.googlesource.com/716679
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Reviewed-by: Justin Novosad <junov@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#508779}
bratell
Removed "using namespace" in BidiResolver.h
If this code uses "using namespace WTF::Unicode" there can be a
conflict for kLeftToRight which also exists in the Mac SDK (in
AVLTree.h). "using namespace" is also not allowed by the coding
standard, and in this case blocks a patch to jumbo compile platform
unit tests.

Bug: 761475
Change-Id: I363dd452adb4ae7ddf7586c9f98a8869f4958c4f
Reviewed-on: https://chromium-review.googlesource.com/718701
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#508776}
bratell
Giving some g_factories objects more distinct names
In jumbo builds cc files are compiled together and then multiple
objects all named g_factory causes compilation errors. An easy
fix is to use more distinct names since that is good for other
reasons as well.

Bug: 746953
Change-Id: If91d9ec90f64c18083f60e0647ddebe86dbf42e9
Reviewed-on: https://chromium-review.googlesource.com/719006
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508752}
bratell
Remove unused member LevelDBDatabase::lru_max_size_
Jumbo builds (builds where many cc files have been merged and
are compiled together) notices some more unused code than normal
builds and protested (warned) that LevelDBDatabase::lru_max_size_
was unused.

Simple fix: remove it.

Bug: 746953
Change-Id: Iaf58d87c4b962f671350984deaff0825b35e3ad8
Reviewed-on: https://chromium-review.googlesource.com/718857
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508743}
bratell
Remove test that has been disabled since April 2013
StringOperatorsText.cpp tried to measure how many copies a string
concatenation does but has been disabled since April 2013 and was
ultimately broken September 2014. This patch removes it because it
uses a macro in a way that is incompatibile with jumbo.

Bug: 761475
Change-Id: If224b7a7dac8660b1f50c2814deffcd2d664c0fe
Reviewed-on: https://chromium-review.googlesource.com/718703
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#508704}
fs
Fix typo in <meta charset> - uft-8 -> utf-8
Change-Id: I69bca984bba263d003b7a23a95d62b3055c69fa5
Reviewed-on: https://chromium-review.googlesource.com/718676
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#508693}
rune
Use a singleton invalidation set for self invalidations.
We used to create separate invalidation set instances for every single
invalidation set which just contains InvalidatesSelf(). That is, every
simple selector which only appears in the rightmost compound selector:

.a {}
#b:hover {}
#parent > .c {}

The invalidation sets for ".a", "#b", ".c", and ":hover" above are all
the same with only InvalidatesSelf() set.

Instead we can use a singleton invalidation set which is shared for all
such invalidation sets. If we later add more features to the set, we
replace the singleton with a new DescendantInvalidationSet instance
with InvalidatesSelf() set and add new features to that set.

This reduces memory use for invalidation sets from ~1MB to ~256kB on
facebook.com (see measurements in 773880).

Bug: 773880
Change-Id: I1018cea1f51628f1f940c3722cc2b48a3164a777
Reviewed-on: https://chromium-review.googlesource.com/713859
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#508692}
mstensho
[LayoutNG] Able to paint line boxes established by direct multicol children.
The legacy layout write-back code for inline layout used to place the
RootInlineBox objects on the multicol container block. But everything has to be
under the flow thread (an anonymous child of the multicol container).

A few new tests pass, and some other tests regressed, mainly because lines are
now visible, but we still don't fragment them. It's been wrong all along, just
invisible.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iec5bf74056d961935de45ae027076a79c703ed5b
Reviewed-on: https://chromium-review.googlesource.com/716877
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508686}
bratell
Giving some g_factory objects more distinct names
In jumbo builds cc files are compiled together and then multiple
objects all named g_factory causes compilation errors. An easy
fix is to use more distinct names since that is good for other
reasons as well.

Bug: 746953
Change-Id: Ie6c221225721e230e8b973ab30c4907bc3713836
Reviewed-on: https://chromium-review.googlesource.com/716496
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508663}
fs
Handle small/zero pixel densities correctly for img.naturalWidth/Height
ImageResourceContent::ImageSize has some special logic for clamping
image dimension that end up as "zero" (LayoutUnits) to one after having
been scaled by the multiplier it is passed.
This "correction" means that for images with a small/zero pixel density,
we'll end up returning 1 even when the density corrected dimension is
(integral) 0.

To handle this, pass 1 as the multiplier to avoid the dimension clamping
and perform the pixel scaling "manually".
While doing this also move the pixel density correction code to
HTMLImageElement, and get rid of the code from ImageResourceContent,
since it only used for <img> naturalWidth/naturalHeight.
This makes ImageResourceContent::SizeType only have a single value, so
remove the enumeration and the argument.

Bug: 773272, 773284
Change-Id: Ie4a907d6cb7f262c876a5010bb7dd6a92af1cb9a
Reviewed-on: https://chromium-review.googlesource.com/708815
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#508646}
bratell
Add include guards to content headers missing include guards
Headers without include guards can not be included more than once
and in jumbo builds there might easily be more than one include
of the same header.

Bug: 746953
Change-Id: I8c19cc0764b5c91dd1aa276ad1f17719b0a70bca
Reviewed-on: https://chromium-review.googlesource.com/716476
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#508637}
bratell
Change mojo module from "mojo" to "ui.mojom" because of conflicts
Having the mojo module be "mojo" means that code appear inside the
C++ namespace "mojo" which then can collide with other code.

This happened while preparing for jumbo compiling mojo code and
caused compilation errors in jumbo because of a mojo::blink
namespace colliding with the ::blink namespace.

Since there already was an ui.mojom.TextInputType from ime, this changes
the code to merge the two TextInputType types.

Bug: 771153
Change-Id: Ic88ed6932a2d64f35ffb7661eedde09dc4619691
Reviewed-on: https://chromium-review.googlesource.com/704581
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Yuzhu Shen <yzshen@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#508634}
mstensho
[LayoutNG] Prevent >=1px clamping of columns from stretching the container.
Move the clamping code to only affect the fragmentainer block size in the
constraint space. It's needed here to ensure content progression, but it
shouldn't affect anything else.

The bug was that if height was auto and there was no non-zero height content
inside, the multicol container would still become 1px tall, which was way too
much if there was nothing to contain.

Added four unit tests. Only the two using balancing used to fail. The two
without balancing are there for coverage.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I590c42dee67b83ec8db724f0ea298f0b4dacb5b0
Reviewed-on: https://chromium-review.googlesource.com/716499
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508510}
mstensho
Add LayoutTests/fragmentation/ to blink_css_fragmentation_tests watchlist.
Also remove myself. Need to keep the empty list of watchers, or presubmit
checks will fail.

Change-Id: If5be8690ee7242a2c5366cecae148c4f871b6e6f
Reviewed-on: https://chromium-review.googlesource.com/717156
Reviewed-by: Aleks Totic <atotic@chromium.org>
Commit-Queue: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508476}
bratell
Remove unused using statement in legacy_router_impl.cc
Noticed because Time is also a macro in X11.

Change-Id: I827617492e82b62eeaf668e24470b5c199718171
Reviewed-on: https://chromium-review.googlesource.com/716482
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#508466}
fs
Box-less VTTCues needn't be removed from their region
If the timeline was active and had a cue that was attached to a region,
but the cue was invisible, VTTCue::RemoveDisplayTree would still attempt
to remove the cue's box from the region when its end time was reached,
resulting in a crash.

Make the entire VTTCue::RemoveDisplayTree gated on the existance of a
cue box.

Bug: 772508
Change-Id: Ie27fe76ed37c3cb9e21a1c2943d70c9cbac6647a
Reviewed-on: https://chromium-review.googlesource.com/707136
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#508457}
bratell
Give g_controllers more distinct names in content tracing
The two different g_controllers clashed when I tried a
jumbo build in content/browser. This renames them with more
distinct names.

Bug: 746953
Change-Id: I06daeb3e2f129c093dadbe88a1bd972bfcf436b3
Reviewed-on: https://chromium-review.googlesource.com/716677
Reviewed-by: Primiano Tucci <primiano@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#508437}
mstensho
[LayoutNG] Calculate overflow on multicol containers.
This gives us correct scrollbars, more or less.

Call UpdateLegacyMultiColumnFlowThread() a tad earlier, before calculating
overflow on the multicol container. It's the column set child that provides
overflow, so make sure that's calculated before calculating it on the parent.

That fixes two tests, but breaks two other tests. They break because of the
refs, which use absolutely positioned objects to cause a scrollbar (but that
doesn't seem to work in NG). But the actual tests now show scrollbars (which is
correct).

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I06a848a63c545559b67003f923208a65fd4f054b
Reviewed-on: https://chromium-review.googlesource.com/715598
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508408}
mstensho
Limit the maximum paint fragment count further.
Hopefully fixes a flaky test that tends to time out.

Bug: 763809
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I57ad04a4bfd26cb5e8e59786bc83e72052e60099
Reviewed-on: https://chromium-review.googlesource.com/716137
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#508389}
fs
Improve SVGInlineTextBox::CalculateBoundaries accuracy
Make said method compute and return a FloatRect (which is then converted
to a LayoutRect in SVGRootInlineBox::LayoutInlineBoxes), as well as
using a float for the baseline.
This should make for more compact, hopefully faster, code (due to less
FloatRect -> LayoutRect and LayoutUnit -> float transitions.) Using a
float for baseline will also yield a small improvement in accuracy, and
is consistent with similar calculations.

Bug: 757436
Change-Id: I8295a2d44f20476f1e234261f8a05fb175484d86
Reviewed-on: https://chromium-review.googlesource.com/708994
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508372}
bratell
Undef MAYBE* macros for jumbo builds.
In jumbo builds source files are merged and macros leak between
cc files. The easiest way to avoid that is to undef them after use.

This fixes a compilation problem with the MAYBE() macro which was
defined in two different tests.

R=fs@opera.com, mstensho@opera.com

Bug: 713137
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ie06359ad1fd1f432ccf666ca12cbd824216283fc
Reviewed-on: https://chromium-review.googlesource.com/716216
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#508352}
mstensho
Fix jumbo build.
TBR=kojii@chromium.org

Bug: 713137
Change-Id: I77d45dc11495dd15740b0189556fce07b6f39d6e
Reviewed-on: https://chromium-review.googlesource.com/715996
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#508309}
mstensho
[LayoutNG] Don't round down when calculating balanced column height.
We need to take some extra care to make sure that the LayoutUnit we return,
multiplied with the number of columns, isn't ever so slightly less than the
content we are to put into the columns. Make it ever so slightly larger instead.
Example: If used column-count is 3 and the content we are going to fit is 100px
tall, we used to calculate a column height of 33.328125px. Now we'll return
33.34375px, which is larger than 33.333333333px, so that the content will
actually fit inside 3 columns, instead of 4.

Otherwise we'd get an overflow column with practically no content, and possibly
an unwanted scrollbar (when we add support for that).

Similar code in ColumnBalancer::ContentRun::ColumnLogicalHeight() for legacy
layout.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I40c9b3004817223487a055ff533c2ad050454b51
Reviewed-on: https://chromium-review.googlesource.com/713416
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508174}
mstensho
[LayoutNG] UpdateAfterLayout() on flow threads, column sets, spanner placeholders.
This is just for good measure. I noticed that the PaintLayer established by a
flow thread had zero size, which can't be good. Not that this seemed to cause
any trouble, but still...

The UpdateAfterLayout() override in LayoutBlock now needs to be public, which
seems like a better idea than up-casting to LayoutBox when calling it.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I8512d36a7fa8f0f68f2e95eb3c42e254a47b0727
Reviewed-on: https://chromium-review.googlesource.com/712035
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508140}
mstensho
[LayoutNG] Enable inline children special code for flow threads.
PlaceChildrenInLayoutBox() has special code for inline child fragments, to
basically skip them, unless we find floats. This wasn't executed for multicol.
This caused DCHECK failures and incorrect layout.

A few new tests now pass. One regresses, but that's because the test expected a
float to be at block offset 0, which it happened to be, since we didn't even
attempt to place it. Now we place it. We place it incorrectly, but at least we
place it. :)

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ifee30438885c267f9d6c271a0db2f5c0f191fad6
Reviewed-on: https://chromium-review.googlesource.com/713858
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#508126}
mstensho
[LayoutNG] Add NGPageLayoutAlgorithm.
This one is used when overflow-y is -webkit-paged-x or -webkit-paged-y.

Such declarations will trigger creation of LayoutPagedFlowThread in legacy
layout, very similar to LayoutMultiColumnFlowThread for multicol. The main goal
here is to produce a correct fragment structure (anonymous fragments for pages),
so that we don't get confused when writing them back to legacy layout. I got
some test regressions when trying to clean up some code, so I need to land this
first. Apart from that, I haven't made a huge effort to make it lay out
correctly.

It may be that this algorithm can also be used for printing, but we'll see.

One text autosizing test has started to fail, for some reason, but it seems that
it has started to fail similarly to constrained-and-overflow-scroll-ancestor.html,
so maybe it's a good sign. :)

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I5e9b15f353376c4508952dab80cf347e35bb7b27
Reviewed-on: https://chromium-review.googlesource.com/712635
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#508041}
bratell
Member IconLoader::icon_size_ is unused on Android
The member icon_size_ in IconLoader is unused on Android. Unused members
sometimes, and specifically in this case, cause warnings in jumbo builds
which breaks the build.

This patch removes the unused member if compiling for Android.

Change-Id: Ie9934cc5e0643a25bbc1c8055e08eab138cf33cb
Reviewed-on: https://chromium-review.googlesource.com/703655
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507947}
fs
Simplify image size handling in ImageDocument
Move the static CachedImageSize(...) helper to the ImageDocument itself,
renaming it to ImageSize() and using |image_element_| as implicit input.
Simplify expression previously involving CachedImageSize to use the
ImageSize() method.

Change other users of ImageResourceContent::ImageSize to use the new
method instead. (Passing a zoom multiplier is redundant if all you want
to check is if the dimensions are empty.)

Simplify ImageDocument::Scale() by eliminating the "page zoom" factor,
which is part of both the numerator and denominator and hence cancel
out. This removes that last user of the PageZoomFactor(...) helper
function, so it can be removed.

Bug: 773272
Change-Id: Iaaa4a39879b9770a68ad95c045747581eeaa0a00
Reviewed-on: https://chromium-review.googlesource.com/709216
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#507796}
bratell
Renamed g_factory in src/chrome/browser/extensions
This is a preparatory patch for jumbo[1] in src/chrome.
The chrome code is now, with Blink jumbified, the single largest time
consumer during compilations. chrome/browser/extensions needs
about 30 CPU minutes to compile on a reference machine and that
should be about 5-10 times faster with jumbo.

[1] https://chromium.googlesource.com/chromium/src/+/master/docs/jumbo.md

Bug: 746957
Change-Id: I696dd1da7ca97e1773e4b0f2ab0714ab6a50021a
Reviewed-on: https://chromium-review.googlesource.com/708674
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507750}
bratell
Add include guards for client_surface_embedder.h
Found when experimenting with jumbo builds. Missing include guards
and multiple inclusion does not work well.

Bug: 773275
Change-Id: Ibc327c1c969f15a1dd417bba075eda8aa19953c2
Reviewed-on: https://chromium-review.googlesource.com/708759
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507729}
bratell
Remove duplicate helper class DestructCounter
There is already a DestructCounter in WTFTestHelpers.h. Having two
complicates jumbo builds and since they are identical, this one
can just be removed.

Bug: 745732
Change-Id: Ieca99932ff66f90d06b3fa8e21fa5b51da0d2f5c
Reviewed-on: https://chromium-review.googlesource.com/708743
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507675}
karlo
Make sure that the border width isn't larger than the border box.
The border box is subject to pixel snapping, but the border width is
rounded.  If the border box snaps down and the border width rounds up,
overpainting can occur.  The border widths are now clamped to the
corresponding border box dimension to prevent this.  This behavior
is in line with Edge.

BUG=739431

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I622d721579a0aad8109900268ca88d5cd85dd11e
Reviewed-on: https://chromium-review.googlesource.com/695109
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#507644}
mstensho
Eliminate some unnecessary includes in WebKit/public/
Mostly about reducing the need for <algorithm>, which is heavy, but removed
some other includes as well.

Bug: 766315
Change-Id: Id92c08e96566dfe5c780f6a101dbfdeb43aa4ac3
Reviewed-on: https://chromium-review.googlesource.com/693236
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#507523}
bratell
Add include guards to udp_socket_resource_constants.h
Missing include guards on
ppapi/proxy/udp_socket_resource_constants.h caused issues with
jumbo compilation experiments.

Change-Id: Idad3ef224327ce6b0db9f27366992b28ab8a7d65
Reviewed-on: https://chromium-review.googlesource.com/707248
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507469}
bratell
Support jumbo for webkit_unit_tests (-2.5 CPU minutes)
This makes webkit_unit_tests support jumbo compilation. In CPU effort
that reduces the reference build time by 2.5 CPU minutes (about 0.3%
of the total build time)

This landed once already as
https://chromium-review.googlesource.com/677449 but broke Android
testing. This has a fix for that problem (splitting test correctly
into test + source_set)

Bug: 713137
Change-Id: I81a42f51e80f02c1874bc5171774d6d292c78a62
Reviewed-on: https://chromium-review.googlesource.com/707137
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507468}
mstensho
[LayoutNG] Copy back the actual column height to legacy layout.
Don't use the content height of the multicol container. The columns may have
been shortened due to balancing.

I expected this to make some of the old layout tests pass. Only one did, and
that one wasn't really a relevant or illustrating one. Most of the existing
test probably depend on line box fragmentation working (which still doesn't
work at all in NG), and that could explain why no relevant tests started to
pass. Added a new and straight-to-the-point test that uses a simple block.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iab5fbbaab9491b430ab9eba1b6ea9ce0d3b0f4ec
Reviewed-on: https://chromium-review.googlesource.com/704837
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507425}
bratell
Support jumbo for mojo generated code (-42 CPU minutes)
Mojo generates a lot of code that is expensive to compile and
compiling them through jumbo saves roughly 80-90% of that effort,
which is 42 CPU minutes on the reference machine (surprising that 
mojo code needs that long to compile).

42 CPU minutes is -7% of the current "fastest" compilation, or
-4.5% of current master use_jumbo_build=true. The wall clock effect
will be similar for a 4c/8t machine but smaller the more cores
the computer have.

This patch includes a change to jumbo.gni to handle targets 
with no sources, and streamlines targets with only one file, 
because both happen through the mojo template.

Bug: 771153
Change-Id: Ia11a709711600f1b6eedd098bf47c1df2239a7a5
Reviewed-on: https://chromium-review.googlesource.com/697664
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507393}
bratell
Remove core/exported jumbo_excluded_source that is no longer needed
Because of an abundance of ToElement WebSearchableFormData was excluded
from jumbo. ToElement<ListedElement> was renamed so this exclude is no
longer needed.

Bug: 713137
Change-Id: I255f6ac5df213f62e5d1f6c2c3ea6b0e96540448
Reviewed-on: https://chromium-review.googlesource.com/704696
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507358}
fs
Simplify setting of 'nonce' in SVGElement::InsertedInto
No need to use one hasAttribute() and two getAttribute() for something
that only needs one getAttribute(). (No synchronization required in this
case, so the 'fast' version can be used.)

Change-Id: I8b85ea56900fba73cf31b5a8f60cfdac280bd069
Reviewed-on: https://chromium-review.googlesource.com/704857
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#507307}
mstensho
[LayoutNG] Framework and initial support for column balancing.
For now, just figure out how tall the content inside the multicol container is,
and divide by the number of columns, and make sure that the result doesn't
overflow the multicol container (by examining height and max-height (or width
and max-width if that's what's at the end of your favorite block axis)).

Previously we just used 42px if the column block size was unspecified, so this
is a slight improvement, as can be seen by the increased number of passing
layout tests. However, there are also some regressions because of this, because
it turned out that 42px was in some cases a better number than what we produce
now. We need to detect unbreakable content by traversing the fragment tree to
improve on this.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I980695a38c7bcaf09793869b1ca3f1e4d1451d37
Reviewed-on: https://chromium-review.googlesource.com/704640
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#507283}
bratell
Qualify the blink namespace in mojo so that mojo::blink is not used
There is a mojo::blink namespace generated from
ui/platform_window/mojo/text_input_state.mojom and if that one is
visible then the string "blink" will be resolved to the wrong
namespace inside namespace mojo.

This fixes android jumbo compilation (only android generates
blink bindings from the mojom file mentioned above).

Bug: 771153
Change-Id: I923e3bebe4fac3e02fe27c60b4472275f9613df8
Reviewed-on: https://chromium-review.googlesource.com/703654
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507070}
bratell
Fix for jumbo base scripts, don't double filter sources
If someone has managed to get a normally filtered file into
sources we need to not accidentally remove it again. This
problem triggered in net where android targets wanted to use
Linux files.

Bug: 772146
Change-Id: Ibca410c78c5a59e9f49c1d0e302204b598df25ca
Reviewed-on: https://chromium-review.googlesource.com/703694
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#507004}
bratell
Support jumbo for webkit_unit_tests (-2.5 CPU minutes)
This makes webkit_unit_tests support jumbo compilation. In CPU effort
that reduces the reference build time by 2.5 CPU minutes (about 0.3%
of the total build time)

Bug: 713137
Change-Id: I358ff81769e5fb0ebf91cd1264713c547fd3e47e
Reviewed-on: https://chromium-review.googlesource.com/677449
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#506867}
rune
Don't update fragment anchor during DOM operations.
We tried to update the fragment anchor position immediately when all
script blocking sheets are removed. As part of that update we do a
style and layout update. The last script blocking sheet may be
removed as part of removing a style element from the DOM. Updating
style and layout in the middle of a DOM operation is not safe.

Instead, update the fragment anchor position during the next safe
lifecycle update. The crash was caused by Document still pointing to a
documentElement being removed while updating the style and layout tree,
but its parent pointer had already been set to null.

Bug: 771088
Change-Id: Iaaaeece23d795c2e41d31b9fb97fc795eb2b8305
Reviewed-on: https://chromium-review.googlesource.com/698305
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506854}
mstensho
[LayoutNG] Ignore scrollbars in anonymous constraint spaces.
We already did ignore borders and padding, but forgot about scrollbars.

This was quite catastrophic for multicol, if a horizontal scrollbar was
actually taller than the columns. We'd end up pushing the scrollbar in front of
us (in block direction), column after column. Infinite loop (until OOM).

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I5c3038406ccf30eeb0e107b31c6bb783c7089ffd
Reviewed-on: https://chromium-review.googlesource.com/702299
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#506844}
bratell
Removing "using namespace" in a global scope in password_manager
"using namespace" in a global scope breaks jumbo builds (and
are not allowed in the code style guide). This patch replaces them
with explicit namespaces.

Bug: 771153
Change-Id: If9c4de9e115c5531708cf06f64cb0088daca2d57
Reviewed-on: https://chromium-review.googlesource.com/697370
Reviewed-by: Vadym Doroshenko <dvadym@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#506837}
bratell
Removing strange sources from mojo typemap
This patch removes a random sources block that was ignored
in normal builds but triggered an assert in jumbo builds.

This also changes the OWNERS file according to presubmit instructions.

Bug: 771153
Change-Id: Ic32f92db25b1b4bd6e2087b95785b4934a94e120
Reviewed-on: https://chromium-review.googlesource.com/702258
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#506801}
bratell
Avoid using classes named Function in blink
There is a Function template in blink's wtf library and it is easy
to get mixed up in it if you try to use the symbol "Function"
elsewhere in blink.

In particular you can easily get an include of
platform/wtf/Functional.h (which exports WTF::Function to the global
scope) in jumbo builds:

Bug: 745732
Change-Id: Ic4f4a02e1aacc5819ce824b94e284bfc6caa964d
Reviewed-on: https://chromium-review.googlesource.com/702236
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#506686}
mstensho
[LayoutNG] Implement NGColumnLayoutAlgorithm::ComputeMinMaxSize().
Intrinsic sizing for multicol used to be defined in the intrinsic and
extrinsic sizing CSS spec, but it must have been removed at some point.

All we have for inspiration now is the implementation in the legacy engine,
which landed with https://chromiumcodereview.appspot.com/23763002 back in 2013.
That, and common sense. :) The principles of min/max width calculation are,
after all, quite simple:

1. Figure out how much width we need to prevent avoidable overflow (min)
2. Figure out how much width we need to prevent avoidable soft wrapping (max)

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Id465449369d0227883e08228ce33346eb5b5cdba
Reviewed-on: https://chromium-review.googlesource.com/700460
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506680}
bratell
Avoid "unused member" warnings by removing unused member.
The profile_ member in TriggeredProfileResetter is not read by 
any code so let us remove it for platforms where it is not used.
This warning appeared in jumbo build
experiments (jumbo builds give the compiler more information which
triggers warnings that were not there before).

Bug: 770625
Change-Id: I4fd04d3147b01d0cf853b34c01ac7aa03fbd7d14
Reviewed-on: https://chromium-review.googlesource.com/695102
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dominic Battré <battre@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506679}
tmoniuszko
Generate projects for Visual Studio 2017 by default
GN should generate projects for Visual Studio 2017 by default since this
is the default compiler now.

Bug: 683729
Change-Id: I560983cf4c228a785e0ed2648567c7e0f07584d4
Reviewed-on: https://chromium-review.googlesource.com/700258
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#506665}
bratell
Removed unused member in device/bluetooth
Nobody used the member connection_monitor_started and that warning
broke jumbo build experiments (it notices such things more than
non-jumbo builds).

Change-Id: I77055474ecdbb1eaab8fbb925ea9b7a739a6f273
Reviewed-on: https://chromium-review.googlesource.com/700268
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Vincent Scheib <scheib@chromium.org>
Reviewed-by: Vincent Scheib <scheib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506429}
fs
Inhibit scroll-to-anchor for embedded SVGs
Fragment anchors are often used for "spriting purposes" when using SVG
documents, so scrolling the referenced element into view could seemingly
randomly scroll the top-level document (if it was same-origin with the
sprite sheet.) This is usually not an expected or wanted behavior.
Inhibit scrolling for all the embedding cases. (It's uncertain whether
this ought to affect <iframe>s or not, but let's include those too for
now. For simplicity.)

While here, also remove the dependency on SVGDocumentExtension for the
trivial operation of getting the root element.

Bug: 493802
Change-Id: I9942093331b2c53ba94ad83cfbe0a3b8b4ca6cbe
Reviewed-on: https://chromium-review.googlesource.com/700638
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#506411}
bratell
Removing "using namespace" in a global scope in autofill
"using namespace" in a global scope breaks jumbo builds (and
are not allowed in the code style guide). This patch replaces them
with explicit namespaces.

Bug: 771153
Change-Id: Ic45f740d8081b9f4e531b30ac05f6578a404de11
Reviewed-on: https://chromium-review.googlesource.com/697371
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506367}
bratell
Removing "using namespace" in a global scope in translate
"using namespace" in a global scope breaks jumbo builds (and
are not allowed in the code style guide). This patch replaces them
with explicit namespaces.

Bug: 771153
Change-Id: Iea234b0e02636b198af20b0f2b6ad53e735ebf7b
Reviewed-on: https://chromium-review.googlesource.com/697704
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Hajime Hoshi <hajimehoshi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506361}
bratell
Remove random string in mojo typemap file
There was a random sources block in image_filter.typemap which
broke jumbo since it has asserts that sources contains nothing
random. Normal builds ignored the sources entry since it didn't
match any toolchain.

Bug: 771153
Change-Id: I4b801ae350807701740946ca5ea5984c4086b61e
Reviewed-on: https://chromium-review.googlesource.com/697207
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#506350}
mstensho
Avoid inclusion of <algorithm> from popular header files when possible.
It's heavy to compile.

Bug: 766315
Change-Id: I0182fe1b9c8e8e6bd2024cb71bab7e3fcc501246
Reviewed-on: https://chromium-review.googlesource.com/695106
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506106}
fs
Revert behavior for non-scaling-stroke transform
https://codereview.chromium.org/2711503002 fixed getScreenCTM by
including the actual CTM from the element to the "screen" ("host"
coordinate space.) This of course also included the scale factor
contributed by any ancestor transforms. Including these transforms
however made evaluation of the non-scaling-stroke transform (the host
transform) unreliable, because of how that transform is "baked" into
the display list. (So if the host transform is sampled when it is
degenerate, all rasterization using that display list will produce
"weird" results - which will remain until an new display list is
recorded.)
Revert the computation of the non-scaling-stroke transform back
something akin to what it was previously until we can figure out a
better way to deal with this situation.

Bug: 747708
Change-Id: I8fdd19829c44f88d4d5e0bbbe4dec3ff2bee52a4
Reviewed-on: https://chromium-review.googlesource.com/697809
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#506099}
bratell
Adding missing include guard to test header file.
Found when experimenting with jumbo compilation for mojo
generated files.

Change-Id: I202a22fa9aa24df3f928992b67e3ad35321e7e1c
Reviewed-on: https://chromium-review.googlesource.com/693254
Reviewed-by: Ken Rockot <rockot@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#506085}
bratell
Jumbo for blink/platform/scheduler and its unit tests (-3.5 CPU minutes)
This adds support for jumbo to the scheduler code, including its
unittest. The total effect is about 3.5 CPU minutes which is about
30% of the remaining blink/platform time, or 0.5% of the total
content_shell+chrome+blink_tests compilation time.

Bug: 
Change-Id: I79f7b4d73e7a585a712744dbe7209f02bb043830
Reviewed-on: https://chromium-review.googlesource.com/693097
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#505982}
bratell
Move shared test classes in wtf tests to a shared file
HashSet, HashMap and ListHashSet, Vector and Deque tests have the
same test classes: MoveOnly, CountCopy, DestructCounter, WrappedInt,
LivenessCounter, ...

This both deduplicates the code and prevents symbol collisions in
jumbo builds.

Bug: 745732
Change-Id: I19874a89ba4933260f3c80727ac5ba1160831ad1
Reviewed-on: https://chromium-review.googlesource.com/678934
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505614}
bratell
Adding namespaces to prevent AppendToVectorTestTask clashes
Several test classes in scheduler have implemented
AppendToVectorTestTask and this patch gives those unique namespaces
to prevent them from clashing in jumbo builds.

Bug: 745732
Change-Id: I265c5507cbcc0f934f5904cc62033443442163f9
Reviewed-on: https://chromium-review.googlesource.com/692018
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#505364}
bratell
Adding namespaces to prevent NopTask collisions in jumbo builds
Several test classes in scheduler have implemented NopTask and
this patch uses unique namespaces to prevent them from clashing
in jumbo builds.

Bug: 745732
Change-Id: I8c3ecc80ab0696fbe4634d330dfe1e942dbcfa8b
Reviewed-on: https://chromium-review.googlesource.com/690345
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#505338}
bratell
Adding namespaces to prevent name collisions in jumbo builds
Several test classes in scheduler use the same name. As an alternative
to renaming them, or some of them, use unique namespaces. This
solves problems with MockTask and MockObserver.

Bug: 745732
Change-Id: I56da313dbbfb116d28d45ccd5f261cdfbf48d188
Reviewed-on: https://chromium-review.googlesource.com/687674
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505147}
fs
Fix pre-order traversal in LayoutBoxModelObject::HasNonEmptyLayoutSize
Passing 'this' (which |object| will be in this case) to
LayoutObject::NextInPreOrder, will turn it into a non-obvious way of
saying FirstChild.
Pass |root| instead of |object| to make the traversal actually pre-
order.

Bug: 769459
Change-Id: I6bc4c487faab053d02bc16826862234f15e2376e
Reviewed-on: https://chromium-review.googlesource.com/690254
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#505099}
fs
LayoutBoxModelObject::HasNonEmptyLayoutSize ignores SVG model objects
Extend the DCHECK to also cover SVG layout objects. The IsBox() check
should cover the SVG root, and if it is zero-sized any descendant should
not be considered to have a "non-empty" layout size. Overflow is
disregarded (as it seems to be in general in this method.)

Bug: 769459
Change-Id: Iea15b86032094a15608b614f5baa1057c5d6a686
Reviewed-on: https://chromium-review.googlesource.com/689997
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#505072}
mstensho
Less forcing of column flow flex children layout.
If the logical height of a child is intrinsic, we only need to lay it out if
there's a chance that the logical width of the flex container changed.
Otherwise nothing's going to change in there.

We do this by checking for kForceLayout, so that we don't risk descending into
deep subtrees just because some flex item sibling changed, for instance.

TEST=PerformanceTests/Layout/flexbox-deeply-nested-column-flow.html

Bug: 766633
Change-Id: I29337a176592779f07a37570fef8c85b1b4f6d99
Reviewed-on: https://chromium-review.googlesource.com/680214
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#504924}
mstensho
Don't include UseCounter.h from CSSParserContext.h and others.
public/platform/web_feature.mojom-blink.h is heavy.
Avoid it when possible.

Break the WebFeature defintion out of UseCounter.h and also make that
enum forward-declarable. There are quite a few translation units that
don't need to deal with UseCounter, just because they need to name a
web feature. And then there are also some places where we just need to
have the type forward-declared, such as in CSSParserContext.h

This reduces the number translation units that depend on UseCounter.h
by about 1601 compilation units, which is ~56%.

It seems that most translation units that include UseCounter.h really
need the WebFeature definition as well, so at least for now, it will
be included there.

Bug: 766315
Change-Id: I1cc0ee843373eb407c424ecd3c03c0f9080770bd
Reviewed-on: https://chromium-review.googlesource.com/669020
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Rune Lillesveen <rune@opera.com>
Reviewed-by: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504840}
rune
Properly await promises in inert-tests.
I did not find a way to await each forEach or map in inert-inlines, so
I fell back on a plain old for-loop.

Bug: 726218, 769347
Change-Id: I196ff128ce95319b7ca297254745aec842ef6cff
Reviewed-on: https://chromium-review.googlesource.com/686814
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504733}
bratell
Changing files for some bindings testing helpers
This is a followup to commit e303b7d8 after same followup
review comments.

Bug: 745732
Change-Id: I768e2fb98d6084e5ea7d24edbe74916cd4bc09c4
Reviewed-on: https://chromium-review.googlesource.com/686896
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#504673}
bratell
Adding namespaces to prevent name collisions in jumbo builds
Several test classes in scheduler use the same name. As an alternative
to renaming them, or some of them, use unique namespaces.

Bug: 745732
Change-Id: I00bbbc957c58c04013a77b89b2b0cdf7c0c6321d
Reviewed-on: https://chromium-review.googlesource.com/682055
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504655}
rune
Missing return of Promise in automated pointerevents test.
Bug: 754222
Change-Id: Ic0c906535182da26f13246248e34023a4a896b8e
Reviewed-on: https://chromium-review.googlesource.com/686821
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#504649}
rune
Reland "Store new ComputedStyle object if style did not change."
This is a reland of https://chromium-review.googlesource.com/681755

The comparison of ComputedStyle does not take additional flags into
account. For instance, the AffectedBy* flags used for updating pseudo
classes like :hover. We used to call SetStyleInternal, but this was
removed because the previous comment said it was because of style
sharing which is now removed.

The display:contents case (768406) never worked because the code path
for StoreNonLayoutObjectComputedStyle() was always skipped when
computed style compared to be equal.

TBR=nainar@chromium.org,treib@chromium.org

Bug: 768406, 767832, 768790
Change-Id: Iee509e43e5fcc29d04944655d3d966ea61cc2adf
Reviewed-on: https://chromium-review.googlesource.com/684186
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#504561}
mstensho
Performance test with deeply nested column flex containers.
In this teste there's a (rather) deeply nested subtree of column-flow flex
containers. The root of this subtree is itself a flex item in a row-flow
container. It has a sibling item whose child changes width, without affecting
the flexed size of the deeply nested subtree. This shouldn't require the
subtree to be re-laid out, but it currently does get re-laid out, thanks to the
fix for bug 752078.

Bug: 766633
Change-Id: I3d76736730f18082a299907f7b2a543d2b087ba8
Reviewed-on: https://chromium-review.googlesource.com/680216
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#504458}
bratell
Adding missing include guard to ui/views/animation/ink_drop_stub.h
Change-Id: Id3e0139beeca89444f4100de67c21da579c49047
Reviewed-on: https://chromium-review.googlesource.com/684739
Reviewed-by: Mohsen Izadi <mohsen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#504388}
bratell
Deduplicate some testing helper functions in v8 bindings test.
V8ScriptValueSerializerTest and V8ScriptValueSerializerTestForModules
had a few methods in common. This patch makes those methods be
shared, or in the case or non-identical methods, renamed to not collide
in jumbo builds.

Bug: 745732
Change-Id: Ia51d9f8dba1910902465dc4cffc193031b47ee3f
Reviewed-on: https://chromium-review.googlesource.com/677446
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#504379}
bratell
Remove a small header by including it in ToV8ForCore.h
A bit of cleanup after a recent commit that added an unnecessary header
file.

Bug: 745732
Change-Id: I1a90f22c9301ab60a09ea2fec9020c5da431460b
Reviewed-on: https://chromium-review.googlesource.com/684177
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504361}
rune
Update counters after style recalc, not layout.
We used to update counters on every layout as long as there was at
least on LayoutCounter in the rendered document. Also, the update was
triggered by marking the changed element for layout.

We need to update counters when we add/remove LayoutCounter, or when
computed counter directives change on rendered elements during style
recalc. We update counters immediately after style recalc and layout
tree rebuild in Document::UpdateStyle().

Bug: 768357
Change-Id: I32693fefaa7bdb74cf959ef5ead4256d2ec2d0da
Reviewed-on: https://chromium-review.googlesource.com/678676
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504310}
bratell
Deduplicate a testing template in v8 bindings test.
The two implementations of ToV8 for testing collided in jumbo builds
so to avoid having to exclude some files in bindings tests from jumbo
this patch moves the template to a shared header.

Bug: 745732
Change-Id: Iaa7cf7e19d987e7a048fc606eafaedb49606959a
Reviewed-on: https://chromium-review.googlesource.com/677394
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Jens Widell <jl@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#504304}
rune
Store new ComputedStyle object if style did not change.
The comparison of ComputedStyle does not take additional flags into
account. For instance, the AffectedBy* flags used for updating pseudo
classes like :hover. We used to call SetStyleInternal, but this was
removed because the previous comment said it was because of style
sharing which is now removed.

The display:contents case (768406) never worked because the code path
for StoreNonLayoutObjectComputedStyle() was always skipped when
computed style compared to be equal.

Bug: 768406, 767832
Change-Id: Iac4708e3cd3a6451d99c1bb2bb69efb74289b8eb
Reviewed-on: https://chromium-review.googlesource.com/681755
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#504285}
mstensho
[LayoutNG] Prevent negative column widths.
If the width of the column gaps is larger than the available content width of
the multicol container, clamp negative column widths to zero. This fixes
DCHECK failures, since the engine doesn't fancy negative widths that much.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I934b28dfe494ccdffb53c0693d1056ff87fed82e
Reviewed-on: https://chromium-review.googlesource.com/666896
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#504134}
bratell
Revert "Add jumbo_test template"
This reverts commit 21f6df2a9bbb8c7bc60186c2ae1792b8361e1c5d.

Reason for revert: This added a dependency between //build and //testing that complicates life for //v8. Need time to evaluate what the best fix it.

Original change's description:
> Add jumbo_test template
> 
> We already support jumbo_source_set, jumbo_component and
> jumbo_static_library so this is just another common template with a
> non-default configuration.
> 
> This is needed in some form for jumbo in blink unittests.
> 
> Bug: 761475
> Change-Id: I443fedb4a41c43cf21102e2a2f8ced937961665c
> Reviewed-on: https://chromium-review.googlesource.com/671369
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
> Commit-Queue: Daniel Bratell <bratell@opera.com>
> Cr-Commit-Position: refs/heads/master@{#503193}

TBR=dpranke@chromium.org,bratell@opera.com,brucedawson@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 761475
Change-Id: Ie58618afa061107ccb28e29cda6e1c50e91629ba
Reviewed-on: https://chromium-review.googlesource.com/681716
Reviewed-by: Daniel Bratell <bratell@opera.com>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#504075}
fs
Add missing file extension (.h) in core/layout/BUILD.gn
TextDecorationOffsetBase.h was missing the .h qualification. This broke
Jumbo builds, but is incorrect in general.

Change-Id: Ife16025f01c1fc51ce6620b77140b1485a8fe994
Reviewed-on: https://chromium-review.googlesource.com/681334
Reviewed-by: Daniel Bratell <bratell@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#504033}
mstensho
[LayoutNG] Re-enable CollapsingMarginsCase6 unit test.
Don't know when it started to pass, but at least it passes now. :)

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: If9d7be1de73310d17996fa85c50a6a18f6169b10
Reviewed-on: https://chromium-review.googlesource.com/664806
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503977}
mstensho
Include less from Element.h
Bug: 766315
Change-Id: I16b36710368f24b76c7598f9956e3cd80c95f4fc
Reviewed-on: https://chromium-review.googlesource.com/668443
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503941}
hugoh
Ignore <input> and <textarea>'s user-select styling
Background:
The CSS spec says that user-select does "selective inheritance",
see https://drafts.csswg.org/css-ui-4/#propdef-user-select.

<input> and <textarea> are two elements that are affected
by this. These elements should not inherit user-select from
parent elements.

Fixed problem:
<input|textarea readonly|disabled> could inherit
"user-select: none".

This regressed because
https://chromium-review.googlesource.com/570246
removed input|textarea's default user-select styling.

Solution:
Make all text controls always selectable. This is done in
LayoutTextControl::AdjustInnerEditorStyle.

Interoperability note:
<input readonly style="user-select: none"
value="Chrome 61 cannot select this.">. This CL fixes
this by ensuring that all text fields (i.e also readonly fields)
are always selectable (no matter user-select styling).

In other words, <input> and <input readonly> now behave in
the same way (both always allow selections) which aligns
us with Firefox and Edge.

BUG=761433, 764316

Change-Id: I89fc94a2a04caf3a87b12a9071081dafd48a8727
Reviewed-on: https://chromium-review.googlesource.com/663217
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Hugo Holgersson <hugoh@opera.com>
Cr-Commit-Position: refs/heads/master@{#503793}
bratell
Rename GarbageCollectedHolder to avoid clash
There is already a GarbageCollectedHolder class in webkit_unit_tests
so this renames the second one GarbageCollectedHolderForToV8Test 
to avoid collisions in jumbo builds.

Bug: 745732
Change-Id: Idc625d35fd3590292d93e1a3a0b685db12bd7368
Reviewed-on: https://chromium-review.googlesource.com/677397
Reviewed-by: Jens Widell <jl@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#503753}
wdzierzanowski
Allow lookup of videodecoder service to fix HW video decoding on macOS 10.13
Tha macOS sandbox has apparently changed in 10.13.  If we don't allow
lookup of the global Mach service com.apple.coremedia.videodecoder,
VTDecompressionSessionCreate() fails with
kVTVideoDecoderNotAvailableNowErr for some videos.

Bug: 767037
Change-Id: I4fee235d3808a504d57660976ef96b3a0a0f54d7
Reviewed-on: https://chromium-review.googlesource.com/677290
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503747}
karlo
offsetParent fails to consider continuations when searching for parent.
Block-level objects can have inline parents, but this triggers the
insertion of anonymous boxes and continuations, which offsetParent()
currently doesn't understand.

This change lets offsetParent() understand continuations better.
If an anonymous continuation is encountered when finding ancestors,
it will use the split inline as the ancestor, and continue searching
from there.

BUG=638177

Change-Id: I8850f9b5dacaffaa26b5f1c414f4f351709d7088
Reviewed-on: https://chromium-review.googlesource.com/674875
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Cr-Commit-Position: refs/heads/master@{#503704}
karlo
[LayoutNG] Implement NG support for the line height quirk.
This cl implements NG support for the line height quirk.  There
are some deviations from the behavior of the old layout code:

- inline boxes with margins in the inline direction will now cancel
  the quirk, previously only borders and padding caused this.  This is
  in line with Gecko and Edge.

- in the existing layout engine, if there's a line break between two
  replaced elements separated by whitespace, the whitespace at the end
  of the line is preserved, in turn causing the line height quirk to
  be cancelled.  The whitespace preservation appears to be in
  violation of CSS 2.2, 16.6.1, and does not exist in NG.

A few test cases had to be altered to accommodate these differences.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I3d8d7eaf0f2c17ef1cbd4545996c29d371aaf7c6
Reviewed-on: https://chromium-review.googlesource.com/664720
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503566}
mstensho
Remove unnecessary includes from UseCounter.h
Especially v8.h is heavy.

Bug: 766315
Change-Id: I9bd71910607f829fd0f71d8de0e64d3dbc741461
Reviewed-on: https://chromium-review.googlesource.com/669019
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#503538}
bratell
Make sure to include traits before testing them in tests.
It's possible to check traits without including their specialization
or doing an implicit instantiation but then you get the default
values which can be wrong (or you would not have had a specialization).
In jumbo builds this is noted because first you get an implicit
instantiation and then an explicit instantiation which is a C++ error.

Fix is to make the explicit instantiation before any implicit
instantiations can happen. I do wish this error wasn't so invisible. It's
the third or fourth detected through jumbo builds.

Bug: 761475
Change-Id: Ifceb604e027ac8877764b584555007c854c74f03
Reviewed-on: https://chromium-review.googlesource.com/677383
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#503454}
bratell
Rename MockScrollableArea to be more unique
There is a MockScrollableArea defined in ScrollbarTestSuite.h so if
the compiler sees that function then you get compilation errors. That
happens in jumbo builds so to avoid this problem this patch renames
the function MockScrollableAreaForAnimatorTest which follows a pattern
used elsewhere.

Bug: 745732
Change-Id: Ia264efac21e4c358e50aa90ec666a95d32366642
Reviewed-on: https://chromium-review.googlesource.com/671424
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#503390}
rune
Expose CSSViewportRule only if runtime flag is enabled.
Bug: 766652
Change-Id: I7e76640a397eafeba28f178fb568b3af7cdccf49
Reviewed-on: https://chromium-review.googlesource.com/674924
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#503370}
bratell
Add jumbo_test template
We already support jumbo_source_set, jumbo_component and
jumbo_static_library so this is just another common template with a
non-default configuration.

This is needed in some form for jumbo in blink unittests.

Bug: 761475
Change-Id: I443fedb4a41c43cf21102e2a2f8ced937961665c
Reviewed-on: https://chromium-review.googlesource.com/671369
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#503193}
mstensho
Don't include Document.h from CSSParserContext.h
Around 330 fewer dependencies on Document.h.

Bug: 766315
Change-Id: I48cb525c176b27463f06090bad125bb2025b5759
Reviewed-on: https://chromium-review.googlesource.com/668444
Reviewed-by: Rune Lillesveen <rune@opera.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#503117}
mstensho
Include less from platform/geometry/ headers.
In particular, avoid <algorithm>.

Specifying the default template parameters to Vector in Forward.h
means that we can no longer specify them along with the template
definition.

Bug: 766315
Change-Id: I62eeaf5da82f59431d68011f904a1fcaf9f93f81
Reviewed-on: https://chromium-review.googlesource.com/668367
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502920}
bratell
Use differently named test classes in blink/platform tests
Both PODFreeListArenaTest and PODArenaTest had local test classes
naemd TestClass and those collided in jumbo build. This patch
changes the colliding names to be more unique inside blink/platform.

Bug: 745732
Change-Id: I8b31e62125c0e0eb84103d91f3e28dd9decd3f5f
Reviewed-on: https://chromium-review.googlesource.com/671265
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#502812}
bratell
Add prefix to test class names to make them more unique.
Jumbo didn't like that there were two TestExtraData classes in
platform/exported tests so this adds appropriate prefixes to them.

Bug: 745732
Change-Id: I9286225bf37dd39342e28aec8ddcca3da6504063
Reviewed-on: https://chromium-review.googlesource.com/671270
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#502811}
bratell
Support jumbo in blink/platform/loader (-2.5 CPU minutes)
Supporting jumbo in blink/platform/loader saves about 2.5 CPU minutes
of effort which is about 0.3% of the remaining build time. Not much
but it's only a few added characters.

Bug: 761475
Change-Id: I3ca17ff6fefb04c43dd9571aea5e749bfe86b81d
Reviewed-on: https://chromium-review.googlesource.com/671231
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#502809}
bratell
Rename InsertionAndDeletionTest to avoid collisions with other tests
There are InsertionAndDeletionTest functions in both PODIntervalTreeTest
and PODRedBlackTreeTest and in jumbo builds they collide. This patch
renames one of them TreeInsertionAndDeletionTest.

Bug: 745732
Change-Id: Ieba300f4532695060250cb70f88f53713158ccf1
Reviewed-on: https://chromium-review.googlesource.com/671228
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#502808}
bratell
Deduplicate some oilpan test utility functions.
Several utility functions existed in both HeapTest.cpp and
HeapCompactTest.cpp. This patch moves them to a shared file so that they
don't collide in jumbo builds. Also, less duplicate code is better.

Bug: 761475
Change-Id: Ia5a4bb0b205646564ccec7e87150283837028191
Reviewed-on: https://chromium-review.googlesource.com/671267
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#502806}
rune
Re-attach whitespace children when removing DOM nodes.
When the display type changes for an element in the DOM tree, the
WhitespaceAttacher would re-attach whitespace siblings appropriately
when traversing the re-attached element.

When a DOM node is removed from the tree, there will be no layout tree
rebuild. Or, at least, the removed node will not be encountered by the
traversal to trigger a re-attachment of any following whitespace nodes.

In order to fix that, introduce a hash set which contains elements
which had one of their layout tree children removed since the last
layout tree update. In the next UpdateStyle mark these elements for
layout tree rebuild and let the WhitespaceAttacher check if any of its
whitespace children needs to be re-attached.

Bug: 763291, 762833, 364817
Change-Id: I4d1b3df10d07f549abfea17df0184beca0623ef7
Reviewed-on: https://chromium-review.googlesource.com/661957
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502803}
mstensho
Include less from ContainerNode.h
Bug: 766315
Change-Id: I791ae5a12f0602c95194a60659e29e572dce5c8a
Reviewed-on: https://chromium-review.googlesource.com/668441
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502744}
bratell
Use differently named test classes in blink/platform tests
Both PaintChunkerTest and PaintControllerTest have test classes named
TestDisplayItem. These collide in jumbo builds so this patch renames
one of them TestDisplayItemGeneric to be unique inside blink/platform.

Bug: 745732
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I3cdd3b21f5523ef54fe3fbe29f4f7dc0607d7874
Reviewed-on: https://chromium-review.googlesource.com/671423
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#502675}
bratell
Fix header include guard for MockImageDecoder.h
The include guard was missing the actual define.

Bug: 745732
Change-Id: Id6435955c9011295b9583d29df6f45d008f0e192
Reviewed-on: https://chromium-review.googlesource.com/671233
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502602}
bratell
Rename EXPECT_RECT_EQ to be more unique and accurate
There is an EXPECT_RECT_EQ in //cc/test/geometry_test_utils.h which is
used by other tests. Since that causes problems in jumbo builds and
since it is not an equality comparison, this renames the macro
EXPECT_FLOAT_RECT_NEAR (following a pattern used elsewhere).

Bug: 745732
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I2720f72dbf0b8dac603c19d312109fb83fdfa313
Reviewed-on: https://chromium-review.googlesource.com/671230
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502601}
bratell
Reuse existing ValueToString<float> in test
There is a ValueToString<float> in FloatPolygon to be used by
POD tests so PODIntervalTreeTres doesn't need to define its own.

Noticed in a jumbo build where the two copies collided.

Bug: 745732
Change-Id: I7dd3cd6429ac9c1357dad8c7e3cf98140a58f9d3
Reviewed-on: https://chromium-review.googlesource.com/671266
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502598}
mstensho
Include less from Node.h
Node.h is a popular header, so this affects compilation times.

Change-Id: Iea71e63f518885aa7c1552470f75b78a1e29a4cf
Reviewed-on: https://chromium-review.googlesource.com/668370
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502493}
mpichlinski
CHR-6375: Fixed crash on fallback from ANGLE to SwiftShader.
During fallback from ANGLE to SwiftShader it is required to unload
ANGLE libraries, otherwise SwiftShader will fail to load its own
libGLESv2 library.

Fixed ANGLE platform reset.

Fixed memory leak on X11 by fixing order in ShutdownGL.

Leak was occuring during fallback from libGL to software GL implementation
because ShutdownGL was cleaning GL implementation info before unloading
GL and therefore libGL was unloaded with known issue crbug.com/250813

Previous attempt with memory leak:
https://chromium-review.googlesource.com/640992

Reverted in:
https://chromium-review.googlesource.com/650286

Bug: 760063, 761930
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ibea80f560aa50ba48cbff6f39a664095db38daaf
Reviewed-on: https://chromium-review.googlesource.com/668357
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502409}
mstensho
[LayoutNG] Border and padding on multicol containers.
Code was missing both on the column fragment positioning side, and on
the legacy write-back side.

Moved the call to UpdateLegacyMultiColumnFlowThread() further
down. Apart from making sense (nice to have written back the size of
the multicol container before updating the flow thread), this became
necessary now, because otherwise ValidateColumnSets() would nuke the
logical width of the flow thread, now that the flow thread gets its
logical width set earlier.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I1f6906f488b0251d4a00117e66ae6e06649568d6
Reviewed-on: https://chromium-review.googlesource.com/668372
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502406}
fs
Enable Skia's SkImageGenerator implementation
The SkImageGenerator_none.cpp implementation of
SkImageGenerator::MakeFromEncodedImpl always produce empty output.

Bug: 758459
Change-Id: I0745e28c7c9f4aa09efbe0f0de7c88faab87f868
Reviewed-on: https://chromium-review.googlesource.com/668408
Reviewed-by: Leon Scroggins <scroggo@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#502401}
fs
Propagate GlobalPaintFlags to EmbeddedContentView::Paint
The global paint flags - like the kGlobalPaintFlattenCompositingLayers
flag - were lost when descending into frames for painting. This would
cause composited layers to not be painted.
Add a GlobalPaintFlags argument to EmbeddedContentView::Paint, and pass
the flags carried by PaintInfo to it, and propagate as needed.

Bug: 765099
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I8c824dd12e7caa4c65cfd0bf0c3ab8de69ddfcfb
Reviewed-on: https://chromium-review.googlesource.com/667160
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#502328}
mstensho
[LayoutNG] Unbreakable content in block fragmentation.
This introduces limited support break-inside:avoid on in-flow block-level
elements. After layout, if we discover that we need to insert a break in front
a node, in order to honor break-inside:avoid, drop the fragment and retry at
the start of the next fragmentainer.

The constraint spaces now need to know the full fragmentainer block size, in
addition to what they have available. It's only when the available size is less
than the full fragmentainer size, that we can break before some node. Otherwise
there'd be no progress, and we'd end up with an infinite number of empty
fragmentainers.

Since I wanted to DCHECK that we only break before the first fragment of some
node, and therefore needed IsFirstFragment(), I moved that function along with
its friends from the anonymous namespace of ng_block_node.cc to a new
ng_fragmentation_utils.h file. There's some uncertainty as to how to treat
non-box fragments here, but we can figure that out later.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I0ad419177d174fdc787061206ee1abd86deb8943
Reviewed-on: https://chromium-review.googlesource.com/666816
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#502217}
bratell
Support jumbo in blink/platform (-20.5 CPU minutes)
Supporting jumbo in blink/platform saves about 20.5 CPU minutes on
the reference hardware.

A few files are still excluded and that is tracked in referenced bugs.

R=haraken@chromium.org

Bug: 761475
Change-Id: Ibdd1916f24c50c0ef2c62ca0b1c3b3e80643fb5d
Reviewed-on: https://chromium-review.googlesource.com/652998
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#502211}
rune
Rebuild non-distributed children with separate WhitespaceAttacher.
We used to pass in the same WhitespaceAttacher to the pass over non-
distributed child nodes which caused DidVisitText() to mess up the
whitespace re-attachment of whitespace being the left-most node of the
distributed nodes. In particular if there was a ::before element
changing display type preceding that left-most space.

Instead, make a RebuildNonDistributedChildren() method which passes in
a separate WhitespaceAttacher.

Bug: 765090
Change-Id: I4fd3bd417d7a5d7accdcb8b6155991093ab05f50
Reviewed-on: https://chromium-review.googlesource.com/666681
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#502202}
rune
Always rebuild layout tree for shadow root when host is rebuilt.
We tried to do a light-weight search for the first in-flow or text
child of the shadow root when shadow root children didn't need a
rebuild. This was done to make the WhiteAttacher point to the correct
text node when re-attaching the ::before element.

This code did not properly handle slots and insertion points. Also,
supporting display:contents for ::after means we will have to traverse
shadow root children from its last node until we find the first in-flow
to properly attach a space inside an ::after element.

For simplicity, and correctness, walk the shadow root children using
RebuildChildrenLayoutTrees() instead.

Bug: 764686
Change-Id: Icb9f8db7172ea54bd876fd95ca722c2906b4c639
Reviewed-on: https://chromium-review.googlesource.com/667138
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#502194}
tsniatowski
Forward cflags/cflags_cc in fuzzer gn template
Forwarding more of the usual gn variables is likely less surprising
-- defines and include_dirs are already forwarded, so add cflags and
cflags_cc too so it takes less effort to suppress a stray warning when
writing a fuzzer test case.

Change-Id: I5a490e4f2520871bdf649fc3ea3b75bbea0653df
Reviewed-on: https://chromium-review.googlesource.com/663860
Reviewed-by: Oliver Chang <ochang@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Commit-Queue: Tomasz Sniatowski <tsniatowski@opera.com>
Cr-Commit-Position: refs/heads/master@{#501926}
mstensho
[LayoutNG] Update multicol FlagExpectations for LayoutNG
Two multicol tests time out flakily, but if they don't, they pass.

TBR=atotic@chromium.org,kojii@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I63f2434629f833c6d52f0a4672faa1a3be1fa8a3
Reviewed-on: https://chromium-review.googlesource.com/666619
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#501923}
mstensho
LayoutNG] Calculate available fragmentainer space correctly.
When processing children, we forgot to subtract the BFC offset. We just used
the value returned from the constraint space's FragmentainerSpaceAvailable()
directly. Renamed that method in both the constraint space and the builder to
FragmentainerSpaceAtBfcStart(), to make it clear that this value doesn't
necessarily return the space available to the block currently being laid out.

Added FragmentainerSpaceAvailable() to the block algorithm instead, and also
moved IsOutOfSpace() into the class.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: If1232a1a33dd4c7655339eed2a88104b98f06bc0
Reviewed-on: https://chromium-review.googlesource.com/664805
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501750}
fs
Rework normalization in LayoutSVGInlineText
When performing (whitespace) normalization in an OriginalText override,
we miss normalization when the layout object has its text content
updated.
Perform the normalization in the SetTextInternal override instead to
cover the text-content-update case as well.

Bug: 645597
Change-Id: Id65cbbe75dbcc636f4cde38b8bb8887d05caf1d7
Reviewed-on: https://chromium-review.googlesource.com/664812
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#501678}
mstensho
[LayoutNG] Detect breaks that occur at the exact start of blocks.
Such breaks used to go unnoticed and cause misery and assorted unpleasantries.
Upgraded test expectations. Added a unit test.

As long as we haven't both got an in-flow child that broke AND exceeded
available fragmentainer space, we need to continue and lay out its siblings. A
block of zero height at a fragmentainer boundary actually belongs in the former
fragmentainer, not the latter. A consequence of this change is that even
non-zero height blocks that start at a fragmentainer boundary gets a
zero-height fragment in the former fragmentainer, before it continues in the
next fragmentainer. We may want to avoid this, but I'm not sure what's more
correct yet (or if it matters at all).

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I50e862d8c0dc787a47b799e2e639e5ca7ba57158
Reviewed-on: https://chromium-review.googlesource.com/663141
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501588}
mstensho
[LayoutNG] Prevent breaks from escaping the containing fragmentation context.
The call sites that call NGFragmentBuilder::AddChild() also need to explicitly
propagate breaks to their container, if that's what they want. The column
layout algoirithm *doesn't* want this.

Bug: 757767
Change-Id: I203c045fc85a65303dfe4c0cdad20eb60e64fba2
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Reviewed-on: https://chromium-review.googlesource.com/663859
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501444}
fs
Fix indentation in SVGImage::DataChanged
Change-Id: If895e92065d23e3da4f5d659c114abf024038b38
Reviewed-on: https://chromium-review.googlesource.com/663537
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#501319}
bratell
Make the forward declaration of ShapeResultSpacing correct.
The lack of PLATFORM_EXPORT on the forward declaration made the compiler
generate non-exported template instantiations which later caused linker
errors when those methods were missing.

R=drott@chromium.org, mstensho@opera.com

Bug: 764255
Change-Id: I2e03b924185dd7787d8129aa4c3c93716341cdbd
Reviewed-on: https://chromium-review.googlesource.com/663377
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#501260}
bratell
Removed unused member variable in OpenTypeCapsSupport
Jumbo builds (where the compiler has more information) noticed that
run_ is unused and emitted a warning.

R=drott@chromium.org

Change-Id: I4a975375cfc772e77dd5e9692c5cdc982a8453c1
Reviewed-on: https://chromium-review.googlesource.com/663179
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501256}
mstensho
[LayoutNG] Update test expectations to get rid of *some* of the unexpected passes.
All probably related to a recent change to TextIterator [1], which made legacy
layout dump text identically to what NG does.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/653665

TBR=xiaochengh@chromium.org,kojii@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Bug: 758816
Change-Id: Idda7617e54d254d76bf170cb59c8cd7c9ddd16d6
Reviewed-on: https://chromium-review.googlesource.com/663037
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#501234}
bratell
Avoid implicit conversion to CGRect and CGSize.
Implicit conversion to CGRect and CGSize can create extra conversion paths
(if known) between various rect/size types. Such extra conversion paths
can make the compiler fail to compile because of ambiguity.

Since conversions between CGRect and CGSize and internal types are lossy
both ways (float <-> int), it's best to avoid them anyway except when
they are really needed so this patch makes the cast operators explicit.

Short term, the implicit conversions break jumbo builds since the compiler
there knows "too much" and gets confused.

Bug: 761475
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I7b29fba20d4dd836015a594081f4e6256bd42732
Reviewed-on: https://chromium-review.googlesource.com/657645
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500928}
mstensho
Adjustments for LayoutNG in LayoutBlockFlow line layout.
LayoutNG ignores LayoutMultiColumnFlowThread objects, so that the DOM
children of a multicol container become actual layout children of said
multicol container (on the NG side), without any intervening flow
thread block. However, the flow thread is still created even in NG (to
be able to paint and hit-test using the legacy layout structure), so
when NG invokes the legacy engine to lay out lines, we need to be able
to stop walking the ancestry when reaching the flow thread.

This fixes a bunch of crashing tests. They will now either pass or
fail (without crashing) instead.

Bug: 757767
Change-Id: I55693c34aefe53b47ceb7d7490059cc1182e5ff8
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Reviewed-on: https://chromium-review.googlesource.com/660297
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#500925}
bratell
Unduplicated test helper function compare_markers.
The 3 copies of compare_markers collided in jumbo builds.

Bug: 745732
Change-Id: I4363201af5e78dfa5ee59148c48d89feeeaa1a80
Reviewed-on: https://chromium-review.googlesource.com/653277
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500918}
tsniatowski
PlzNavigate: Fix multiple extra_headers in LoadUrlWithParams
NavigationControllerImpl operates on LoadURLParams, which state
"Extra headers for this load, separated by \n.", and on
NavigationEntryImpl, which state "Extra headers (separated by \r\n)
to send during the request". However, there is no conversion
from one form to the other, instead the extra headers are passed
verbatim.

This is not an issue when PlzNavigate is not enabled, because there
are more conversions on the way to and from the renderer, and things
end up working anyway. However, the shorter path of PlzNavigate
makes code further down choke on improper data when more than one
header is passed.

Fix by converting LF to CRLF when moving from LoadURLParams to
NavigationEntryImpl, and by adding a second header to a bunch of tests
that only sent one extra_header, thus not showing the problem.

BUG=763804

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I3e492520c8bd059b0d00107b38cfdf6daa8d96f2
Reviewed-on: https://chromium-review.googlesource.com/659577
Commit-Queue: Tomasz Sniatowski <tsniatowski@opera.com>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500905}
mstensho
Fix jumbo build.
A static IsPositionValidFor() got added to two .cpp files almost at the same
time. Made them non-static and declared them in Position.h

TBR=rlanday@chromium.org,yoichio@chromium.org

Change-Id: I50d7006b20ddba2b7f58906eb167107cb38933e6
Reviewed-on: https://chromium-review.googlesource.com/659658
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#500887}
bratell
Avoid global "using namespace std"
Importing all of namespaces into the global level causes problems with
jumbo builds (and also coding style). This patch removes a few
using namespace std;
from WTF.

Bug: 761475
Change-Id: Ibdb073db243c960058d06433666f24c6880f40a8
Reviewed-on: https://chromium-review.googlesource.com/657642
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500877}
bratell
Renamed IsValid in blink/platform/network unit tests
Both ParsedContentDispositionTest and ParsedContentTypeTest used a local
helper function named IsValid. That is normally no big deal
but in jumbo builds they can be compiled in the same translation unit
and then the function will collide. This patch gives the functions
unique names so that no tests have to be excluded from jumbo.

Bug: 745732
Change-Id: Icc591553e54062eb189d8c7df243191c3f75f42a
Reviewed-on: https://chromium-review.googlesource.com/657840
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500860}
fs
Reevaluate SVGImageElement 'href' when moving to a new document
This aligns the behavior of SVGImageElement to that of HTMLImageElement
for when the element is moved to a new document.

Bug: 720310
Change-Id: I2d78778a40de874fe45b710a0f284ded6cc8b84b
Reviewed-on: https://chromium-review.googlesource.com/657384
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#500655}
mstensho
[LayoutNG] Ignore block-start margin in subsequent fragments.
The block-start margin only matters in the first fragmentainer where the node
occurs. This used to trigger DCHECK failures.

The new unit test used to DCHECK-fail (but would pass with DCHECKs disabled).

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I8ee47f0d08a989f121c5bd8f18806398a4d6d837
Reviewed-on: https://chromium-review.googlesource.com/657182
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#500614}
mstensho
Include ComputedStyle.h from fewer header files.
Brings down the number of translation units that depend on ComputedStyle.h by
268 (from around 1250).

A recent CL, https://chromium-review.googlesource.com/648536 increased the
number of dependent translation units by 222, so this CL should cancel out the
build time slowdown introduced by that CL.

Change-Id: Ic3eef583dd9679c5e5f94d99b5366003f96b89d8
Reviewed-on: https://chromium-review.googlesource.com/656117
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Jia Meng <jiameng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500553}
bratell
Skip CharCategory alias since it was only used once
The CharCategory alias caused issues with jumbo builds. Too many
different interpretations of the symbol CharCategory triggered
compilation error. Since this alias really doesn't add any value,
it's easy to just drop it.

Bug: 761475
Change-Id: I8473fda6104a520f1464a88d49ba73599ea5fc62
Reviewed-on: https://chromium-review.googlesource.com/654838
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500548}
rune
Use Previous/NextSibling instead of Slow*Child().
The former methods should be faster.

Change-Id: I1fb5ae5eeaea78b561cffbe6a78594af0f7a75b6
Reviewed-on: https://chromium-review.googlesource.com/655078
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#500402}
fs
Remove unused state from TextTrackLoader
Merge kIdle and kLoading using the name of the latter.

Bug: 466083
Change-Id: I51041fac66a18df6ff0801bcc9606c1f1c04126d
Reviewed-on: https://chromium-review.googlesource.com/652473
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#500382}
bratell
Remove unused "using base::Time"
When experimenting with jumbo builds in content this Time conflicts
with other things, and since it's unused it's easy to just remove it.

Change-Id: I853e2da58963c875158b750839a706e49edad93e
Reviewed-on: https://chromium-review.googlesource.com/653161
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500370}
mstensho
[LayoutNG] Customized fragment tree dumping, for use in unit tests.
Add a dump method to NGPhysicalFragment that returns a string, in addition to
the one we already have, that dumps to stderr. Add flags, so that callers can
pick exactly what to dump.

Change most of the column layout algorithm tests to compare a fragment dump
tree string to an expectation string. Maintaining and following what was going
on inside those tests was at the brink of what's humanly possible.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I3151509d0cfb189c2330557bf25ef16b1a78f478
Reviewed-on: https://chromium-review.googlesource.com/652467
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500353}
bratell
Avoid the name UnicodeRange in tests since it already exists
There is a platform/fonts type UnicodeRange so creating a function
with the same name causes confusion in jumbo builds where both
the type and the function will be known to the compiler at the same
time.

R=fs@opera.com

Bug: 745732
Change-Id: Id8c9ebfb7289cd546979638814b3e67b169f6671
Reviewed-on: https://chromium-review.googlesource.com/655457
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500320}
bratell
Deduplicate a couple of hash function in platform/fonts.
In jumbo builds the two implementations of AddToHash and
AddFloatToHash collided. The AddToHash implementations were identical
while AddFloatToHash were slightly different, but it seems better for
everyone to merge them to a single set of functions.

Bug: 761475
Change-Id: I547b432970a4f4f03e2fea7af1e7bfdf400de149
Reviewed-on: https://chromium-review.googlesource.com/651418
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500297}
bratell
Removing global "using namespace" in platform Mac code
Importing namespaces into the global namespace causes issues in jumbo
builds. This patch removes some that were not even used and replace
some with explicit namespaces.

Bug: 761475
Change-Id: Iaec529e8a4ea8a8572575fb546263946282d1c59
Reviewed-on: https://chromium-review.googlesource.com/654641
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500296}
bratell
Reuse an existing WebCoreFloatToSkScalar instead of copying it
There is one WebCoreFloatToSkScalar in platform/graphics/skia and one
in platform/geometry. This patch makes platform/geometry use the one in
platform/graphics/skia.

Bug: 761475
Change-Id: I32c938c5d3ea08d2cf3e7bfc2a0ff469006268b0
Reviewed-on: https://chromium-review.googlesource.com/653159
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#500285}
bratell
Merge two implementations of operator<<(FloatPoint3D)
There were two implementations of
TextStream& operator<<(TextStream& ts, const FloatPoint3D& p)
in filter serialization and while that is a minor issue, they caused
conflicts in jumbo builds so rather than excluding files from jumbo,
this moves the implementation to FloatPoint3D.h.

Bug: 761475
Change-Id: I11eee18d33f3eb34b50fb5849bb0e72d6a9a8089
Reviewed-on: https://chromium-review.googlesource.com/651417
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500252}
fs
Forward-declare TextTrack in HTMLMediaElement.h
Change-Id: I535a633cdb7c31c632b61411bad00e5918d62e6c
Reviewed-on: https://chromium-review.googlesource.com/652548
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#500243}
fs
Empty files should not succeed in loading (as WebVTT)
Empty files will naturally not have a valid signature, so should fail
the signature check. When there's no data, the loader will not get any
DataReceived() callback, and hence not create a VTTParser. The
NotifyFinished() callback only checked for any error on the resource,
and would flag success if there were no resource error.
Check for the presence of a parser to detect the case where there's no
data and infer failure from it.

Also move the flush of the VTTParser first in NotifyFinished() since
it could, in rare cases, end up setting |state_| to kFailed.

Bug: 761969
Change-Id: If6c17d50ec968625a98490e625c5f248761efe1a
Reviewed-on: https://chromium-review.googlesource.com/650291
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499925}
mstensho
[LayoutNG] Skip more virtual test suites.
Test suites that aren't relevant to NG only slow down testing and increase
noise.

TBR=atotic@chromium.org

Change-Id: Ideb731da4441ba839a8d9c19d2fa532c8fd086d1
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Reviewed-on: https://chromium-review.googlesource.com/649655
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499723}
mstensho
NGLayoutAlgorithm::Node() doesn't need to be virtual
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iddc121dbcf39b0b7381ceb5485606a9a4fea9bdc
Reviewed-on: https://chromium-review.googlesource.com/649654
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499684}
mstensho
[LayoutNG] Position multicol children in the legacy flow thread.
Previously we practically skipped positioning of direct multicol children. We
did actually attempt to position direct *floated* children, but that triggered
a DCHECK failure.

Re-enable and update the remaining disabled NGColumnLayoutAlgorithm unit tests.
They were all about floats, and therefore they used to trigger DCHECK failures.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: If3b1d464501a6132254ed4c016886303f224a4f2
Reviewed-on: https://chromium-review.googlesource.com/649532
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#499675}
mstensho
[LayoutNG] Comma instead of 'x' as separator between coordinates in ToString().
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I96dcb6728816c030fffda7fa67a0a90eb7d1fe5f
Reviewed-on: https://chromium-review.googlesource.com/650255
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499654}
bratell
Enable jumbo compiling for modules unit test (-13 CPU minutes)
When use_jumbo_build=true this patch should save roughly 12.5
CPU minutes on my reference machine.

Bug: 713137
Change-Id: Icaa9e691ca6212f336691755aea83ddbdbe23a18
Reviewed-on: https://chromium-review.googlesource.com/648408
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499651}
fs
Remove residual Skips of WPT tests with absolute path
Absolute paths should be working now.

Bug: 498120
Change-Id: I21c69e34a7f9f17122a631b3e2a154c64974042b
Reviewed-on: https://chromium-review.googlesource.com/650248
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#499599}
bratell
Put local types in the anonymous namespace to be consistent.
BytesConsumerTestUtil.cpp imports BytesConsumer::Result as blink::Result
and BlobBytesConsumerTest.cpp imports BytesConsumer::Result as
blink::{anonymous namespace}::Result and for the Windows compiler that
causes a naming conflict in jumbo builds.

This patch puts both BytesConsumer::Result in the anonymous namespace so
that the compiler won't get confused.

Bug: 745732
Change-Id: I073a36fb71109be2e7fefff34268186d03a5547b
Reviewed-on: https://chromium-review.googlesource.com/649226
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#499595}
rune
Use code path for V1 instead of V0 without shadow trees.
The result should not be different, but this change is using the Shadow
DOM v1 code path for matching CSS rules when we don't have any Shadow
DOM v0 roots. This means we'll use the same code path as we'll use when
Shadow DOM v0 is removed.

Bug: 760405
Change-Id: I90a140db91d1282e59c037a476fef8b95b4e36cc
Reviewed-on: https://chromium-review.googlesource.com/647755
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499570}
rune
Don't compute pseudo element style on other pseudo elements.
Nested pseudo elements are not allowed. We tried to match selectors for
scrollbar pseudo elements on ::before/::after pseudo elements. This
caused DCHECK failure in v1 shadow dom code trying to find assigned
slot for the ::before/::after pseudo. Instead, return early trying to
compute pseudo element style on pseudo elements.

Bug: 761838
Change-Id: Iaa571c96701ad9f5eb87cb93f0cfb085f42c043e
Reviewed-on: https://chromium-review.googlesource.com/649611
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499564}
rune
Don't request style on element when pseudo element style is null.
StyleForLayoutObject returns nullptr for ::before and ::after pseudo
elements when the pseudo element should not generate any boxes. This
caused us to incorrectly request OriginStyleForElement as a fall-back
which caused DCHECKs to trigger when trying to match rules against the
PseudoElement.

Instead, call OriginalStyleForElement as a fall-back in
CustomStyleForElement for elements which do have custom style callbacks
but don't need a specialized CustomStyleForElement.

Bug: 760405
Test: shadow-dom/crashes/css-focus-recalc.html
Change-Id: Ib7bcd50fd624f1ebcefc716533cf7098c203a2f4
Reviewed-on: https://chromium-review.googlesource.com/648984
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499558}
mpichlinski
CHR-6375: [Windows] Fixed crash on fallback from ANGLE to SwiftShader.
During fallback from ANGLE to SwiftShader it is required to unload
ANGLE libraries, otherwise SwiftShader will fail to load its own
libGLESv2.dll.

Fixed ANGLE platform reset.

Bug: 760063
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I02280b2c1cd6c3d81087c7e2befb412bb2a89510
Reviewed-on: https://chromium-review.googlesource.com/640992
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499529}
bratell
Avoid having two g_unique_id in blink/platform
In jumbo builds the two g_unique_id clashed so to avoid having to
exclude one of the files from jumbo builds, it's better to rename them.

With this patch they will be g_unique_media_stream_component_id and
g_unique_media_stream_descriptor_id instead. As a bonus that should help
when analyzing binaries if anyone ever encounter these symbols.

Bug: 761475
Change-Id: Ib6c7120a4ff428bceaf1197441c1d8e271b63d18
Reviewed-on: https://chromium-review.googlesource.com/648409
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499518}
bratell
Avoid using "using namespace ..." in global scope
With jumbo (unity builds, merged translation units) a
"using namespace WTF" or "using namespace Unicode"
statement intended for just the local translation unit will affect
many other translation units which causes various issues.

There is also (with the current implementation of jumbo) a warning
about such usage that will prevent things from compiling.

Without this patch this file will have to be manually excluded from
jumbo builds and I am trying to avoid such exclusion lists for
performance and maintenance.

Bug: 761475
Change-Id: Ide7c7f90b2b2190362f279008e31dfcc31309ad7
Reviewed-on: https://chromium-review.googlesource.com/648407
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#499517}
mstensho
[LayoutNG] Proper overflow legacy write-back inside multicol.
Only calculate overflow when at the last fragment. It's only then that we can
be sure that all children have been laid out. This used to trigger DCHECK
failures in legacy layout.

Also don't let a line break fool us into believing that the block fragmented
(by creating unfinished break tokens).

Re-enable and update unit test OverflowedBlock, now that overflow no longer
causes DCHECK failures in legacy layout.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I9a104c3a7392db66c251e6f8da8ea8c7e16ba357
Bug: 757767
Reviewed-on: https://chromium-review.googlesource.com/645968
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499503}
mstensho
[LayoutNG] Skip assorted virtual test suites.
They don't seem relevant for NG.

TBR=atotic@chromium.org

Change-Id: Id701e9773cee3737cceb46440704125b9c9178e0
Reviewed-on: https://chromium-review.googlesource.com/647760
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#499495}
fs
Support all of HTML's character entities in WebVTT
This updates the VTTTokenizer to align with the updated WebVTT tokenizer
steps:

 https://w3c.github.io/webvtt/#html-character-reference-in-data-state

and

 https://w3c.github.io/webvtt/#html-character-reference-in-annotation-state

The old states for handling "escapes" are removed, adding new ones per
above, for invoking the HTML parser's entity matcher.
A new WEBVTT_SWITCH_TO operation is also added so that state transitions
can be performed without advancing the input position. (Matches
mechanics of the HTML parser.)

The WPT test webvtt/parsing/cue-text-parsing/tests/entities.html is
updated since it had an incorrect expected result for the "&notit;"
case.

Old, now incorrect and/or redundant, tests for entities are removed.

Bug: 761303
Change-Id: I8ffb4fb2da7169c2ba3c84eb8c3206daabefbb30
Reviewed-on: https://chromium-review.googlesource.com/647586
Reviewed-by: Philip Jägenstedt <foolip@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#499473}
bratell
Removing unused "using namespace icu".
Having global "using namespace ..." complicates things, or prevents,
jumbo builds but this one seems completely unused anyway.

Bug: 761475
Change-Id: I592035ec4030b575acbdbcf9ca11b24217380ed5
Reviewed-on: https://chromium-review.googlesource.com/647567
Commit-Queue: Kent Tamura <tkent@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499433}
karlo
Add NG support for quirky bottom margins plus minor fix for top margins.
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ib3b5e035955c0d1379f7c206ef283934a2c31eae
Reviewed-on: https://chromium-review.googlesource.com/645988
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499406}
rune
Removed svg/as-image/svg-nested.html
The test is creating a 50000 nodes deep tree which at some point causes
a stack overflow in one of the recursive methods traversing the DOM
tree. Removing test as it arbitrarily causes a stack overflow.

Bug: 760904
Change-Id: Ib1b841a51cbe383bc630ca57b3dd07c8c859cee0
Reviewed-on: https://chromium-review.googlesource.com/647536
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499392}
bratell
Deduplicated the Determinant function in platform/geometry.
Both FloatQuad and FloatPolygon wants to calculate the
determinant/cross product between two FontSize objects and they each
had a copy of such a function. In Jumbo builds those two identical symbols
collided.

Bug: 761475
Change-Id: I216b0ec2bf6fdb450ef81315692396fc395c3d6e
Reviewed-on: https://chromium-review.googlesource.com/647847
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499322}
bratell
Undef local CONVOLVE_ONE_SAMPLE after use.
Since other code use equally named macros we get jumbo build collision
unless they are undefined (or renamed).

Bug: 761475
Change-Id: I650fe9651a55e9fd682340f6160e2212de024f58
Reviewed-on: https://chromium-review.googlesource.com/647715
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Raymond Toy <rtoy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499264}
bratell
Adding missing include guard on blink header
VideoFrameResourceProvider.h was missing an include guard which happened
to work in normal builds, but not in jumbo builds.

R=haraken@chromium.org, lethalantidote@chromium.org

Change-Id: I72b9c9343ce6862f26d2ae89beaf3af3b084e0ed
Reviewed-on: https://chromium-review.googlesource.com/647538
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#499206}
mstensho
[LayoutNG] Update FlagExpectations for LayoutNG
Just skip virtual/outofblink-cors/

TBR=atotic@chromium.org

Change-Id: Iaf28ead83625b01b1017f2a3cd2029299ed61b54
Reviewed-on: https://chromium-review.googlesource.com/645952
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499180}
ptworek
Rename ArrayBufferContents::AllocationKind to GetAllocationKind.
Current name clashes with the name of the enum class the function is
supposed to return. Clang does not care, but gcc fails to compile the
code.

Bug: 760070
Change-Id: I935d91493a3fc7b289d03f776c14b6ec4f3f622a
Reviewed-on: https://chromium-review.googlesource.com/645549
Reviewed-by: Yuta Kitamura <yutak@chromium.org>
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499171}
bratell
Add include guards to ipc message headers
The solution without include guards isn't compatible with jumbo.

Bug: 746953
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Iaaea9654fa2c38c40ab458678693518abe555d34
Reviewed-on: https://chromium-review.googlesource.com/580868
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#499162}
rune
Update :in-range/:out-of-range style when input type changes.
The :in-range/:out-of-range pseudo classes only matches for steppable
input typesi. We need to schedule style invalidations for these pseudo
classes when the input changes and at least one of them is steppable.
Changing between two steppable types may also need invalidation as
min/max/value need to be reparsed and their value may not be valid or
their interpretations may be different.

Bug: 751406
Change-Id: I0dc6517ded832fdaa63f1a3bdda161dcf2b3b448
Reviewed-on: https://chromium-review.googlesource.com/646327
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499158}
rune
Update :indeterminate style when input type changes.
The :indeterminate pseudo class only matches for certain input types.
We need to schedule style invalidations for :indeterminate when the
input changes between certain types.

Bug: 751406
Change-Id: I4cae67ce883ec0969119f788718db8b978f9a67d
Reviewed-on: https://chromium-review.googlesource.com/646168
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499157}
rune
Update :checked style when input type changes.
The :checked pseudo class only matches for certain input types. We need
to schedule style invalidations for :checked when the input changes
between certain types.

Bug: 751406
Change-Id: I818b498339a643766e0c619cb6b70bfd09c6efcb
Reviewed-on: https://chromium-review.googlesource.com/645987
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#499156}
mstensho
Min-width takes precedence over max-width.
This also applies to intrinsic sizing, obviously. Clamp to max-width, THEN
min-width - not the other way around.

Bug: 754263
Change-Id: Ide083d3ba591b252cd1bfa28500be3c3c2324d79
Reviewed-on: https://chromium-review.googlesource.com/645306
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499024}
fs
Make SMIL interval position calculations more resilient
When 'dur' is mutated, all dependent state is not updated at once, but
rather lazily. This means that we can get into an inconsistent state
where some timing parameters have been applied while some have not, and
code that uses - and thus realizes - the state changes will be first to
observe them. This can for instance lead to an interval position of NaN
being computed, which would wreak havoc when computing values.

For the specific case, we'd first get an 'indefinite' simple duration
and compute an interval thereafter. When 'dur' is then modified to a
finite value the simple duration will not be updated until the next
frame is computed (triggered by mutation of 'end'), leaving us with
a valid/finite simple duration but an infinite interval. (This then
results in arithmetic with Inf, yielding a NaN value for |percent|.)

Properly updating all the interval computation state on mutations is a
somewhat involved task, so paper over it for now by computing the (last)
active duration differently depending on the case we're in. While this
change is a bit of a workaround, it should be a perfectly reasonable
change on its own.

Bug: 760057
Change-Id: I1878f06db500eb1251ef2ca1cd7f10e0c8f86a00
Reviewed-on: https://chromium-review.googlesource.com/645973
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#498911}
mstensho
[LayoutNG] Skip siblings preceding the first break token.
When we resume layout in a next fragmentainer, assume that all siblings
preceding the one associated with the first break token have been finished.
Assuming the opposite - that all preceding siblings needed layout - caused
infinite loops.

Example:
<div style="columns:5; column-fill:auto; height:60px;">
    <div id="child1" style="height:100px;"></div>
    <div id="child2" style="height:100px;"></div>
</div>

After the first column, we'll have an unfinished break token for #child1, which
is what we'll resume with in the second column.
After the second column, we'll have a finished break token for #child1 and an
unfinished break token for #child2.
After the third column, we'll only have an unfinished break token for #child2,
since we skipped #child1 (it was finished).
The fourth column obviously only contains #child2. We shouldn't start at
#child1 just because it has no break token, or we'll get an infinite loop.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I845a75bb646615223f9acfcc51e2fab04b05b058
Bug: 757767
Reviewed-on: https://chromium-review.googlesource.com/639410
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498817}
tmoniuszko
Add missing gurl.h include to sensor_permission_context.cc
Bug: 
Change-Id: I2988959a20acd595e046574773101b12135d0f1b
Reviewed-on: https://chromium-review.googlesource.com/640383
Reviewed-by: Raymes Khoury <raymes@chromium.org>
Commit-Queue: Tomasz Moniuszko <tmoniuszko@opera.com>
Cr-Commit-Position: refs/heads/master@{#498777}
rune
Setup AttachContext correctly when attaching pseudo elements.
AttachContext.previous_in_flow was not set up correctly when attaching
pseudo elements. That caused incorrect whitespace attachment in some
cases. In order to do this, the AttachContext for children is set up in
Element instead of ContainerNode as ::before and ::after are attached
in Element before/after ContainerNode::AttachLayoutTree.

I have separated the creation and attachment of pseudo elements.
CreatePseudoElementIfNeeded now only creates the pseudo element.
Previously pseudo elements were sometimes attached as part of style
recalc, at which point we don't have a previous_in_flow to pass in.
This is also good for our goal of separating style recalc and layout
tree construction completely.

We still create pseudo elements when attaching a layout tree if these
pseudo elements are inside a subtree being (re-)attached. When we start
constructing ComputedStyle for elements in sub-trees being re-attached
in RecalcStyle instead of LayoutTreeBuilder, we can fully rely on
pseudo elements being generated for RecalcStyle.

The modified test expectations are actually a revert of what was
changed when landing the WhitespaceAttacher.

Bug: 759532
Change-Id: Ic9f0f61d8c78bc8df7c5e589444a54583c78d763
Reviewed-on: https://chromium-review.googlesource.com/643269
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#498767}
mstensho
[LayoutNG] Update FlagExpectations for LayoutNG
TBR=eae@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I91ac1b71748f838b922d3e93ba59aa9d17b39bff
Reviewed-on: https://chromium-review.googlesource.com/643070
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#498488}
mstensho
Fix Jumbo build.
InspectorCacheStorageAgent.cpp has recently got a "using" declaration of
blink::protocol::CacheStorage::Header, and that collided with the
forward-declaration of blink::Header FetchHeaderList.h. Just remove the
forward-declaration. It looks like there's no class named Header in this
district anymore.

TBR=hiroshige@chromium.org

Change-Id: I54e5f7ff3b53a388930b1101417e0dc1fa46af2b
Reviewed-on: https://chromium-review.googlesource.com/643127
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#498439}
fs
Don't rely on the cached 'local' flag when resolving <use> target
Since the document URL can change between a <use> 'href' is set, and the
actual element reference is resolved (looked up by id), the notion of
being "local" to the document can change during this window as well.
To avoid this, we need to re-evaluate the "is local" state before
resolving the element reference. This appears to match what other UAs
are doing (but they could/do differ in other ways.) Keep the cached
"is local" state and use where applicable to avoid the full URL compare.

Bug: 749855
Change-Id: Ibbe9b1fb7e37f86b57f775d288203fbd9b3d5f4e
Reviewed-on: https://chromium-review.googlesource.com/641459
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498433}
rune
No need for forced SetStyleInternal for unchanged ComputedStyle.
This was done to avoid use of out-dated ComputedStyle from the style
sharing cache.

Also, removed unnecessary DCHECKs for style sharing sanity and fixed a
comment.

Bug: 721517
Change-Id: I3a4117328b7a62dac84ef3e81017702f6f40315b
Reviewed-on: https://chromium-review.googlesource.com/628519
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#498417}
rune
Invalidate matched properties cache when registering custom properties.
Not forcing SetStyleInternal in Element::RecalcOwnStyle triggered a
DCHECK fail for (!!value == !!parsed_value) in
SetResolvedInheritedVariable(). We were hitting the matched properties
cache to re-use the custom properties from the style recalc before and
after property registration. The property registration made the custom
property value invalid due to the given syntax.

It's possible this should be detected as a style propagation change in
RecalcOwnStyle (ComputedStyle::operator==), but clearing the matched
properties cache seemed like a good idea since all style is
recalculated on property registration anyway.

This CL is split out of:

https://chromium-review.googlesource.com/c/chromium/src/+/628519/

Test: custom-properties/registered-property-cssom.html
Change-Id: I593f2fa1be788ce00872d46356924f6f5415174e
Reviewed-on: https://chromium-review.googlesource.com/635565
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#498393}
mstensho
[LayoutNG] Move column layout algorithm tests to a separate file.
FragmentChildIterator and ConstructBlockLayoutTestConstraintSpace() are needed
by both block and column layout algorithm tests, so they needed a new home. Put
them in ng_base_layout_algorithm_test.h

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I664c1f0a7b04e6096b25bfff344f0ebae9fa1bd0
Reviewed-on: https://chromium-review.googlesource.com/641150
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#498162}
bratell
Be more specific about namespace for Message in unit tests
There is a gtest namespace ::testing and a helper namespace in blink
called ::blink::testing. If both are visible to the compiler,
::blink::testing will be used first and classes in ::testing will not
be found. This happens in jumbo builds so we better be more specific.

R=haraken@chromium.org

Bug: 
Change-Id: I611b7afde07fb217978e90cf041e89ce7634fb8e
Reviewed-on: https://chromium-review.googlesource.com/640699
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#498080}
rune
Missing comparison of timing functions for style recalc.
TransitionsMatchForStyleRecalc and AnimationsMatchForStyleRecalc did
not compare timing functions. Move common timing comparison into the
CSSTimingData class and add a test for timing functions.

This was discovered trying to remove a SetStyleInternal hack from

Element: :RecalcOwnStyle().
Change-Id: I11edf92a63653e44ca6384523d0dd4da7786dc25
Reviewed-on: https://chromium-review.googlesource.com/635723
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#498047}
mstensho
[LayoutNG] Make percent sizing work through anonymous constraint spaces.
Re-enable a unit test that now passes again. Also fixes a layout test.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ic1d15dccaefc5773ae4305771808d328548007b4
Reviewed-on: https://chromium-review.googlesource.com/637910
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498034}
mstensho
Revert "Locate the correct flow thread for spanners and out-of-flow objects."
This reverts commit b71ac55bffca1c376d6ed4e540194436daccfbd1.

Reason for revert: Opened up a can of worms. Re-seal it.

Original change's description:
> Locate the correct flow thread for spanners and out-of-flow objects.
> 
> LayoutFlowThread::LocateFlowThreadContainingBlockOf() used to just
> give up if the nearest ancestor flow thread of some object wasn't the
> containing flow thread.
> 
> The machinery that maintains the special-objects
> (LayoutMultiColumnSet, LayoutMulticolumnSpannerPlaceholder) for
> multicol still needs to ignore out-of-flow objects and spanners,
> though, so I moved the check for this from
> LocateFlowThreadContainingBlockOf() to
> FlowThreadDescendantWasInserted() and
> FlowThreadDescendantWillBeRemoved().
> 
> Checking on the paint side whether page logical height is known is
> no longer necessary.
> 
> Bug: 757947
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
> Change-Id: Ief0492e9de52b01b08c3bc0318cb3c8abe67ccd3
> Reviewed-on: https://chromium-review.googlesource.com/632057
> Reviewed-by: Emil A Eklund <eae@chromium.org>
> Commit-Queue: Morten Stenshorne <mstensho@opera.com>
> Cr-Commit-Position: refs/heads/master@{#497437}

TBR=mstensho@opera.com,robhogan@gmail.com,eae@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 757947
Change-Id: Idf54d6cea2c03871c3a3443880f6b5b331cd7d30
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Reviewed-on: https://chromium-review.googlesource.com/637870
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#497791}
rune
Support ::before and ::after pseudo elements after ::slotted.
Allow pseudo elements after ::slotted() pseudo elements to allow for
scopes to which an element has been slotted to generate ::before /
::after pseudo elements.

The scoping spec[1] allows tree-abiding[2] pseudo elements after
::slotted. This CL adds support for ::before and ::after.

[1] https://drafts.csswg.org/css-scoping/#slotted-pseudo
[2] https://drafts.csswg.org/css-pseudo-4/#treelike

Bug: 754081
Change-Id: I95d91ea06d8fa75537cf8c845da477b2fb034a7d
Reviewed-on: https://chromium-review.googlesource.com/616042
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497742}
mstensho
Include less from LayoutUnit.h.
This header is included in about 4500 compilation units.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Icd9996f634899877c84e130f67fdf497a01734a0
Reviewed-on: https://chromium-review.googlesource.com/635726
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#497563}
mstensho
[LayoutNG] Copy multicol layout back to the LayoutObject tree.
Stitch fragments generated from the same layout input node
together, so that the flow thread based multicol implementation
in legacy layout can perform painting, hit-testing and other
layout tree read operations like before.

The position will only be updated when at the first fragment for
each node. The position of subsequent fragments are only relevant
to LayoutNG. For legacy layout they just contribute to the
block-size of the LayoutObject. Currently, the position will
still be mostly wrong, unless the object starts in the first
column.

One change to the break tokens was necessary: the final break
token also needs to set its used block size, just like the
preceding tokens, so that clients can tell that it's not the
first fragment of some node.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I4a1491262bb5a5284abfa27695ed90beb620a56d
Reviewed-on: https://chromium-review.googlesource.com/634223
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497478}
mstensho
Locate the correct flow thread for spanners and out-of-flow objects.
LayoutFlowThread::LocateFlowThreadContainingBlockOf() used to just
give up if the nearest ancestor flow thread of some object wasn't the
containing flow thread.

The machinery that maintains the special-objects
(LayoutMultiColumnSet, LayoutMulticolumnSpannerPlaceholder) for
multicol still needs to ignore out-of-flow objects and spanners,
though, so I moved the check for this from
LocateFlowThreadContainingBlockOf() to
FlowThreadDescendantWasInserted() and
FlowThreadDescendantWillBeRemoved().

Checking on the paint side whether page logical height is known is
no longer necessary.

Bug: 757947
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Ief0492e9de52b01b08c3bc0318cb3c8abe67ccd3
Reviewed-on: https://chromium-review.googlesource.com/632057
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#497437}
landell
Emacs jade rebranded to indium
Bug: 
Change-Id: Iff92857fcf7ef95578687dacb9309fcfad331e6d
Reviewed-on: https://chromium-review.googlesource.com/631720
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#497072}
mstensho
Reland "Reland "[LayoutNG] Bring back native support for multicol.""
This is a reland of 3bb64d0c55ed57a6522cc09f5be97be220c81fc0
Original change's description:
> Reland "[LayoutNG] Bring back native support for multicol."
> 
> This is a reland of b7e830ddf678c7daaa41a982fad87156b1bbbe4b
> Original change's description:
> > [LayoutNG] Bring back native support for multicol.
> > 
> > Still missing: Copy data back into the LayoutObject tree.
> > 
> > Some layout tests now fail, since we're not using the legacy engine to lay out
> > multicol. Quite a few crash or freeze, too.
> > 
> > Also brought back some of the unit tests. They needed some changes, because of
> > the following:
> > 
> > 1. We now create a fragment for each column, from an anonymous constraint
> > space. I.e. we have one more level of fragments, and it's the column fragments
> > that have their inline offset shifted to the correct column, rather than
> > setting it on the first child block, which is what we did last time these tests
> > worked.
> > 
> > 2. Mistakes introduced when converting test to using setBodyInnerHTML() rather
> > than building the layout trees programmatically:
> > https://codereview.chromium.org/2725773002
> > 
> > 3. New bugs. :)
> > 
> > Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
> > Change-Id: I4df85d684f0ddb8f7f0f75d15230a1ab61e9f9a0
> > Reviewed-on: https://chromium-review.googlesource.com/591429
> > Commit-Queue: Morten Stenshorne <mstensho@opera.com>
> > Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
> > Reviewed-by: Emil A Eklund <eae@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#496446}
> 
> TBR=eae@chromium.org,ikilpatrick@chromium.org
> 
> Change-Id: I479ea313e9ca9a56bdbbcad009a4c1b18a8b9e63
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
> Reviewed-on: https://chromium-review.googlesource.com/627358
> Commit-Queue: Morten Stenshorne <mstensho@opera.com>
> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
> Reviewed-by: Koji Ishii <kojii@chromium.org>
> Reviewed-by: Morten Stenshorne <mstensho@opera.com>
> Cr-Commit-Position: refs/heads/master@{#496814}

TBR=eae@chromium.org,ikilpatrick@chromium.org

Change-Id: Ic81481d78f216e45d437968090f76479326ad708
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Reviewed-on: https://chromium-review.googlesource.com/631816
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#497061}
mstensho
[LayoutNG] Update FlagExpectations for LayoutNG
TBR=eae@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I187593e14a27bf76957055cceb0ec00cf3fae65d
Reviewed-on: https://chromium-review.googlesource.com/631776
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#497023}
rune
Remove Internals.isStyleSharing().
Not in use and style sharing is removed.

Bug: 721517
Change-Id: I9eb72320ba001102f4c29f22240cf9dbd3a4f460
Reviewed-on: https://chromium-review.googlesource.com/628520
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#496957}
mstensho
Reland "[LayoutNG] Bring back native support for multicol."
This is a reland of b7e830ddf678c7daaa41a982fad87156b1bbbe4b
Original change's description:
> [LayoutNG] Bring back native support for multicol.
> 
> Still missing: Copy data back into the LayoutObject tree.
> 
> Some layout tests now fail, since we're not using the legacy engine to lay out
> multicol. Quite a few crash or freeze, too.
> 
> Also brought back some of the unit tests. They needed some changes, because of
> the following:
> 
> 1. We now create a fragment for each column, from an anonymous constraint
> space. I.e. we have one more level of fragments, and it's the column fragments
> that have their inline offset shifted to the correct column, rather than
> setting it on the first child block, which is what we did last time these tests
> worked.
> 
> 2. Mistakes introduced when converting test to using setBodyInnerHTML() rather
> than building the layout trees programmatically:
> https://codereview.chromium.org/2725773002
> 
> 3. New bugs. :)
> 
> Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
> Change-Id: I4df85d684f0ddb8f7f0f75d15230a1ab61e9f9a0
> Reviewed-on: https://chromium-review.googlesource.com/591429
> Commit-Queue: Morten Stenshorne <mstensho@opera.com>
> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
> Reviewed-by: Emil A Eklund <eae@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#496446}

TBR=eae@chromium.org,ikilpatrick@chromium.org

Change-Id: I479ea313e9ca9a56bdbbcad009a4c1b18a8b9e63
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Reviewed-on: https://chromium-review.googlesource.com/627358
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#496814}
mstensho
[LayoutNG] Update FlagExpectations for LayoutNG
TBR=eae@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ib177fd2754c2f05d7d7765e7599e6e6bb5d4ceab
Reviewed-on: https://chromium-review.googlesource.com/628878
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#496740}
mstensho
[LayoutNG] Update FlagExpectations for LayoutNG
TBR=eae@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I3c0967138e9f7dd81d052f2f5117ba815ad3249c
Reviewed-on: https://chromium-review.googlesource.com/626296
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#496640}
rune
Remove style sharing workaround from StyleInvalidator.
Style sharing is no longer present in the codebase, so the SetStyle /
LocalStyleChange should no longer be necessary here.

Bug: 721517

Change-Id: I0437f3c3c3188101299b053d81b36a7542baf610
Reviewed-on: https://chromium-review.googlesource.com/625880
Reviewed-by: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#496597}
mstensho
[LayoutNG] Bring back native support for multicol.
Still missing: Copy data back into the LayoutObject tree.

Some layout tests now fail, since we're not using the legacy engine to lay out
multicol. Quite a few crash or freeze, too.

Also brought back some of the unit tests. They needed some changes, because of
the following:

1. We now create a fragment for each column, from an anonymous constraint
space. I.e. we have one more level of fragments, and it's the column fragments
that have their inline offset shifted to the correct column, rather than
setting it on the first child block, which is what we did last time these tests
worked.

2. Mistakes introduced when converting test to using setBodyInnerHTML() rather
than building the layout trees programmatically:
https://codereview.chromium.org/2725773002

3. New bugs. :)

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I4df85d684f0ddb8f7f0f75d15230a1ab61e9f9a0
Reviewed-on: https://chromium-review.googlesource.com/591429
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496446}
rune
Removed leftover FIXME for whitespace attachment.
WhitespaceAttacher now handles this properly and it's done as part of
layout tree building, not style recalc.

Change-Id: I0fd970c86425c155429c008afdf280866b539a72
Reviewed-on: https://chromium-review.googlesource.com/626301
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#496438}
mstensho
Saturated arithmetic when calculating multicol preferred widths.
With sufficiently large column-gap and high enough column-count, we'd
integer-overflow and end up with a negative gap_extra result, which is a value
that contributes to the preferred min/max preferred logical widths (which
therefore also could become negative). Let all values involved be of type
LayoutUnit, so that we get saturated arithmetic enabled.

Bug: 743230
Change-Id: I06d7d8f9c1214af35faf0b52f1652fc626cd67ef
Reviewed-on: https://chromium-review.googlesource.com/625624
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496329}
mstensho
[LayoutNG] Update FlagExpectations for LayoutNG
TBR=eae@chromium.org

Change-Id: Ic03560b8ed7ceb89c9bf746c04320b6c655ca1b2
Reviewed-on: https://chromium-review.googlesource.com/625918
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#496293}
fs
Setting DOMMatrix.m33 or m44 to 1 should preserve is2D
Per [1], setting a value other than one (1) should clear the is2D flag.
We had the logic reversed.

[1] https://drafts.fxtf.org/geometry/#dommatrix-attributes

Bug: 756789
Change-Id: I37fcd4e20fedee6ba29bb164e81cdf324971f9a1
Reviewed-on: https://chromium-review.googlesource.com/623410
Commit-Queue: Dominic Cooney <dominicc@chromium.org>
Reviewed-by: Dominic Cooney <dominicc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496224}
mstensho
[LayoutNG] Clean up #includes.
NGLayoutResult needs to know about NGUnpositionedFloat, and
NGUnpositionedFloat needs to know about NGLayoutResult, so some
forward-declaring is necessary, to avoid circular dependencies.

Also got a dependency on the rather heavy ComputedStyle out of a header
file.

Change-Id: I8f35bbb48bf39118abf093d8ffb6c8a44545ca57
Reviewed-on: https://chromium-review.googlesource.com/623651
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496008}
rune
Let LayoutView::StyleWillChange handle viewport invalidation.
Make sure we only do a single SetStyle for viewport ComputedStyle
to which we propagate certain documentElement/body styles. That way we
can do style invalidation diffing on SetStyle. The invalidation will
now be done on LayoutView::StyleWillChange instead of invalidating
LayoutView from LayoutBox::StyleWillChange for documentElement and body
changes.

The LayoutView invalidation does still use a limited repaint based on
propagated background changes.

Bug: 755539

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I629098e0073827513801311b730c62fc98079db4
Reviewed-on: https://chromium-review.googlesource.com/609984
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495573}
rune
Check for HasNormalColumnGap() for LayoutView style changes.
PropagateStyleToViewport() propagated the absolute length of column-gap
only, and did not consider the "normal" keyword value. A change between
0 and "normal" was not detected as a change, hence the pages were not
laid out with the new value.

Bug: 756423
Change-Id: Idfe6c34b2e88fb741f25950c6d5a79290e33b728
Reviewed-on: https://chromium-review.googlesource.com/618926
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#495256}
ckulakowski
Add missing dependency to //base for target device_monitors
Because of lack of this dependency Build sometimes fails because of
missing file base/debug/debugging_flags.h:

[2017-08-17 10:18:12] [526/33287] CXX
obj/media/device_monitors/device_monitors/system_message_window_win.obj
[2017-08-17 10:18:12] >>BUILDBOT>>errors>>compile>>
[2017-08-17 10:18:12] FAILED:
obj/media/device_monitors/device_monitors/system_message_window_win.obj
[2017-08-17 10:18:12] ninja -t msvc -e environment.x64 --
c:\buildbot\clcache\bin/gomacc.exe "c:\program files (x86)\microsoft
visual studio 14.0\vc\bin\amd64/cl.exe" /nologo /showIncludes
@obj/media/device_monitors/device_monitors/system_message_window_win.obj.rsp
/c ../../media/device_monitors/system_message_window_win.cc
/Foobj/media/device_monitors/device_monitors/system_message_window_win.obj
/Fd"obj/media/device_monitors/device_monitors_cc.pdb"
[2017-08-17 10:18:12] CLCache Error: Failed to process compiler output
[2017-08-17 10:18:12] >>BUILDBOT>>errors>>compile>>
[2017-08-17 10:18:12] ../..\base/debug/stack_trace.h(14): fatal error
C1083: Cannot open include file: 'base/debug/debugging_flags.h':
No such file or directory

Bug: 756401
Change-Id: I5468361db2558e082828eaba81458039167e6ab1
Reviewed-on: https://chromium-review.googlesource.com/618571
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495240}
mstensho
[LayoutNG] Remove test failure expectation, now that they apparently pass.
One test doesn't fail anywhere. Three other tests only fail on Mac.

Change-Id: I799cfdac2f3ea32f5fde97957a7053bfd0146195
Reviewed-on: https://chromium-review.googlesource.com/616730
Reviewed-by: Aleks Totic <atotic@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#495191}
rune
Only need to repaint background for color changes with no image.
Implement a VisuallyEqual for backgrounds because computed style
comparison would trigger unnecessary repaints when background image
related properties changed when there were no images.

Bug: 754685
Change-Id: I4c687426905e9687b298549b3015ac1207dbbc17
Reviewed-on: https://chromium-review.googlesource.com/612089
Reviewed-by: meade_UTC10 <meade@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#494738}
mstensho
When main axis is logical y, lay out flex items before getting intrinsic size.
There's no other way to figure out an object's intrinsic logical height, than
to lay it out. We cannot use the logical height we found in the previous layout
pass as intrinsic size.

Bug: 752078
Change-Id: Ibfd9426752ea8489256ac40f0c16e1a31a74a377
Reviewed-on: https://chromium-review.googlesource.com/612179
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Rune Lillesveen <rune@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#494488}
rune
Removed unused InheritColumnPropertiesFrom.
Change-Id: I39641a2c8fe9045ba3611050c03fd909d18b9ef4
Reviewed-on: https://chromium-review.googlesource.com/613161
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#494086}
ingemara
Remove ignore_manifest in android_aar_prebuilt
Manifest merging is now supported! \o/

Bug: 643967
Change-Id: I460e4635fc2dc34592f50aed03f4056a5f402364
Reviewed-on: https://chromium-review.googlesource.com/567078
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Ingemar Ådahl <ingemara@opera.com>
Cr-Commit-Position: refs/heads/master@{#494041}
rune
Propagate style to viewport after style recalc.
Since we are now propagating up to the viewport style and don't do any
inheritance after propagation, we can postpone the propagation until
after the style recalc has finished. That means we only have to call
StyleForElement on html and body elements once. It also means we can
remove the code to clear animation update from
InheritHtmlAndBodyElementStyles().

InheritHtmlAndBodyElementStyles() has been renamed to
PropagateStyleToViewport() which better explains what the method does.

The rem unit style recalc still needs to be triggered right after the
documentElement has been recalculated, but that code is moved to
the StyleEngine called from Element::RecalcOwnStyle().

Change-Id: I3850aee300aa31174f022581e615e5d66205d674
Reviewed-on: https://chromium-review.googlesource.com/608028
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#493348}
mstensho
[LayoutNG] Place the root fragment.
All fragments but the root one are already placed by the fragment builder, when
walking through the children of a node. However, the fragment established by
the root node was left unplaced.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I8233b49f271034d6af8b19ebf3fd59b226b59065
Reviewed-on: https://chromium-review.googlesource.com/602207
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#492946}
rune
Apply :placeholder-shown and :read-write changes on input type change.
Whether :placeholder-shown, :read-only, and :read-write matches an html
input element depends on its type. Apply changes on type attribute
changes accordingly.

The placeholder text and visibility had to be updated sychronously,
otherwise the pseudo invalidation happens before the placeholder
visibility update as part of layout tree attachment.

Bug: 751406
Change-Id: Ic5bf1c62073cdf2648dfbf7876828323fecfe4be
Reviewed-on: https://chromium-review.googlesource.com/605252
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492935}
rune
No need for recalc on viewport propagation.
Before the fix for issue 732349, we relied on propagation from body to
viewport to affect the computed style of the root element which was
handled through a subtree recalc after viewport propagation. This is no
longer necessary. In fact, when rtl was specified on body, but the
computed style of html was ltr, InheritHtmlAndBodyElementStyles would
always trigger a subtree recalc, which would happen every frame we had a
style recalc.

There's a hope this will fix performance issue 739133.

I think that InheritHtmlAndBodyElementStyles can be made into a
PropagateStyleToViewport method which can be called at the end of
style recalc to avoid calculating html and body style twice. I'll try
to do that in a separate CL.

Bug: 739133
Change-Id: I0beebcf850661434eedb8bd19405698c27b7ae89
Reviewed-on: https://chromium-review.googlesource.com/606007
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#492889}
mstensho
[LayoutNG] Physical fragment tree dump support.
Call NGPhysicalFragment::ShowFragmentTree() to dump the fragment tree.
The solution is inspired by NGLayoutInputNode::ShowNodeTree().

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ie256d74bb80f2be5f372ec57791b693e4f5bdeaf
Reviewed-on: https://chromium-review.googlesource.com/602227
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#492575}
ingemara
Remove redundant GMS version meta-data
The <meta-data> is merged into the final apk manifest from dependency
manifests.

//third_party/android_tools:google_play_services_basement_java provides
the manifest and accompanying resource value.

Bug: 643967
Change-Id: I09590a6c060e4e92c45e928ad57d64546d90f7e3
Reviewed-on: https://chromium-review.googlesource.com/567138
Reviewed-by: Yuwei Huang <yuweih@chromium.org>
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Ingemar Ådahl <ingemara@opera.com>
Cr-Commit-Position: refs/heads/master@{#492568}
rune
Evaluation of :required and :optional changes on input type changes.
If an input element changes to or from hidden in the presence of a
"required" attribute, the evaluation of :required and :optional will
change. Schedule invalidation sets to update computed style
appropriately.

Bug: 751406
Change-Id: I64ccaaa58067594e4a150f80fe73aaf4c9f93c83
Reviewed-on: https://chromium-review.googlesource.com/602027
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492304}
mstensho
[LayoutNG] Remove NGPhysicalFragment::NGFragmentType from NGFragmentBuilder.
It was always kFragmentBox, even for inline layout, so it was meaningless.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: If03b39b4315b8165045488901dbd67225ff54e8a
Reviewed-on: https://chromium-review.googlesource.com/602245
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#492292}
rune
Add tests for scroll direction of propagated writing-mode from body.
Change-Id: Ief891686240dcf4c30012b6282b1616de0500878
Reviewed-on: https://chromium-review.googlesource.com/602240
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#492254}
rune
Support unclosed parentheses at end of sizes attribute.
Instead of returning false, match unclosed left-parentheses and
function tokens. Fixes eight cases in the WPT.

Bug: 749381
Change-Id: I7b3f061ee026be1da9ab377488f83007a2a0689d
Reviewed-on: https://chromium-review.googlesource.com/599851
Reviewed-by: Renée Wright <rjwright@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#492235}
mstensho
Don't #undef STATIC_ASSERT_ENUM.
Causes problems for Jumbo builds.

TBR=nverne@chromium.org

Change-Id: If4a37cff9ae787ec0c750b652663fd2d8d6b1a66
Reviewed-on: https://chromium-review.googlesource.com/598090
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Nicholas Verne <nverne@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Nicholas Verne <nverne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491391}
mstensho
Need to #define EXPECT_RECT_EQ in a header file.
Multiple definitions in various .cpp files causes problems for Jumbo builds.

TBR=chrishtr@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I907fc4bbba428de44579c9466a8884270102483b
Reviewed-on: https://chromium-review.googlesource.com/598070
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#491389}
rune
Remove rulesets used for style sharing.
After style sharing code is removed, we no longer need the sibling and
uncommon attribute rulesets to reject style sharing. This also means
RuleFeatureSet no longer needs to be traced, so some oilpan cruft could
be removed.

The StyleEngine API UsesSiblingRules() relied on the size of the sibling
ruleset, but it was only used as what looked like an optimization for
:empty selector updates where :empty is found in non-rightmost compound
selectors. However, the presence of :empty itself would add a sibling
selector in the previous code, and :empty in non-rightmost compound not
followed by an adjacent selector would only have de-generate cases like
":empty span" which could never match anything, or ":not(:empty) span"
which would always be true if the whole selector matches. Therefore, it
makes sense to just drop the API/check.

Bug: 721517
Change-Id: I85100850cb8cec56b17947916d7755ebcf3f15ec
Reviewed-on: https://chromium-review.googlesource.com/597689
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#491344}
rune
Remove stats for style sharing.
Style sharing code is removed and these stats will always be 0.

Bug: 721517
Change-Id: Iae76778bd564ad22645d3d14709c1d8d13d796c6
Reviewed-on: https://chromium-review.googlesource.com/595744
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#490984}
rune
Remove ununsed kSharingMode selector matching.
After style sharing code was removed, this mode is no longer in use.

Bug: 721517
Change-Id: Ia0997792f5641b722d86922f40d631613552c137
Reviewed-on: https://chromium-review.googlesource.com/595728
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#490958}
sigbjornf
Retire sigbjornf@ ownerships.
TBR=haraken,jochen
NOTRY=true

Change-Id: I764c7f96d306867c8fd0e1dda4f498bfc1285f87
Reviewed-on: https://chromium-review.googlesource.com/593310
Reviewed-by: Sigbjørn Finne <sigbjornf@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Sigbjørn Finne <sigbjornf@opera.com>
Cr-Commit-Position: refs/heads/master@{#490722}
mstensho
[LayoutNG] MultiColumnFragmentainerGroup needs to know its height.
Otherwise DCHECKs will fail when attempting certain read operations on the
legacy layout tree.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I8f09461bf7404aab1ef9a369380542759bb05a53
Reviewed-on: https://chromium-review.googlesource.com/591567
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#490657}
tmoniuszko
Fix truncation from 'double' to 'float' warning in resource_prefetch_predictor.cc
Bug: 
Change-Id: I56e4ef0806162bb42bfc9edf47e8810499737ad6
Reviewed-on: https://chromium-review.googlesource.com/591367
Reviewed-by: Egor Pasko <pasko@chromium.org>
Commit-Queue: Egor Pasko <pasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490382}
mstensho
[LayoutNG] HandleInflow() return a bool rather than WTF::Optional<>.
This way we won't need previous_inflow_position in Layout() to be optional, and
it makes the code more readable, and possibly more efficient too.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Id42f5b950cf2edec646d5bf8b594b8d4b9948449
Reviewed-on: https://chromium-review.googlesource.com/590427
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490364}
karlo
InlineBlockBaseline() and friends now return LayoutUnit instead of int.
Add support for floating point baselines.  This patch retains integer
calculations for font ascender/descender, to avoid impacting too many
web pages.  Line painting is rounded to CSS pixels at the paint stage.

BUG=617763

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I15850c55d54fbb0c885d4040be3c90ea2a51d7ca
Reviewed-on: https://chromium-review.googlesource.com/543141
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Javier Fernandez (OOO till Aug 4th) <jfernandez@igalia.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490327}
hugoh
Fix crash in spatnav when <area> looses its connected <img>
BUG=747734
TEST=See above clusterfuzz bug for repro steps.

Change-Id: I9d2ee28c7dab9e5f9af875e3011b1d0acb13ae29
Reviewed-on: https://chromium-review.googlesource.com/586589
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Hugo Holgersson <hugoh@opera.com>
Cr-Commit-Position: refs/heads/master@{#490049}
mstensho
[LayoutNG] Reduce variable span, for increased readability.
Also changed the child loop from "while" to "for".

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iabca756c82281525818f1d5f3f31613679bae211
Reviewed-on: https://chromium-review.googlesource.com/584755
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#489991}
mstensho
Rename duplicate MockWebFrameClient classes.
Caused trouble for Jumbo builds, all of a sudden.

TBR=bokan@chromium.org

Change-Id: I226e3b78c4abe008765123c21ed72868ea3f9f4b
Reviewed-on: https://chromium-review.googlesource.com/588908
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#489888}
sigbjornf
Remove sigbjornf@ from blink_dom watchlist.
TBR=tkent
NOTRY=true

Change-Id: Id8d1ff08ae2065243894803ece9e0b5da9b131d7
Reviewed-on: https://chromium-review.googlesource.com/588089
Reviewed-by: Sigbjørn Finne <sigbjornf@opera.com>
Commit-Queue: Sigbjørn Finne <sigbjornf@opera.com>
Cr-Commit-Position: refs/heads/master@{#489876}
mstensho
Let CalculatePaginationStrutToFitContent() figure out the strut all on its own.
Remove the strut_to_next_page parameter, and let it calculate it on its own.

This is a preparatory patch for supporting repeated table footers. That will
break the "space left" == "pagination strut" invariant. Actually, this wasn't
truly an invariant even prior to this CL, because the next fragmentainer isn't
necessarily tall enough to hold the content (which will result in a pagination
strut larger than the amount of remaining space).

No behavior changes intended.

Change-Id: I4f3499d969d6f128077e281f2dd45826cd6d83fc
Reviewed-on: https://chromium-review.googlesource.com/583619
Commit-Queue: Robert Hogan <robhogan@gmail.com>
Reviewed-by: Robert Hogan <robhogan@gmail.com>
Cr-Commit-Position: refs/heads/master@{#489780}
bratell
Change jumbo chunk separation to ignore headers
Since jumbo chunks were divided before headers were filtered out, the
actual chunk sizes were not deterministic and much smaller than expected.

This patch filters headers first, and halves the chunk size to get the same
actual chunks.

Bug: 747368
Change-Id: Ia537af07f7226a87d8de1309bf494914789609e4
Reviewed-on: https://chromium-review.googlesource.com/581289
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#489598}
hugoh
Do not show I-beam when hovering 'user-select: none'
All elements now have 'user-select: auto' as their default
value (not 'user-select: text').

Spec: https://drafts.csswg.org/css-ui-4/#propdef-user-select

This default value has no effect; elements are styled as usual.
This is important because Blink needs a "no change" default
to be able to find cases where 'user-select' should affect
mouse pointer styling.

BUG=742235
TEST=EventHandlerTest.ChildCanOverrideUserSelectText
     EventHandlerTest.HitOnUserSelectNoneDoesNotShowIBeam
     EventHandlerTest.ShadowChildCanOverrideUserSelectText

Above 3 tests failed before this patch.

Change-Id: I1ed0ad69daf6a1a1bd4b21623fcdb145ef596d88
Reviewed-on: https://chromium-review.googlesource.com/570246
Commit-Queue: Hugo Holgersson <hugoh@opera.com>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489363}
mstensho
Explicit namespace ::testing, to not confuse it with blink::testing
This fixes a merge mistake at
https://chromium-review.googlesource.com/c/519168/25/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp

That CL overwrote parts of https://codereview.chromium.org/2970833002 ,
which broke Jumbo compilation.

BUG=739121

Change-Id: I486a2c49032ffeef2bd81d5e230a9f9cf81b646f
Reviewed-on: https://chromium-review.googlesource.com/582611
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#489050}
gianlucac
Fix parsing of $GTK_MODULES
The AtkUtilAuraLinux::Initialize function checks whether accessibility
should be enabled. To do so, it calls PlatformShouldEnableAccessibility,
which parses the content of the environment variable GTK_MODULES. This
variable contains a list of colon-separated modules; the function parses
it as it were a whitespace-separated list, looking for a module called
`gail:atk-bridge`, while in fact, the module to look for is
`atk-bridge`. On systems having a more complex content for GTK_MODULES
(mine is `gail:atk-bridge:unity-gtk-module`), the parse fails, and the
initialization aborts.

Bug: 747393
Change-Id: I17d82331af1d117d0ed70520b4367c5915037316
Reviewed-on: https://chromium-review.googlesource.com/582807
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489022}
mstensho
Revert "Make border width rounding visible to js via getComputedStyle."
This reverts commit e87da780e04bf05f5ae863d7fda517ee6c03d534.

Reason for revert: This fix is a spec violation, and the previous behavior was more correct. A slightly inaccurate representation (off by less than 0.02px) is better than clamping it to 1px.

Original change's description:
> Make border width rounding visible to js via getComputedStyle.
> 
> CL (https://chromium-review.googlesource.com/c/525536/) moved rounding of border 
> widths to the painting stage, hence rounding is no longer visible in js via 
> getComputedStyle. This cl makes rounding visible again to users via getComputedStyle.
> 
> This cl contains the following changes
> * Implemented a ZoomAdjustedPixelValueWithRounding method.
> - This method is the same as ZoomAdjustedPixelValue except that it
> rounds pixel value to 1 if original value is between 0 and 1.0.
> * Changed ComputedStyle for border-[top|right|bottom|left] to use
> ZoomAdjustedPixelValueWithRounding so that getComputedStyle will
> display rounded pixels for these properties (and also border-width that
> is a shorthand of these 4 longhand properties).
> * Changed a layout test.
> 
> Bug: 737962
> Change-Id: I0656f7ea1212fe32f866d95218995fb3de109e05
> Reviewed-on: https://chromium-review.googlesource.com/560917
> Commit-Queue: Jia Meng <jiameng@chromium.org>
> Reviewed-by: Alan Cutter <alancutter@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#487384}

TBR=alancutter@chromium.org,jiameng@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 737962
Change-Id: I03120da255990456614ffc3e0e3180eaa20a566a
Reviewed-on: https://chromium-review.googlesource.com/582608
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#488947}
bratell
Make sure CSSPropertyIdMap knows the CSSPropertyID traits.
CSSPropertyID has some custom traits and without knowing them the
HashTable will not be compiled as intended. This was noticed through
a warning in jumbo builds about the traits being instantiated implicitly
before they were instantiated explicitly (in a specialization).

R=haraken@chromium.org

Bug: 747408
Change-Id: I2dea24bec17c8d071cbe60e443834d440eebfb2a
Reviewed-on: https://chromium-review.googlesource.com/581447
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#488861}
mstensho
Always relayout when an object gets or loses a PaintLayer.
This rids us of some crufty code, and also fixes bugs. The approach was also
broken for multicol, because we started UpdatePaginationRecursive() in the
middle of the tree without looking for a containing flow thread (pagination
layer). This would result in the new layer erroneously not becoming paginated.

Also had to update a unit test, to satisfy its requirement that the style change
won't trigger layout.

BUG=616596

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I50ed61a7174e360259b7b786bab01cf74616fc32
Reviewed-on: https://chromium-review.googlesource.com/542915
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488768}
bratell
Deduplicated 3 JSON string constants, "null", "true" and "false"
Both JSONParser and JSONValues use constants for the strings
"null", "true" and "false". That is probably no problem since the
linker will merge identical strings, but since the constants had
the same names as well they caused collisions in jumbo builds.

This patch makes JSONParser use the JSONValues constants.

Change-Id: I27b01b354aa9cfeab0f8c636f22ecfbc2762a6bc
Reviewed-on: https://chromium-review.googlesource.com/577552
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#488654}
bratell
Fix compilation for ATK (accessibility)
A variable wasn't given the right name inside the ATK support when
a patch consolidated 3 AX properties into single restrictions
property for accessibility objects.

R=aleventhal@chromium.org, jochen@chromium.org

Change-Id: I0c82e055e39614110cfc4f7a7299d226bd4e6ad2
Reviewed-on: https://chromium-review.googlesource.com/580927
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#488630}
bratell
Renamed CreateDecoder helper functions in Image decoder tests
All image decoder test have a helper function "CreateDecoder" which
conflicts in jumbo builds where the tests are merged. This patch renames
them "CreateBMPDecoder", "CreateJPEGDecoder" and so on.

Bug: 745732
Change-Id: I2cfd108c39ade76a09059d77778557ab44b82752
Reviewed-on: https://chromium-review.googlesource.com/576098
Reviewed-by: Noel Gordon <noel@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#488407}
bratell
Support jumbo builds in core unit tests (except editing)
This patch makes the build system for core unit tests support jumbo
builds (unity builds) which saves roughly 60 CPU minutes (5% of the
build time) on my computer. Currently jumbo is by default disabled so
this will have no direct effect unless you have
  use_jumbo_build = true
in your gn settings.

Bug: 713137
Change-Id: I376e62fb66738cba9135d02f8079d983cfe67495
Reviewed-on: https://chromium-review.googlesource.com/575055
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#488238}
bratell
Make blink/modules support jumbo compilations (-60 CPU minutes)
Compiling browser code in blink/modules currently use
about 80 CPU minutes. That is about 7% of the total compilation time.
If you use jumbo compilation (merge many files into a single
translation unit) that time drops to about a fifth of that.

There are also unit_tests in modules that will be jumbofied in
a different patch.

Bug: 713137
Change-Id: I9155d2af0c9dce6b3178f77b9366062eb45d4560
Reviewed-on: https://chromium-review.googlesource.com/568302
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#488179}
mstensho
Include less from platform/graphics/Image.h
Change-Id: I00ae6625688bb740ecf0235c98e25f41296b359f
Reviewed-on: https://chromium-review.googlesource.com/553298
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#487925}
bratell
Avoid using the name Function since it collides with WTF::Function
If a class named Function is created and the header
platform/wtf/Functional.h included, any attempt at using WTF::Function
will fail with a lot of strange template instantiation errors.

This can happen unexpectedly in jumbo builds so to avoid that error
this patch renames a testing class that used to be 
named Function, ReaderFunction.

R=fs@opera.com

Bug: 746343
Change-Id: I498ecf4f8cb293de634c40060a2df34c78a23e09
Reviewed-on: https://chromium-review.googlesource.com/574864
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#487870}
bratell
Make multiple jumbo_* templates instead of just jumbo_target
Initially there was just one template, jumbo_target, but that
caused problems with default configurations and also made every
patch one line more verbose than necessary. Better to have multiple
templates and make the usage just a little bit simple.

Bug: 713137
Change-Id: I7e2b1f0c5216b4465bae331763d6aa5a08e1c996
Reviewed-on: https://chromium-review.googlesource.com/575058
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487823}
bratell
Deduplicate CreateIDBValue() used in indexeddb unit_tests
IDBRequestTest and IDBTransactionTest both had an identical helper
function CreateIDBValue. In jumbo builds those identical functions
collided so this patch moves the code to a shared helper file.

Bug: 745732

Change-Id: I36c658509c76deca4e03590858140e02a07f38d3
Reviewed-on: https://chromium-review.googlesource.com/575145
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487547}
bratell
Avoid "using namespace blink" in global scope
With jumbo (unity builds, merged translation units) a "using blink"
statement intended for just the local translation unit will affect
many other translation units which causes various issues.

There is also (with jumbo) a warning about such usage that will prevent
things from compiling.

Without this patch this file will have to be manually excluded from
jumbo builds and I am trying to avoid such exclusion lists for
performance and maintenance.

Review-Url: https://codereview.chromium.org/2965323002
Cr-Commit-Position: refs/heads/master@{#487501}
bratell
Made test class names unique in media_controls unit tests
MediaControlsImplTest and MediaControlsOrientationLockDelegate use the
same class names for Mock classes. Such as MockChromeClient and
StubLocalFrameClient. That is normally no big deal but in jumbo builds
they can be compiled in the same translation unit and then the classes
will collide. This patch gives the class names unique suffixes so that
media_controls tests don't have to be excluded from jumbo.

Bug: 745732

Change-Id: I6c3a4d5d92ae690ece53aa093ffb4039eb79137e
Reviewed-on: https://chromium-review.googlesource.com/575140
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487485}
bratell
Renamed MockEventListener in presentation and remoteplayback unit tests
Both PresentationReceiverTest and RemotePlaybackTest use a local test
class named MockEventListener. That is normally no big deal
but in jumbo builds they can be compiled in the same translation unit
and then the classes will collide. This patch gives the classes
unique prefixes so that no tests have to be excluded from jumbo.

Bug: 745732

Change-Id: Ic9a5e4e896b226d5ef7f99f2549cd3d4bb66fc42
Reviewed-on: https://chromium-review.googlesource.com/575141
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487479}
bratell
Renamed MockWebAudioDevice in webaudio unit tests
Both AudioContextTest and BaseAudioContextTest use a local test
class named MockWebAudioDevice. That is normally no big deal
but in jumbo builds they can be compiled in the same translation unit
and then the classes will collide. This patch gives the classes
unique prefixes so that no tests have to be excluded from jumbo.

Bug: 745732

Change-Id: Ie736a0541082c56af745d51061897a081d2d1da5
Reviewed-on: https://chromium-review.googlesource.com/575142
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487475}
bratell
Made constant names unique in notification unit tests
NotificationDataTest, NotificationImageLoaderTest and
NotificationResourceLoaderTest all use constants, such as kBaseDir,
with the same name. That is normally no big deal but in jumbo builds they
can be compiled in the same translation unit and then the constants
will collide. This patch gives the constants unique prefixes so that
the tests don't have to be excluded from jumbo.

Change-Id: Ib01d88e75cdc876a58c52a6ee3b49a942ccb19ab
Reviewed-on: https://chromium-review.googlesource.com/576088
Reviewed-by: Peter Beverloo <peter@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487458}
bratell
Renaming unit_test class MockHTMLResourcePreloader to not collide.
CSSPreloadScannerTest and HTMLPreloadScannerTest
both use a local MockHTMLResourcePreloader class for
testing. That is normally no big deal but in jumbo builds they
can be compiled in the same translation unit and then the classes
will collide. This patch gives the classes unique prefixes.

R=fs@opera.com

Change-Id: I29cd360e919c6b708a6021b6930b3347e5ae8194
Reviewed-on: https://chromium-review.googlesource.com/574707
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487242}
bratell
Renaming unit_test class MockLocalFrameClient to not collide.
Both FrameFetchContextTest and MixedContentCheckerTest deckare a class
named MockLocalFrameClient. That is normally no big deal
but in jumbo builds they can be compiled in the same translation unit
and then the functions will collide. This patch adds a prefix to
the class names to make them more unique.

R=fs@opera.com

Change-Id: I215f7edafa2fa0b229dc5847a1e158df825e8c27
Reviewed-on: https://chromium-review.googlesource.com/574708
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487140}
bratell
Renaming unit_test class StubLocalFrameClient to not collide.
ElementVisibilityObserverTest, HTMLMediaElementEventListenersTest and
VideoPainterTest all use a local StubLocalFrameClient class for
testing. That is normally no big deal but in jumbo builds they
can be compiled in the same translation unit and then the classes
will collide. This patch gives the classes unique prefixes.

R=fs@opera.com

Change-Id: I47c7088486456e22ca776419a836f4e5d18be39c
Reviewed-on: https://chromium-review.googlesource.com/574605
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487122}
mstensho
Include less from Color.h
Moved the rarely used Blend() overload to a new file ColorBlend.h,
since it requires heavy stuff to be included.

This change caused Image.h to lose its inclusion of FloatSize.h. Removed the
default value from a FloatSize parameter.

Change-Id: I9b32e425c86b237b4c3a69ec53e601faa713f56f
Reviewed-on: https://chromium-review.googlesource.com/553139
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487119}
bratell
Use more unique names for blink core TestCase classes
It is fairly common to have a help struct with test data and a fair
portion of the code call that struct TestCase and put it in a fairly
global namespace. In jumbo builds those structs will collide so this
patch renames them to more specific names such as
MediaQuerySetTestCase or SizesCalcTestCase.

R=fs@opera.com

Change-Id: Ic02ef5062782a0ec3862ad3bffdc462574ca8a61
Reviewed-on: https://chromium-review.googlesource.com/574600
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487114}
bratell
Renaming unit_test class MockValidationTestClient to not collide.
Both DocumentTest and HTMLFormControlTest uses a local
MockValidationTestClient class for testing. That is normally no big deal
but in jumbo builds they can be compiled in the same translation unit
and then they will collide. This patch gives the classes unique
prefixes.

R=fs@opera.com

Change-Id: If1f2d22fca4c5f7b3ad662f6ae746cef4baf48c3
Reviewed-on: https://chromium-review.googlesource.com/574174
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#487091}
bratell
Renaming unit_test class MockChromeClient to not collide.
LocalFrameViewTest, HTMLVideoElementPersistentTest and
PaintLayerScrollableTests all use a local MockChromeClient class for
testing. That is normally no big deal but in jumbo builds they
can be compiled in the same translation unit and then the classes
will collide. This patch gives the classes unique prefixes.

R=fs@opera.com

Change-Id: Ibd6c9d17e1e8dfbe42cbb254344e52a81ce48788
Reviewed-on: https://chromium-review.googlesource.com/574176
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#487090}
bratell
Avoid using "using" in global scope
"using namespace" in global scope introduces a lot of symbols into the
current scope and does not work well with jumbo. In case of WTF you
can also equally well just write a WTF:: prefix.

Bug: 
Change-Id: Id615f60151e0bc46cfe2a5e9a6a9313c412f1344
Reviewed-on: https://chromium-review.googlesource.com/570446
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487076}
bratell
Renaming unit_test function ConstructConstraintSpace to not collide
ng_block_layout_algorithm_test and ng_constraint_space both use a local
function ConstructConstraintSpace for testing. That is normally
no big deal but in jumbo builds they can be compiled in
the same translation unit and then the functions will collide.
This patch gives the functions unique names.

R=fs@opera.com

Change-Id: I3941094aad201b7ec6796d63664da8cfba8056c3
Reviewed-on: https://chromium-review.googlesource.com/574237
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487072}
bratell
Move unit_test *_EQ macros to a shared file instead of repeating them
There are several classes in frame which have use of for instance
EXPECT_POINT_EQ and EXPECT_SIZE_EQ. The problem (beyond duplicating
code) is that in jumbo builds those defines collide.

This patch moves the shared macros to core/frame/FrameTestHelpers.h.

There are also equally named macros in cc/test/geometry_test_utils.h
but those work on gfx::Rect/gfx::RectF which is not quite API 
compatible (different character case).

R=fs@opera.com

Change-Id: I60cb7eff533e4dccc796937a027ec090071cd5c2
Reviewed-on: https://chromium-review.googlesource.com/574179
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#487071}
bratell
Be more specific about namespace for _ in unit tests
There is a gtest namespace ::testing and a helper namespace in blink
called ::blink::testing. If both are visible to the compiler,
::blink::testing will be used first and classes in ::testing will not
be found. This happens in jumbo builds so we better be more specific.

R=fs@opera.com

Change-Id: I4da27383432226191b0fcb72f3c54784698f0262
Reviewed-on: https://chromium-review.googlesource.com/574488
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487070}
bratell
Add support for jumbo_component.
Normal jumbo_target has the wrong default configs for components so this
adds a new jumbo_component that has the right default configs.

Bug: 713137
Change-Id: I32fd2d015162d85b7ff07d5515489b9e33cfb987
Reviewed-on: https://chromium-review.googlesource.com/571790
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487068}
bratell
Deduplicate helper class SampleInterpolation in unit tests
Both InterpolableValueTest and InterpolationEffectTest use an
identical class for value testing. These classes collided in jumbo
builds where they were compiled in the same translation unit.

This patch moves the class to AnimationTestHelper.h and changes its
name to be more descriptive now when it isn't as close to where it
is used anymore.

Also changing the name of the kDuration constant that interfered
with blink::kDuration.

R=fs@opera.com

Change-Id: Ic90cec2972f5464d7932b2ba91994273968e87c4
Reviewed-on: https://chromium-review.googlesource.com/574489
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487067}
bratell
Renaming unit_test classes Mock* to not collide
IdleDeadlineTest and ScriptedIdleTaskControllerTest both use similarly
names mock classes, MockScheduler, MockThread and MockPlatform which
collide in jumbo builds where they are merged into the
same translation unit.

This patch gives the classes unique names.

R=fs@opera.com

Change-Id: I305cb3fbdfbd3b3b6fc7c18e8c3ceccf89da863e
Reviewed-on: https://chromium-review.googlesource.com/574487
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487066}
bratell
Renaming unit_test class MockCanvas to not collide.
PageOverlayTest and PrintContextTest both use a local mock
test class named MockCanvas for testing. That is normally
no big deal but in jumbo builds they can be compiled
in the same translation unit and then the classes
will collide. This patch gives the classes unique names.

R=fs@opera.com

Change-Id: Icfcb2b4b553e50e08cb6ac56712e4e9aa5f2b69e
Reviewed-on: https://chromium-review.googlesource.com/574349
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487065}
bratell
Avoiding redefining LineBreakType in unit_tests.
There is blink enum class LineBreakType used to correctly layout text.
That makes it unsuitable to use the same name in a unit_test since they
may collide, and actually will collide in jumbo builds.

This patch changes LineBreakType to NewlineType

R=fs@opera.com

Change-Id: I3c5ae6ea5b6e199990c8b51c3a55eb1d17a8f19e
Reviewed-on: https://chromium-review.googlesource.com/574238
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487064}
bratell
Renaming unit_test functions Ident and Dimension to not collide.
CSSTokenizerTest already uses functions named Ident and Dimension so to
avoid special casing in jumbo builds where the tests are compiled
together, rename them here.

R=fs@opera.com

Change-Id: I6b600c269463d897b6d56287e450e37d027b2911
Reviewed-on: https://chromium-review.googlesource.com/574173
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487058}
bratell
Renaming unit_test class TestParam to not collide.
HTMLMediaElementTest and MediaCustomControlsFullscreenDetectorTest
both use a local TestParam struct/enum for testing.
That is normally no big deal but in jumbo builds they
can be compiled in the same translation unit and then the classes
will collide. This patch gives the classes unique prefixes.

R=fs@opera.com

Change-Id: I17a4d3a25e38bc0789071fcec31b066a385d34a0
Reviewed-on: https://chromium-review.googlesource.com/574178
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487057}
bratell
Renaming unit_test function RegisterMockedURLLoad to not collide.
There is a shared RegisterMockedURLLoad in URLTestHelpers and a couple of
local ones imported with "using" or locally declared. That is
normally no big deal but in jumbo builds they
can be compiled in the same translation unit and then the functions
will collide. This patch removes a "using" and renames a function
to make the names more unique.

R=fs@opera.com

Change-Id: I6866f13bd1903e42269b7286645a9f07396b68a8
Reviewed-on: https://chromium-review.googlesource.com/574180
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487056}
bratell
Renaming unit_test class PreconnectTestCase to not collide.
HTMLResourcePreloaderTest and HTMLPreloadScannerTest
both use a local PreconnectTestCase struct for
testing. That is normally no big deal but in jumbo builds they
can be compiled in the same translation unit and then the classes
will collide. This patch gives the classes unique prefixes.

R=fs@opera.com

Change-Id: I99f315843fd6908ba94595e852e6c1fac6acdedb
Reviewed-on: https://chromium-review.googlesource.com/574177
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Yoav Weiss <yoav@yoav.ws>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487053}
bratell
Avoid using the function name Function in unit_tests.
There is a ::Function template in wtf/Functional.h and if someone else
defines a function with the same name that template will be harder to
use. This is more of a problem in jumbo builds where more code is
visible so that both the definitions becomes visible at the same time.

R=fs@opera.com

Change-Id: I0be2f2e2441f3e5db0049f65e1b4c0be8997d586
Reviewed-on: https://chromium-review.googlesource.com/574028
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487050}
bratell
Be more specific about namespace for Message in unit tests
There is a gtest namespace ::testing and a helper namespace in blink
called ::blink::testing. If both are visible to the compiler,
::blink::testing will be used first and classes in ::testing will not
be found. This happens in jumbo builds so we better be more specific.

R=fs@opera.com

Bug: 
Change-Id: I912ed721a0ccae7b8e8b622020f87f15204362cf
Reviewed-on: https://chromium-review.googlesource.com/574027
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#487049}
mostynb
don't forget to actually return the number of specified test jobs
BUG=741927,743615
TEST=Running browser_tests with the flags below, should print "Using 1 parallel jobs."
--run-manual --ui-test-action-max-timeout=350000 --test-launcher-jobs=1 --test-launcher-bot-mode --test-launcher-print-test-stdio=always
TBR=phajdan.jr@chromium.org

Change-Id: I33f2b4fc54b43ebec8a27c532da17146b42c07cd
Reviewed-on: https://chromium-review.googlesource.com/573380
Reviewed-by: Mostyn Bramley-Moore <mostynb@opera.com>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#487014}
bratell
Use more unique names in fonts testcases
Many fonts tests use local helper classes TestRun, ExpectedRun and
helper macros DECLARE_RUNSVECTOR and CHECK_RUNS. With jumbo builds
those names start colliding so this patch gives the classes and
macros a prefix related to the actual test.

Change-Id: I494cfc182070ae37a87b68f08303fc8cc3ef9cfe
Reviewed-on: https://chromium-review.googlesource.com/570424
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486866}
bratell
Explicit template forward declaration for platform/fonts
Doing an implicit template instantiation before doing an explicit
template instantiation in the same translation unit is a C++
violation. That happens if you jumbo compile blink platform but is
easy to avoid with a forward declaration such as the one this patch
adds.

Change-Id: I7b22e28b2bf8f2583598e97db69d68fa1613550e
Reviewed-on: https://chromium-review.googlesource.com/570444
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486858}
bratell
Unduplicate SkiaScalarToHarfBuzzPosition
There were two implementation of SkiaScalarToHarfBuzzPosition and
in jumbo builds they collided. This patch merges them.

Bug: 
Change-Id: Ibea7aeffbfdf77eb3fd088949f912eb41e56c462
Reviewed-on: https://chromium-review.googlesource.com/570428
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486856}
bratell
blink/platform: Be explicit about namespace testing to not mix it with blink::testing
There are two namespaces named testing used in Blink unit tests, one
from gtest and one internal helper namespace. If both are visible then
the gtest testing namespace won't be used unless prepended with ::, as
is already done in large parts of the code.

BUG=739121
R=haraken@opera.com

Change-Id: I48f6a3145886253576a53d1ad9c08307ceca0d52
Reviewed-on: https://chromium-review.googlesource.com/567143
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#486839}
bratell
Remove some jumbo exclusions no longer needed
The files listed in core_generated jumbo exclusions have since been
fixed so the exclusions are no longer necessary.

R=fs@opera.com

Bug: 713137
Change-Id: Ib9a9216147e9df7d8b196de761556d3f23997448
Reviewed-on: https://chromium-review.googlesource.com/571222
Commit-Queue: Daniel Bratell <bratell@opera.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#486804}
bratell
Merge the two identical To16Bit functions in font tests
There are two very small, identical, To16Bit functions in
font shaping tests. Since they caused collisions in jumbo builds and
I didn't want to exclude the files from jumbo files I've merged them
into a utilities file.

Bug: 
Change-Id: I0c7e7d4ee708431a6401de7a01790f78c4e75e08
Reviewed-on: https://chromium-review.googlesource.com/570426
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486794}
mostynb
--gtest_filter should only change NumParallelJobs' default value
BUG=741927,735587

Change-Id: Ib95bd85e2f1ad14e27ba8fa76f8b52f8e137e830
Reviewed-on: https://chromium-review.googlesource.com/569159
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#486773}
bratell
Clean out some "using namespace WTF".
Some global "using namspace WTF" caused problems with jumbo builds
and since WTF is also meant to be used without using namespace WTF
this patch just replaces them with explicit namespaces.

Bug: 
Change-Id: Ifc06e163c095de0e2ce5a8c69123578557ef0dee
Reviewed-on: https://chromium-review.googlesource.com/565413
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#486735}
bratell
Fix error in error message concatenation in jumbo script.
Best to not try to add a string to a set without converting the set to
a string first.

R=dpranke@chromium.org

Bug: 713137
Change-Id: Id4c632b1f944fcafdd046983b1ddd4678c44928f
Reviewed-on: https://chromium-review.googlesource.com/564939
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#486706}
bratell
Rename 5*ExtraDataContainer to SomethingExtraDataContainer
There are five different classes in
third_party/WebKit/Source/platform/exported named ExtraDataContainer.
They are only used as local internal classes so they don't normally
collide in the compiler, but they do so in jumbo builds.

This patch renames them so that the names are more unique.

Bug: 742337
Change-Id: Iad42e0d29f600fabd6ea9081687a7107d3043282
Reviewed-on: https://chromium-review.googlesource.com/570052
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#486481}
bratell
Rename the two different TestClient classes in fetch unit tests
In jumbo the two different TestClient classes clashed so this patch
renames them to not collide so that these files can be included in
jumbo compilations.

R=tyoshino@chromium.org

Bug: 
Change-Id: Ieea187ba6928df04df0059ad357730d7a82022bc
Reviewed-on: https://chromium-review.googlesource.com/570040
Commit-Queue: bratell at Opera <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486367}
bratell
Let there be only one global class Result in fetch unit tests
Both BytesConsumer::Result and WebDataConsumerHandle::Result are
imported into global/blink namespace in fetch unit tests. That causes
collisions in jumbo builds so this removes the
WebDataConsumerHandle::Result in that namespace.

R=tyoshino@chromium.org

Bug: 
Change-Id: I52f860aa4ccd59b4be944f950c25797022582b68
Reviewed-on: https://chromium-review.googlesource.com/570042
Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#486346}
bratell
Reduce the number of MockClient classes in fetch unit tests
Jumbo builds had the three different MockClient classes colliding. This
patch renames two of them so that they will not collide.

R=tyoshino@chromium.org

Change-Id: Ib646bdb3ed4e08cbf28b736a67d4fcb3646ede00
Reviewed-on: https://chromium-review.googlesource.com/570043
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#486344}
bratell
Merge three identical ToString implementations in fetch unit tests
In jumbo builds the ToString implementations collided and since they
are identical anyway, this patch just merges them to one implementation.

R=tyoshino@chromium.org

Bug: 
Change-Id: I379a6e7bf759e12ae6f37347e8e2e80154a1079b
Reviewed-on: https://chromium-review.googlesource.com/570039
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#486343}
bratell
Make the fetch unit test Command class not collide.
In jumbo builds the two Command classes in fetch unit_tests would collide
since they are both imported into the same global/blink scope with
"using" statements. This patch changed the "using" statements to give
the classes different names.

R=tyoshino@chromium.org

Bug: 742239
Change-Id: I37a783755049ff36ebd63f6b432a0e07bce4a4db
Reviewed-on: https://chromium-review.googlesource.com/570018
Commit-Queue: bratell at Opera <bratell@opera.com>
Reviewed-by: Takeshi Yoshino <tyoshino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486342}
fs
Deflake two tests in svg/animations/mozilla/
Pause the timeline after adjusting the current time, similarly to how
it's done in other tests in this directory and in other places. This
avoids flakiness due to the timing of the first frame differing from
that of the 'load' event.

TBR=schenney@chromium.org
BUG=726362,742068

Change-Id: Id9753fc1d5b53a389a59f9b8f36a8965fb9597d0
Reviewed-on: https://chromium-review.googlesource.com/569619
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#486323}
hugoh
Show pointer (not I-beam) when mouse drags in the air
A bug surfaced when Blink started to allow hidden selections.
The condition "show I-beam if we have a non-empty selection"
became too generous.

We should show an I-beam when:
- Node is editable
- Node is selectable
- A link's text is being selected

Besides fixing the condition I moved its block into
ShouldShowIBeamForNode() to try to gather stray I-beam
logic into one place.

TEST=LinkSelectionTest.DragOnNothingShowsPointer

BUG=735852

Change-Id: I5366462c713155754de39b0c5d11fa33656eb6e3
Reviewed-on: https://chromium-review.googlesource.com/566798
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: David Bokan <bokan@chromium.org>
Commit-Queue: Hugo Holgersson <hugoh@opera.com>
Cr-Commit-Position: refs/heads/master@{#486308}
fs
Remove kInitialFrameDelay from SMILTimeContainer::Start
This is an old hack to preserve behavior of certain tests. These tests
have since been fixed to not rely on this. Get rid of it and just call
UpdateAnimationsAndScheduleFrameIfNeeded(...) instead to schedule the
first frame just like any other.

BUG=726362

Change-Id: I1ff2673a8d4b71ea237a2902f10599e08bcfb7d6
Reviewed-on: https://chromium-review.googlesource.com/564608
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#486115}
bratell
Drop inspector jumbo excludes as they are not needed
Some files excluded from jumbo compilation seems to compile just
fine in jumbo so this patch removes their special treatment.

Review-Url: https://codereview.chromium.org/2971153002
Cr-Commit-Position: refs/heads/master@{#486000}
bratell
Avoid duplicate functions: one AddStringToDigestor is enough
There are two implementation of AddStringToDigestor. Beyond being
one more than needed, they also conflict in jumbo builds.

This patch merges the two AddStringToDigestor and removes the
conflicting files from the jumbo exclusion list.

Review-Url: https://codereview.chromium.org/2800133003
Cr-Commit-Position: refs/heads/master@{#485992}
bratell
Rename a constant in editing unit tests to make it more unique.
kDescription is the name of two constants in editing unit_tests and
in jumbo builds those collides. This renames one of them
kTestDescription to make both constants have unique names.

R=fs@opera.com

Bug: 
Change-Id: I7fcb2fde1a6841ef92fe7d55a7b363da7c2c7fa0
Reviewed-on: https://chromium-review.googlesource.com/568146
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485970}
bratell
Avoid naming conflict for Cache and Response in cachestorage
There are multiple Cache types and Response types so when importing
one of them into the global namespace you can easily get naming conflicts, especially with jumbo. This renames Cache and Protocol
locally to avoid such naming conflicts.

Review-Url: https://codereview.chromium.org/2968183002
Cr-Commit-Position: refs/heads/master@{#485939}
bratell
Also check jumbo_excluded_sources when jumbo is disabled
Since jumbo is still disabled by default and there is no active
bot that checks things, it is best to check that jumbo_excluded_sources
are correct also when jumbo is disabled.

Bug: 713137
Change-Id: I85bb92f283be240a704ce3ec0d5765933ba52016
Reviewed-on: https://chromium-review.googlesource.com/563683
Commit-Queue: bratell at Opera <bratell@opera.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485913}
bratell
Rename ToElement<>(ListedElement) to ToHTMLObjectElementFromListedElement
Having two sets of templates named ToElement caused compilation failures
when both templates were visible to the compiler at the same time.
Since one of the templates doesn't benefit from being a template
this patch renames it and makes it an ordinary function.

R=fs@opera.com, tkent@chromium.org

Bug: 738389
Change-Id: Ia6247ad0f794cc4094f3f73cd7492ad5d94407c2
Reviewed-on: https://chromium-review.googlesource.com/567141
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485904}
hugoh
Avoid race at shutdown between browser process' IO thread and GPU thread
Background:
- When the GPU thread is *in-process* it runs inside the browser process.
- GpuChildThread is a ChildThreadImpl and a IPC::Listener.
- When GpuChildThread sees an error (or shutdown) of its IPC channel,
  it quits its message loop (= stops the thread).

Problem:
The browser process' IOThread calls InProcessGpuThread::StopSoon()
while the in-process GPU thread destructs itself.

When InProcessGpuThread::StopSoon asks for task_runner() the in-process
GPU thread has - sometimes - already destructed itself and its
MessageQueue. The IOThread then sees task_runner() == null and crashes:

[FATAL:ref_counted.h(484)] Assert failed: ptr_ != nullptr.
0 base::debug::StackTrace::StackTrace()
1 base::debug::StackTrace::StackTrace()
2 logging::LogMessage::~LogMessage()
3 base::Thread::StopSoon()
4 base::Thread::Stop()
5 content::InProcessGpuThread::~InProcessGpuThread()
6 content::InProcessGpuThread::~InProcessGpuThread()
7 content::GpuProcessHost::~GpuProcessHost()
8 content::GpuProcessHost::~GpuProcessHost()
9 content::BrowserChildProcessHostImpl::TerminateAll()
10 content::BrowserProcessSubThread::IOThreadPreCleanUp()
11 content::BrowserProcessSubThread::CleanUp()
12 base::Thread::ThreadMain()
13 base::(anonymous namespace)::ThreadFunc()

Solution:
If a thread runs in the browser process, only Thread::Stop should
stop its message loop. Otherwise, QuitWhenIdle could race Thread::Stop.

BUG=258935

Review-Url: https://codereview.chromium.org/2973723003
Cr-Commit-Position: refs/heads/master@{#485895}
bratell
Avoid "using namespaces" when they might introduce colliding symbols.
SVGNames and HTMLNames share some symbols, like hrefAttr. When some
of the tests are compiled together in jumbo, having both
using namespace SVGNames and using namespace HTMLNames caused compilation
issues.

R=fs@opera.com

Bug: 
Change-Id: Id943efc79ac54a5b69b6095f622746f4e0fb0532
Reviewed-on: https://chromium-review.googlesource.com/567140
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485652}
bratell
Use ::testing in tests to not mix with blink::testing
There are two namespaces testing, one in ::testing and one in
::blink::testing. If you are inside ::blink and the code knows about
both of them, it will use ::blink::testing first.

This causes issues with jumbo builds where more code is visible.

R=fs@opera.com

Bug: 
Change-Id: Ia879a40b1626ac6929fc74a0f31509614e6b7051
Reviewed-on: https://chromium-review.googlesource.com/567142
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485650}
bratell
Rename one of two EXPECT_RECT_EQ.
Use the name EXPECT_RECT_APPROX_EQ for comparison of approximately
equal rects so that it doesn't collide with the other EXPECT_RECT_EQ
in jumbo builds.

R=fs@opera.com

Bug: 
Change-Id: I16815d32b06915db00f6a945883c7628cf343990
Reviewed-on: https://chromium-review.googlesource.com/567088
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485648}
fs
Make svg/W3C-SVG-1.1 animation tests "static"
These tests are animated, but has from a testing standpoint never gone
beyond sampling the frame at t=0. This is however partly by "accident"
because t=0 is just after 'load', while the frame dumped will have a
value of 't' greater than 0. To ensure t=0 is sampled, pause the
timeline.

This commit was generated by a script (explaining the imperfect
indentation.)

BUG=726362

Change-Id: I60bdd2d0fa30b09318b18d2eda39583821107199
Reviewed-on: https://chromium-review.googlesource.com/565723
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#485618}
bratell
Change code to make jumbo exceptions unnecessary in core/html
In jumbo several compilation units are merged so you have to
have more unique names in each one, and don't #undef macros
needed by other compilation units.

BUG=713137

Review-Url: https://codereview.chromium.org/2971683003
Cr-Commit-Position: refs/heads/master@{#485585}
bratell
Use the same sqlite header configuration in all of webdatabase
Some of third_party/WebKit/Source/webdatabase uses sqlite withq
internals exposed and some uses it with internals not exposed. That
mismatch causes issues in jumbo builds since it compiles several files
together and need headers to say the same thing.

This changes webdatabase so that it all compile with the
CHROMIUM_SQLITE_INTERNALS define set.

R=michaeln@chromium.org

Bug: 740542
Change-Id: I0b5c66fde7d191afd7a7143ef32c9c6f1b21b9e2
Reviewed-on: https://chromium-review.googlesource.com/565502
Reviewed-by: Michael Nordman <michaeln@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485558}
tmoniuszko
Add missing includes to media_router_file_dialog.cc
Both Profile and Browser are used in code.

BUG=

Review-Url: https://codereview.chromium.org/2966033002
Cr-Commit-Position: refs/heads/master@{#485557}
bratell
Only compile the PNG encoder once.
The PNG fuzzer included all of PNGImageDecoder.cpp and effectively
compiled it a second time. Since the fuzzer already depends on the
png encoder it will just be linked together anyway.

This double compilation caused jumbo errors because symbols appeared
twice.

Change-Id: I0ef1502ba90247e34c33055056bdeb808e0dbb89
Reviewed-on: https://chromium-review.googlesource.com/565411
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485555}
ingemara
Merge Android manifests when assembling apk
Merge all resource dependency manifests using the manifest merger from the
Android SDK, providing the functionality described in
https://developer.android.com/studio/build/manifest-merge.html.

Removing the nontrivial manifest guard in the android_aar_prebuilt() template
will be done in a follow-up change, as well as removing pre-merged manifest
tags, such as "com.google.android.gms.version" meta-data.

Bug: 643967
Change-Id: Ifdf9f3f76f5c80f1a2326dcd47045d032556936f
Reviewed-on: https://chromium-review.googlesource.com/558296
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Ingemar Ådahl <ingemara@opera.com>
Cr-Commit-Position: refs/heads/master@{#485303}
bratell
Avoid global using namespace statements in modules/sensor
global using namespace statements cause issues with jumbo builds so this
patch moves and removes two such occurances in modules/sensor.

An alternative is to import explicit symbols rather than the full
namespaces.

R=mikhail.pozdnyakov@intel.com

Bug: 
Change-Id: Iafc85a856b02b381dae6244b2fc3acedc37e30db
Reviewed-on: https://chromium-review.googlesource.com/565296
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485277}
bratell
Renamed a local class Function in a test to not collide with WTF.
There is a Function<> template in WTF/Functional.h which is shadowed
or collides with any local definitions of Function. This is not always
a problem, but it caused problems in Jumbo builds so let us rename
it to something harmless.

Change-Id: Ib594b2673a1dce6b4647445d3377b1e1099849da
Reviewed-on: https://chromium-review.googlesource.com/563667
Commit-Queue: bratell at Opera <bratell@opera.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485273}
bratell
Add include guards to some generated files in core/css.
A couple of files in core/css were missing include guards which broke
jumbo builds.

R=fs@opera.com

Change-Id: I1d50e8b62f4926c054d51b48ab4f4edf5df5b76d
Reviewed-on: https://chromium-review.googlesource.com/565291
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485272}
bratell
Jumbo for blink/core generated files as well (saving 8 CPU minutes)
The target that compiles generated files does not use the same
template as other code in blink core so it didn't automatically become
jumbo enabled. Since it's a non-negliable part of the build time (~1%)
this patch enables jumbo for this target as well.

R=fs@opera.com
BUG=713137

Review-Url: https://codereview.chromium.org/2973603003
Cr-Commit-Position: refs/heads/master@{#485267}
bratell
Add jumbo support for Blink/core generated files
Core generated files does not use the same template as most blink core
code so it needs to be explicitly turned on (note jumbo is still by
default disabled so normal builds are not yet affected).

This saves about 8 CPU minutes for me.

Bug: 713137
Change-Id: I73ad558021b245c8742672cd3903e27dfdf48ab5
Reviewed-on: https://chromium-review.googlesource.com/563682
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485232}
bratell
Deduplicate CopyBytes in modules/crypto
The two identical functions CopyBytes collided in a jumbo build so
this is primarily to avoid having to exclude one of the files from the
jumbo building.

BUG=

Review-Url: https://codereview.chromium.org/2972023002
Cr-Commit-Position: refs/heads/master@{#485231}
bratell
Mojo: Be more explicit with namespace 'testing'
There are two namespaces named testing used in Blink unit tests, one
from gtest and one internal helper namespace. If both are visible then
the gtest testing namespace won't be used unless prepended with ::, as
is already done in large parts of the code.

This is more important for jumbo builds where the visibility of code
expands.

BUG=739121

Change-Id: Iaed685c8750fbffbaac384aabc4e2a8f54bcf5c0
Reviewed-on: https://chromium-review.googlesource.com/563619
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: bratell at Opera <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#485226}
bratell
Some documentation for the jumbo feature.
R=dpranke@chromium.org
BUG=713317

Review-Url: https://codereview.chromium.org/2968963002
Cr-Commit-Position: refs/heads/master@{#485222}
fs
Adjust svg/animations/animate-linear-discrete-additive*.svg
In these tests we want to sample animation values at a certain point in
time. We are however sampling the animations at the next frame that is
painted - at which point the timeline may have advanced, and hence we
sample at t+<framedelay> (or thereabout) instead. Currently this works
"fine" because the first animation frame follows special scheduling
rules, making sure the timeline won't advance within this time window.
Rather than relying on this, just pause the timeline instead.

BUG=726362

Change-Id: I2314b435861050fd0163670928318563bd09f271
Reviewed-on: https://chromium-review.googlesource.com/563624
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485166}
bratell
Be explicit about namespace testing to not mix it with blink::testing
There are two namespaces named testing used in Blink unit tests, one
from gtest and one internal helper namespace. If both are visible then
the gtest testing namespace won't be used unless prepended with ::, as
is already done in large parts of the code.

BUG=739121
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2967013002
Cr-Commit-Position: refs/heads/master@{#484966}
bratell
Use unique variable names in gperf generated code
By default gperf generates code with the types and variables
stringpool_t and stringpool. If jumbo combines more than one gperf
generated file those collides.

This patch changes the variable names to something more unique.

R=fs@opera.com
BUG=713137

Review-Url: https://codereview.chromium.org/2972193002
Cr-Commit-Position: refs/heads/master@{#484961}
bratell
Avoid PermissionDescriptor name collision.
Fix to allow us to skip a permissions exclusion for jumbo. Locally rename
one of them to MojoPermissionDescriptor.

Review-Url: https://codereview.chromium.org/2965333002
Cr-Commit-Position: refs/heads/master@{#484953}
bratell
Drop a "using namespace WTF" in V8CSSStyleDeclarationCustom.cpp
global "using namespace WTF" causes compiler warnings in jumbo builds
and in general extend the global namespace a lot which increases the
risk of symbol conflicts.

This patch changes a "using namespace WTF" to an explicit
WTF::CopePointCompareLessThan.
Review-Url: https://codereview.chromium.org/2975603002
Cr-Commit-Position: refs/heads/master@{#484938}
bratell
Changing XPathGrammer.y to not use global using blink
When using "using namespace Foo" at global level you will
introduce a lot of symbols into the global scope which will make
it harder for jumbo (unity builds/merged files) to compile without
symbol collisions.

Also, global using namespace statements will, with the current
implementation of jumbo not compile because of a compiler warning.

This patch changes to more explicit namespaces.

BUG=

Review-Url: https://codereview.chromium.org/2974653002
Cr-Commit-Position: refs/heads/master@{#484928}
bratell
Make ElementFactory.cpp.tmpl generate unique names
ElementFactory is used for both SVG and HTML and some names it
exported were the same so in a jumbo build they would collide. By
making the name unique we don't have to exclude the generated files
from jumbo building.

R=fs@opera.com
BUG=

Review-Url: https://codereview.chromium.org/2965343002
Cr-Commit-Position: refs/heads/master@{#484911}
mostynb
remove the OS() macro
Replace OS(FOO) macro calls with defined(OS_FOO) and remove the OS macro.

This is mostly a mechanical change:

for p in MACOSX LINUX WIN ANDROID POSIX FREEBSD OPENBSD
do
	for file in `git grep -w "OS($p)" | sed -e "s/:.*//" | uniq`
	do
		sed -i -e "s/OS($p)/defined(OS_$p)/g" $file
	done
done

Followed by some semi-automatic build/build_config.h inclusion
and clang format.

BUG=737403

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I69e567334665c331b46e04be86a60aeca4a3e9c4
Reviewed-on: https://chromium-review.googlesource.com/561010
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#484853}
rune
Handle re-entrant AttachLayoutTree for the same node.
Lazy whitespace re-attachment introduced tracking of the last seen in-
flow box in AttachContext. We have three places where we may end up
calling AttachLayoutTree from AttachLayoutTree for the same element[1]
causing re-entrancy issues for AttachContext. The AttachContext would
keep a pointer to the LayoutObject created by the outer AttachLayoutTree
while that may have been deleted by the inner AttachLayoutTree.

Here we store the passed-in AttachContext on a SyncReattachContext stack
and pass it, with the previous in-flow restored, when re-entering
ReattachLayoutTree().

[1] This typically happens when we find out that a resource won't load
while attaching the layout object and we immediately decide to render
fallback content.

Bug: 738596
Change-Id: I978f77fbaa481a713b21ece92aabac39d37af450
Reviewed-on: https://chromium-review.googlesource.com/560836
Reviewed-by: meade_UTC10 <meade@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#484847}
ingemara
Add command line flag to override suppression.xml path
Let the suppression script optionally write to a configuration file set
on the command line, rather than the default.

//build_overrides/build.gni can set a 'lint_suppressions_file' variable,
allowing different products to override the lint suppression
configuration. Updating this overriding suppression configuration can
otherwise be cumbersome.

Bug: 737897
Change-Id: I1551d7e6951f212e42ee79ffac568e9a5208aec9
Reviewed-on: https://chromium-review.googlesource.com/561137
Reviewed-by: Peter Wen <wnwen@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Ingemar Ådahl <ingemara@opera.com>
Cr-Commit-Position: refs/heads/master@{#484621}
bratell
Use aggregated bindings for jumbo as well as for Windows.
If the builder requests a jumbo build, use aggregated bindings since
that is more or less the same thing.

BUG=713137

Review-Url: https://codereview.chromium.org/2971713002
Cr-Commit-Position: refs/heads/master@{#484298}
bratell
Use cssvalue::CounterValue instead of blink::CSSCounterValue
A cleanup patch used the wrong namespace for CSSCounterValue. It still
works but it was not right.

R=fs@opera.com

Review-Url: https://codereview.chromium.org/2967163003
Cr-Commit-Position: refs/heads/master@{#484276}
ingemara
Set Python shebang in build to /usr/bin/env python
A common solution for developers using Linux distributions were
/usr/bin/python is linked to /usr/bin/python3 is to put a python ->
python2 symlink earlier in the PATH when working with python2-only
projects. This doesn't work when shebangs bypasses any environment
configuration.

The change was generated by executing:
  sed -i 's|#!/usr/bin/python|#!/usr/bin/env python|' \
    $(grep -rl '#!/usr/bin/python' build)

Change-Id: I2de77532fd31a0348ec58f4d9af4b7172dc1b9ed
Reviewed-on: https://chromium-review.googlesource.com/559347
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Ingemar Ådahl <ingemara@opera.com>
Cr-Commit-Position: refs/heads/master@{#484266}
bratell
Support C and Objective-C in jumbo base scripts.
Up until now only C++ files were merged. With this Objective-C
will also be merged and if there are any C files (there are only
a few spread out) then those will also be handled.

BUG=713137

Review-Url: https://codereview.chromium.org/2972533002
Cr-Commit-Position: refs/heads/master@{#484230}
ingemara
Escape '$' when generating lint suppression regexp
Java class names (for inner classes) may contain '$', which is a EOL
pattern marker in Java regexps. To ensure proper regexps are generated,
escape the marker to allow the regexp to match the entire path.

Bug: 737882
Change-Id: I935d06c197453b674bb0e493d0887e271fdd9610
Reviewed-on: https://chromium-review.googlesource.com/554750
Commit-Queue: Ingemar Ådahl <ingemara@opera.com>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#484228}
bratell
Drop unused member loader_ in testing file SimRequest.h
This caused compilation errors (through a compiler warning) in
jumbo builds. I speculate that if the compiler (clang) sees both
an object creation and the full declaration it will complain about
members that are never accessed.

R=fs@opera.com

Review-Url: https://codereview.chromium.org/2969203002
Cr-Commit-Position: refs/heads/master@{#484224}
bratell
Be explicit about namespace testing to not mix it with blink::testing
There are two namespaces named testing used in Blink unit tests, one
from gtest and one internal helper namespace. If both are visible then
the gtest testing namespace won't be used unless prepended with ::, as
is already done in large parts of the code.

BUG=739121
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2970833002
Cr-Commit-Position: refs/heads/master@{#484087}
bratell
Scripts for unity/jumbo (default disabled) compilation.
To speed up compilation times, jumbo allows files to be compiled
together. This is a well known method ("unity builds") to both
compile faster and create a poor man's "full program optimization".
For Chromium we are only interested in the compile times.

This patch includes the basic scripts that do the source file merging
and changes Blink Core to use those scripts. If the gn configuration
includes: use_jumbo_build = true then Blink Core will use jumbo
compile. Otherwise it will compile as usual.

The expected speedup from using Jumbo on Blink Core (and nothing else)
is about 17% of the content_shell+blink_tests compilation CPU
time. This is about half an hour for people building with an ordinary
computer, but less both in percentage and minutes if using some kind
of build accelerator like goma.

More information in
https://docs.google.com/document/d/19jGsZxh7DX8jkAKbL1nYBa5rcByUL2EeidnYsoXfsYQ/edit#

BUG=713137

Review-Url: https://codereview.chromium.org/2963733003
Cr-Commit-Position: refs/heads/master@{#483986}
mostynb
(reland) base::LaunchUnitTestsSerially should not be overridable by cmdline
(reland) base::LaunchUnitTestsSerially should ignore the --test-launcher-jobs
command line switch, and never use parallel jobs.  To achieve this, change
callers of base::TestLauncher to pass the requested number of parallel test
jobs, instead of the default number of parallel test jobs.

And while we're at it, let's remove TestLauncherDelegate's
AdjustDefaultParallelJobs method, which no longer has any users.

BUG=735587,736837
TBR=rdevlin.cronin@chromium.org

Change-Id: I4085fb21c1dce467527210407e3913ff3b5e3bc6
Reviewed-on: https://chromium-review.googlesource.com/549342
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Reviewed-by: Alok Priyadarshi <alokp@chromium.org>
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483909}
mostynb
add a bunch of missing header guards
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I2175e7c672332c9046e8cc5d60f246a62f62478b
Reviewed-on: https://chromium-review.googlesource.com/558409
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#483907}
mostynb
remove a couple of vim modelines
We don't appear to use vim modelines in the codebase, and moreover
these conflict with our style guide.

Change-Id: Iac4a1c5dc7ac1b4b51b8862c2d943ffe0d038a7b
Reviewed-on: https://chromium-review.googlesource.com/558407
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#483875}
wdzierzanowski
Turn MediaLog usage from plain wrong into questionable
ReadConcatentatedBoxes() was handing out BoxReader instances that
referred to MediaLog objects that had gone out of scope.

BUG=712310

Review-Url: https://codereview.chromium.org/2966493005
Cr-Commit-Position: refs/heads/master@{#483840}
rune
Implement lazy (re-)attachment of whitespace.
The existing implementation of re-attachment of whitespace nodes had
performance issues because it tried to re-attach whitepace nodes as
early as possible, leading to multiple re-attachments of the same node
and multiple sibling-walks past the same out-of-flow elements.

Instead, this CL stores the last seen text node in a new
WhitespaceAttacher object and delays the re-attachment of that text
node until we know its need for a LayoutObject for the current layout
tree rebuild. In particular, we don't re-attach the whitespace node
when previous siblings are/become display:none or out-of-flow.

Contrary to what last_text_node did, the WhitespaceAttacher persist
the last seen text node in the flat tree order and across
display:contents and slot/content element which fixes various
correctness issues in addition to performance issues.

In addition to the last visited text node, we also store the last
seen display:contents element and only walk the display:contents
subtree when needed to find its first in-flow whitespace descendant.

BUG=349395,399816,705525,686016,648931,650168

Change-Id: Id397986c49a4bc75e831da1ff8b679f2043873c3
Reviewed-on: https://chromium-review.googlesource.com/517940
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483683}
hugoh
Allow outdirs when !enable_extensions and !enable_print_preview
This lets us generate outdirs for builds where enable_extensions
and enable_print_preview are false. This is a configuration that
is used by Opera's TV SDK.

This can be seen as a fixup to https://codereview.chromium.org/2904443004/ .

BUG=725906

TEST=gn gen --args='enable_extensions=false enable_print_preview=false' out/GnTest

Review-Url: https://codereview.chromium.org/2958243002
Cr-Commit-Position: refs/heads/master@{#483654}
mstensho
Include less from LayoutTheme.h
Change-Id: I034264c0fceec2155ef823717092d2cd36a2887b
Reviewed-on: https://chromium-review.googlesource.com/553140
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483338}
mstensho
Don't include ComputedStyle.h where not needed.
Also removed unnecessary inclusions of core/dom/NodeComputedStyle.h

Because of this change, 13 more compilation units no longer include ComputedStyle.h

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I2a647d891c7e0957e7ee0f96ebc6e2face6e0c14
Reviewed-on: https://chromium-review.googlesource.com/553259
Reviewed-by: Rune Lillesveen <rune@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#483324}
mostynb
Roll src/third_party/ffmpeg/ 06ac9ea36..88c555e9e (2 commits)
https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/06ac9ea361fa..88c555e9e69e

$ git log 06ac9ea36..88c555e9e --date=short --no-merges --format='%ad %ae %s'
2017-06-28 mostynb add ffmpeg_use_atomics_fallback gn arg
2017-06-06 jrummell Remove unused configs for linux-noasm/arm64

Created with:
  roll-dep src/third_party/ffmpeg

Change-Id: I33825f010c5a13026540e5c1454977961e9ec1b0
Reviewed-on: https://chromium-review.googlesource.com/553379
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#483211}
mstensho
Include less from ComputedStyle.h (and ComputedStyleBase.h and SVGComputedStyle.h).
Change-Id: I42edad3643a1a9c76bb5281d5771045678304533
Reviewed-on: https://chromium-review.googlesource.com/553258
Reviewed-by: Rune Lillesveen <rune@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#483315}
mstensho
Don't include StyleResolverState.h where not needed.
It involves ComputedStyle.h, which is heavy.

Change-Id: I345d1c0fd69dfb68c0e96b5af0f932e1d67405f1
Reviewed-on: https://chromium-review.googlesource.com/553260
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Rune Lillesveen <rune@opera.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#483310}
mstensho
Include less from Length.h
Moved parts of Length::Blend() into the .cpp files, since it requires a heavy
include.

Change-Id: I527d8cfb119e7475f00d2664ae4788e80cf4b479
Reviewed-on: https://chromium-review.googlesource.com/553299
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#483301}
rune
Separate initial style and viewport/ICB style.
We store the initial containing block/viewport style on the Document
node. This style includes properties propagated from body/html like
writing-mode and overflow. It also sets things like z-index to a non-
auto value to establish a stacking context.

The problem was that this ComputedStyle was used for inheriting values
down to the root element as well, which is incorrect. The root element
should inherit initial values.

Instead, split StyleForDocument into InitialStyleForElement and a
StyleForViewport which applies viewport specific properties on top of
the initial values. Then use InitialStyleForElement as the style to
inherit from for the root element.

A bunch of writing-mode tests are modified to apply writing-mode on the
html element instead of body. The code change aligns with the spec and
how Gecko behaves by not propagating the writing-mode on body to the
html element. The intention of the modified tests was to have the effect
of setting the same writing-mode on the html element.

Bug: 732349,541529,590818,590835,731022
Change-Id: I4ff9c076c54483245db931ede6a2293ef5279cd2
Reviewed-on: https://chromium-review.googlesource.com/548379
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: meade_UTC10 <meade@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#482950}
sigbjornf
Simplify OfflineAudioDestinationNode::DoOfflineRendering().
No need to track is-suspended state.

R=hongchan
BUG=736429

Review-Url: https://codereview.chromium.org/2959693002
Cr-Commit-Position: refs/heads/master@{#482417}
sigbjornf
Retire audiosource-premature-gc.html test expectation.
Not needed following r482301.

TBR=xidachen@chromium.org
NOTRY=true
BUG=736429

Review-Url: https://codereview.chromium.org/2960733002
Cr-Commit-Position: refs/heads/master@{#482395}
sigbjornf
Repost offline rendering task if GC prevents.
R=
BUG=736429

Review-Url: https://codereview.chromium.org/2959663002
Cr-Commit-Position: refs/heads/master@{#482301}
karlo
Move rounding up to 1.0f of border widths to the painting stage.
BUG=727669

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Id6226e1df033e8ee72ffa32cde4c0d12fc3cbf36
Reviewed-on: https://chromium-review.googlesource.com/525536
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482233}
mostynb
base::LaunchUnitTestsSerially should not be overridable
base::LaunchUnitTestsSerially should ignore the --test-launcher-jobs
command line switch, and never use parallel jobs.

BUG=735587

Change-Id: I7e455a805b898f12e7adc91a41feb9627e008964
Reviewed-on: https://chromium-review.googlesource.com/543344
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481990}
rune
Store previous in-flow layout object in AttachContext.
This is split out of [1]. In order to avoid backtracking past out-of-
flow, display:none, and display:contents nodes of attached siblings
for whitespace re-attachment, we keep track of the last attached in-
flow box for an AttachLayoutTree().

The AttachContent is made non-const to pass on previous in-flow past
slot, content, and display:contents ancestors.

This CL does not have behavioral changes on its own.

[1] https://chromium-review.googlesource.com/c/517940/

BUG=399816

Change-Id: I7bf5faaf3e9fe3d1b4f62c22076be6ad31790cfe
Reviewed-on: https://chromium-review.googlesource.com/543037
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#481853}
sigbjornf
Hold global GC heap lock while making audio thread access.
For auxillary threads that rarely need to gain access to another
thread's GC heap, we have to ensure that this happens while the
heap-owning thread isn't concurrently GCing the heap. Otherwise there
is the possibility that heap objects might be relocated or mutated
while the auxillary thread tries to access.

A CrossThreadPersistent<T> (CTP) ensures reference liveness across
threads, but isn't sufficient to handle the wanted exclusive access
after a non-attached thread has deref'ed the persistent. So, for
this to happen, keep the global CTP lock while accessing a heap
object during offline audio rendering -- it specifically accessing
heap objects while a GC runs. As all GCs hold the lock on the global
CTP region while they run, this ensures exclusion.

It is clearly desirable to have all heap access be under the control
of the heap-owning thread, and threaded code should try hard to avoid
accessing another thread's heap objects. The CTP global lock is the
mechanism to use when that isn't practically feasible -- feel free to
add a "TODO(foo): avoid using" next to any instances that you end up
introducing.

As regards audio thread cross-thread usage, the code needs auditing to
check if there are other places where setting up this CTP lock is
required.

R=haraken,rtoy,hongchan
BUG=732511

Review-Url: https://codereview.chromium.org/2951903003
Cr-Commit-Position: refs/heads/master@{#481809}
rune
Update style for body when viewport defining element changes.
Whether the body box has scrolling overflow or not depends on the
computed overflow of the html element.

The HasOverflowClip flag, along with creating and removing a paint
layer on LayoutBlock is updated as part of SetStyle. However, if the
html element is recalculated, its overflow changing causing the
viewport defining element to change, but body did not need a recalc,
the overflow clip flag and paint layer is not updated for body.

This CL forces a SetStyle on the body LayoutObject to trigger the
necessary update after recalc when when the viewport defining element
changes.

This fixes scrollingElement.html in wpt/cssom-view.

Bug: 665927
Change-Id: I146c3e976edef28074bde6531fe4c6ec65ecb090
Reviewed-on: https://chromium-review.googlesource.com/544958
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481682}
mstensho
Don't include ComputedStyle.h from Node.h
This caused it to be included in about 3400 compilation units. Removing this
dependency reduces the number to about 1000.

Compiling ComputedStyle.h takes almost 6 seconds here (which is worth an
investigation on its own).

Some changes elsewhere were required because of this, because they
inadvertently depended on things included via ComputedStyle.h . Keeping
Blob & co merely forward-declared in IDBValueWrapping.h required some
extra work.

The dependency was introduced here:

https: //codereview.chromium.org/2821193003
Change-Id: I5323c12821ae7e5408f6f5f1fee17222a0acf511
Reviewed-on: https://chromium-review.googlesource.com/543155
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Rune Lillesveen <rune@opera.com>
Reviewed-by: nainar <nainar@chromium.org>
Reviewed-by: Joshua Bell <jsbell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481675}
rune
No need to update layout for scrollingElement in compositing.
The style and layout is guaranteed to be clean at this point.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I28d877f2cafa9fe49e5ce922cf9b95d2e3fa8b2c
Reviewed-on: https://chromium-review.googlesource.com/540795
Reviewed-by: Chris harrelson <chrishtr@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#481440}
mstensho
Element::ClientQuads() needs to take transforms into account.
In LayoutGeometryMap, when there's a non-uniform step (e.g. when inside
multicol), we fall back on doing it the slow way, i.e. we involve
LayoutObject::MapLocalToAncestor(). The mode flags initially passed from
ClientQuads() will just be echoed here, so we need to make sure that
kUseTransforms is specified.

BUG=683925

Change-Id: I2a6fe83fb1332a19a581203d6c44c6924da3f027
Reviewed-on: https://chromium-review.googlesource.com/541339
Reviewed-by: Chris harrelson <chrishtr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#481039}
mstensho
[LayoutNG] Place floats correctly in non-physical writing modes.
Use logical offsets as much as we can, and have legacy layout convert
it for us when storing physical offsets in FloatingObject. Use
SetLogicalLeftForFloat() and SetLogicalTopForFloat() in
LayoutBlockFlow for this. They actually take inline and block offsets.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iffd4aa759cb520f03a7642f15c1e40279e48c2b9
Reviewed-on: https://chromium-review.googlesource.com/541363
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#480995}
mstensho
Update FlagExpectations for enable-slimming-paint-v2
Based on results from https://chromium-review.googlesource.com/c/539399/3

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I461903e9bc16ea85abf8f7cb80c7a6b468a37c51
Reviewed-on: https://chromium-review.googlesource.com/541298
Reviewed-by: Chris harrelson <chrishtr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#480830}
rune
Update HasOverflowClip for body after style recalc.
The HasOverflowClip flag on LayoutBlock is updated as part of SetStyle,
but for body, the flag may need to change as a result of changing the
overflow property on the root element.

This CL always updates the flag for body after a style recalc. It's
only strictly necessary to do this if the root element is recalculated
and changes overflow between visible and a non-visible overflow, and at
the same time, the body element does not need a style recalc. Those
checks would complicate the code with little gain, so left to be done
unconditionally.

This fixes scrollingElement.html and HTMLBody-ScrollArea_quirksmode.html
in wpt/cssom-view. The latter had a bug that it didn't clear the
"scroll" values set to check if overflowY could be set, which caused a
subsequent test to incorrectly fail in both Blink and Gecko.

BUG=665927

Change-Id: I72ea8c51f2ec52320aaacd7373bc1a6e8a80dbed
Reviewed-on: https://chromium-review.googlesource.com/540596
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: Rick Byers <rbyers@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#480824}
rune
Null check PrimaryFont().
No known way to reproduce, but this null check fixes a crasher reported
to the Opera crash servers for the desktop version of Opera. There was
already a null check for PrimaryFont() on the first line style in the
same method. This fix has been shipped and confirmed to fix the issue
for Opera.

Only seeing crashes for Windows on our crash server, so it might be a
Windows-only issue.

R=drott@chromium.org,eae@chromium.org

Change-Id: Ifca144023a319e4b900da12c62900819ba09f777
Reviewed-on: https://chromium-review.googlesource.com/538758
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#480406}
mstensho
If min/max widths are already dirty during layout, don't recalculate.
Min/max widths are recalculated right before layout if they are dirty, but only
on those objects that actually need it, even if they are marked dirty. If the
object doesn't need min/max widths to figure out its own size, and no ancestor
needs this information either, the flag should just be left on indefinitely.
It's a waste of time to recalalculate the min/max widths for such objects, and
just leaving them dirty instead will also help the marking machinery cut off
earlier, since it will walk the containing block chain until it finds something
that's already marked.

If we get to layout and the flag is still set, it has to mean that nobody cares
about the min/max widths. This is a speculative fix for bug 732703, that
restores to the behavior we had prior to
https://chromium-review.googlesource.com/c/527640/ .

BUG=732703

Change-Id: I146dd8e2d41712aece91fdb199a2254f1a24e43f
Reviewed-on: https://chromium-review.googlesource.com/538658
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#480774}
mstensho
Need to dirty min/max widths on certain children, regardless of entry-point.
It doesn't matter whether it's during layout or not that we decide to
recalculate the min/max widths. If the min/max widths of a child is known to be
affected by changes in the containing block, we need to recalculate them
regardless of that.

This got broken by https://chromium-review.googlesource.com/527640 . It used to
work prior to that change, because then, dirty bits on the child of the
shrink-to-fit container were accidentally left behind from a previous layout
pass, so that min/max widths got properly recalculated the next time its parent
got marked dirty.

BUG=728548

Change-Id: I011e2101d3913ac44284a6d18c16260a42ee7eee
Reviewed-on: https://chromium-review.googlesource.com/538694
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#480591}
mostynb
add missing import for enable_extensions
BUG=733663,725906
TBR=brettw

Change-Id: I2c4b30ac5c93372952f7f3901929afc57bef6572
Reviewed-on: https://chromium-review.googlesource.com/537372
Reviewed-by: Mostyn Bramley-Moore <mostynb@opera.com>
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#479784}
hugoh
Allow generation of a chromium outdirs when enable_extensions=false
This allows us at Opera to patch chromium a little less before
building a downstream product that doesn't depend on extensions.

At the moment, the 'chrome' target does not compile when
enable_extensions=false - and this is fine since Chrome indeed
needs extensions. But other browser products that use
enable_extensions=false can now generate an outdir without
getting complaints from GN.

BUG=725906

TEST=gn gen out/GnTest
TEST=gn gen --args='enable_extensions=false' out/GnTest
TEST=gn gen --args='is_component_build=true' out/GnTest
TEST=gn gen --args='is_component_build=true enable_extensions=false' out/GnTest
TEST=gn gen --args='target_os="android"' out/GnTest
TEST=gn gen --args='target_os="android" enable_extensions=false' out/GnTest
TEST=gn gen --args='target_os="chromeos"' out/GnTest
TEST=gn gen --args='target_os="chromeos" is_component_build=true' out/GnTest

Review-Url: https://codereview.chromium.org/2904443004
Cr-Commit-Position: refs/heads/master@{#479646}
ingemara
Remove WebContentsDelegateAndroid::OnGoToEntryOffset
It was added by Opera in https://codereview.chromium.org/684133007, but
has since stopped being used downstream. There are no references to the
method in any upstream code.

BUG=

Review-Url: https://codereview.chromium.org/2942553002
Cr-Commit-Position: refs/heads/master@{#479637}
mstensho
Update LEGEND implementation to better match the spec.
Only rendered legends [1] should establish a new block formatting context and
shrink to fit.

[1] https://html.spec.whatwg.org/multipage/rendering.html#rendered-legend

BUG=727378

Change-Id: I0aeddbd6d4b345bbe626be8ac2efd1fea501372e
Reviewed-on: https://chromium-review.googlesource.com/535595
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#480791}
mstensho
Check if we are going to create a new column row, instead of just assuming it.
Before attempting to guess what the height of the next column row is going to
be, make sure that we're actually going to create one. If we're not going to
create one, the height of the already existing row is what we should use.

This fixes a recently introduced DCHECK failure. It also makes us handle
overflowing columns in a nested fragmentation context properly. That has
probably never worked before, though.

Also shortened the name of a parameter, to prevent the code formatter from
creating soup.

Change-Id: I45ccc272312a0757630c0d97d1d023168756d51c
Reviewed-on: https://chromium-review.googlesource.com/535556
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479428}
hugoh
Add missing #include <cerrno> in socket_options.cc
One of our toolchains does not expose |errno| in the global namespace.

BUG=none

Review-Url: https://codereview.chromium.org/2930873002
Cr-Commit-Position: refs/heads/master@{#479366}
mstensho
Relax a DCHECK: Column indices out of bounds are fine here.
Just let MultiColumnFragmentainerGroup::LogicalHeightInFlowThreadAt() return
0 if the column index is past the end. The last column *within* bounds will
get its height clamped against the bottom of the flow thread, like before.

BUG=732030

Change-Id: Icd0c8d77f73a02b69a27f24ca70b7b0a023c28dd
Reviewed-on: https://chromium-review.googlesource.com/533016
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#479436}
mstensho
Made focus hightlight region calculation (outline-style:auto) multicol-aware.
Went for a very simplistic solution, at least for now. Just use the bounding
box of everything inside the multicol container.

BUG=714675

Change-Id: Ie5ca0f747edc4ac3b384ecb784443592edee7379
Reviewed-on: https://chromium-review.googlesource.com/534473
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#479406}
mstensho
Let NextLogicalTopForUnbreakableContent() rely on PageLogicalHeightForOffset().
Due to poorly duplicated code (not consistently clamping against computed
height/max-height), the machinery was confused as to how tall a next
fragmentainer group (column group) would be, and would trick the line layout
code into incorrectly believing that there'd be enough space for a tall line,
if we just pushed it all the way past the current fragmentainer group. This
caused a DCHECK failure:

DCHECK_GT(page_logical_height, LayoutUnit()) in

LayoutBox: :PageLogicalHeightForOffset().
Change-Id: I1e34fe3e84d798f3679404589414d90a758a72ea
Reviewed-on: https://chromium-review.googlesource.com/532959
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#479305}
wdzierzanowski
Stop assuming metadata contains at least one stream
It is valid for a media::Demuxer implementation to provide 0 streams in
GetAllStreams().  In this case, the metadata built by PipelineImpl is
empty too.  This should be handled, just like PipelineImpl already
handles absence of streams with PIPELINE_ERROR_COULD_NOT_RENDER.

TEST=media_blink_unittests

Review-Url: https://codereview.chromium.org/2930333004
Cr-Commit-Position: refs/heads/master@{#479066}
ckulakowski
Add ifdef guard to WorkletModuleTreeClient.h
We use "jumbo" compilation of blink in our project. The main idea is
to compile some number of cc files as one compilation unit. It
significantly speeds up compilation time of blink. With "jumbo"
enabled there is compilation error due to lack of ifdef
guard in file WorkletModuleTreeClient.h.

BUG=732727

Review-Url: https://codereview.chromium.org/2935823003
Cr-Commit-Position: refs/heads/master@{#478967}
sigbjornf
Avoid AudioBufferSourceHandler data race.
Following r478084, the main thread may contend with the audio thread
on accessing AudioBufferSourceNodeHandler's mutable state. Coordinate
such access by introducing a Mutex over |min_playback_rate_|.

Using atomic ops would be the natural choice for handling this, but
steering clear of those over doubles (cf. https://crrev.com/1256053006)
until std::atomic<> is allowed.

R=haraken,hongchan
BUG=731568

Review-Url: https://codereview.chromium.org/2929283002
Cr-Commit-Position: refs/heads/master@{#478679}
mstensho
Better handling of min/max widths that depend on the containing block.
This is about how we behave when NeedsPreferredWidthsRecalculation()
is true. This is a rather rare situation, and also an unfortunate one,
since min/max width calculation should be strictly bottom-up.

If we mark min/max widths of an object as dirty, we need to guarantee
that they're actually going to be recalculated. Otherwise, if the
object is left around with dirty min/max widths, it will block
subsequent min/max dirtying of any descendant. We also need to make
sure that if we mark min/max widths as dirty due to
NeedsPreferredWidthsRecalculation(), we also need to mark the min/max
widths of every child with the same issue as dirty, recursively, since
any layout change may have affected the min/max widths there too.

Documented NeedsPreferredWidthsRecalculation(). Added one test that
has been failing for ages, and one that started to fail because of the
bug referenced. Both pass now.

BUG=728548

Change-Id: I8b9325ba20a6da2329d28d21a6eca6bc1aa36c06
Reviewed-on: https://chromium-review.googlesource.com/527640
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#478616}
mstensho
Update HR implementation to match the spec.
Don't hardcode HR as establishing a new formatting context.
Set overflow:hidden in the UA stylesheet instead. [1]
Also specify unicode-bidi:isolate [2]

Some heavy test expectation rebaselining is necessary, since making
HR overflow:hidden entails that it will now establish a PaintLayer.

[1] https://html.spec.whatwg.org/multipage/rendering.html#the-hr-element-2
[2] https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering

BUG=728499

Change-Id: I1734242d240cb236269b218283bcb16b4ca7c0e4
Reviewed-on: https://chromium-review.googlesource.com/521044
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478611}
sigbjornf
Avoid unsafe heap access from audio thread.
The audio thread tries to touch main thread Blink GCed objects in a
select few places, which isn't safe as a GC might concurrently run.

Avoid such cross off-thread usage, rearrange the processing of
finished nodes from the audio thread to the main thread.

R=hongchan,rtoy,haraken
BUG=727091,729275

Review-Url: https://codereview.chromium.org/2913303002
Cr-Commit-Position: refs/heads/master@{#478084}
wdzierzanowski
Declare kAppendWholeFile as constexpr
kAppendWholeFile was dynamically initialized, causing it to be 0 at the
time of the initialization of the kMediaSourceADTSTests array when
built with VC 2015.  This resulted in an assertion failure in
MockMediaSource constructor.

std::numeric_limits::max() is constexpr in C++11, so fix that by
declaring kAppendWholeFile as constexpr too.

While we're here, let's change DCHECKs in mock_media_source.cc to
CHECKS, because there is no reason to prefer DCHECK over CHECK in
test-only code.

TEST=media_unittests --gtest_filter=ProprietaryCodecs/BasicMSEPlaybackTest.PlayToEnd/*

Review-Url: https://codereview.chromium.org/2920243002
Cr-Commit-Position: refs/heads/master@{#477755}
karlo
Floor widths in LayoutTable::BorderBefore() and BorderAfter().
LayoutTable::BorderBefore() and LayoutTable::BorderAfter() incorrectly
did not floor widths.  Borders in tables are not yet sub pixel, so all
border widths should be integers.

BUG=727928

Change-Id: I7ca1a93b4a749c112100634a984ebe825c1570a8
Reviewed-on: https://chromium-review.googlesource.com/520385
Reviewed-by: David Grogan <dgrogan@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Karl Anders Øygard <karlo@opera.com>
Cr-Commit-Position: refs/heads/master@{#480402}
fs
Tidy up SVGListPropertyHelper
Turn some iterations into range-based for-loops. Use operator== from
Vector<...> rather than re-implementing it. Remove FindItem (unused.)
Deduplicate some code, replace 0 with nullptr where appropriate and
simplify the padding loop.

BUG=709001

Review-Url: https://codereview.chromium.org/2920103002
Cr-Commit-Position: refs/heads/master@{#476914}
mstensho
De-virtualize HasRelativeLogical{Height,Width} in LayoutBox.
It's not overridden anywhere.

Change-Id: I5eb4be5ee121c726c5219854ed9e9408b3ac62e5
Reviewed-on: https://chromium-review.googlesource.com/522062
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#476777}
mstensho
No longer let 0 mean that fragmentainer height is unknown.
For multicol, PageLogicalHeightForOffset() would normally figure out what to
return by consulting the flow thread, which would find the appropriate column
set, which in turn would find the appropriate fragmentainer group and return
its height.

We used to treat a 0 value as "unknown" most of the time (but there were also
cases where we'd accept it as a column height). We now always have to call
IsPageLogicalHeightKnown() first to tell whether it's known or not. This is
reasonable, since the calling code always has to act upon the situation of not
knowing the height (typically skip some steps, since fragmentation is
impossible until height is known).

It is now forbidden to call PageLogicalHeightForOffset() if height is unknown
(there are DCHECKs). The height is unknown in many cases in the first multicol
balancing pass. The height will be known once we have made a column height
estimate. It doesn't have to be the final and correct height. This CL doesn't
change anything in that regard, but now we are required to be sure that we
have some clue at all before dealing with fragmentainer heights.

MultiColumnFragmentainerGroup now has a flag that tells whether the logical
height is known or not. We need the flag, because the logical height may
actually end up as 0, e.g. when a multicol container just has zero-height
content, or when the multicol container itself has a specified height of 0.
This unclamped height will be used as block progression for the column row,
which will contribute to the final height of the multicol container. The
actual column height will be clamped to not be less than 1px. This is in
accordance with the spec [1]. We previously used to treat truly zero-height
fragmentainer groups as having an unknown height in some parts of the code,
while in other parts of the code we'd just accept it and end up dividing by
it (to convert a flow thread offset to a column index, for instance).

This is a clean-up CL that happens to fix bugs.

[1] https://drafts.csswg.org/css-break/#breaking-rules

BUG=722041,722754

Change-Id: I63550d804bef073a5c24570d63bd55176ec5e396
Reviewed-on: https://chromium-review.googlesource.com/514049
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476270}
fs
Remove svg/animations/animate-local-url.html from TestExpectations
No flakes observed after https://codereview.chromium.org/2907193002.

TBR=schenney@chromium.org
BUG=727257

Review-Url: https://codereview.chromium.org/2917623002
Cr-Commit-Position: refs/heads/master@{#475869}
mstensho
Always relayout children of LayoutView when printing.
We can normally trust UpdateLogicalWidth() to detect and report size changes,
but this is not the case when printing, because
FrameView::ForceLayoutForPagination() changes the logical width of the
LayoutView behind our back.

BUG=702778

Review-Url: https://codereview.chromium.org/2908503003
Cr-Commit-Position: refs/heads/master@{#475862}
rune
Do not prepend implicit type selectors to :host rules.
:host and :host-context() should not have implicit type selectors pre-
pended for universal rules with default @namespace. Default @namespace
applies to type and universal selectors inside :host() and
:host-context(), but a default @namespace rule should not affect :host.
That is, :host matches the host element regardless of any @namespace
rules.

R=hayato@chromium.org,kochi@chromium.org
BUG=727603

Change-Id: I78d2919275aa6bdc4fdc5b02a4772d2352819258
Reviewed-on: https://chromium-review.googlesource.com/518019
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#475834}
rune
Put unqualified pseudos into the more specific rulesets.
We were incorrectly putting unqualified pseudo classes for :focus,
:visited, :-webkit-any-link and :link into the universal RuleSet which
meant we would match them for every element defeating the optimization
of having the separate rulesets.

This patch starts tracking the pseudos inside the extraction step to
make sure we put them into the right ruleset. It also adds some asserts
that the default UA sheet never adds any universal rules.

This removes one rule (:focus) from the set of rules for every element.

Bug: 721514
Change-Id: I4208e1c8c938aa0af7a736594f3c0059b6b28fcc
Reviewed-on: https://chromium-review.googlesource.com/517789
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Naina Raisinghani <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#475642}
fs
Clean up creation of "detached" SVG* data type objects
Add CreateDetached helpers for the various objects (or, their tear-offs)
that can be created without having a context element. This is in
preparation for replacing some of these with their DOM* counterparts
from the Geometry specifications [1]. The "detached" term is borrowed from
the SVG2 specification [2].
Also drop all of the default arguments that pass QualifiedName::Null(),
and instead explicitly pass them where needed (for detached objects.)

[1] https://drafts.fxtf.org/geometry/
[2] https://svgwg.org/svg2-draft/struct.html#__svg__SVGSVGElement__createSVGNumber

BUG=709001

Review-Url: https://codereview.chromium.org/2912663002
Cr-Commit-Position: refs/heads/master@{#475583}
mstensho
Less duplicated code between AvoidsFloats() and CreatesNewFormattingContext().
In general there shouldn't really be any need for both. We could just remove
AvoidsFloats() and keep CreatesNewFormattingContext(). But then again, it might
be considered weird to say that replaced content creates a block formatting
context. So let's keep the both of them for now.

However, the following rule should always apply: If the object creates a new
formatting context, it implies that it also avoids floats. That's the reason for
declaring LayoutBlockFlow::AvoidsFloats() as final.

Furthermore, the only kind of LayoutBlock-type objects that DOESN'T create a
new formatting context, are certain LayoutBlockFlow (block container) objects.
So move the checks over from LayoutBlock to LayoutBlockFlow. Keep a virtual
true-returning CreatesNewFormattingContext() in LayoutBlock. We could actually
consider removing this, but there are 2-3 call sites that currently need it.

This CL causes a couple of minor rendering differences: Previously, HR elements
were told to avoid floats, but not to establish block formatting contexts.
Let's be consistent and return true for both. This makes us more compatible
with Edge. Test included. Turning HR elements into true block formatting
contexts also affects margin collapsing. Its top and bottom margins no longer
collapse. Had to make a change to the default style sheet for HR inside
SELECT because of this. Inside SELECT, HR loses its borders, so that its top
and bottom margins would previously collapse, but not anymore, now that it
establishes a block formatting context. To cancel out any rendering difference,
reduce margins in this particular case.

Similarly for RT (ruby text). LayoutRubyText objects are repositioned after
layout, which essentially requires them to contain all child floats, i.e.
establish a new block formatting context. Previously they achieved a
quasi-formatting context by returning true from AvoidFloats(). The screenshot
test fast/ruby/float-overhang-from-ruby-text.html would fail spectacularly if
they exposed child floats to their sibling ruby base. That test expectation
still requires a tiny update to its layout tree dump, though.

This CL also makes CreatesNewFormattingContext() return true for tables,
flexboxes, grids, and anything blocky that isn't LayoutBlockFlow. This
shouldn't be a web-exposable change, though, since no non-LayoutBlockFlow types
can contain float children (e.g. a float inside a table would have to be
wrapped inside either a table-cell or a table-caption (which both establish a
new block formatting context), and a float inside a flexbox would have to be
wrapped inside a flex item (which establishes a new block formatting context)).

BUG=460704

Change-Id: If60c1fc636db73a7ff241471ea7bf95adf996512
Reviewed-on: https://chromium-review.googlesource.com/512824
Reviewed-by: Robert Hogan <robhogan@gmail.com>
Commit-Queue: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#475749}
rune
Fixed flaky test snav-z-index.html.
requestAnimationFrame before initTest().

Without this change, repeat-each=10 caused failures most of the time.
With this change repeat-each=100 has been run locally a few times
without any failures (Linux x64).

Also converted some setTimeout => requestAnimationFrame for better
predictability.

R=kochi@chromium.org
BUG=724567

Change-Id: Ic1f27c3fda1ff7da063ab29286d707cb518ab7a6
Reviewed-on: https://chromium-review.googlesource.com/518163
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#475429}
fs
Attempt to fix flakiness in svg/animations/animate-local-url.html
SMIL animations start after the 'load' event has been dispatched, so
make sure to schedule the relevant timer after the 'load' event handler
has run.

TBR=schenney@chromium.org
BUG=727257

Review-Url: https://codereview.chromium.org/2907193002
Cr-Commit-Position: refs/heads/master@{#475364}
fs
Remove unused methods in SVGListPropertyHelper and SVGPropertyTearOff*
SVGPropertyTearOffBase: :GetType, and corresponding concretization in
Review-Url: https://codereview.chromium.org/2913513002
Cr-Commit-Position: refs/heads/master@{#475310}
rune
Use LowerASCII instead of DeprecatedLower in css/
Incorrectly folded upper-case non-ascii characters into ascii for type,
attribute, id, and class selectors causing non-matching selectors to
match.

Also fixed for media types and features.

BUG=726176

Change-Id: I5a6f813b2722ee4efcff2ab933f5ad075faadcbb
Reviewed-on: https://chromium-review.googlesource.com/517105
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Morten Stenshorne <mstensho@opera.com>
Cr-Commit-Position: refs/heads/master@{#475021}
rune
Drop author ::-internal-* pseudo at parse time.
The SelectorChecker already always failed, but the selector should be
invalid and the whole rule dropped. There is a single pseudo
::-internal-media-controls-overlay-cast-button which is still web-
facing. That is tracked by issue 678285.

Moved the update pseudo page in @page into a separate method.

BUG=725480,678285

Change-Id: Ifca8a0e593c4d11720b0b0822e4c753ff45fb52b
Reviewed-on: https://chromium-review.googlesource.com/512827
Commit-Queue: Rune Lillesveen <rune@opera.com>
Reviewed-by: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#474987}
sigbjornf
Enable heap compaction on all 'container' arenas.
Reconcile indexing for compactable arenas to always be wrt
the arena index -- it was miscued on setting, using an
offset instead, thereby preventing vector[1-4] arenas from
being considered for compaction.

R=haraken
BUG=726335

Review-Url: https://codereview.chromium.org/2908463002
Cr-Commit-Position: refs/heads/master@{#474966}
fs
Stricter equality check for local refs in CSSURIValue
'local' references ("#foo") needn't even consider the absolute URL(s)
when being compared. In this particular case, the (redundant) comparison
ended up comparing equal because a base-URL-less parser context is used
when parsing the property (will be fixed separately.)
When |is_local_| is set, only consider the relative URLs during the
comparison.

BUG=725469

Review-Url: https://codereview.chromium.org/2905033003
Cr-Commit-Position: refs/heads/master@{#474717}
sigbjornf
blink_gc_plugin: disallow WeakMember<> fields in off-heap objects.
Add missing check for WeakMember<> fields in non-managed classes;
not permitted just like Member<>.

R=dcheng,haraken
BUG=724418

Review-Url: https://codereview.chromium.org/2902563002
Cr-Commit-Position: refs/heads/master@{#474368}
mstensho
When moving past a left-hand scrollbar, don't jump way outside the content box.
We handle rendering, scrolling and scrollbars quite poorly if a scrollbar is
actually wider than its containing block. See crbug.com/724255 for more info on
this corner-case.

We end up with negative values in parts of the code where they are not
expected. This CL is just a simple regression fix to at least make sure that
scrollWidth doesn't get messed up by left-hand scrollbars.

AngularJS depends on this.

BUG=720227

Review-Url: https://codereview.chromium.org/2893833004
Cr-Commit-Position: refs/heads/master@{#474226}
rune
Don't trigger full active style update on styleSheets access.
Element.styleSheets and ShadowRoot.styleSheets need to be made up-to-
date on access. We used to do a full active style update, but re-
collecting the stylesheet list should be enough, leaving the active
style dirty flags intact.

We introduce a dirty-flag for the stylesheet list in
StyleSheetCollection to avoid repeatedly re-collecting this list while
the active style is still dirty.

This coincidentally fixes issue 722826 since we do not collect
stylesheets in import shadow trees as part of the active style update,
but is now made up-to-date on request when accessing the styleSheets
collection on shadow roots inside import documents.

This fixes the performance issue 717506.

R=meade@chromium.org
BUG=717506,722826

Review-Url: https://codereview.chromium.org/2884993002
Cr-Commit-Position: refs/heads/master@{#473846}
hugoh
Correct logic "Should ContextMenu target the selection?"
If the selection doesn't have focus, it shouldn't be the target
of the context menu.

For example, an _unfocused_ range selection should not be the
context menu's target (the focused element should be the target).

BUG=725005, 725022

Review-Url: https://codereview.chromium.org/2880313002
Cr-Commit-Position: refs/heads/master@{#473842}
fs
Get SVGLayoutTreeAsText shape values from ComputedStyle
The values from ComputedStyle better reflect what values are actually
used.

Review-Url: https://codereview.chromium.org/2888603005
Cr-Commit-Position: refs/heads/master@{#473157}
rune
Make CSSSelector::SelectorText() non-recursive.
Should fix the stack overflow issue for selectors with an excessive
amount of compound selectors.

R=meade@chromium.org
BUG=719374

Change-Id: I2a1cfb8cb2d00d96f8d46a6e7317c5871020c6cd
Reviewed-on: https://chromium-review.googlesource.com/506020
Reviewed-by: Eddy Mead <meade@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#473972}
rune
Update styleSheets list in import without active style update.
Querying document.styleSheets should not need to do a full active style
update. This CL is implementing a light-weight update of the styleSheets
list querying document.styleSheets on html import documents.

We collect and swap style_sheets_for_style_sheet_list_ for the
collection of the import document without touching the active style or
the dirty flags for active style on the master document. This is
straightforward for import documents as they don't have an active
stylesheet list themselves. Doing this optimization for top level
documents and shadow trees is the next step, but we need to be more
careful for those cases to keep the dirtyness without having to re-
collect for the styleSheets api every time.

BUG=717506

Review-Url: https://codereview.chromium.org/2880303002
Cr-Commit-Position: refs/heads/master@{#472751}
fs
Remove SVGTextMetrics Width/Height getters
Remove said methods, replacing them with an additional Advance(...)
overload and a new method Extents() for the users that need those (all
in SVGTextQuery.)

BUG=544767

Review-Url: https://codereview.chromium.org/2888623008
Cr-Commit-Position: refs/heads/master@{#472650}
rune
Remove duplicate selector list serialization code.
CSSStyleRule::GenerateSelectorText() was identical to
CSSSelectorList::SelectorsText(). Removed the former.

R=nainar@chromium.org

Change-Id: Ia9432434c8a7943228a39fe5d1005b2fb49492bc
Reviewed-on: https://chromium-review.googlesource.com/506730
Reviewed-by: Alexis Menard <alexis.menard@intel.com>
Reviewed-by: Naina Raisinghani <nainar@chromium.org>
Commit-Queue: Rune Lillesveen <rune@opera.com>
Cr-Commit-Position: refs/heads/master@{#472627}
rune
Clear document scope dirtiness in import StyleEngine.
This is part of the plan to fix 717506 by re-collect sheets for
style_sheets_for_style_sheet_list_  separately from updating all of
active style to make it more light-weight.

Some sanity checking and comment about document scope dirtiness in,
and clear dirtiness after updating active sheets for, html imports.

Also renamed to UpdateActiveStyleSheetsInImport() to make it clearer
what the method does.

BUG=717506

Review-Url: https://codereview.chromium.org/2880263002
Cr-Commit-Position: refs/heads/master@{#472447}
rune
Allocate CSSGlobalRuleSet on heap.
Avoids allocating the CSSGlobalRuleSet on html import StyleEngines.

Review-Url: https://codereview.chromium.org/2883003002
Cr-Commit-Position: refs/heads/master@{#472186}
rune
Avoid synchronous stylesheet update on html import loaded.
A use counter was updating the styleSheets list, which updated all of
active style to figure out if an html import contains stylesheets.
Instead, do a simpler walk of the stylesheet candidate nodes and return
early if one of them has a sheet, or a sheet load is in progress.

BUG=717506

Review-Url: https://codereview.chromium.org/2882983002
Cr-Commit-Position: refs/heads/master@{#472139}
hugoh
Rename *Focus*-methods of FrameSelection to clarify its public API
As we've now added FS::SelectionHasFocus in [1], let's rename
FS::*IsFocused* to FS::*FrameIsFocused* to emphasize that these
methods give information about the Frame (in contrast to
FS::SelectionHasFocus).

BUG=715889
TEST=No behavior change

[1] = crrev.com/2841093002
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2876973003
Cr-Commit-Position: refs/heads/master@{#472129}
rune
Don't try to set the empty string as the preferred set.
Noticed during debugging that we did an extra MarkDocumentDirty() for
active stylesheet update trying to change the preferred set from empty
string to empty string in a document where no sheets had a title
attribute.

Guard the call sites which didn't check for emptiness and add a DCHECK
in the SetPreferredStylesheetSetNameIfNotSet implementation.

Review-Url: https://codereview.chromium.org/2879223002
Cr-Commit-Position: refs/heads/master@{#472039}
fs
Use CorrespondingUseElement() in SVGElement::TreeScopeForIdResolution
For elements sourced non-locally, CorrespondingElement() will give the
TreeScope of the document it was sourced from rather than the TreeScope
of the <use> element. Until we are able to resolve references at
ComputedStyle resolution, attempt to use the host of the shadow tree,
i.e the (outermost) <use> element. (This will not work when external
paint servers are supported, or with a paint server defined in the
referenced document.)

BUG=721167

Review-Url: https://codereview.chromium.org/2877973002
Cr-Commit-Position: refs/heads/master@{#471955}
hugoh
Make context menu aware of hidden selection
When the frame's selection is hidden, the context menu should
use the focused element (not the selection) as context.

BUG=715059

Expected: Context menu for <a>.
Review-Url: https://codereview.chromium.org/2869713003
Cr-Commit-Position: refs/heads/master@{#471719}
fs
Nested <use>s can resolve against an external resource
Rather than using TargetElementFromIRIString(...) when resolving nested
<use> references, we should be using ResolveTargetElement(), since the
latter also considers a possible external resource.

BUG=721196

Review-Url: https://codereview.chromium.org/2875303002
Cr-Commit-Position: refs/heads/master@{#471632}
mstensho
Distinguish between row (fragmentainer group) height and column (fragmentainer) height.
TLDR; The spec [1] says that a fragmentainer height must always be 1px or
greater, to ensure progress. If we just do this, we'll avoid a lot of trouble
with limitations in the data types that we use.

While *column* heights will now be clamped to >= 1px, we still allow the height
of a *row* (fragmentainer group) to be less than 1px. We don't want the row to
take up more space than it should in its container.
E.g. <div style="columns:2; height:0.5px;"><div style="height:1px";></div></div>
will give a row height of 0.5px, as specified. The column height, on the other
hand, should be clamped up to 1px.

And here, for the nastiness that this CL aims to fix:
<div style="columns:2; height:0.25px;">
    <div style="height:10000000px;"></div>
</div>
The content to fragment is 10 million pixels tall, and the column height has
been specified as 0.25px. Internally in our code, heights are stored as
LayoutUnit, which is a fixed-point unit with 6 bits reserved for decimals. On
the other side of the decimal point we have room for 32-6 bits = 26 bits, which
is what we have for a signed integer. That's 25 bits for the absolute value.
That's just over 30 million. LayoutUnit uses saturated arithmetic so there'll
never be any integer overflow or underflow, but there may be other ill effects.
Like in this case, if we actually allow a column height of less than 1px (i.e.
0.25px), when the engine for example wants to figure out the *actual* column
count (column count was *specified* as 2, but there's no way we're going to be
able to fit a 10 millions pixels tall thing in two columns when the column
height is 0.25px, so the actual count will be way higher), we take the flow
thread portion (10000000px) and divide by the column height (0.25px). If we
divide something by something (positive) less than 1, we of course end up with
a quotient larger than the dividend. While the dividend may be small enough to
fit unclamped in a LayoutUnit (10000000px fits just fine), the quotient
(40000000) may not. So, while the actual column count really is 40 million (if
we allow columns to be shorter than 1px), the engine will clamp the 40 million
to fit inside a LayoutUnit. That's 33554431. This is the root of the problem,
and this incorrect column count value may in turn lead to other bad things,
even negative column heights in subsequent rows (and good luck calculating a
used column count off that!). It would probably be possible to cope with this,
if we only take extra care everywhere, when dealing with close-to-insane
numbers.

Or we can just do what the spec says, and clamp column heights to >= 1px.

[1] https://drafts.csswg.org/css-break/#breaking-rules

BUG=712626,715208

Review-Url: https://codereview.chromium.org/2874933005
Cr-Commit-Position: refs/heads/master@{#471330}
jl
Inherit [Unforgeable] attributes between components
Specifically, when an interface in modules/ inherits an interface in core/
that defines an [Unforgeable] attribute, the interface in modules/ should
still have the attribute.

BUG=712070

Review-Url: https://codereview.chromium.org/2874153003
Cr-Commit-Position: refs/heads/master@{#471284}
fs
Fix textPath textLength position adjustment for the spacing case
Follow-up to https://codereview.chromium.org/2870393002, adjusting the
<textPath> 'textLength' computation in the same way.

BUG=719522

Review-Url: https://codereview.chromium.org/2868413003
Cr-Commit-Position: refs/heads/master@{#471248}
mostynb
debug_fission does not depend on bundled binutils
Change-Id: Ic6cd79175a1ea51dcd8f6ba11bf48ed6f800db6b
Reviewed-on: https://chromium-review.googlesource.com/503011
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#471243}
mstensho
Improve LayoutMultiColumnFlowThread::IsPageLogicalHeightKnown().
Simply returning whether the last column set has a known height isn't really
sufficient. All column sets need to have known heights.

However, instead of asking each column set every time we call
LayoutMultiColumnFlowThread::IsPageLogicalHeightKnown(), use a flag.

BUG=709792,717939

Review-Url: https://codereview.chromium.org/2877703003
Cr-Commit-Position: refs/heads/master@{#471231}
rune
Rebuild layout tree in flat tree order.
Marking the DOM for layout tree rebuild and the actual rebuilding is
now contained in the lifecycle update at a point where the shadow dom
distribution is up-to-date. We can therefore safely mark the flat-tree
ancestor chain without risking that it's broken by a distribution.

The point of doing RebuildLayoutTree in flat tree order is that layout
boxes can then be re-attached in the layout tree order which makes it
simpler to handle whitespace reattachment. For shadow trees and slotted
elements, when using the shadow-including tree order, we could have
elements rebuild their layout boxes in an order arbitrarily decided by
the slot assignments and slot positions in the shadow tree.

Note that while the RebuildLayoutTree traversal used to happen in the
shadow-including order, the layout attachment already happens in the
flat tree order.

See [1] for a plan to fix correctness and performance of whitespace
re-attachment.

This CL is doing the following changes:

1. Modify MarkAncestorsWithChildNeedsReattachLayoutTree to mark flat
   tree ancestry.

2. Rebuild distributed children for InsertionPoint and HTMLSlotElement.
   These children were rebuilt after their host's shadow tree before
   this change.

3. Factored out RebuildLayoutTreeForChild() as common code for both
   walking light tree children in ContainerNode, and distributed
   children in InsertionPoint and HTMLSlotElement.

4. Made FinalDestinationSlot() a member of node instead of a static
   function as it is now needed in multiple files.

[1] http://bit.ly/2ozyBdx

Review-Url: https://codereview.chromium.org/2836753002
Cr-Commit-Position: refs/heads/master@{#471188}
mostynb
remove superfluous size_t value >= 0 check
This assertion adds no value, and can trigger warnings (and errors if
you build with -Werror). I think it should be removed. If it is really
important, a comment where the variable is defined would suffice.

Patch submitted upstream:

https: //github.com/gperftools/gperftools/pull/885
Change-Id: Ife6de127928bfdd0c3861b65cdeb8e5ccbfee16d
Reviewed-on: https://chromium-review.googlesource.com/503034
Reviewed-by: Will Harris <wfh@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#471054}
bratell
Merged all PointerToId functions into TraceHelper::PointerToString.
There are many places in scheduler/renderer that need to make a string
out of a pointer for tracing purposes. This creates a shared function
for them.

This was noticed while experimenting with jumbo builds which can not
handle reused symbol names in the global or global anonymous scope.

Review-Url: https://codereview.chromium.org/2837323002
Cr-Commit-Position: refs/heads/master@{#470948}
rune
Check StyleSheetIsLoading before clearing LinkStyle sheet.
StyleSheetIsLoading() returns true if the top sheet is loaded but has
loading imports. If the top level sheet is cleared before we check the
loading status, we will not appropriately call RemovedPendingSheet()
which may block rendering indefinitely.

R=meade@chromium.org,pmeenan@chromium.org
BUG=718358

Review-Url: https://codereview.chromium.org/2873133002
Cr-Commit-Position: refs/heads/master@{#470943}
fs
Fix textLength position adjustment for the "adjust spacing" case
There should be no advance adjustment after the last character (really,
"typographic unit"), so divide the excess space by the character count
minus one - i.e the number of gaps - rather than the character count.

BUG=719522

Review-Url: https://codereview.chromium.org/2870393002
Cr-Commit-Position: refs/heads/master@{#470928}
fs
Remove the SVGImageElement::needs_loader_uri_update_ flag
Since xml:base is no longer a thing, there's no reason to delay the
resource (image) load until the <image> element is in the document.

Remove the flag and initiate resource loads a way resembling
HTMLImageElement. This means a change in behavior, since it will now be
possible get the load to start before the image is inserted into the
document. The new behavior matches Gecko.

Also clean up the code a bit, remove some unused includes and add a TODO
for the document adopt case.

BUG=720310

Review-Url: https://codereview.chromium.org/2868323002
Cr-Commit-Position: refs/heads/master@{#470898}
sigbjornf
Fix compilation of heap compaction debug diagnostics code.
R=
BUG=675877

Review-Url: https://codereview.chromium.org/2871123005
Cr-Commit-Position: refs/heads/master@{#470893}
jl
Reimplement [PutForwards] per spec
An attribute setter for an attribute X with [PutForwards=Y] should mostly
just do

  Set(Get(this, X), Y, value)

With the previous implementation, we instead essentially inlined both the
getting of X and setting of Y into the setter. This is unnecessary (both
will be implemented correctly separately) and also incorrect, since both
the getter for X and setter for Y could be overridden by a script.

BUG=683310

Review-Url: https://codereview.chromium.org/2733763003
Cr-Commit-Position: refs/heads/master@{#470864}
hugoh
Algorithm for deciding if a frame's selection should be hidden
Background:
Crrev.com/464698 introduced "hiding" of unfocused selections
in text controls. Hiding avoids clearing the selection upon change
of focus.

Problem:
Now we only hide selections inside text controls.
Selections within content-editable elements must also be hidden.

Solution:
Generalize previous work into an algorithm that, given current
DOM and its activeElement, determines whether a frame's selection
should be hidden.

See the algorithm in InHidden() for documentation and read its
unit tests in FrameSelectionTest.cpp.

BUG=715059, 715889

Review-Url: https://codereview.chromium.org/2841093002
Cr-Commit-Position: refs/heads/master@{#470822}
mostynb
include what you use: errno.h in native_test_launcher.cc
Add missing errno.h include.

Review-Url: https://codereview.chromium.org/1428653003
Cr-Commit-Position: refs/heads/master@{#470564}
rune
Counters are always generated content and cannot be selected.
Copying selection across generated ::before/::after with counter() did
not copy the contents, but the counter content was painted as selected
as if it was.

LayoutTextFragment was already overriding the implementation of
CanBeSelectionLeaf() to skip generated content, but LayoutCounter
inherits from LayoutText which returns always true. Return false for
LayoutCounter as it is always generated content.

R=mstensho@opera.com
BUG=703807

Review-Url: https://codereview.chromium.org/2867083003
Cr-Commit-Position: refs/heads/master@{#470141}
bratell
Avoid duplicating the BleedAvoidanceIsClipping function in Blink paint
There were two copies of BleedAvoidanceIsClipping and that is not what
we want.

I noticed this while experimenting with jumbo builds where the two
identical symbols would collide.

Review-Url: https://codereview.chromium.org/2863083002
Cr-Commit-Position: refs/heads/master@{#469951}
mstensho
The first table row is pushed down by border-spacing.
We need to make sure this happens *before* laying it out when inside a
fragmentation context.

Added tests fast/multicol/balance-table-with-border-spacing.html and
fragmentation/table-with-border-spacing.html for this.

This change also fixes breaking inside border-spacing adjacent to table
rows with break-inside:avoid set. There should be no reason to prevent
breaking inside border spacing, just because it's adjacent to such table
rows, but it looks like this was the behavior we got, by accident.
Updated printing/avoid-setting-header-offset-on-header.html accordingly
and threw in an additional test
fragmentation/border-spacing-break-before-unbreakable-row.html for this
collateral fix. It's hopefully correct, since we now match Edge's behavior.

BUG=709387,534751

Review-Url: https://codereview.chromium.org/2803383002
Cr-Commit-Position: refs/heads/master@{#469690}
mmarkowicz
Workaround for UCRT deadlock between gpu's main and watchdog threads
Deadlock is likely caused by UCRT lib bug that can be reproduced with
low-frequency in Opera Browser on Windows 7. Deadlock will permanently freeze
gpu process (watchdog will not intervene as, ironically, it's involved in a
deadlock).

BUG=718388
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2857743004
Cr-Commit-Position: refs/heads/master@{#469617}
rune
Disable inheritance propagation for text-align.
The text-align property has an internal value -webkit-match-parent with
a dependency on the parent computed style used in the UA sheet for LI,
which means the independent inheritance optimization won't work.

R=ktyliu@chromium.org,nainar@chromium.org
BUG=716797

Review-Url: https://codereview.chromium.org/2860743004
Cr-Commit-Position: refs/heads/master@{#469609}
rune
Stop matching scrollbar pseudo element without a scrollbar.
While matching rules for elements, we mark elements as affected-by-* for
user action pseudo classes like hover. It means that when the element is
later hovered, we need to recalculate style to apply hover styles to
that element.

In general, we currently don't support pseudo classes after pseudo
elements, but for scrollbar pseudo elements we do:

  ::-webkit-scrollbar:hover {}

However, we do not want such rules to mark the element as affected-by-
hover. The hover style on scrollbar parts get their hover style updated
when hovered regardless of any flags, and making scrollbar pseudo
element rules affect hover updates on the actual elements causes
unnecessary style recalcs.

BUG=716006

Review-Url: https://codereview.chromium.org/2850743003
Cr-Commit-Position: refs/heads/master@{#469309}
sigbjornf
IsAccessWhiteListed(): avoid unnecessary stringification.
The origin whitelist may well be empty, so check that first
before taking on the stringification of the security origin.

R=
BUG=

Review-Url: https://codereview.chromium.org/2855133005
Cr-Commit-Position: refs/heads/master@{#469300}
mostynb
allow_posix_link_time_opt and is_cfi are clang features
This is required for GCC builds with is_official_build=true.

BUG=464797

Review-Url: https://codereview.chromium.org/2858723002
Cr-Commit-Position: refs/heads/master@{#469188}
fs
Hoist layout update out of SVGGraphicsElement::GetBBox and overrides
Call Document::UpdateStyleAndLayoutIgnorePendingStylesheets() in the DOM
entrypoint instead of in each GetBBox implementation/override. Add
DCHECKs as needed in the GetBBox implementations instead to assert the
precondition.
Adjust ResizeObservation::ComputeTargetSize (which shouldn't need to
update the layout anyway) to account for this.

Review-Url: https://codereview.chromium.org/2854123004
Cr-Commit-Position: refs/heads/master@{#469061}
fs
Rename SVGPreserveAspectRatio::GetCTM to ComputeTransform
This method doesn't "get (a) CTM", it rather computes a transform that
maps from the (initial) viewport space to the viewbox space while
considering the value of 'preserveAspectRatio'.

Review-Url: https://codereview.chromium.org/2856863005
Cr-Commit-Position: refs/heads/master@{#469057}
fs
Simplify the SVGGraphicsElement ...CTM methods
GetCTM() only has a single caller, so can be trivially folded. Similarly
GetScreenCTM which has one kAllowStyleUpdate and one
kDisallowStyleUpdate, so it can be folded while hoisting the call to
update style and layout.
This means that there are no longer a collision between internal methods
and the ones exposed in the DOM, so the "...FromJavascript" suffixes can
be dropped.

Review-Url: https://codereview.chromium.org/2858913002
Cr-Commit-Position: refs/heads/master@{#469055}
rune
Don't update column position in StyleDidChange.
StyleDidChange set the first column position to the horizontal border
spacing value regardless of whether this value changed or not.

I am not familiar with how table layout works in Blink and haven't
debugged this extensively, but when we re-layout a table cell because
it has out-of-flow content which needs layout, the first effective
column position is set wrongly. It gets its initial value from the line
removed in this CL by a style recalc on the table element prior to the
re-layout, which is the h_spacing_, but the spacing is subtracted once
more in http://bit.ly/2pBB7x1

R=eae@chromium.org,mstensho@opera.com
BUG=716006

Review-Url: https://codereview.chromium.org/2855853002
Cr-Commit-Position: refs/heads/master@{#468920}
fs
More targeted resource-switching mechanism for SVG selection painting
The mechanism by which resources are generated for painting using
selection style for SVG text is a bit too heavy-handed, and can end up
invalidating both layout and other things. All that is needed is looking
up any <paint> ('fill' or 'stroke') references and invalidating any
state from the non-selection style.

Use a reduced/tailored version of SVGResourcesCache::ClientStyleChanged
that only recreates/swaps the SVGResources object for the LayoutObject
and wrap that mechanism in a scope object.

BUG=713024
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2846513002
Cr-Commit-Position: refs/heads/master@{#468658}
fs
getScreenCTM on <use> should not include the additional translation
This is a partial revert of https://codereview.chromium.org/2711503002,
preserving the fix from that bug (crbug.com/678167) while restoring the
LocalCoordinateSpaceTransform() infrastructure to compute the correct
CTM for <use> elements.

BUG=716711

Review-Url: https://codereview.chromium.org/2853223002
Cr-Commit-Position: refs/heads/master@{#468657}
sigbjornf
Revert "Verify that constant vectors aren't invalidated during iteration."
Back out the problem diagnosis CHECKs() added in r463124; condition not
triggered.

R=haraken
BUG=699269

Review-Url: https://codereview.chromium.org/2857503002
Cr-Commit-Position: refs/heads/master@{#468584}
sigbjornf
Fix detached event listener attribute updating.
The parser will in some cases create new elements in documents that
have become frame-detached. Account for that -- no execution context
due to the document having become detached -- when processing the
event listeners of an event attribute.

R=haraken
BUG=714353

Review-Url: https://codereview.chromium.org/2855443002
Cr-Commit-Position: refs/heads/master@{#468294}
fs
Abort the SVG filter content recording if the FilterData was dropped
In the (rare) case of a recording being started and the FilterData
structure being yanked away (and destroyed) from under
SVGFilterPainter's feet, we need to put the PaintController in a
consistent state before destroying it.
Add a new method SVGFilterRecordingContext::Abort() and call that when
SVGFilterPainter::FinishEffect encounters a null FilterData for the
LayoutObject.

BUG=713024
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2847133002
Cr-Commit-Position: refs/heads/master@{#468092}
fs
Refactor FilterData::state_ handling in SVGFilterPainter
Make FilterData::state_ only be checked and updated within
SVGFilterPainter, and not by SVGFilterRecordingContext or the local
painting helper.
Instead SVGFilterRecordingContext only manages the recording state, and
gets passed bounds while returning a paint record.
This simplifies some of the corner-cases with regards to how "aborted"
filters are handled, getting rid of some "FilterData is null" in many
cases.

BUG=713024
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2851753002
Cr-Commit-Position: refs/heads/master@{#468085}
mstensho
Don't truncate the border-spacing before the table-header-group when fragmenting.
BUG=716442

Review-Url: https://codereview.chromium.org/2848883002
Cr-Commit-Position: refs/heads/master@{#468055}
fs
Proactively dispose image filters for SVG filter chains
Because of the spanning of multiple heaps by the resources associated
with FilterEffects [GCd] (SkImageFilter [mallocd]), the garbage
collector only observes a relatively slow growth, while resources tied
by or via the other heap can be substantial.

Since we have fairly good control of the lifetimes here, we can try to
dispose of our references to the resources on the other heap up front,
and prevent growth due to (dead) GCd objects in limbo.

Also rename FilterEffect::ClearResult to DisposeImageFilters to better
match it does nowadays.

BUG=610158

Review-Url: https://codereview.chromium.org/2846593008
Cr-Commit-Position: refs/heads/master@{#467983}
landell
Avoid sending double responding close control frames in WebSockets
This avoids sending a second ack close frame when we get a flow
control request from the renderer while waiting for the connection to
be closed.

BUG=

Review-Url: https://codereview.chromium.org/2845033002
Cr-Commit-Position: refs/heads/master@{#467964}
rune
Remove unused AttachContext parameter.
Review-Url: https://codereview.chromium.org/2844253002
Cr-Commit-Position: refs/heads/master@{#467904}
bratell
Merge two IsInDocument implementations.
There were two helper functions IsInDocument implementations in
core/input and this moves them to EventHandlingUtil so they can
be shared.

R=dtapuska@chromium.org

Review-Url: https://codereview.chromium.org/2845973002
Cr-Commit-Position: refs/heads/master@{#467684}
bratell
Remove unused "using" statements in WebKit/Source/platform.
Some "using" statements that were no longer used lingered in the
source code so let us remove them.

Review-Url: https://codereview.chromium.org/2841923002
Cr-Commit-Position: refs/heads/master@{#467654}
rune
Better overflow handling for aspect-ratio MQ.
This change fixes two issues:

1. Clamp instead of casting double values from parser to internal
   unsigned storage.
2. Promote width/height/numerator/denominator multiplications to double
   to avoid integer overflow for large numerator/denominators.

R=yoav@yoav.ws,suzyh@chromium.org
BUG=676709,714079

Review-Url: https://codereview.chromium.org/2836613002
Cr-Commit-Position: refs/heads/master@{#467615}
bratell
Adding missing include guard for SharedGpuContext.h
Review-Url: https://codereview.chromium.org/2841933002
Cr-Commit-Position: refs/heads/master@{#467054}
tmoniuszko
Make //content/public/renderer dependency on //media public
There's following include chain:
content/public/renderer/content_renderer_client.h
media/base/decode_capabilities.h
media/base/video_color_space.h
ui/gfx/color_space.h
third_party/skia/include/core/SkColorSpace.h
SkMatrix44.h

Dependency chain must be also public to make sure that target that depends
on //content/public/renderer has include paths configured properly and
skia header inclusion doesn't cause 'include file not found' error during
compilation.

BUG=

Review-Url: https://codereview.chromium.org/2839623002
Cr-Commit-Position: refs/heads/master@{#467018}
mstensho
Allow forced breaks inside floats.
BUG=700919

Review-Url: https://codereview.chromium.org/2840443003
Cr-Commit-Position: refs/heads/master@{#466848}
fs
Tidy up fragment loops in SVGInlineTextBoxPainter
Convert the loop in PaintTextFragments to a for-range, and remove the
unneeded local variable in CollectFragmentsInRange.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2843483002
Cr-Commit-Position: refs/heads/master@{#466696}
rune
Removed superfluous custom style DCHECK.
Custom style callbacks are called during style recalc. There is no need
to check that ShadowRoot does not have such callbacks during layout
tree rebuild. There is already a check in ShadowRoot::RecalcStyle().

R=nainar@chromium.org
BUG=595137

Review-Url: https://codereview.chromium.org/2833223002
Cr-Commit-Position: refs/heads/master@{#466551}
ollel
Add curly brackets to list of characters that gn needs to escape
Curly brackets {} needs to be escaped to avoid brace expansion
on systems using bash as the default shell.

BUG=709934

Review-Url: https://codereview.chromium.org/2809633002
Cr-Commit-Position: refs/heads/master@{#466286}
rune
Scopeless matching of :host rules for style sharing.
The kSharingRules mode for selector matching needs to bypass scope
checking in various places because we match selectors from the set of
global uncommon attribute rules for which the source scope is unknown.

We should really store these rules per scope, at least for Shadow DOM
v1, and pass the correct scope for matching.

BUG=711539

Review-Url: https://codereview.chromium.org/2824853004
Cr-Commit-Position: refs/heads/master@{#465980}
rune
Collect media query results for non-matching stylesheets.
Viewport and device dependent media query results are collected after
an active stylesheet update happen. The results are collected on the
ScopedStyleResolvers and propagated to the CSSGlobalRuleSet. It's
necessary that the active stylesheet update causes these media query
results to be up-to-date so that e.g. a viewport resize checks these
results to detect that we need an active stylesheet update for a given
resize.

That did not happen when we only added sheets for which the media
attrbute did not match, because adding a sheet with a null RuleSet does
not affect the computed style and the changed_rule_sets set was empty.

Now, if we add or remove a sheet which does not apply, and that sheet
has a viewport or device dependent media query, still return
kActiveSheetsAppended or kActiveSheetsChanged to trigger the re-
collection of those media query results.

BUG=710878

Review-Url: https://codereview.chromium.org/2829873002
Cr-Commit-Position: refs/heads/master@{#465912}
fs
Move the BreakCycle() method from the cycle solver to SVGResources
This means we can get rid of the SVGResources::ResetFoo methods, and
thus the "friend"-ship between SVGResourcesCycleSolver and SVGResources.
This also reduces the dependencies between the cycle solver and specific
resource types.
Choose a more "semantic" name (ClearReferencesTo), and also remove the
unused DEBUG_CYCLE_DETECTION define.

Review-Url: https://codereview.chromium.org/2821333002
Cr-Commit-Position: refs/heads/master@{#465535}
hugoh
Update description of mouse-click-plugin-clears-selection.html
After crrev.com/2616623002, we now do expect the layout tree
to contain a selection (a selection that is hidden). So let's
update the test's inline description to reflect this exception.

BUG=678601

Review-Url: https://codereview.chromium.org/2817073003
Cr-Commit-Position: refs/heads/master@{#464710}
hugoh
Do not send redundant selectionchange-events (decouple focus)
This CL aims to remove redundant selectionchange-events
that were sent upon change of focus caused by element.focus(),
tab-navigation, spatnav and mouse-clicks.

Goals:
1. Send == one selectionchange-event, not two, for each caret jump.
2. Send <= one selectionchange-event, not two, for each focus jump.

Background:
When you click/tab to an <input> text-field, a
ViewHostMsg_TextInputStateChanged-message is sent to browser-side.

Problem:
With current logic, RenderFrameImpl::didChangeSelection is
called twice so two ViewHostMsg_TextInputStateChanged-messages
are sent to browser-side:
 (1) when focus leaves an <input>-field (unnecessary!).
 (2) when focus enters another <input>-field.

Worse, also the web page gets two selectionchange events.
The first one is immediately invalid so the webpage should
not react to it.

(1) happens because FocusController::setFocusedElement()
always clears the selection when a new element gets focus.

Solution:
Do not clear selection when focus moves. To keep current visual
behavior when focus moves away from a text-field we need to hide
that field's selection (clicking outside a text-field hides its
selection).

Test updates:
1. Check for one selectionchange event, not two.
2. LayoutTests' trees now expect the "hidden" selection.
3. A new test in WebFrameTest.cpp tests tab-key navigation.

BUG=678601, 679635, 699015, 692898
TEST=In content_shell, select some text in an <input>-field,
     click another <input>-field (move focus).
     Notice: one selectionchange event is fired (as in Firefox).
TEST=In content_shell, select some text in an <input>-field,
     click on an <img>. Notice: selection gets hid and
     zero selectionchange events are fired (as in Firefox).

Review-Url: https://codereview.chromium.org/2616623002
Cr-Commit-Position: refs/heads/master@{#464698}
fs
Add connected-paranoia in SVGElement::UpdateRelativeLengthsInformation
When (animated attribute) mutations are trigger by a 'id' change (via
an IdTargetObserver), relative lengths state may be revalidated while
the element are in the process of being removed from the document, but
has not yet been marked as such. If relative length state is updated in
such a case, the |elements_with_relative_lengths_| set could end up in
an inconsistent state.
Instead of only relying on the connected bit of the current element,
also check all the ancestors to make sure.

BUG=705200

Review-Url: https://codereview.chromium.org/2817913002
Cr-Commit-Position: refs/heads/master@{#464408}
rduszynski
Fix disabling FFMpeg video decoders on non-Android platforms
If disable_ffmpeg_video_decoders is set to true on platfoms other
than Android ffmped_video_decoder.* is always included.
This patch removes those sources and fixes dependencies in code.

Review-Url: https://codereview.chromium.org/2808093008
Cr-Commit-Position: refs/heads/master@{#464394}
bratell
Avoid duplicate functions/code in core/inspector: isErrorStatusCode
While experimenting with unity builds I encountered a few duplicate
symbols and functions in core/inspector. One of them was
isErrorStatusCode, a one instruction function that was defined in both
NetworkResourcesData.cpp and InspectorNetworkAgent.cpp.

This patch renames one of them IsHTTPErrorStatusCode, a more suitable
name.

Review-Url: https://codereview.chromium.org/2807533005
Cr-Commit-Position: refs/heads/master@{#464076}
bratell
Deduplicating compositing scrollingCoordinator helper
In the experiments with unity builds I ran into the
scrollingCoordinatorFromLayer function that was defined identically at
two different places. This patch moves the code to PaintLayer where
it is also available to PaintLayer itself.

R=pdr@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2803013005
Cr-Commit-Position: refs/heads/master@{#464054}
fs
Invalidate the "values cache" when resetting animated value state
When we revalidate the animated value, and the value 'source' is the
'values' attribute, we need to also reset the cached 'from' and 'to'
values kept in SVGAnimationElement. If not, a target change could clear
the animated from/to values and not notice that they are stale on
revalidation.
Companion to https://codereview.chromium.org/2763283002.

BUG=710247

Review-Url: https://codereview.chromium.org/2817643003
Cr-Commit-Position: refs/heads/master@{#464037}
fs
Strip only ASCII spaces from SMIL 'values' attributes
This is more consistent with other microsyntaxes used for attribute
parsing, while also making it consistent with the XSSAuditor.

BUG=709365, 710460

Review-Url: https://codereview.chromium.org/2807193003
Cr-Commit-Position: refs/heads/master@{#463662}
fs
Support calc(...) in ConsumeAngleOrPercent / for conic-gradient
Because of the explicit check for <percentage-token>, calc(...) would
not be properly handled for percentages. CSSGradientValue also wasn't
checking for calc() values when evaluating stops.
Rewrite ConsumeAngleOrPercent in a vein similar to
ConsumeLengthOrPercent.
Make CSSPrimitiveValue::IsAngle() consider resolved type, and update
CSSRotation TypedOM implementation to counter this.

BUG=709730

Review-Url: https://codereview.chromium.org/2813583002
Cr-Commit-Position: refs/heads/master@{#463585}
rune
Rename cleanup in comments in css/ directory.
After the renaming of methods and variables to match chromium style,
a bunch of comments were not correct.

BUG=643310

Review-Url: https://codereview.chromium.org/2812743003
Cr-Commit-Position: refs/heads/master@{#463561}
rune
Rename cleanup in comments in style/ directory.
After the renaming of methods and variables to match chromium style,
a bunch of comments were not correct.

BUG=643310

Review-Url: https://codereview.chromium.org/2812593005
Cr-Commit-Position: refs/heads/master@{#463559}
rune
kChildNeedsReattachLayoutTree should not be initially set.
This flag should have been dropped in [1] since we dropped setting
kNeedsReattachLayoutTree initially in that CL.

[1] https://codereview.chromium.org/2760233004

R=nainar@chromium.org
BUG=595137

Review-Url: https://codereview.chromium.org/2807063003
Cr-Commit-Position: refs/heads/master@{#463421}
fs
Use a ResizeObserver to determine default font-size for text tracks
Text track needs to derive the default font for the cues from the size
of the <video> area, and currently does this by updating style during
the call to layout() on the LayoutTextTrackContainer, violating the
document lifecycle.

To avoid mutating style during layout, hook up a ResizeObserver from
TextTrackContainer to HTMLVideoElement and rely on the ResizeObserver
logic to iterate on the style and layout.

This eliminates the need to have a special LayoutObject for
TextTrackContainer, so just use a LayoutBlockFlow and remove all traces
of LayoutTextTrackContainer.

The media/track/track-cue-rendering.html test is updated to check sizes
after layout and paint instead of a forced layout.

BUG=372245

Review-Url: https://codereview.chromium.org/2803243002
Cr-Commit-Position: refs/heads/master@{#463280}
sigbjornf
Verify that constant vectors aren't invalidated during iteration.
Clearing a heap vector while it is being iterated and on the stack is
unsafe, as it promptly releases the backing store.

Add CHECK()s to verify that this doesn't happen for a crasher involving
MediaQuerySets that's proving hard to pindown, but there are some
suggestions that the heap vector contents of MediaQuerySet::m_queries
is being mutated.

R=
BUG=699269

Review-Url: https://codereview.chromium.org/2806003002
Cr-Commit-Position: refs/heads/master@{#463124}
bratell
Avoiding name collisions between flexbox and grid
I'm still experimenting with unity builds and one of the name
collisions that you encounter when compiling layout is between flexbox
code and grid code. This patch changes top level functions to be
member functions.

No functional changes.

Review-Url: https://codereview.chromium.org/2803323002
Cr-Commit-Position: refs/heads/master@{#463059}
bratell
Avoid duplicate functions/code in core/editing: endTag
While experimenting with unity builds I encountered a few duplicate
symbols and functions in core/editing. This patch renames, moves
and unifies them.

elementCannotHaveEndTag is a utility function used in serializers
and since it is used in multiple places, and MarkupFormatter is
not a good place for it, let us put it in EditingUtilities.

BUG=708949
R=yosin@chromium.org

Review-Url: https://codereview.chromium.org/2804943002
Cr-Commit-Position: refs/heads/master@{#462994}
mstensho
A column-span:all element should always establish a new formatting context.
This also applies when the element isn't contained by a multicol container
(which means that we shouldn't require the spanner placeholder to be present).

BUG=709362

Review-Url: https://codereview.chromium.org/2799363003
Cr-Commit-Position: refs/heads/master@{#462865}
bratell
Avoid converting an IntRect to IntRect via FloatRect
IntRects can be implictly converted to FloatRect so code managed
to call enclosingIntRect on an IntRect which then converted to
FloatRect and back for an expensive noop.

R=mstensho@opera.com
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2805203003
Cr-Commit-Position: refs/heads/master@{#462848}
fs
Use long timeout for the svg/interfaces.html test
Lots of interfaces, so can take a while to run. Use the 'long' timeout
option.

BUG=709030

Review-Url: https://codereview.chromium.org/2806513002
Cr-Commit-Position: refs/heads/master@{#462655}
fs
Revert "Neuter the "screen scale factor" computation for SVG <text>"
This reverts commit 6f80957a6a5e7ec792a2f3cd7f06e2a744196d1d.

Clean revert, but a reference to FrameHost had to be changed to Page, and
an ASSERT was changed to a DCHECK.

BUG=706880,664961

Review-Url: https://codereview.chromium.org/2805043002
Cr-Commit-Position: refs/heads/master@{#462563}
mstensho
Remove DCHECK in column balancer that failed because of flexbox bugs.
This DCHECK was useful (detects broken layout, but nothing more dangerous than
that). However, as long as we don't paginate flex items at their final block
position (see bug 606350), we cannot assert like this, because it's going to
fail under certain circumstances.

BUG=685047

Review-Url: https://codereview.chromium.org/2797313003
Cr-Commit-Position: refs/heads/master@{#462447}
bratell
Avoid duplicate functions/code in core/editing: MatchResultICU
While experimenting with unity builds I encountered a few duplicate
symbols and functions in core/editing. This patch renames, moves
and unifies them.

There is a global MatchResult in css/SelectorChecker.h and if that one
is included anywhere in editing, then it will collide with a local
MatchResult used in iterators. Renaming the local one MatchResultICU
will both match the name of other symbols and avoid the collision.

BUG=708949
R=yosin@chromium.org

Review-Url: https://codereview.chromium.org/2806433002
Cr-Commit-Position: refs/heads/master@{#462431}
bratell
Avoid duplicate functions/code in core/editing: kInvalidOffset
While experimenting with unity builds I encountered a few duplicate
symbols and functions in core/editing. This patch renames, moves
and unifies them.

kInvalidOffset is a name used both by PositionIterator and TextIterator.
This renames on of them kInvalidTextOffset to better match its use and
to avoid the name collision.

BUG=708949
R=yosin@chromium.org

Review-Url: https://codereview.chromium.org/2798283002
Cr-Commit-Position: refs/heads/master@{#462428}
bratell
Avoid duplicate functions/code in core/editing: DirectionalSelection
While experimenting with unity builds I encountered a few duplicate
symbols and functions in core/editing. This patch renames, moves
and unifies them.

shouldAlwaysUseDirectionalSelection is a common helper function
and since it's not identicallty implemented everywhere it cannot
be merged. Instead make the one in SelectionModifier a member function
to move it out of global scope.

BUG=708949
R=yosin@chromium.org

Review-Url: https://codereview.chromium.org/2798143003
Cr-Commit-Position: refs/heads/master@{#462427}
bratell
Avoid duplicate functions/code in core/editing: kUnsetCodePoint
While experimenting with unity builds I encountered a few duplicate
symbols and functions in core/editing. This patch renames, moves
and unifies them.

kInvalidCodePoint is used in both ForwardGraphemeBoundaryStateMachine and
BackwardGraphemeBoundaryStateMachine so to avoid clashes, use different
names for them.

BUG=708949
R=yosin@chromium.org

Review-Url: https://codereview.chromium.org/2801893004
Cr-Commit-Position: refs/heads/master@{#462423}
bratell
Avoid duplicate functions/code in core/editing: computeDistance
While experimenting with unity builds I encountered a few duplicate
symbols and functions in core/editing. This patch renames, moves
and unifies them.

Several classes use computeDistanceToLeftGraphemeBoundary and instead
of copying the whole function, make a single copy in EditingUtilities.
Also move computeDistanceToRightGraphemeBoundary since those two functions
are too similar to split up.

BUG=708949
R=yosin@chromium.org

Review-Url: https://codereview.chromium.org/2802953002
Cr-Commit-Position: refs/heads/master@{#462420}
fs
Implement support for the 'transform-box' property
Spec:

 https://drafts.csswg.org/css-transforms-1/#transform-box

Intent to implement:

 https://groups.google.com/a/chromium.org/d/topic/blink-dev/v8g3QF8pRF8

Implemented behind the CSSTransformBox Blink runtime flag.
Add some basic tests and a smoke test for the "legacy" transform-box
behavior. Existing tests are adjusted to be compatible with the new
behavior.
The test svg/transforms/transform-origin-css-property.xhtml is "fixed"
by adding units when required (unitless numbers are not valid in inline
style.)

BUG=595829

Review-Url: https://codereview.chromium.org/2786643003
Cr-Commit-Position: refs/heads/master@{#462266}
rune
Document::hoverNode() is always an Element.
Make hoverNode(), hoverElement() and only mark Elements as hovered
using FlatTreeTraversal::parentElement() instead of parent(). This
means we can get rid of some checks for nodes being text or element
nodes. It means we also only mark elements as being hovered in the flat
tree ancestor chain.

R=ecobos@igalia.com

Review-Url: https://codereview.chromium.org/2797173002
Cr-Commit-Position: refs/heads/master@{#462257}
bratell
Removing duplicate functions and symbol names in core/css
In the unity build experiment I encountered a few colliding duplicate
symbol names in core/css and this patch removes them by replacing
duplicated symbols with a single code and by doing some symbol
renames.

Review-Url: https://codereview.chromium.org/2797973002
Cr-Commit-Position: refs/heads/master@{#462256}
rune
Allow display:contents elements in hover chain.
Document::updateHoverActiveState walked the shadow-including ancestor
path assuming no layoutObject meant display:none. Changed to walk flat
tree ancestors checking for display:contents style in addition.

ContainerNode::setHovered did not allow hover state to be changed when
setting hovered=true on elements without a layout object. Changed to
allow for display:contents here as well.

R=ecobos@igalia.com
BUG=705984

Review-Url: https://codereview.chromium.org/2790133002
Cr-Commit-Position: refs/heads/master@{#462199}
bratell
Rename duplicate symbols inside core/dom
While experimenting with unity builds I got into problems with
code that used the same symbol name for multiple purposes. This
renames those which also will make the life for symbol debugging
slightly easier.

kSupplementName: Name used in both CSSSelectorWatch.cpp and
DocumentParserTiming.cpp.

WTF::Unicode symbols: Depending on how unity builds are created,
global "using" statements can affect more than intended and trigger
warnings and errors. Now global "using" statements are not allowed by
the Chromium coding standard so assuming it will eventually apply to
Blink as well, the using statements might as well be removed now.

previousAncestorSiblingPostOrder was a function in both
FlatTreeTraversal.cpp and NodeTraversal.cpp. Could easily be made
class local and the name collision was no more.

Review-Url: https://codereview.chromium.org/2802723002
Cr-Commit-Position: refs/heads/master@{#462123}
sigbjornf
PagePopupController: handle frame-detached window usage.
R=haraken
BUG=708225

Review-Url: https://codereview.chromium.org/2798863002
Cr-Commit-Position: refs/heads/master@{#462078}
rune
Revert increased limit for m_selectorIndex.
If 2^13 simple selectors in a style rule was not enough, 2^14 will be
exceeded at some point. Leave the available bit for later use and avoid
regressions for m_selectorIndex when we need that bit.

R=esprehn@chromium.org
BUG=704562

Review-Url: https://codereview.chromium.org/2797953002
Cr-Commit-Position: refs/heads/master@{#462015}
bratell
Fewer reused duplicate symbol names in animation.
When experimenting with unity builds you get conflicts between
cpp files if they use the same symbol name for different things
(or the same thing). This make names more unique. No functional changes.

Formatted with git cl format (#includes moving around).

R=alancutter@chromium.org

Review-Url: https://codereview.chromium.org/2794013002
Cr-Commit-Position: refs/heads/master@{#461755}
bratell
Remove duplicate using statement.
One "using namespace WTF::Unicode" is enough, and actually might be one
too many if the Chromium coding style is adapted in blink.

This caused a bit of a problem when experimenting with unity builds.

R=jsbell@chromium.org

Review-Url: https://codereview.chromium.org/2792933003
Cr-Commit-Position: refs/heads/master@{#461686}
mstensho
[LayoutNG] WIP on storing layout output in the legacy tree for multicol.
Painting NG fragment trees is still not supported, so in the meantime
we'll keep LayoutMultiColumnFlowThread and LayoutMultiColumnSet, and have
multicol painted and hit-tested in the old-fashioned way (just like
everything else, really).

Based on work by glebl.

BUG=635619

Review-Url: https://codereview.chromium.org/2786923004
Cr-Commit-Position: refs/heads/master@{#461409}
rune
Added available bit to m_selectorIndex.
Increased the max number of simple selectors for one style from 8192 to
16384 by moving one bit to the second 32-bit part to make space for
another bit. There is one bit left, but it cannot be utilized since the
bit field cannot span two 32 bit values. This doesn't really fix the
issue since it's not unlikely someone will use more than 16000 selectors
if they use more than 8000 selectors.

R=meade@chromium.org
BUG=704562

Review-Url: https://codereview.chromium.org/2785103004
Cr-Commit-Position: refs/heads/master@{#461389}
fs
Implement Image::maybeAnimated for SVGImage
This CL renames SVGImage::hasAnimations to maybeAnimated, overriding
the implementation from the base class (Image.) The old method matches
the new one in certainty of the reply, and allows SVGImages to be paused
when being scrolled out of view etc.

BUG=706152

Review-Url: https://codereview.chromium.org/2783133002
Cr-Commit-Position: refs/heads/master@{#461094}
bratell
Avoid duplicating the target name "svg".
It has not been possible to build just the svg code with
ninja -C out/Default svg
because of two other, minor, build targets named svg.
This commit renames those svg_layout and svg_style.

Review-Url: https://codereview.chromium.org/2783253002
Cr-Commit-Position: refs/heads/master@{#461073}
rune
Rephrased documentation about VTT, ::cue, and custom pseudo scopes.
We should not make these rules part of boundary crossing rules as they
will go away when Shadow DOM v0 goes away. Adjusted the documentation
to not hint in that direction.

R=kochi@chromium.org,meade@chromium.org
BUG=551751

Review-Url: https://codereview.chromium.org/2787823002
Cr-Commit-Position: refs/heads/master@{#461059}
bratell
Removing unnecessary "using" statements.
In the Chromium code style using statements are not allowed and these
ones are not even needed/used so let us just drop them.

Review-Url: https://codereview.chromium.org/2788693002
Cr-Commit-Position: refs/heads/master@{#460866}
bratell
Remove unused variable layout_object.
clang triggered compilation errors about this unused variable when
experimenting with a unity build. Not sure why doesn't detect that it
is unused normally.

R=mstensho@opera.com

Review-Url: https://codereview.chromium.org/2785213002
Cr-Commit-Position: refs/heads/master@{#460862}
bratell
Adding missing include in svg/GradientAttributes.h
If you managed to include GradientAttributes.h before you included
SVGGradientElement.h you would have no definition of
SVGSpreadMethod and other types.

R=fs@opera.com

Review-Url: https://codereview.chromium.org/2790623002
Cr-Commit-Position: refs/heads/master@{#460791}
rune
Pass nextTextSibling to ::before layout rebuild.
Correct whitespace re-attachment relies on the next text node being
tracked in order to re-attach when a previous sibling element changes
display type. We did that just while traversing light tree siblings or
slotted siblings.

::before pseudo element display type may affect following whitespace
text node, so we need to pass on the next text sibling result from the
descendant traversal.

As we traverse siblings from right-to-left, we should also rebuild
::after before DOM siblings, and ::before after DOM siblings.

This fixes the case where an element, whose left-most child, or shadow
root child, is a whitespace text node, changes its ::before element's
display type from block to inline.

The pseudo element layout tree rebuild is renamed from reattach* to
rebuild* to match the semantics of the rest of the methods.

R=esprehn@chromium.org
BUG=648951

Review-Url: https://codereview.chromium.org/2766163002
Cr-Commit-Position: refs/heads/master@{#460737}
hugoh
Render focus-selection-textarea at constant font-size to avoid flakiness
When crrev.com/453211 updated FreeType on Linux, some glyphs
got bigger due to the new antialiasing and hinting settings.

Bigger glyphs made focus-selection-textarea.html layout differently.
With the new layout, scripted mouse clicks no longer hit the right spot.

After the manual rebaselining in crrev.com/453211, the expected result
on Linux started to include FAIL whereas other platforms still expected
PASS. This CL makes also Linux PASS.

BUG=706119, 274030

TEST=python third_party/WebKit/Tools/Scripts/run-webkit-tests -t\
     PcDebug LayoutTests/fast/forms/focus-selection-textarea.html

Review-Url: https://codereview.chromium.org/2786953002
Cr-Commit-Position: refs/heads/master@{#460732}
tommyt
PaymentApp: Receive payment app responses in Android
This change adds a callback parameter to
ServiceWorkerPaymentInstrument.invokePaymentApp, so that the response
from the payment app can be passed back to the merchant.

Depends on https://codereview.chromium.org/2718013004/

BUG=669876

Review-Url: https://codereview.chromium.org/2775933002
Cr-Commit-Position: refs/heads/master@{#460715}
karlo
Fix for performance regression on high dpi devices.
ComputedStyle::getRoundedInnerBorderFor() could generate negative
content boxes for boxes with no content and sub pixel borders that
round up (eg. 1.5px-1.99px).  Negative content boxes are illegal per
spec, and causes BoxBorderPainter::paintBorderFastPath() to bail,
and performance to be substantially degraded.

This issue would be evident on the paint-offset-changes perftest when
device pixel ratio was set to eg. 1.5.  The issue was introduced in
934becac5daa91ea979fb66e4ae21761ca11ebc9

BUG=692955

Review-Url: https://codereview.chromium.org/2782153002
Cr-Commit-Position: refs/heads/master@{#460534}
fs
Deduplicate testharness test names in LayoutTests/svg/
Some tests were using non-unique names, which triggers a harness error
for "newer" versions of testharness.js.
Twiddle the relevant names a bit so that they become unique.

BUG=705626

Review-Url: https://codereview.chromium.org/2782583002
Cr-Commit-Position: refs/heads/master@{#460447}
rune
Corrected specificity for :not for default @namespace.
The argument to :not() consists of a universal, type, or a simple
selector. However, we prepend an implicit universal selector with the
default namespace URI to all compound selectors to correctly match only
elements in the default namespace. That is not necessary for compounds
inside pseudo argument lists, but we do in those cases as well.

When calculating the specificity for :not(), we assume its argument
consists of a single simple selectors, but in the case where we have a
default namespace, a namespaced universal selector is prepended. We
only added the specificity for the universal selector in that case.
Instead, walk all sub-selectors of the :not() compound when calculating
the specificity.

R=meade@chromium.org
BUG=706206

Review-Url: https://codereview.chromium.org/2777063007
Cr-Commit-Position: refs/heads/master@{#460355}
hugoh
Reland: Do not send redundant selectionchange-events (decouple focus)
Reason for reland:
Update Win7/10 LayoutTests correctly: crbug.com/706119

Background:
Blink tells browser-side when a new <input>-element gets focus.
The information is passed in the
ViewHostMsg_TextInputStateChanged-message.

Problem:
With current logic, RenderFrameImpl::didChangeSelection is
called twice so two ViewHostMsg_TextInputStateChanged-messages
are sent to browser-side:
 (1) when focus leaves an <input>-field (unnecessary!).
 (2) when focus enters another <input>-field.

Worse, also the web page gets two selectionchange events.
The first one is immediately invalid so the webpage should
not react to it.

(1) happens because FocusController::setFocusedElement()
always clears the selection when a new element gets focus.

Solution:
When JavaScript moves focus to an element, element.focus(),
and when the user moves focus using tab-key navigation or
mouse, we don't clear the old selection (we hide it). This
means, we only send one selectionchange event, not two, for
each caret jump (as in Firefox).

Test updates:
1. Check for one selectionchange event, not two.
2. LayoutTests' trees now expect the "hidden" selection.
3. A new test in WebFrameTest.cpp tests tab-key navigation.

Follow-up will remove the remaining redundant clears:
crbug.com/692898 (tab jumps to non-editable elements).

BUG=678601, 679635, 699015
TEST=In content_shell, select some text in an <input>-field,
     click another <input>-field (move focus).
     Notice: one selectionchange event is fired.

Review-Url: https://codereview.chromium.org/2616623002
Cr-Commit-Position: refs/heads/master@{#460314}
mstensho
Stop appending fragmentainer groups when flow thread offset approaches infinity.
The final column height is a function of the difference between the logical
bottom and logical top of the flow thread portion of a given fragmentainer
group. If the logical top is LayoutUnit::max(), we know for sure that the
bottom won't be any larger than that. Just give up in such cases (and keep
using the current fragmentainer group), rather than ending up dividing by zero.

BUG=703543

Review-Url: https://codereview.chromium.org/2784493002
Cr-Commit-Position: refs/heads/master@{#460284}
bratell
Remove the wrapper functions content::RecordAction et al
content::RecordAction and content::RecordComputedAction no longer
add any value (they used to do thread hopping) so replace them with
direct calls to base::RecordAction and base::RecordComputedAction.

Also remove includes and using declarations from files not using the
functions at all.

BUG=601483
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2771233002
Cr-Commit-Position: refs/heads/master@{#460037}
rune
Add separate trace events for recalcStyle and rebuildLayoutTree.
When style recalc and layout tree building is fully separated, it will
be valuable to measure them separately as well.

R=nainar@chromium.org,esprehn@chromium.org
BUG=595137

Review-Url: https://codereview.chromium.org/2779573002
Cr-Commit-Position: refs/heads/master@{#460027}
hugoh
Do not send redundant selectionchange-events (decouple focus)
Background:
Blink tells browser-side when a new <input>-element gets focus.
The information is passed in the
ViewHostMsg_TextInputStateChanged-message.

Problem:
With current logic, RenderFrameImpl::didChangeSelection is
called twice so two ViewHostMsg_TextInputStateChanged-messages
are sent to browser-side:
 (1) when focus leaves an <input>-field (unnecessary!).
 (2) when focus enters another <input>-field.

Worse, also the web page gets two selectionchange events.
The first one is immediately invalid so the webpage should
not react to it.

(1) happens because FocusController::setFocusedElement()
always clears the selection when a new element gets focus.

Solution:
When JavaScript moves focus to an element, element.focus(),
and when the user moves focus using tab-key navigation or
mouse, we don't clear the old selection (we hide it). This
means, we only send one selectionchange event, not two, for
each caret jump (as in Firefox).

Test updates:
1. Check for one selectionchange event, not two.
2. LayoutTests' trees now expect the "hidden" selection.
3. A new test in WebFrameTest.cpp tests tab-key navigation.

Follow-up will remove the remaining redundant clears:
crbug.com/692898 (tab jumps to non-editable elements).

BUG=678601, 679635, 699015
TEST=In content_shell, select some text in an <input>-field,
     click another <input>-field (move focus).
     Notice: one selectionchange event is fired.

Review-Url: https://codereview.chromium.org/2616623002
Cr-Commit-Position: refs/heads/master@{#459984}
karlo
Fix for performance regression on high dpi devices.
ComputedStyle::getRoundedInnerBorderFor() could generate negative
content boxes for boxes with no content and sub pixel borders that
round up (eg. 1.5px-1.99px).  Negative content boxes are illegal per
spec, and causes BoxBorderPainter::paintBorderFastPath() to bail,
and performance to be substantially degraded.

This issue would be evident on the paint-offset-changes perftest when
device pixel ratio was set to eg. 1.5.  The issue was introduced in
934becac5daa91ea979fb66e4ae21761ca11ebc9

BUG=692955

Review-Url: https://codereview.chromium.org/2771093003
Cr-Commit-Position: refs/heads/master@{#459770}
rune
Update :in-range/:out-of-range when steppable min/max/value changes.
We called pseudoStateChanged in a lot of cases where it wasn't
necessary. It should suffice to call it for the mentioned pseudo
classes when the min and max attributes changes, or the value is
changed, either as an attribute or as a result of user input.

This should fix the performance regressions in issue 704775.

R=tkent@chromium.org
BUG=704775

Review-Url: https://codereview.chromium.org/2774723004
Cr-Commit-Position: refs/heads/master@{#459733}
sigbjornf
blink_gc_plugin: retire warn-stack-allocated-trace-method option.
As a final(!) step in phasing in the check over trace() methods inside
of STACK_ALLOCATED() classes, remove the detection of the warning option.
It's always on.

R=
BUG=689874

Review-Url: https://codereview.chromium.org/2776033002
Cr-Commit-Position: refs/heads/master@{#459677}
sigbjornf
Remove no-op blink-gc-plugin argument.
Following the clang roll in r455977, the clang blink_gc_plugin always
warns of STACK_ALLOCATED() classes having redundant trace() methods;
drop using the gc-plugin no-op option.

R=
BUG=689874

Review-Url: https://codereview.chromium.org/2776023002
Cr-Commit-Position: refs/heads/master@{#459676}
sigbjornf
Clarify Beacon transmission limit checking.
The implementation of navigator.sendBeacon() imposes a cap on the size
of transmitted beacon payloads. The internal handling of that limit
was not as clear as could be, so attempt to clarify its representation
and handling.

Also clarify the interpretation of a negative cap limit: if a frame's
settings provide a negative value, no transmission limit is imposed.

R=mkwst, tyoshino
BUG=701678

Review-Url: https://codereview.chromium.org/2753863003
Cr-Commit-Position: refs/heads/master@{#459564}
fs
Make resource lookup more uniform in SVGResources::buildResources
Replace the pattern:

if (!ensureResources(resources).setFoo(
        getLayoutSVGResourceById<LayoutSVGResourceBar>(...)))
  treeScopeResources.addPendingResource(...);

with a new pattern using a new attachToResource helper which folds in
the last step (addPendingResource) as well. This makes for less
callsites to adjust when modifying resource lookup.
This also makes the return value of the setFoo(...) methods unnecessary,
so make them return void.

BUG=454767

Review-Url: https://codereview.chromium.org/2772773005
Cr-Commit-Position: refs/heads/master@{#459533}
fs
Add SVGFitToViewBox::hasValidViewBox helper
This encapsulates the use of the 'is valid' flag of SVGRect. This both
makes for more readable code, and should make it easier to transition
away from the 'is valid' flag. (Note: !isSpecified() implies !isValid().)

BUG=703050

Review-Url: https://codereview.chromium.org/2774753004
Cr-Commit-Position: refs/heads/master@{#459520}
sigbjornf
PartitionDumpStats(): reduce stack consumption for 'light' reporting.
Following r456291's lead, avoid putting a large array on the stack for
light stats reporting in PartitionDumpStats(), where it isn't made use
of. This avoids running into stack pressure when sampling memory use
in production builds (on Windows, in particular.)

R=haraken
BUG=704894

Review-Url: https://codereview.chromium.org/2771033006
Cr-Commit-Position: refs/heads/master@{#459498}
sigbjornf
Clear out prefinalizer-allocated vector for conservative GC safety.
It is unsafe to revive dead objects by creating references to them
while in a finalizer, prefinalizer or not. Avoid doing so in
MediaStreamSource::setReadyState(), which MediaStreamComponent's
prefinalizer may end up running.

See associated comment for further details.

R=haraken
BUG=704234

Review-Url: https://codereview.chromium.org/2776473003
Cr-Commit-Position: refs/heads/master@{#459390}
sigbjornf
Simplify pre+post GC ThreadState steps.
No need to involve the ThreadHeap for these, as they're entirely
handled by the ThreadState now.

R=
BUG=671856

Review-Url: https://codereview.chromium.org/2774473003
Cr-Commit-Position: refs/heads/master@{#459373}
fs
Revalidate SMIL animation value after target change
When a target moves in the tree, the animation value was invalidated,
but never revalidated again when the element was reinserted.
Make sure to signal a revalidation if there's an active interval and the
the animation is running after the target element was reinserted.

BUG=701128

Review-Url: https://codereview.chromium.org/2763283002
Cr-Commit-Position: refs/heads/master@{#459150}
fs
Use SVGResources in SVGLayoutTreeAsText writeResources
As the FIXME suggests, this should better reflect the actual state of
the resources resolution by including the cycle-solving step.

Some tests (recursive-clip/mask, clip-path-recursive-call-by-child)
needs to be updated to reflect the change to actually show cycles
having been broken. The rests of the tests are updated to reflect
that LayoutSVGInlineText can't have resources.

BUG=454767

Review-Url: https://codereview.chromium.org/2763363002
Cr-Commit-Position: refs/heads/master@{#459119}
rune
Notify inspector of stylesheet changes when removing tree scopes.
We did not update active stylesheet lists when removing a shadow since
there is no collection to update. However, the inspector expects a
notification since it receives a flat vector of active stylesheets from
all scopes.

Add a m_treeScopesRemoved member to not early return from
updateActiveStyleSheets and still call probe::activeStyleSheetsUpdated.
Unless other tree scopes are dirty, calling the inspector is all that
happens.

R=kochi@chromium.org
BUG=703427

Review-Url: https://codereview.chromium.org/2766373002
Cr-Commit-Position: refs/heads/master@{#459039}
qingchengl
Update expat to 2.2.0 to fix CVE vulnerability.
Security fixes:
    CVE-2016-0718 -- Fix crash on malformed input
    CVE-2016-4472 -- Improve insufficient fix to CVE-2015-1283 /
    CVE-2015-2716 introduced with Expat 2.1.1
    CVE-2016-5300 -- Use more entropy for hash initialization
        than the original fix to CVE-2012-0876
    CVE-2012-6702 -- Resolve troublesome internal call to srand
            that was introduced with Expat 2.1.0
            when addressing CVE-2012-0876 (issue #496)

BUG=703537

Review-Url: https://codereview.chromium.org/2761253002
Cr-Commit-Position: refs/heads/master@{#459025}
sigbjornf
Allow safe per-thread heap compaction UMA reporting.
R=haraken
BUG=704413

Review-Url: https://codereview.chromium.org/2769113003
Cr-Commit-Position: refs/heads/master@{#459024}
mstensho
No default value for AncestorSearchConstraint in locateFlowThreadContainingBlockOf().
The default used to be to bail out and return nullptr if it encountered
something unbreakable. It's better to let callers make a conscious choice here.
Tree-read operations (painting or hit testing, for instance) that call
LayoutObject::locateFlowThreadContainingBlock() are typically interested in
converting from flow thread coordinates to visual coordinates.

This is a defensive CL that only reverts unintended and bad changes from
https://codereview.chromium.org/2748973002 - added a TODO for cases where we
have LayoutState; if we are inside of layout, we should ideally stop at
strictly unbreakable ancestors.

BUG=702978

Review-Url: https://codereview.chromium.org/2764883004
Cr-Commit-Position: refs/heads/master@{#458784}
mpawlowski
Allow building the dump_syms tool on Windows
The Windows target was not ported from gyp, until now.
We're building dump_syms on Windows in Opera so I though I'd share the patch.

BUG=245456

Review-Url: https://codereview.chromium.org/2712423002
Cr-Commit-Position: refs/heads/master@{#458759}
sigbjornf
Revert of MediaStreamSource: verify unlocked state when finalizing. (patchset #1 id:1 of https://codereview.chromium.org/2741663004/ )
Reason for revert:
Diagnosis completed, reverting (cf. https://bugs.chromium.org/p/chromium/issues/detail?id=682945#c48 )

Original issue's description:
> MediaStreamSource: verify unlocked state when finalizing.
>
> To diagnose an audio thread crash condition, verify that the lock
> over audio consumers that MediaStreamSource keeps, isn't held when it is
> being finalized. If it is, then the audio thread is active using the
> MediaStreamSource object..which is not a well-formed state to be in.
>
> R=
> BUG=682945
>
> Review-Url: https://codereview.chromium.org/2741663004
> Cr-Commit-Position: refs/heads/master@{#456029}
> Committed: https://chromium.googlesource.com/chromium/src/+/c662576c8bb7cecef0dd9a699112fa5cc4b6ab79

TBR=hongchan@chromium.org,haraken@chromium.org,rtoy@chromium.org,guidou@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=682945

Review-Url: https://codereview.chromium.org/2765073004
Cr-Commit-Position: refs/heads/master@{#458744}
sigbjornf
Revert of Lock out GCs while iterating over MediaStreamSource audio consumers. (patchset #1 id:1 of https://codereview.chromium.org/2761463002/ )
Reason for revert:
Revert this check, no longer needed (cf. https://bugs.chromium.org/p/chromium/issues/detail?id=682945#c48 )

Original issue's description:
> Lock out GCs while iterating over MediaStreamSource audio consumers.
>
> Attempt to diagnose a crash condition by locking out main thread GCs
> while the audio thread propagates consumeAudio() updates.
>
> R=haraken
> BUG=682945
>
> Review-Url: https://codereview.chromium.org/2761463002
> Cr-Commit-Position: refs/heads/master@{#457753}
> Committed: https://chromium.googlesource.com/chromium/src/+/e78674d2467706fa8634f8542251591d1d358b57

TBR=haraken@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=682945

Review-Url: https://codereview.chromium.org/2768683004
Cr-Commit-Position: refs/heads/master@{#458716}
sigbjornf
Revert of Revert "Pull AudioDestinationConsumer off the Blink GC heap." (patchset #1 id:1 of https://codereview.chromium.org/2757883002/ )
Reason for revert:
Experiment finished, we do want bb9b04fe09 (cf. https://bugs.chromium.org/p/chromium/issues/detail?id=682945#c48 )

Original issue's description:
> Revert "Pull AudioDestinationConsumer off the Blink GC heap."
>
> This reverts commit bb9b04fe0965eeb09f229f7a727fe7235add810f,
> attempting to diagnose root crash cause.
>
> R=rtoy,haraken
> BUG=682945
>
> Review-Url: https://codereview.chromium.org/2757883002
> Cr-Commit-Position: refs/heads/master@{#457833}
> Committed: https://chromium.googlesource.com/chromium/src/+/937ebc1a2de7ac71ec1de4c6bb1ed7a6331e4683

TBR=haraken@chromium.org,hongchan@chromium.org,rtoy@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=682945

Review-Url: https://codereview.chromium.org/2762413004
Cr-Commit-Position: refs/heads/master@{#458700}
rune
Make all setNeedsReattachLayoutTree happen from updateStyle.
The setNeedsReattachLayoutTree calls which were done outside of
updateStyle were all accompanied by a NeedsReattachStyleChange for the
node marking the ancestor chain for recalc. Therefore we can simply
mark for re-attachment inside the recalcStyle pass instead.

Enforce the invariant by introducing a DCHECK that the we are inside
updateStyleAndLayoutTree, and that the shadow DOM distribution is
up-to-date.

R=nainar@chromium.org,esprehn@chromium.org
BUG=595137

Review-Url: https://codereview.chromium.org/2760233004
Cr-Commit-Position: refs/heads/master@{#458683}
sigbjornf
OfflineAudioContext: add missing suspendIfNeeded() call.
R=haraken,rtoy
BUG=704012

Review-Url: https://codereview.chromium.org/2760323002
Cr-Commit-Position: refs/heads/master@{#458656}
rune
Updating :in-range should not rely on validation.
m_validityIsDirty is not related to isInRange() and isOutOfRange().
This fixes sibling style invalidation using invalidation sets for
:in-range and :out-of-range changes when value changes through
setAttribute.

R=tkent@chromium.org
BUG=699884

Review-Url: https://codereview.chromium.org/2764023003
Cr-Commit-Position: refs/heads/master@{#458576}
sigbjornf
Enable idle GC for worker thread heaps.
Idle task processing is now supported on threads other than
the main thread, hence go ahead and enable idle GCs for
worker thread heaps.

R=haraken
BUG=702902

Review-Url: https://codereview.chromium.org/2765843002
Cr-Commit-Position: refs/heads/master@{#458405}
mostynb
LinkedStack.h is no longer used, remove it
BUG=none
NO_DEPENDENCY_CHECKS=true

Review-Url: https://codereview.chromium.org/2761853003
Cr-Commit-Position: refs/heads/master@{#458376}
sigbjornf
Check detached status before attempting to clear drag transfer state (reland.)
Speculatively try to address failing access of dragState() when
clearing out state after 'dragend' has been dispatched.

R=dcheng
BUG=702516

Review-Url: https://codereview.chromium.org/2759603002
Cr-Original-Commit-Position: refs/heads/master@{#457993}
Committed: https://chromium.googlesource.com/chromium/src/+/a995166eab58770b85268173bf9b34e4bc276171
Review-Url: https://codereview.chromium.org/2759603002
Cr-Commit-Position: refs/heads/master@{#458354}
sigbjornf
MouseEventManager: reset drag state upon detaching.
If an ongoing drag detaches the frame of the dragged element, have
the MouseEventManager reset the drag state while handling the detachment
from the frame. Otherwise the DragState will retain a reference to
the drag source (and its document) for too long, triggering a reported
leak on shutdown.

R=
BUG=703057

Review-Url: https://codereview.chromium.org/2762613002
Cr-Commit-Position: refs/heads/master@{#458116}
mstensho
getClientRects() shouldn't clip against any ancestors.
Inside multicol we used to clip against the column box of each fragment. Since
fragments don't really exist in our implementation (we rather have this tall
flow thread which we slice into columns, when appropriate), we still need to
clip in the block direction, to properly fake the fragments.

Removed fragmentainerInFlowThread(), since it's no longer used. Added a
parameter to the clip rectangle calculation code, to be able to only limit the
clip rectangles in the block direction.

BUG=685927

Review-Url: https://codereview.chromium.org/2750153002
Cr-Commit-Position: refs/heads/master@{#458109}
bratell
Add include guards to header files in content missing them
Review-Url: https://codereview.chromium.org/2759103002
Cr-Commit-Position: refs/heads/master@{#458053}
sigbjornf
Check detached status before attempting to clear drag transfer state.
Speculatively try to address failing access of dragState() when
clearing out state after 'dragend' has been dispatched.

R=dcheng
BUG=702516

Review-Url: https://codereview.chromium.org/2759603002
Cr-Commit-Position: refs/heads/master@{#457993}
mstensho
Need to notify the multicol machinery when floats have been laid out.
We may have to trigger creation of additional fragmentainer groups, in case
there's no regular in-flow content that does it for us.

Review-Url: https://codereview.chromium.org/2762483002
Cr-Commit-Position: refs/heads/master@{#457978}
fs
Rework SMIL animation target invalidation
The invalidation of a timed/animation element's target "tuple" (element,
attribute name, attribute type) is somewhat complex.
Rework it to use two methods that can be overridden rather than having
overrides for each setTargetElement/setAttribute{Name,Type}. This allows
to get rid of complicated things like the checkInvalidCSSAttributeType()
in SVGAnimateElement. It should also make the code slightly easier to
reason about when it comes to what state gets invalidated where.

BUG=641437,701128

Review-Url: https://codereview.chromium.org/2746013007
Cr-Commit-Position: refs/heads/master@{#457972}
sigbjornf
Correctly track cross-thread pending FetchEvents.
ServiceWorkerGlobalScopeProxy is an object that resides on the
main thread heap, but is passed to the embedder and called
on the (service) worker thread. As the object is GC managed
by the main thread, the worker thread cannot update the proxy
object with references to heap objects residing in its heap,
as the per-thread heap design assumes that each heap only keeps
local heap references (via Member<T> and similar.) References
across heaps must instead be kept and handled by explicit
CrossThreadPersistent<> references.

This per-thread heap rule was not being followed for the tracking
of pending FetchEvents; adjust the map representation to do so.

R=haraken
BUG=702527

Review-Url: https://codereview.chromium.org/2752203005
Cr-Commit-Position: refs/heads/master@{#457970}
fs
Inherit 'viewBox' into view spec if it is valid
When constructing a view spec from a fragment identifier, the
(negated) hasEmptyViewBox() condition was used to determine if the
viewBox value should be set from the element. This condition however
will equate to:

  !(is-valid && is-empty) => !is-valid || !is-empty

meaning that invalid viewBox values would be transferred. In the case
where a <view> element without a 'viewBox' specified was referenced, the
'viewBox' value from the root could be overwritten by an invalid one.

Use only the validity of the 'viewBox' to determine if the value should
be inherited.

BUG=702380

Review-Url: https://codereview.chromium.org/2753773009
Cr-Commit-Position: refs/heads/master@{#457921}
mstensho
Consistent pagination strut propagation policies.
There's no break opportunity between a spanner and the next block in a column.
Also no break opportunity between a float and an in-flow block. The spec is a
bit vague here, but our implementation certainly doesn't support it.

We have to prevent strut propagation in such cases. If the first piece of
content inside the block (e.g. a line) doesn't fit inside the current
fragmentainer, it's the line that needs to be pushed, not the block.

One of the tests included here used to cause a DCHECK failure.

Review-Url: https://codereview.chromium.org/2746013010
Cr-Commit-Position: refs/heads/master@{#457888}
mstensho
Always include flow thread overflow in the last column set.
Also do this if the last column set is followed by one or more column spanner
placeholders, or we'd just risk losing content in such situations.

BUG=699029

Review-Url: https://codereview.chromium.org/2758663003
Cr-Commit-Position: refs/heads/master@{#457882}
mstensho
Push the top margin of floats past all useless fragmentainers.
The top margin of a float is not to be split across fragmentainer boundaries if
it can be avoided. We had code to push the margin over to the next
fragmentainer if we were out of space, but we may actually have to push it all
the way to the next fragmentainer *group* (i.e column row) in some cases.

calculatePaginationStrutToFitContent() helps us get there. That's the method we
use to push oversize content (lines and unbreakable blocks) to a better place,
so let's use it for margins too.

Review-Url: https://codereview.chromium.org/2759693002
Cr-Commit-Position: refs/heads/master@{#457881}
sigbjornf
Revert "Pull AudioDestinationConsumer off the Blink GC heap."
This reverts commit bb9b04fe0965eeb09f229f7a727fe7235add810f,
attempting to diagnose root crash cause.

R=rtoy,haraken
BUG=682945

Review-Url: https://codereview.chromium.org/2757883002
Cr-Commit-Position: refs/heads/master@{#457833}
rune
Floats are also out-of-flow considering white-space.
When blocks in inlines break lines, we don't create LayoutObjects for
whitespace Text nodes following those blocks unless they are out-of-flow.
However, we incorrectly didn't skip floats looking for such blocks
which caused us to drop whitespace LayoutObjects after floats.

R=mstensho@opera.com
BUG=569786

Review-Url: https://codereview.chromium.org/2757563006
Cr-Commit-Position: refs/heads/master@{#457762}
sigbjornf
Lock out GCs while iterating over MediaStreamSource audio consumers.
Attempt to diagnose a crash condition by locking out main thread GCs
while the audio thread propagates consumeAudio() updates.

R=haraken
BUG=682945

Review-Url: https://codereview.chromium.org/2761463002
Cr-Commit-Position: refs/heads/master@{#457753}
rune
Skip ruleset invalidations for SubtreeStyleChange roots.
When the TreeScope invalidation root is already with SubtreeStyleChange
there is no need to schedule ruleset invalidations for that scope. We
did not end up scheduling the invalidation sets, but went through a lot
of unnecessary steps in scheduleInvalidationsForRuleSets(). Instead,
just return early.

Added some more tests and corrected typos from
https://crrev.com/5fef4a38

Review-Url: https://codereview.chromium.org/2751193004
Cr-Commit-Position: refs/heads/master@{#457715}
mstensho
Make the gdb Vector pretty-printer work with Python version >= 3.
In iterators it's now called __next__(), not next(), apparently.

Review-Url: https://codereview.chromium.org/2754473007
Cr-Commit-Position: refs/heads/master@{#457711}
rune
Remove incorrect styleResolver() checks.
Whether the StyleResolver is created or not does no longer tell if we
have usable invalidation sets or not. Removing SubtreeStyleChange which
is presumably not necessary anymore.

Add a check for not scheduling any invalidation sets if the document is
already marked for full recalc.

Review-Url: https://codereview.chromium.org/2749273004
Cr-Commit-Position: refs/heads/master@{#457383}
tsniatowski
Fix android key event timestamps
Pass a Java long to C++ as a jlong type, not a C++ long which can have a
different size to avoid broken / negative event timestamp values.
ImeAdapter's Java side uses "long" in SendKeyEvent, so the C++ side must
use a jlong or int64_t, and not a C++ long. Otherwise things don't work
well when system uptime is over 2^31ms (~25 days).

Additionally, do not do an extra divide-by-1000 when the used helper
function will do the milliseconds to seconds conversion already, so the
timestamps are correctly measured in milliseconds.

The resulting keyboard event timestamps end up nicely sane and positive,
and no longer clamped to 0 in PerformanceBase.cpp.

BUG=701726
R=aelias@chromium.org

Review-Url: https://codereview.chromium.org/2755453004
Cr-Commit-Position: refs/heads/master@{#457369}
mstensho
Strictly unbreakable objects need to prevent interaction with the outside.
A strictly unbreakable object (i.e. when getPaginationBreakability() ==
ForbidBreaks) has no valid break points inside. This is the case for e.g.
images, writing mode roots and scrollable objects. If such an object is in the
containing block chain between two nested multicol containers, column content
in multicol containers on the inside shouldn't interact with columns in the
enclosing multicol container.

BUG=698686

Review-Url: https://codereview.chromium.org/2748973002
Cr-Commit-Position: refs/heads/master@{#457177}
mstensho
Remove old flow-thread aware code from computeLogicalLocationForFloat().
CSS regions supported variable fragmentainer widths. However, multicol doesn't,
so the code is no longer necessary.

Review-Url: https://codereview.chromium.org/2748963002
Cr-Commit-Position: refs/heads/master@{#457149}
sigbjornf
sendBeacon(): once transmission allowance has been reached, always fail.
Fix allowance checking logic for Beacon transmissions upon reaching
the limit. If the allowance limit was 'perfectly' exhausted after N
Beacon requests, subsequent Beacon requests would go ahead without
the (now zero) allowance limit imposed.

R=mkwst
BUG=701678

Review-Url: https://codereview.chromium.org/2751953002
Cr-Commit-Position: refs/heads/master@{#457088}
sigbjornf
Accurate transfer of SerializedScriptValue allocation costs.
r456009 added transferring of allocation costs for a
SerializedScriptValue and any array buffers that it refers to,
transferring that cost from one v8 context to another as part
of a postMessage()

The handoff 'protocol' provided there fell short in that it could
fail to subtract transferable (array buffer contents) costs in
the source context, or end up doing it twice if the postMessage()
failed. Bookkeeping confusion resulted.

Rework the mechanism by instead having ArrayBufferContents keep
track of its external allocation cost registration status, so as
to prevent double discounting. Along with that, it is both safe
and accurate to unregister all allocation costs prior to
transfer. Should the value successfully be posted to its target
context, cost will be registered there. And if not, the value will
be destructed (..but without discounting allocation cost yet again.)

R=jbroman,haraken
BUG=700353

Review-Url: https://codereview.chromium.org/2741793003
Cr-Commit-Position: refs/heads/master@{#456800}
sigbjornf
Pull AudioDestinationConsumer off the Blink GC heap.
The AudioDestinationConsumer interface and its single implementation
does not meet the bar for being on the Blink GC heap. It doesn't cause
harm to have them there, but in order to diagnose an unexplained
failure, pull these objects off the heap.

We may want to restore them to the Blink GC heap once the issue has
been resolved.

R=
BUG=682945

Review-Url: https://codereview.chromium.org/2748133003
Cr-Commit-Position: refs/heads/master@{#456736}
fs
Dirty pres. attribute style on <svg> dimension change when not attached
When an <svg> wasn't attached, and it had its 'width'/'height' mutated
via the SVG DOM interfaces (SVG*Length), presentation attribute style
would not be dirtied. This could lead to an incorrect size being
computed in some cases.
Ensure that presentation attribute style is always updated if the <svg>
element is not attached.

BUG=701075

Review-Url: https://codereview.chromium.org/2747153002
Cr-Commit-Position: refs/heads/master@{#456702}
fs
Invalidate SVG 'transform' pres. attribute style even if not attached
When the 'transform' attribute was manipulated via its SVG DOM
representation (SVGTransformList), the
presentation-attribute-style-is-dirty flag would not be set unless the
element had been attached.
Reorder the contents of the 'transform' branch in
SVGGraphicsElement::svgAttributeChanged so that the presentation
attribute style is always dirtied regardless of attachment status.

BUG=701075

Review-Url: https://codereview.chromium.org/2745053005
Cr-Commit-Position: refs/heads/master@{#456696}
fs
Remove argument to LayoutSVGResourceGradient::collectGradientAttributes
We can assume that element() is non-null, and just cast it in the
overriding implementations.
Move the synchronizeAnimatedSVGAttribute(...) calls into actual
attribute collection, so that it applies to all elements in the
inheritance chain.
Also rewrite the lengthy comment, because gradient building has changed
significantly from what it describes, and attribute collection now
precedes the actual Gradient construction. Replicate the new comment to
the similar place for <pattern>s.

BUG=661598

Review-Url: https://codereview.chromium.org/2749593002
Cr-Commit-Position: refs/heads/master@{#456662}
fs
Add Gradient::addColorStops method
This seems a better fit on Gradient than on LayoutSVGResourceGradient.

Review-Url: https://codereview.chromium.org/2749583002
Cr-Commit-Position: refs/heads/master@{#456504}
sigbjornf
Turn IDBTransaction into the ContextLifecycleObserver it needs to be.
Revert r453574's switch to using ContextClient for IDBTransaction,
going back to ContextLifecycleObserver. This is needed in order for
IDBTransaction's debug checks upon destruction to be able to safely access
the ExecutionContext.

While ContextClient keeps a weak reference to its ExecutionContext,
accessing it from a destructor assumes that weak processing for the
ContextClient will already have run (and cleared out the ExecutionContext
weak reference, if needs be.) This assumes that weak processing will
always run, which it won't if the ContextClient and ExecutionContext are
determined to be garbage during the same GC.

Update ContextLifecycleObserver comments to mention this subtle detail.

R=jsbell,haraken
BUG=699819

Review-Url: https://codereview.chromium.org/2742393002
Cr-Commit-Position: refs/heads/master@{#456432}
fs
Remove <filter> from the chainableResourceTags set
We don't actually support inheritance for <filter>, so having it in the
set is of no use.

BUG=661598

Review-Url: https://codereview.chromium.org/2743293002
Cr-Commit-Position: refs/heads/master@{#456380}
fs
Refactor <paint> URL resolution in SVGResources
Hoist the has-url check out of paintingResourceFromSVGPaint(), and
remove |hasPendingResource| - consider all null-returns as having pending
resources. (This means "incorrect" <paint> URL references are considered
pending, just as URL references for other resource types.)

BUG=454767

Review-Url: https://codereview.chromium.org/2746933002
Cr-Commit-Position: refs/heads/master@{#456374}
fs
Move common gradient attribute collection to SVGGradientElement
Move the collection of attributes shared by both gradient types to the
base class (collectCommonAttributes.) Introduce a new helper for looking
up a potential element to inherit attributes from. Restructure the
"collection loop" a bit after the common code has been broken out.
This also means that buildStops() can be made private.

BUG=661598

Review-Url: https://codereview.chromium.org/2741993002
Cr-Commit-Position: refs/heads/master@{#456371}
fs
Use IdTargetObserver in SVGSMILElement
Move SVGSMILElement (target reference) and SVGSMILElement::Condition to
use IdTargetObserver via SVGURIReference::observeTarget.
Simplify the result to avoid needing the lookupEventBase helper.

BUG=661598

Review-Url: https://codereview.chromium.org/2737403003
Cr-Commit-Position: refs/heads/master@{#456367}
sigbjornf
PartitionAlloc: use less stack when dumping stats.
Avoid unnecessary stack usage in PartitionDumpStatsGeneric() for
the intermediate array of sizes used for full stats reporting.

Full stat dumps are currently only made use of by unit tests,
light reports do not make really use of an intermediate array and
allocation can be avoided for those. Addressing some reported
stack overflow failures (Windows.)

R=haraken
BUG=699893, 699922

Review-Url: https://codereview.chromium.org/2741853007
Cr-Commit-Position: refs/heads/master@{#456291}
rune
Track lastTextNode during rebuildLayoutTree.
We keep track of last seen text node for more efficient whitespace
re-attachment. When style recalc and layout tree building was split,
the text node is still tracked during recalc, stored in a hash map, and
retreived when needed during layout tree building.

However, the text nodes are also traversed during layout tree building
so that we can track the nodes during that phase instead.
StyleReattachData is removed and this CL reverts back to using the
m_nonAttachedStyle map for ComputedStyle.

The comment about reversed traversal of children for avoiding n^2
performance is moved to rebuildChildrenLayoutTrees() since that's where
the issue is. We should be able to do the child recalc first-to-last
now if we want to.

R=nainar@chromium.org,esprehn@chromium.org
BUG=595137

Review-Url: https://codereview.chromium.org/2740823005
Cr-Commit-Position: refs/heads/master@{#456047}
rune
Initial containing block for print not affected by page zoom.
The page zoom factor is not applied to the ICB for printing, yet the
ICB basis for media queries and viewport units were. Use 1 as a page
zoom factor in viewportSizeForViewportUnits and use that method to get
the size for the ICB for evaluating media queries.

BUG=699014,699910

Review-Url: https://codereview.chromium.org/2738173002
Cr-Commit-Position: refs/heads/master@{#456040}
sigbjornf
MediaStreamSource: verify unlocked state when finalizing.
To diagnose an audio thread crash condition, verify that the lock
over audio consumers that MediaStreamSource keeps, isn't held when it is
being finalized. If it is, then the audio thread is active using the
MediaStreamSource object..which is not a well-formed state to be in.

R=
BUG=682945

Review-Url: https://codereview.chromium.org/2741663004
Cr-Commit-Position: refs/heads/master@{#456029}
hugoh
Remove LayoutTests that test the now unsupported user-select: ignore
BUG=none

Review-Url: https://codereview.chromium.org/2740953004
Cr-Commit-Position: refs/heads/master@{#456028}
wdzierzanowski
Stop assuming anything about result of MFStartup()
MFStartup() usually returns S_OK.  However, being a system library
function it doesn't have to, and we have no control over it.  It can
return an error when something goes wrong within Media Foundation, or
simply on an "N" edition of Windows that doesn't even have Media
Foundation.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2735783002
Cr-Commit-Position: refs/heads/master@{#456026}
sigbjornf
postMessage(): transfer allocation costs along with value.
A MessageEvent's data value will in some cases hold on to significant
amounts of off-heap memory, so we take care of registering that
external allocation with v8, so that it can be taken into consideration
by the GC triggering logic.

However, when posting a message to another context, we must arrange for
its total 'external allocation' to be associated with the target context.
Including the sizes of any transferables (array buffers), so balance the
books more accurately by also transferring the external allocation cost
of those transferables.

R=
BUG=698981

Review-Url: https://codereview.chromium.org/2734173002
Cr-Commit-Position: refs/heads/master@{#456009}
fs
Remove side-effects from the SVGTreeScopeResources constructor
SVGTreeScopeResources and SVGDocumentExtensions carries disjoint state,
so this side-effect is not required.

Review-Url: https://codereview.chromium.org/2739063004
Cr-Commit-Position: refs/heads/master@{#455826}
fs
Fold SVGDocumentExtensions::reportError into only user
This method only had a single user, and it seems like it could just call
Document::addConsoleMessage directly.
Also remove a stray 'public' access specifier by moving the single
method in it up a bit in the file.

Review-Url: https://codereview.chromium.org/2738233002
Cr-Commit-Position: refs/heads/master@{#455802}
sigbjornf
Remove some dated Member friendships.
CollectionBackingTraceTrait no longer exists, and Visitor only
needs to be friend with WeakMember<>.

R=
BUG=

Review-Url: https://codereview.chromium.org/2745433003
Cr-Commit-Position: refs/heads/master@{#455786}
fs
Use IdTargetObserver in SVGUseElement
Change SVGUseElement to use the observeTarget() helper from
SVGURIReference. Since SVGUseElement has some additional requirements
for its reference management, a more low-level observeTarget() variant
is exposed.
To facilitate this change, clearShadowTree() is renamed to
clearResourceReference(), and the shadow tree tear-down is hoisted out
of it.

BUG=661598

Review-Url: https://codereview.chromium.org/2744613002
Cr-Commit-Position: refs/heads/master@{#455769}
fs
Use IdTargetObserver in SVGFEImageElement
Change SVGFEImageElement to use the observeTarget() helper from
SVGURIReference.
A slight change in behavior for when a load is initiated for a potential
image resource is made. Instead of using a "failed element lookup and a
non-existing id" as the condition, use "failed element lookup and non-
local resource reference".
Also add a new method clearImageResource() and put the tear-down for
the image resource, and change a use of ownerDocument() to just
document().

BUG=661598

Review-Url: https://codereview.chromium.org/2740003003
Cr-Commit-Position: refs/heads/master@{#455765}
fs
Disable virtual/gpu-rasterization/images/cross-fade-background-size.html
Minor differences on Windows bots.

TBR=xhwang@chromium.org
NOTRY=true
BUG=699573

Review-Url: https://codereview.chromium.org/2741693002
Cr-Commit-Position: refs/heads/master@{#455714}
fs
Store element reference for event-bases too
Rather than using the (obviously "racy") technique of looking up the
event-base element again when disconnecting from it, store the reference
on connect (sharing storage with the sync-base element since they are
mutual exclusive) and use it to disconnect properly.

BUG=641437

Review-Url: https://codereview.chromium.org/2739893002
Cr-Commit-Position: refs/heads/master@{#455699}
mstensho
Text control elements should contain all (shadow DOM) children.
For instance, INPUT type="search" elements allow styling of the cancel button,
via a ::-webkit-search-cancel-button pseudo element selector. We don't want authors
to be able to escape the containing INPUT element by styling the cancel button as
position:absolute, etc.

Force INPUT and other text control elements to be in the containing block chain of
all its descendants. This should be a good idea in general (and at least harmless),
and there's also C++ code [1] that essentially assumes that it is so.

Since this change makes canContainFixedPositionObjects() in LayoutObject and
ComputedStyle even more different than they used to be, we need to change some
code from using the one in ComputedStyle to the one in LayoutObject.

Two existing tests in fast/forms/ had to be updated, since they were adding together
offsetLeft of an INPUT element and offsetLeft of something inside the INPUT element
in a way that used to work by accident. Use getBoundingClientRect() instead, since
the test ultimately wants absolute coordinates anyway.

[1] See ThemePainterDefault::paintSearchFieldCancelButton()

BUG=685527
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2733593002
Cr-Commit-Position: refs/heads/master@{#455644}
fs
Add a new mechanism for watching SVGElement 'href' targets
This CL adds a new mechanism for watching elements referenced via 'href'
attributes. It uses IdTargetObserver as the basis adding a callback for
notification.
This is a step away from relying on SVGTreeScopeResources for tracking
of "pending" elements for these use cases. Each element is instead does
its own tracking via the relevant TreeScope. This will eventually mean
that the buildPendingResourcesIfNeeded mechanism can be removed.

SVGTextPathElement and SVGMPathElement are updated to use this new
scheme. Other uses will be replaced in future CLs.

BUG=661598

Review-Url: https://codereview.chromium.org/2737653006
Cr-Commit-Position: refs/heads/master@{#455584}
karlo
Account for borders and padding when calculating background tile size.
This is required when sub-pixel borders and padding are used, otherwise
the tile size may become one pixel too small, causing rendering artifacts.
Test case attached.

BUG=686435
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2689993003
Cr-Commit-Position: refs/heads/master@{#455454}
mstensho
Search the entire subtree when looking for the end of an inline continuation chain.
Inlines may be nested, so we may not find the last inline in the chain as a
direct child of the anonymous blocks. We need to search the entire subtree.
Don't do this with anonymous blocks that wrap block children (the block-level
DOM children of the inline-level objects), though. We're not going to find
anything interesting there.

This fix is speculative; the original bug report didn't come with a test case.

BUG=662767

Review-Url: https://codereview.chromium.org/2738503004
Cr-Commit-Position: refs/heads/master@{#455420}
sigbjornf
XMLHttpRequest: return null upon failing responseArrayBuffer allocation.
The allocation of a response ArrayBuffer may fail, a large enough
contiguous chunk of memory simply not being available from the
underlying allocator. The spec [1] now admits allocation failure as a
possibility, allowing the return of a null buffer if so.

Update our implementation accordingly, returning null rather than
failing hard with an OOM.

1 - https://xhr.spec.whatwg.org/#arraybuffer-response

R=haraken,yhirano
BUG=673211

Review-Url: https://codereview.chromium.org/2730943002
Cr-Commit-Position: refs/heads/master@{#455398}
rune
Move ::selection invalidation to applyPseudoStyleChanges.
Removed need for separate StyleDifference constant for ::selection and
otherwise simplified the code.

R=mstensho@opera.com

Review-Url: https://codereview.chromium.org/2732113002
Cr-Commit-Position: refs/heads/master@{#455262}
rune
Make ::first-line invalidation work when added or removed.
We were only invalidating ::first-line properly when both old and new
ComputedStyle contained ::first-line styles. Now, instead call
setNeedsLayoutAndPrefWidthsRecalc to trigger changes when either old or
new ComputedStyle does not have ::first-line style.

The ::first-line invalidation is moved from Element to LayoutObject,
and unnecessary traversal code removed.

I have not been able to come up with a case where we need to compare
PseudoIdFirstLineInherited style, so diffing that is removed.

R=mstensho@opera.com
BUG=562418,564239,689979

Review-Url: https://codereview.chromium.org/2728383002
Cr-Commit-Position: refs/heads/master@{#455088}
fs
Make HashTraits<QualifiedName>::emptyValue return a const reference
This avoids unnecessary construction of a temporary object, saving a few
cycles and some code-space (~2k on x86-64.)
Also inline QualifiedName::null for some additional savings.

Review-Url: https://codereview.chromium.org/2702403013
Cr-Commit-Position: refs/heads/master@{#455069}
fs
Don't double-resolve URL in TextTrackLoader::load
The caller (HTMLTrackElement::loadTimerFired) will already have
resolved the URL.

BUG=466083

Review-Url: https://codereview.chromium.org/2731953002
Cr-Commit-Position: refs/heads/master@{#455050}
mstensho
Allow zero-height fragmentainers.
We used to assert against this, but we really can't, since there are
legitimiate reasons for a fragmentainer (and fragmentainer groups and column
sets) to have zero height, e.g. when its content is zero-height.

BUG=698359

Review-Url: https://codereview.chromium.org/2737503002
Cr-Commit-Position: refs/heads/master@{#455040}
sigbjornf
TestInterfaces: support delegate clearing.
Following r454834, the implementation of SetDelegate() also needs to
handle resetting of the test delegate.

R=
BUG=698713

Review-Url: https://codereview.chromium.org/2738513004
Cr-Commit-Position: refs/heads/master@{#455030}
fs
Improve handling of duplicate id's for SVG resources
This CL attempts to fix the known issues with duplicate id's and SVG
resources. There are a variety of cases where this fails, and the added
tests attempt to cover those as well as possible.

The know bugs generally stem from:

 * Resources being registered in (layout) tree order after style
   recalc. This for instance mean that any later defined resources
   will shadow any earlier appearing resource (which would the correct
   one.)

 * Removing a resource container does not consider that there could now
   be another resource that is no longer shadowed by the one removed.
   Together with the above, this also meant that removing a resource
   from the DOM could invalidate, and break, all occurences of said
   resource.

This CL attempts to handle the above by factoring the result of
getElementById into the equation, considering it to be "the truth" when
possible/required. The new methods registerResource and
unregisterResource form the basis of this, codifying the two basic
operations on which the tracking is built. The tracking of the
'registered' flag from LayoutSVGResourceContainer is now handled by
SVGTreeScopeResources. While this flag could be considered an
optimization at this point, DCHECKs are added to attempt to keep it
true to it's purpose.

BUG=454767

Review-Url: https://codereview.chromium.org/2722543002
Cr-Commit-Position: refs/heads/master@{#454951}
bratell
Stop casting HTMLInputElement to HTMLInputElement.
There can be some confusion which cast method to use, the
one for HTMLElements or the one for ListedElements so don't
even bother.

Review-Url: https://codereview.chromium.org/2728403003
Cr-Commit-Position: refs/heads/master@{#454899}
ckulakowski
Add message loop to v8's unittests
When (at least some) v8 unittests are started in bigger batch
we hit v8 garbage collector's incremental marking hard limit.
When it happens v8's engine posts task and it causes crash as
there is no active message loop. This change creates message
loop for v8's unittests to fix this crash.

BUG=695374

Review-Url: https://codereview.chromium.org/2735703003
Cr-Commit-Position: refs/heads/master@{#454898}
sigbjornf
RenderFrameImpl: avoid creating many temporary WebDocuments.
Accessing a property off of a WebFrame's document will entail instantiating
a WebDocument, which implies a WebPrivatePtr<> holding a persistent reference.

Avoid the overhead via some manual CSEing.

R=esprehn,jochen
BUG=

Review-Url: https://codereview.chromium.org/2723083002
Cr-Commit-Position: refs/heads/master@{#454878}
rune
Bit-mask incorrectly removed first-line pseudo bit.
The m_pseudoBits member only contains the 8 bits for the public pseudo
element bits, yet we used a mask to retrieve them. That mask was
incorrectly set to 0x1fe when it should have been 0xff. Anyway, that
mask is unnecessary and removed.

The mask issue caused StylePropagationDiff, returned from
diffPseudoStyles, to be NoChange for pure ::first-line changes. That
NoChange return were the only case which triggered first-line
invalidation properly.

Instead, always check for pseudo style changes in
pseudoStyleCacheIsInvalid. This fixes issue 698451.

The pseudoStyleCacheIsInvalid method has a weird name, has bugs, and
should be put on LayoutObject and called as part of setStyle instead.
That is for follow-up CLs.

R=meade@chromium.org,mstensho@opera.com
BUG=698451

Review-Url: https://codereview.chromium.org/2729373003
Cr-Commit-Position: refs/heads/master@{#454850}
mharanczyk
Avoid fetching RFH from nav handle for not committed navigations.
For devtool use case there is only a need to check if hosts match,
so compareing frame tree node id instead of raw pointers will give
same result.

BUG=697991

Review-Url: https://codereview.chromium.org/2730873002
Cr-Commit-Position: refs/heads/master@{#454849}
karlo
Calculate positioningArea and not just size, for tiling background.
Computing the correct background tiling size when sub-pixel border or
padding is used, requires calculating the full positioning area and not
just size. The actual fix for 686435 is in a followup cl.

BUG=686435
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2690053002
Cr-Commit-Position: refs/heads/master@{#454843}
sigbjornf
WebViewTestProxyBase: clear out main test delegate upon destruction.
The first BlinkTestRunner created is set as the main delegate of test
interfaces along with being set as the delegate of the web view test
proxy object.

When that view test proxy goes away, unregister the main delegate at
the same time as it can no longer be safely accessed.

R=tkent
BUG=698166

Review-Url: https://codereview.chromium.org/2734713002
Cr-Commit-Position: refs/heads/master@{#454834}
mstensho
Isolate strictly unbreakable multicol containers that are nested.
A strictly unbreakable object (i.e. when getPaginationBreakability() ==
ForbidBreaks) has no valid break points inside. This is the case for e.g.
images, writing mode roots and scrollable objects. If such an object is an
inner multicol container, column content inside shouldn't interact with
enclosing columns.

BUG=696726,695535,675070

Review-Url: https://codereview.chromium.org/2729903003
Cr-Commit-Position: refs/heads/master@{#454765}
mmarkowicz
Update views::Textfield cursor color on text color change
views::Textfield::SetTextColor should apply new color to the cursor as well.
Currently this will happen but only after Textfield::OnNativeThemeChanged
is triggered in some way.

BUG=697939

Review-Url: https://codereview.chromium.org/2730623003
Cr-Commit-Position: refs/heads/master@{#454616}
bratell
Remove some unnecessary 'using namespace'
The construct "using namespace" is not allowed by the Chromium
coding style and since these are not even necessary I'm just
removing them.

Review-Url: https://codereview.chromium.org/2729093003
Cr-Commit-Position: refs/heads/master@{#454605}
fs
The WebVTT 'line' settings should be parsed as a float
Per https://w3c.github.io/webvtt/#parse-the-webvtt-cue-settings .
Negative zero is transformed to positive zero.

Also make valid percentages outside of [0, 100] fail quicker.

BUG=697869

Review-Url: https://codereview.chromium.org/2725313002
Cr-Commit-Position: refs/heads/master@{#454587}
rune
Call getUncachedPseudoStyle on correct node for ::selection.
getUncachedSelectionStyle is typically called for the LayoutObject we
are currently painting. This might not be the node the ::selection
style is matched for. Specifically, we request getUncachedSelectionStyle
on LayoutText objects, but we need to match the ::selection style on its
parent element.

This already happened inside getUncachedPseudoStyle, but it's guarded by
a hasPseudoStyle() call for the pseudo element type. In the case where
we pass in a LayoutText, we are relying on the computed style with the
PseudoIdSelection bit set to be propagated down to the LayoutText object.
That does not happen if the style change for the element parent is
NoChange or NoInherit.

Instead find the element for which we are matching ::selection in
getUncachedSelectionStyle instead. The firstAncestorOrSelf() call is
still present in getUncachedPseudoStyle as there may be other pseudo
elements types where we rely on this.

R=mstensho@opera.com
BUG=685174

Review-Url: https://codereview.chromium.org/2727253004
Cr-Commit-Position: refs/heads/master@{#454575}
sigbjornf
Support XMLHttpRequest.send(URLSearchParams)
Update send()'s overloaded set to also include URLSearchParams,
mirroring a recent BodyInit spec addition,

 https://fetch.spec.whatwg.org/#bodyinit

R=yhirano,tyoshino
BUG=694449

Review-Url: https://codereview.chromium.org/2723583005
Cr-Commit-Position: refs/heads/master@{#454571}
rune
needsPaintInvalidation() should not return true for selection.
In [1] we introduced a paint invalidation constant for repainting
selection. needsPaintInvalidation() started to also return true when
only the selection needed paint invalidation. Callers of that method
assumes that true will cause at least a full element repaint which made
us skip setting the diff to invalidate the object and only invalidate
the selection in some cases. Instead, only return true for
PaintInvalidationObject and PaintInvalidationSubtree.

[1] https://crrev.com/eff357ef

R=mstensho@opera.com
BUG=697337

Review-Url: https://codereview.chromium.org/2727843004
Cr-Commit-Position: refs/heads/master@{#454564}
bratell
Remove some unnecessary using namespaces and add include guards
The Chromium Code Style doesn't allow using namespace and when
I looked at the code it seems some of them in layout are not
even needed. This removes the ones that are not needed and
adds explicit scoping at the one place it's needed.

Also adding a missing header guard and remove an unused enum.

Review-Url: https://codereview.chromium.org/2722313007
Cr-Commit-Position: refs/heads/master@{#454563}
msimonides
Add View::AddedToWidget and RemovedFromWidget.
Many views implement ViewHierarchyChanged to perform some setup once a
Widget becomes available to them. This results with code duplication.
With these new methods there will be no need to implement
ViewHierarchyChanged for the common case.

BUG=5191

Review-Url: https://codereview.chromium.org/2713643002
Cr-Commit-Position: refs/heads/master@{#454542}
bratell
Skip a few "using namespace" that we don't really need.
The Chromium coding style doesn't allow "using namespace" at all
and since the code will eventually adapt and they are causing
issues with some experiments I rather remove them now.

Review-Url: https://codereview.chromium.org/2729583004
Cr-Commit-Position: refs/heads/master@{#454449}
mstensho
Respect constrained height on nested multicol containers.
If there's no more space in an inner multicol container (according to e.g. its
height or max-height), don't create any additional fragmentainer groups (i.e.
column rows).

The spec isn't clear here, but this change moves us closer to Edge, and also
eliminates cases where we'd previously end up with pathological numbers of
fragmentainer groups.

Also flipped the logic in hasFragmentainerGroupForColumnAt(), and renamed it to
needsNewFragmentainerGroupAt().

BUG=688158

Review-Url: https://codereview.chromium.org/2725943003
Cr-Commit-Position: refs/heads/master@{#454411}
fs
Add a use-counter for transforms using the reference box on SVG element
For gauging the risk of implementing 'transform-box' proper - mostly
with an eye towards the initial value.

BUG=595829

Review-Url: https://codereview.chromium.org/2725973003
Cr-Commit-Position: refs/heads/master@{#454408}
bratell
Avoid name collision for secondsPerHour/secondsPerMinute
There are other places declaring the names secondsPerHour
and secondsPerMinute. They don't collide right now, but by
moving these to a smaller namespace I can avoid collisions
in some experiments.

Review-Url: https://codereview.chromium.org/2730683004
Cr-Commit-Position: refs/heads/master@{#454384}
fs
Fix core/frame PRESUBMIT for UseCounter changes
The start marker was missing a piece after
https://codereview.chromium.org/2586863002

Review-Url: https://codereview.chromium.org/2728543006
Cr-Commit-Position: refs/heads/master@{#454312}
sigbjornf
blink_gc_plugin: always enable warn_stack_allocated_trace_method check.
R=haraken,thakis
BUG=689864

Review-Url: https://codereview.chromium.org/2730673003
Cr-Commit-Position: refs/heads/master@{#454307}
sigbjornf
Enable Blink GC plugin check for stack allocated classes.
The latest clang roll (crbug.com/685244) included a GC plugin with
support for checking STACK_ALLOCATED() classes w/ unwanted trace
method definitions. Add support for that check to the build system,
unconditionally enabled.

R=haraken,thakis
BUG=689874

Review-Url: https://codereview.chromium.org/2724353002
Cr-Commit-Position: refs/heads/master@{#454306}
fs
Sync the FeatureObserver (UseCounter) metric in histograms.xml
Catching up with changes to Blink's
third_party/WebKit/Source/core/frame/UseCounter.h.

Review-Url: https://codereview.chromium.org/2729543004
Cr-Commit-Position: refs/heads/master@{#454280}
mharanczyk
React to not committed render frame navigations in devtools.
Currently it was trying to handle only error pages or committed
navigations which lead to RenderFrameDevToolsAgentHost being stuck
in suspended state for navigations that did not commit (for example
downloads). This in turn caused webdriver to get stuck on further
interactions with such frames. This is regression caused by
https://codereview.chromium.org/2655413002.

BUG=682002

Review-Url: https://codereview.chromium.org/2720823004
Cr-Commit-Position: refs/heads/master@{#454229}
bratell
Drop some "using namespace" in WebKit/Source/html.
Drop some "using namespace" that are not used or not allowed
by the coding standard.

Review-Url: https://codereview.chromium.org/2726603002
Cr-Commit-Position: refs/heads/master@{#453964}
sigbjornf
Construct URLSearchParams from sequence initializer.
Follow up recent spec addition[1,2] and support sequence<sequence<USVString>>
initializers for URLSearchParams.

1 - https://github.com/whatwg/url/issues/27
2 - https://github.com/whatwg/url/pull/175

R=tyoshino,haraken
BUG=680531

Review-Url: https://codereview.chromium.org/2725593003
Cr-Commit-Position: refs/heads/master@{#453903}
fs
Move MarkupTokenizerInlines.h to core/html
This set of helpers is used by HTMLTokenizer and VTTTokenizer - both of
which reside in core/html.

Review-Url: https://codereview.chromium.org/2724593002
Cr-Commit-Position: refs/heads/master@{#453887}
bratell
Avoid conflict between 2 enums named Mode and 2 values named None.
If you include (directly or indirectly) forms/TypeAhead.h or
MediaFragmentURIParser.h or track/vtt/VTTRegion.h you get conflicts
either with the enum value None or the enum name Mode so give the
enum a less generic name.

Review-Url: https://codereview.chromium.org/2724533003
Cr-Commit-Position: refs/heads/master@{#453634}
perja
bluetooth: show better error messages for services, characteristics and descriptors.
The error message now contains the UUID of the respective service, characteristic or descriptor.

BUG=619932

Review-Url: https://codereview.chromium.org/2680783002
Cr-Commit-Position: refs/heads/master@{#453590}
sigbjornf
Convert unnecessary ContextLifecycleObservers into ContextClients.
Convert remaining types that do not make use of |contextDestroyed()|
overriding, making them be context clients instead.

R=dcheng,haraken
BUG=610176

Review-Url: https://codereview.chromium.org/2721603005
Cr-Commit-Position: refs/heads/master@{#453574}
rune
Use independent property inheritance fast-path for text-align.
This was originally attempted in [1], but the custom function for
applying text-align values did not clear the inherited bit.

Added a test to the framework to catch the case for trying to propagate
a value down to a descendant with the property explicitly set.

[1] https://codereview.chromium.org/2628503002/

R=sashab@chromium.org,napper@chromium.org
BUG=628043,686585

Review-Url: https://codereview.chromium.org/2715213003
Cr-Commit-Position: refs/heads/master@{#453430}
rune
Remove out-of-date comment about scoped style resolvers.
Collecting features is not longer connected to StyleResolver and the
comment is no longer correct in any way. The nullptr test is still
there because a TreeScope may have stylesheet candidates which do not
have style sheets. A candidate is causing the TreeScope to be added to
the active list, while it has to have at least one active stylesheet to
enforce a ScopedStyleResolver instance.

R=meade@chromium.org

Review-Url: https://codereview.chromium.org/2716363002
Cr-Commit-Position: refs/heads/master@{#453427}
fs
Rename SVGPaintContext::paintSubtree to paintResourceSubtree
To better reflect it's use and function.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2715513009
Cr-Commit-Position: refs/heads/master@{#453278}
fs
Tidy up instance time handling in SVGSMILElement
Merge the addBeginTime and addEndTime methods into a single method
addInstanceTime (that takes a BeginOrEnd argument.) Migrate callers to
the new method, getting rid of SVGSMILElement::handleConditionEvent in
the process.
Also inline some trivial functions in SVGAnimationElement.

BUG=641437

Review-Url: https://codereview.chromium.org/2712343004
Cr-Commit-Position: refs/heads/master@{#453233}
sigbjornf
MessagePort: don't post repeated message dispatch tasks.
If a task has already been posted to drain the incoming queue of messages,
don't post another.

R=haraken,dcheng
BUG=693595

Review-Url: https://codereview.chromium.org/2716163002
Cr-Commit-Position: refs/heads/master@{#453205}
mstensho
Allow flow thread portion logical bottom to be above its logical top.
We used to try to prevent this, as an attempt to make sure that no
fragmentainer group would have overlapping flow thread portion rectangles with
other fragmentainer groups. But that was already easily achievable with e.g. an
empty block between two column spanners anyway.

There is a legitimate reason for the flow thread portion bottom to be above the
top: negative margins.

Introduce MultiColumnFragmentainerGroup::logicalHeightInFlowThreadAt().
Less duplicated code. Some extra care is now needed, to make sure that we don't
end up with negative logical heights.

BUG=688760,683090,683554

Review-Url: https://codereview.chromium.org/2709013007
Cr-Commit-Position: refs/heads/master@{#453201}
fs
Add comment about SVGGraphicsElement.{nearest,farthest}ViewportElement
Move to bottom of interface per common practice.

BUG=695981

Review-Url: https://codereview.chromium.org/2714123003
Cr-Commit-Position: refs/heads/master@{#453124}
fs
Update VTTCue enum AlignSetting, "middle" -> "center"
Apparently this was missed in https://codereview.chromium.org/2683633006

R=foolip@chromium.org
BUG=663797

Review-Url: https://codereview.chromium.org/2719513002
Cr-Commit-Position: refs/heads/master@{#453121}
fs
Fold svgAttributeChanged into parseAttribute for SVGAnimateElement
This separation does not really give much in terms of benefits. Since
none of the SMIL-related attributes are exposed through SVG DOM, the
former method is always called after the latter. Move the code from the
former to the latter. This even avoids the attribute value lookup, for a
tiny perf gain...

BUG=641437

Review-Url: https://codereview.chromium.org/2706243012
Cr-Commit-Position: refs/heads/master@{#452861}
fs
Remove 'begin'/'end' processing from SVGSMILElement::svgAttributeChanged
The svgAttributeChanged hook is (with one exception) used for attributes
that are part of the SVG DOM representation ("object model".) 'begin'
and 'end' are not. Move handling to SVGSMILElement::parseAttribute
instead.

BUG=641437

Review-Url: https://codereview.chromium.org/2719493002
Cr-Commit-Position: refs/heads/master@{#452858}
fs
Tidy up event-/syncbase registration in SVGSMILElement
Move code for connect/disconnecting from event- and syncbase into the
Condition innerclass to improve readability.
Also make Condition::m_baseID and m_name be AtomicStrings (to avoid
casting and hashing all over the place), convert loops to range-syntax
and use references where it makes sense in related code-paths.

BUG=641437

Review-Url: https://codereview.chromium.org/2714643007
Cr-Commit-Position: refs/heads/master@{#452857}
fs
Avoid duplicating the CSS property mapping for SVG pres. attrs.
The attribute (object) -> CSS property mapping is specified at
construction and stored, so rather than having to repeat it, just read
and use the stored value.

Also add a cssValue() helper method to SVGAnimatedPath.

Review-Url: https://codereview.chromium.org/2708923011
Cr-Commit-Position: refs/heads/master@{#452839}
fs
Remove LayoutSVGResourceContainer::m_id
By passing the old and new values to the idChanged() method, the only
"reload" of the value can be eliminated, and other instances can use
getIdAttribute() on the element. This makes the m_id field unused, so
it can be removed.

BUG=454767

Review-Url: https://codereview.chromium.org/2714153002
Cr-Commit-Position: refs/heads/master@{#452838}
sigbjornf
Verify that a new heap page isn't also marked as being off heap.
Attempt to diagnose a rare assert failure, where a conservative
GC stack scan finds a potential pointer in both the heap's
negative heap page cache and in the map of in-use heap pages.

Those two mapping should be mutually exclusive by construction,
and must be -- the negative page cache must not contain false
positives. Hence, add verification when a new page is committed
& used, it does not already have a mapping in that negative cache.

R=haraken
BUG=649485

Review-Url: https://codereview.chromium.org/2715713005
Cr-Commit-Position: refs/heads/master@{#452833}
sigbjornf
A per-heap RegionTree needs no lock.
R=keishi,haraken
BUG=671856

Review-Url: https://codereview.chromium.org/2717613004
Cr-Commit-Position: refs/heads/master@{#452814}
bratell
Add header guards to CanvasAsyncBlobCreator.h
R=fs

Review-Url: https://codereview.chromium.org/2711333002
Cr-Commit-Position: refs/heads/master@{#452812}
fs
Cleanup the SVGTreeScopeResources interface
After some previous refactoring, some methods no longer need to be
public, and some methods can be folded into others to avoid some hash-
lookups.
Also use HashMap::removeAll in removeElementFromPendingResources, change
some methods to use references and hide a longish typename with 'auto'.

BUG=454767

Review-Url: https://codereview.chromium.org/2705163008
Cr-Commit-Position: refs/heads/master@{#452645}
sigbjornf
Tidy ScriptRunner pending script handling.
R=hiroshige
BUG=686281

Review-Url: https://codereview.chromium.org/2710233002
Cr-Commit-Position: refs/heads/master@{#452619}
mstensho
Avoid negative content box sizes.
Negative values had two possible causes:

1. Subtracting the scrollbar size from the border box size. Scrollbars do not
affect the border box size, but they occupy space between some border edge and
padding edge. This means that the presence of a scrollbar on an object reduces
the size of the content box and the containing block established by said
object. This means that if e.g. the specified width of an object is 10px and it
has a vertical scrollbar that takes up more than that, e.g. 15px, the content
box width should become 0, not -5px.

2. Subtracting two huge (or even saturated) LayoutUnit values from one
LayoutUnit value. When we during layout convert a specified content-box width
to border-box (via padding-box), which is what LayoutBox::m_frameRect uses, we
may end up with saturated LayoutUnit values, so that:
LayoutUnit specified_content_box_width = <whatever, something nice, maybe>;
LayoutUnit left_padding = LayoutUnit::max() /*(or something huge, at least)*/;
LayoutUnit right_padding = LayoutUnit::max() /*(or something huge, at least);*/
LayoutUnit padding_box_width = content_box_width + left_padding + right_padding;
LayoutUnit content_box_width = padding_box_width - left_padding - right_padding;
Here, content_box_width won't be the same as specified_content_box_width,
because padding_box_width got saturated. That's kind of inevitable, with
saturated arithmetic and all, but what's worse is that we used to end up with a
negative value in content_box_width, which is illegal. So just clamp negative
values to 0 to avoid that.

Negative box sizes have various kinds of ill effects, such as inline-axis
misalignment and unwanted negative block direction progression. It was possible
to get negative padding (which is illegal) resolved from percentage values.
This in turn caused unnecessary assertion failures in multicol.

Attempted to come up with sensible layout tests that don't make assumptions
about how the engine deals with extreme values internally.

BUG=683554,683090

Review-Url: https://codereview.chromium.org/2716583002
Cr-Commit-Position: refs/heads/master@{#452578}
mstensho
Merge overflowRectForFlowThreadPortion() into flowThreadPortionOverflowRectAt().
No need to keep this in LayoutMultiColumnSet anymore. Also got rid of
unused method LayoutMultiColumnSet::flowThreadPortionOverflowRect().

No behavior changes intended.

Review-Url: https://codereview.chromium.org/2711003005
Cr-Commit-Position: refs/heads/master@{#452537}
sigbjornf
Avoid needless InstanceCounter.h inclusion.
Only needed if RefCounted<> is compiled specially.

R=
BUG=

Review-Url: https://codereview.chromium.org/2714703002
Cr-Commit-Position: refs/heads/master@{#452453}
fs
Move SVGElement::buildPendingResourcesIfNeeded to SVGTreeScopeResources
Move notification of a resource "appearing" to SVGTreeScopeResources,
naming the method notifyResourceAvailable().
Simplify the handling of the pending resources map to avoid unnecessary
hash-lookups in some cases.

BUG=454767

Review-Url: https://codereview.chromium.org/2710583005
Cr-Commit-Position: refs/heads/master@{#452187}
sigbjornf
DisplayItemClient: avoid hash table temporaries when iterating.
R=pdr.
BUG=
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2712703002
Cr-Commit-Position: refs/heads/master@{#452147}
sigbjornf
Avoid unnecessary HashTable resizing during copy construction.
We do know the final table size, so reserve its size before starting
to copy over. Thereby avoiding intermediate table allocations.

R=esprehn
BUG=

Review-Url: https://codereview.chromium.org/2715473004
Cr-Commit-Position: refs/heads/master@{#452060}
fs
Move LayoutSVGResourceContainer registration to SVGTreeScopeResources
Move LayoutSVGResourceContainer::registerResource to
SVGTreeScopeResources, renaming it to updateResource while getting rid
of addResource (since it's only called from updateResource.)
Simplify the interaction with the m_pendingResources set a bit, to
eliminate a hash-lookup in certain code-paths.

BUG=454767

Review-Url: https://codereview.chromium.org/2714473002
Cr-Commit-Position: refs/heads/master@{#452050}
sigbjornf
Remove unnecessary PagePool locks.
With per-thread heap (arenas), there will not be any contention
on adding and removing page pool entries.

R=haraken
BUG=671856

Review-Url: https://codereview.chromium.org/2707193004
Cr-Commit-Position: refs/heads/master@{#452023}
rune
Repaint selection when element with ::selection style is recalculated.
Selection was not repainted unless the selected text was repainted due
to other style changes. Now, if the ComputedStyle is recalculated for
an element and either the old or the new ComputedStyle had a bit set
for PseudoIdSelection, schedule paint invalidation for the selection
leaf children of that element.

Note that we don't need to traverse down the descendants because the
current implementation of ::selection in Blink only affects direct
children. The selection state is only propagated to containing block
ancestor, which is why we look for a containing block to check if any
of the children is selected.

R=mstensho@opera.com
BUG=685174

Review-Url: https://codereview.chromium.org/2709693003
Cr-Commit-Position: refs/heads/master@{#451992}
fs
Compute a more correct "screen scope" transform for SVGSVGElement
For getScreenCTM, only the position (translation) of the outermost svg
element was computed - any additional transform data was dropped.

Use LayoutObject::localToAbsoluteTransform to compute the full transform
rather than just the position of the layout box. Since using this method
works for any (attached) element, implement getScreenCTM without using
computeCTM, and get rid of the ScreenScope variant of the latter. This
also allows us to simplify SVGSVGElement::localCoordinateSpaceTransform
a bit, and drop the CTMScope argument from the
localCoordinateSpaceTransform declaration(s).

It's not clear from [1] how elements which are not in the rendering tree
(i.e has 'display: none' or similar) should be handled. With this
implementation we will return an identity matrix in those cases, which
doesn't seem unreasonable. (The option would be to return 'null', which
is how elements not in the document should be treated, but we don't have
that semantic implemented yet.)

[1] https://svgwg.org/svg2-draft/types.html#__svg__SVGGraphicsElement__getScreenCTM

BUG=678167

Review-Url: https://codereview.chromium.org/2711503002
Cr-Commit-Position: refs/heads/master@{#451938}
fs
Clean up the getLayoutSVGResource*ById helpers
Drop getLayoutSVGResourceContainerById helper, since we can just use
SVGTreeScopeResources::resourceById directly.

For getLayoutSVGResourceById, rather than calling through
TreeScope::ensureSVGTreeScopedResources, just pass the
SVGTreeScopeResources and do the lookup from there. Said object is
already available in the relevant places (only the layout tree dumping
needs to be updated wrt that.)

BUG=454767

Review-Url: https://codereview.chromium.org/2708543003
Cr-Commit-Position: refs/heads/master@{#451839}
sigbjornf
Disallow cross-thread Persistent<> read access.
A Persistent<> reference is belongs to the thread that created it,
read and write access must only be performed by that thread.

Debug verification have been in place for some time to verify that Persistent<>
updates only happen on its creation thread, and that the updated heap pointer
resides on that thread's heap. Extend the debug checks to also apply to read
access, checking that no other thread accesses the Persistent<>.

This requires converting a handful of Persistent<>s to CrossThreadPersistent<>s.

R=haraken
BUG=693988

Review-Url: https://codereview.chromium.org/2702243003
Cr-Commit-Position: refs/heads/master@{#451753}
sigbjornf
Gracefully handle navigator.getVRDisplays() in detached contexts.
R=haraken
BUG=686602

Review-Url: https://codereview.chromium.org/2703283003
Cr-Commit-Position: refs/heads/master@{#451734}
sigbjornf
Simplify MediaStreamAudioSourceNode ownerships.
The processing that happens on the audio thread for this object
doesn't access the MediaStream. Hence the reference to it and the
track can be kept directly on the node object, thereby avoiding the
use of a pair of Persistent<>s.

R=haraken
BUG=693988

Review-Url: https://codereview.chromium.org/2699403002
Cr-Commit-Position: refs/heads/master@{#451726}
mwrobel
Make Editor::findEventTargetFrom() to align Clipboard API specification
This patch changes |Editor::findEventTargetFrom()| to return focused element if
selection start is not editable to align Clipboard API specification[1] for
improving interoperability.

[1] https://w3c.github.io/clipboard-apis/#to-fire-a-clipboard-event

BUG=690104
TEST=webkit_unittests --gtest_filter=ClipboardEventFlowTest.*

Review-Url: https://codereview.chromium.org/2685723005
Cr-Commit-Position: refs/heads/master@{#451716}
fs
Rewrite svg/zoom/page/zoom-get-screen-ctm.html to use testharness
In preparation for some future tweaks to this test.

BUG=678167

Review-Url: https://codereview.chromium.org/2708493003
Cr-Commit-Position: refs/heads/master@{#451657}
rune
Remove unused processedBlocks variable.
R=mstensho@opera.com

Review-Url: https://codereview.chromium.org/2702233003
Cr-Commit-Position: refs/heads/master@{#451651}
fs
Disable flaky compositing/reflections/nested-reflection-* tests
The following two tests appear to produce slightly different results
(different offsets?) somewhat randomly:

 compositing/reflections/nested-reflection-anchor-point.html
 compositing/reflections/nested-reflection-animated.html

TBR=cfroussios@chromium.org
NOTRY=true
BUG=693510

Review-Url: https://codereview.chromium.org/2702343002
Cr-Commit-Position: refs/heads/master@{#451635}
sigbjornf
Removed dated Persistent<>::checkPointer() assert.
Remove the ASan-only verification that a Persistent<> refers to a heap
object. Static asserts will ensure that Persistent<T> is only instantiated
for GCed types, so this verification adds little extra value.

R=haraken
BUG=

Review-Url: https://codereview.chromium.org/2701273002
Cr-Commit-Position: refs/heads/master@{#451580}
rune
Invalidate custom pseudo elements for RuleSet invalidations.
When we have selectors containing custom pseudo elements matching
elements inside the UA shadow, and no id, class, or attribute selectors
present, do like we do for type selectors and invalidate as part of an
invalidation set scheduled on the root node of the tree scope for
RuleSet invalidations.

We utilize the same invalidation set as for type invalidations and mark
it as invalidating custom pseudo elements as well as marking it as
tree-boundary-crossing to allow drilling into the UA shadow.

This means we will traverse into all shadow sub-trees, but it should at
least be better than the existing recalc all behavior.

The full recalc for custom pseudo elements caused a full recalc for one
of the stylesheets on facebook.com.

R=ericwilligers@chromium.org
BUG=680549

Review-Url: https://codereview.chromium.org/2700943003
Cr-Commit-Position: refs/heads/master@{#451578}
mstensho
Add out-of-flow objects under the inline in a continuation chain, when possible.
The same goes for floating objects. Only when a floating or out-of-flow
positioned object is to be added between two block-level children should we add
it to the anonymous block box holding the block-level children. If the new
child is to be added before a block-level child, and this beforeChild is the
first block-level child, we should rather make the new child the last child of
the preceding inline, rather than the first child of the anonymous block
containing block-level children.

Also cleaned up and documented the code somewhat.

BUG=689643

Review-Url: https://codereview.chromium.org/2698243002
Cr-Commit-Position: refs/heads/master@{#451525}
rune
Schedule a type selector invalidation set for RuleSet invalidations.
We marked all elements which had a selector in the tagRules bucket for
style recalc for RuleSet invalidations. That means we would recalculate
style for all spans if we added a stylesheet containing a rule with an
"#id span" selector (but not for "#id span.class" as that ends up in
the classRules bucket).

Instead, use an invalidation set containing only tag names for the
selectors where there are no ids, classes, or attribute selectors, and
which have a type selector in the rightmost compound. This means that
"#id span" will not add "span" to that set, but "span" and "div span"
will. "div span" will not add "div", and "div *" will cause a full
scope recalc. In order to support invalidation for those, we would have
had to have one invalidation set for each tag name instead of a single
descendant invalidation set for all.

RuleSet invalidations schedule this typeRuleInvalidationSet on the root
of the TreeScope When doing ruleset invalidations.

BUG=680549

Review-Url: https://codereview.chromium.org/2703643003
Cr-Commit-Position: refs/heads/master@{#451488}
fs
Use unique id's in svg/filters/feBlend-all-modes.html
The same id's would be reused in all the three groups (color
combinations.) Add the group index to the id's to avoid this.

BUG=454767

Review-Url: https://codereview.chromium.org/2703803003
Cr-Commit-Position: refs/heads/master@{#451483}
mstensho
Avoid over-eager clipping of child layers in multicol.
Self-painting layers (caused by e.g. position:relative) don't contribute to
visual overflow in their parent layout object; see
LayoutBox::addOverflowFromChild(). We cannot use the visual overflow rectangle
set on the flow thread when calculating the bounding box of a fragment
established by a child layer.

Therefore, only clip in the flow thread's block direction in
overflowRectForFlowThreadPortion(), and leave the inline axis alone. I
simplified the implementation, since it's now way easier to start with an
infinite rectangle, and just limit the dimensions that need it afterwards.

Also got rid of an old check for hasOverflowClip(), which must have been
residue from the CSS regions implementation.

This also happened to fix some inaccuracies mostly invisible to the naked
eye, when it comes to transform:scale()d text with glyphs that have negative
left bearing or overflow the line box vertically. It looks like we measure and
lay out with the CSS computed font, and then switch to a scaled font when
painting, so that it looks crisp and nice. This may result in tiny
inaccuracies in the bounding box of the text, and
fast/borders/border-antialiasing.html exhibited this, and had to be
rebaselined. Added fast/multicol/scale-transform-text.html to better
demonstrate what we're fixing.

paint/invalidation/multicol-with-relpos.html also had to be rebaselined,
since it turns out that it has never painted its stuff correctly until now.

BUG=571978

Review-Url: https://codereview.chromium.org/2699653002
Cr-Commit-Position: refs/heads/master@{#451376}
rune
Remove stray method declaration in RuleFeatureSet.
Review-Url: https://codereview.chromium.org/2703693002
Cr-Commit-Position: refs/heads/master@{#451307}
sigbjornf
Tidy DEFINE_(THREAD_SAFE_)STATIC_LOCAL() implementations.
Move the handling of static local singletons into the
WTF::StaticSingleton<T> wrapper class, including the "same thread"
debug verification.

Use it to also implement the "thread safe" variant also, which can
now be done in a straightforward manner after issue 686866 enabled
C++ thread safe statics.

R=kinuko
BUG=686866

Review-Url: https://codereview.chromium.org/2680843006
Cr-Commit-Position: refs/heads/master@{#451305}
mstensho
Don't keep pointers to table sections when told to recalculate sections.
They may have been deleted.

We should ideally assert in header(), footer() and firstBody() in LayoutTable
that we're not waiting for a section recalc, but that's currently failing in one
trybot; see crbug.com/693212

This would have fixed the original use-after-free issue with bug 680224, but
before this CL landed, I found another fix that attacked the root cause instead.
Still no point in keeping potentially dead pointers around, though.

BUG=680224

Review-Url: https://codereview.chromium.org/2636153002
Cr-Commit-Position: refs/heads/master@{#451257}
rune
Add type selector invalidation set for ruleset invalidations.
We currently look at RuleSet::tagRules() to figure out if an element
needs a style recalc when adding a stylesheet. This recalculates too
much for rules like "#id span" which ends up in the tagRules bucket,
causing style recalcs for every span. The plan is to use an
m_typeRuleInvalidationSet which contains the tag names for rules which
don't contain other simple selectors which have associated invalidation
sets.

For instance, "#id span" will not add span to m_typeRuleInvalidationSet
since we can rely on the invalidation set for #id to invalidate spans.
However, "span" or "div span" will add span to that set.

This CL prepares for this by introducing the set and a way to collect
it. This new set will be scheduled on the root node of the TreeScope
when adding/removing a stylesheet. We did not support scheduling
invalidation sets on the document node, so this CL adds that
possibility as well.

BUG=680549

Review-Url: https://codereview.chromium.org/2699883002
Cr-Commit-Position: refs/heads/master@{#451170}
sigbjornf
document.lastModified: treat invalid dates like unknown ones.
If the value supplied via Last-Modified: is unparseable, treat the
modification date as unknown and return the current time (rather than
00-00-0000 00:00:00)

This aligns behavior with all other browsers.

R=foolip
BUG=693053

Review-Url: https://codereview.chromium.org/2698773005
Cr-Commit-Position: refs/heads/master@{#451123}
sigbjornf
Remove unused blink_gc_plugin_flags.py script.
Became unused with GN, now safe to remove.

R=dcheng,thakis
BUG=

Review-Url: https://codereview.chromium.org/2691943009
Cr-Commit-Position: refs/heads/master@{#451056}
mstensho
Less code duplication in PaintLayer::collectFragments()
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2691303004
Cr-Commit-Position: refs/heads/master@{#450737}
fs
Don't clear 'web animations dirty' flag if we have no rare data
If an SVGElement has an instantiated ElementAnimations object and
animation time has progressed, but no actual animation has been applied
(and hence no SVGElementRareData has been created), we don't need to
clear the dirty bit in the rare data.
The initial trigger for this seems to be the Element.computedName
implementation for a detached node, which tries to compute style in
this case, triggering a DCHECK in Node::containingTreeScope when doing
so.

BUG=686424

Review-Url: https://codereview.chromium.org/2689713003
Cr-Commit-Position: refs/heads/master@{#450689}
karlo
Reorder setting of zooming, to prevent reflowing and size mismatch.
When zooming is applied to the document, the color suggestion picker can lose
or gain bottom pixels, which causes missing borders or rendering artifacts.

This appears to be caused by some unfortunate assumptions and interactions
in Source/web/resources/colorSuggestionPicker.js and friends.

The color picker is a separate window, and the contents of the window is
generated in ColorChooserPopupUIController.cpp.  colorSuggestionPicker.js
resizes the window to exactly fit the content, but the zoom factor is applied
afterwards, causing an additional reflow (see WebPagePopupImpl.cpp:329).
There is no guarantee that the zoomed contents will fit the window any more,
and much of the time it doesn't.

By setting zoom factor before forcing layout, the final size is reached the first
time around, and the window size should be correct.

BUG=691375

Review-Url: https://codereview.chromium.org/2695723002
Cr-Commit-Position: refs/heads/master@{#450513}
fs
Actually delegate in additional FilterEffectBuilder constructor
Because url(...) filters are ignored/dropped this will not have any
practical effect, but could avoid issues in the future.

BUG=593838
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2692883003
Cr-Commit-Position: refs/heads/master@{#450374}
fs
Remove unused includes of SVGDocumentExtensions.h
Review-Url: https://codereview.chromium.org/2696803002
Cr-Commit-Position: refs/heads/master@{#450334}
mstensho
ColumnBalancer: need to examine lines that protrude into the flow thread portion.
We cannot skip a line that starts before the flow thread portion of interest,
if it ends inside the portion.

Some extra care is needed to avoid regressions here: The part of a line that
starts before the multicol container itself needs to be ignored, or we risk
overstretching the multicol container.

BUG=642181

Review-Url: https://codereview.chromium.org/2690863003
Cr-Commit-Position: refs/heads/master@{#450033}
karlo
Support subpixel layout of borders.
This cl implements subpixel layout of borders.  Painting of subpixel
borders now uses rounding to nearest CSS pixel, and is aligned with
Edge.  Handling of device pixel ratios > 1 isn't implemented here,
and is better covered in a separate task.

This does not implement subpixel borders for tables, as that interacts
with table layout width calculations, which would also need to be
adapted to subpixels.  Again, that's better dealt with in a separate
task.

A number of test cases had to be rebaselined, due to minor changes in
layout and/or painting.  Most of these changes appear in tests that uses
zooming, and implicitly have fractional borders.

svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm now looks a bit
broken, but that's due to an unrelated issue with aspect ratio and
subpixels (in LayoutPart, if I recall correctly).

BUG=227192
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2640143005
Cr-Commit-Position: refs/heads/master@{#449943}
sigbjornf
Fix partition_alloc unit tests.
R=haraken
BUG=691197, 684513

Review-Url: https://codereview.chromium.org/2689103002
Cr-Commit-Position: refs/heads/master@{#449892}
sigbjornf
Tie DragState to DragController.
Clarify ownership & scope of DragState and have the page's
DragController own it.

R=dcheng
BUG=688569

Review-Url: https://codereview.chromium.org/2687193004
Cr-Commit-Position: refs/heads/master@{#449889}
fs
Remove TextTrack.regions and VTTRegionList
Removed from the WebVTT spec https://github.com/w3c/webvtt/pull/31

Because we no longer need to track a list of regions in TextTrack, we
can also remove all the plumbing between the parser and the (loadable)
TextTrack.

BUG=690014

Review-Url: https://codereview.chromium.org/2685943004
Cr-Commit-Position: refs/heads/master@{#449791}
fs
Various cleanups in VTTRegion
 * Eliminate single-use pseudo-id functions (and associated statics)

 * Avoid redundant calls to getBoundingClientRect, and use
   ClientRect::height where appropriate.

 * Allow using ElementTraversal::childrenOf in
   VTTRegion::displayLastVTTCueBox by putting a break after
   startTimer().

 * Get rid of VTTRegion::m_settings and updateParametersFromRegion
   (they are not used.)

 * Replace 'long' with 'int' for lines, because that matches the
   WebIDL type better.

 * Remove unused includes (add more specific ones when needed.)

Review-Url: https://codereview.chromium.org/2689703002
Cr-Commit-Position: refs/heads/master@{#449790}
mstensho
Specify orphans:1 and widows:1 in old multicol test.
The test and the ref rendered identically, but it didn't look as asserted by
the textual pass condition.

Review-Url: https://codereview.chromium.org/2692453002
Cr-Commit-Position: refs/heads/master@{#449637}
fs
Implement VTTCue.region and sync the VTTRegion interface
This CL implements the VTTCue.region property, replacing 'regionId'. The
main implementation mechanism is a new map in VTTParser that tracks the
regions currently seen.

Rewrite the region parser test to be based on cues rather than the list
of regions. This will ease the removal of TextTrack.regions.

Sync the VTTRegion with the current spec by

 * renaming the 'height' property to 'lines',

 * adding and using the ScrollSetting IDL enumeration type and

 * dropping the 'id' and 'track' properties.

Update tests as needed to match the above changes.

BUG=690014

Review-Url: https://codereview.chromium.org/2682333002
Cr-Commit-Position: refs/heads/master@{#449589}
sigbjornf
Prevent icf/comdat folding for OOM_CRASH() entry points.
We have various OOM-failure entry points which call OOM_CRASH() but
not much more. These are all NO/NEVER_INLINEd, but that isn't sufficient
to prevent the linker from common'ing up these identical functions
(see associated bug for an example), leading to confused crash stacks.

Avoid invasive linker optimization by adopting r306650 to OOM_CRASH().

R=haraken,primiano
BUG=690447

Review-Url: https://codereview.chromium.org/2683033008
Cr-Commit-Position: refs/heads/master@{#449582}
sigbjornf
Move VisitorMarkingMode into Visitor.
Move this enum back into Visitor where it better belongs; recent
simplifications to the marking visitor implementation class types
makes that a trivial exercise.

R=haraken
BUG=671856

Review-Url: https://codereview.chromium.org/2688083002
Cr-Commit-Position: refs/heads/master@{#449568}
mstensho
Stay within the containing block when looking for a line to dirty.
BUG=686469

Review-Url: https://codereview.chromium.org/2686913002
Cr-Commit-Position: refs/heads/master@{#449237}
fs
Remove TextTrack.{add,remove}Region
Removed from the spec by https://github.com/w3c/webvtt/pull/31

BUG=690014

Review-Url: https://codereview.chromium.org/2684993003
Cr-Commit-Position: refs/heads/master@{#449140}
sigbjornf
blink_gc_plugin: warn of unused trace methods to stack allocated classes.
A STACK_ALLOCATED()-annotated class does not need a trace method; issue
a warning if encountered.

R=haraken
BUG=689874

Review-Url: https://codereview.chromium.org/2685583002
Cr-Commit-Position: refs/heads/master@{#449046}
fs
SVGTransformList.consolidate() should return null on an empty list
SVGTransformList.consolidate() returns an SVGTransform with type
"unknown", which is an invalid object that other parts of the code
couldn't cope with. The specification:

 https://svgwg.org/svg2-draft/coords.html#__svg__SVGTransformList__consolidate

say that 'null' should be returned in this case though, so do that
instead.

Rewrite svg/dom/SVGTransformList-empty-list-consolidation.html to use
actually assert this part of the contract, and also convert it use
testharness.js while at it.

BUG=688306, 688303

Review-Url: https://codereview.chromium.org/2681803004
Cr-Commit-Position: refs/heads/master@{#448994}
rune
Clear MatchedPropertiesCache on StyleRule changes.
CSSOM changes used to cause a FullStyleUpdate which cleared the whole
StyleResolver. With the new active stylesheet update using RuleSet-
based style invalidation, clearing the MatchedPropertiesCache was
missing. The reason it needs to be cleared, is that the hash key for
the cache entry is based on StylePropertySet pointers which don't
change when adding/removing declarations to a mutable StylePropertySet.

R=meade@chromium.org
BUG=681183

Review-Url: https://codereview.chromium.org/2679623002
Cr-Commit-Position: refs/heads/master@{#448939}
sigbjornf
blink_gc_plugin: report illegal on-heap iterators as warnings/errors.
Fix classification bug, when encountered this should be reported as a
warning/error, not as a supplementary note.

R=
BUG=

Review-Url: https://codereview.chromium.org/2681753002
Cr-Commit-Position: refs/heads/master@{#448932}
fs
Remove faulty assertion in LayoutSVGResourceContainer::registerResource
When notifying pending elements we don't know what resource type the
registration is for, so it's entirely plausible that the resource type
is one that a possible client isn't really interested in (like a 'mask'
ending up pointing to a <filter>, like in this particular case.)

BUG=687985

Review-Url: https://codereview.chromium.org/2680683003
Cr-Commit-Position: refs/heads/master@{#448688}
sigbjornf
Remove trace() methods for stack-only classes.
A class annotated with STACK_ALLOCATED() does not require a trace
method, as its heap references are reachable and kept alive by virtue
of being on the stack, should any conservative GC go ahead.

R=haraken
BUG=

Review-Url: https://codereview.chromium.org/2685563002
Cr-Commit-Position: refs/heads/master@{#448627}
sigbjornf
Track constant InputDeviceCapabilities objects per-window.
Do not keep global main thread Persistent<>s for the two
constant InputDeviceCapabilities objects, as that will
end up sharing wrapper objects across contexts.

R=dcheng
BUG=688569

Review-Url: https://codereview.chromium.org/2675793005
Cr-Commit-Position: refs/heads/master@{#448597}
sigbjornf
Out-of-line trace() methods of editing template types.
With a simpler trace method infrastructure in place, we
can now define trace methods of the editing templates
out-of-line.

R=haraken
BUG=654985

Review-Url: https://codereview.chromium.org/2672413003
Cr-Commit-Position: refs/heads/master@{#448563}
sigbjornf
Add missing documentation for Allocator.h macros + EAGERLY_FINALIZE().
R=haraken
BUG=662326

Review-Url: https://codereview.chromium.org/2672273002
Cr-Commit-Position: refs/heads/master@{#448234}
sigbjornf
Have SubframeLoadingDisabler singleton live off-heap.
Primarily to diagnose potential heap corruption, keep
track of the disabled set off-heap. The untraced references
added aren't unsafe, as they are all stack-reachable by
construction.

R=dcheng,haraken
BUG=684551

Review-Url: https://codereview.chromium.org/2667853006
Cr-Commit-Position: refs/heads/master@{#447682}
sigbjornf
Disallow sequences with lengths exceeding max allocation supported.
Vector backing stores are limited in size by the maximum allowed by
their allocator. When converting incoming IDL sequence types into
native arrays, check if the requested size exceed that max limit and
throw a TypeError(), if needed.

Only pathological inputs will run up against this limit and exception.

R=
BUG=682910

Review-Url: https://codereview.chromium.org/2657173002
Cr-Commit-Position: refs/heads/master@{#447466}
mstensho
Remove unused declarations of pageLogicalHeight.
BUG=686648

Review-Url: https://codereview.chromium.org/2664063003
Cr-Commit-Position: refs/heads/master@{#447323}
sigbjornf
Change HeapCompaction feature status to stable.
R=
BUG=672030

Review-Url: https://codereview.chromium.org/2653413002
Cr-Commit-Position: refs/heads/master@{#447248}
ckulakowski
Chromium doesn't compile with -Wglobal-constructors
We compile chromium with clang flag -Wglobal-constructors in our
project. We have following compilation error during compilation
of user_input_tracker.cc:

../../chrome/browser/page_load_metrics/user_input_tracker.cc:27:11:
error: declaration requires a global constructor [-Werror,-Wglobal-constructors]
const int kRateLimitClampMillis = (kOldestAllowedEventAgeSeconds * 1000) /

In order to get rid of this global constructor I recommend to declare
static class variable UserInputTracker::kMaxTrackedEvents and global
variable kRateLimitClampMillis as constexpr which will be expanded to
numerical value during compilation.

BUG=686669

Review-Url: https://codereview.chromium.org/2662803002
Cr-Commit-Position: refs/heads/master@{#447000}
sigbjornf
Tidy generated toMemberNativeArray<>() invocations.
R=haraken
BUG=682910

Review-Url: https://codereview.chromium.org/2654143006
Cr-Commit-Position: refs/heads/master@{#446662}
sigbjornf
Cleanly detach XHR and other pending loader clients from Inspector.
If the XHR object is finalized without first being notified of
ExecutionContext destruction, its prefinalizer is responsible for making
up the difference and behave as if that did.

Do so by delegating to contextDestroyed(); this takes care of
releasing its resources promptly, along with unregistering as
a loader client (with its associated async loader and Inspector.)

Also make other Inspector loading clients cleanly detach when
finalized; prevents Inspector from keeping dead raw pointers to them.

R=yhirano,haraken
BUG=667254

Review-Url: https://codereview.chromium.org/2649323005
Cr-Commit-Position: refs/heads/master@{#446660}
fs
Don't paint selections in <mask>s, <clipPath>s and <pattern>s
Painting a selection within a <mask>, <clipPath> or <pattern> can
trigger a client "style change" to update the resource cache with
whatever the selection style refers to. This "style change" signal will
trigger a layout on the resource's clients while painting.
Since painting selections within these types of resources, add a
PaintLayerFlag and use it to disable selection painting in these cases.
Include the painting of elements references from feImage as well under
the same umbrella.

BUG=683388
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2648343004
Cr-Commit-Position: refs/heads/master@{#446318}
sigbjornf
Remove trace frame template specialization.
More tidying after r445993, only one instantiation of these method
templates.

R=haraken
BUG=683019

Review-Url: https://codereview.chromium.org/2654243002
Cr-Commit-Position: refs/heads/master@{#446302}
sigbjornf
Float32ImageData, PerformanceObserver: no finalization needed.
R=haraken
BUG=

Review-Url: https://codereview.chromium.org/2652393002
Cr-Commit-Position: refs/heads/master@{#446289}
sigbjornf
Emit trace(Visitor*) rather than a templated trace().
One trace() method will now suffice, simplify generated code.

R=haraken
BUG=683019

Review-Url: https://codereview.chromium.org/2653153003
Cr-Commit-Position: refs/heads/master@{#446262}
sigbjornf
blink_gc_plugin: retire overloaded traceImpl detection and handling.
With the specialized InlineGlobalMarkingVisitor gone (r445993), Blink no
longer use a templated traceImpl() method for its trace methods. Follow
up and remove the checks for it in the GC plugin.

R=
BUG=683019

Review-Url: https://codereview.chromium.org/2655933002
Cr-Commit-Position: refs/heads/master@{#446137}
rune
Return ActiveSheetsChanged when rulesets change in common prefix.
When comparing old and new active sheets, we only append the added
sheets to the ScopedStyleResolver if the old sheet vector is a prefix
of the new sheets. However, that's not correct if any of the RuleSets
in the common prefix changed due to media query changes or cssom
modifications of a stylesheet.

I can confirm that this fixes 681472. The other two issues in the BUG
field look like duplicates, but I've not been able to reproduce them.

R=meade@chromium.org,sashab@chromium.org
BUG=681472,677371,681882

Review-Url: https://codereview.chromium.org/2650743002
Cr-Commit-Position: refs/heads/master@{#446008}
sigbjornf
Revert of Add null check to animations for registered custom property initial values (patchset #2 id:20001 of https://codereview.chromium.org/2649863006/ )
Reason for revert:
This goes together with the revert https://codereview.chromium.org/2649103008/ ; looks like the two CLs didn't match up,

 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.10/builds/29275

(Hope the double revert doesn't cause too much work.)

Original issue's description:
> Add null check to animations for registered custom property initial values
>
> After a recent change to CSSInterpolationType for registered custom properties
> it was assumed that all registered custom properties had initial CSSValues.
> This is not the case and null derefs were reachable. This patch fixes up
> the false assumption.
>
> BUG=684234
>
> Review-Url: https://codereview.chromium.org/2649863006
> Cr-Commit-Position: refs/heads/master@{#445969}
> Committed: https://chromium.googlesource.com/chromium/src/+/f2ec8922cbe5f632a937cf242faf5f23c0d1b3ff

TBR=ericwilligers@chromium.org,alancutter@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=684234

Review-Url: https://codereview.chromium.org/2650403002
Cr-Commit-Position: refs/heads/master@{#445996}
sigbjornf
Revert of Add smooth interpolation support for <color> custom properties (patchset #5 id:80001 of https://codereview.chromium.org/2564793002/ )
Reason for revert:
Added test is seen failing on the bots, e.g.,

 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Trusty/builds/22494
 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.11/builds/15502

Original issue's description:
> Add smooth interpolation support for <color> custom properties
>
> This change enables smooth interpolation for animations on
> custom properties registered as <color>.
>
> This does not add support for CSS Transitions, only CSS
> Animations and Web Animations.
> This does not add support for currentcolor for CSS Animations,
> supporting this may require further redesigns to style resolution.
>
> BUG=671904
>
> Review-Url: https://codereview.chromium.org/2564793002
> Cr-Commit-Position: refs/heads/master@{#445967}
> Committed: https://chromium.googlesource.com/chromium/src/+/96bee2c42c8df73523e971850215d29d1c40c15f

TBR=sashab@chromium.org,alancutter@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=671904

Review-Url: https://codereview.chromium.org/2649103008
Cr-Commit-Position: refs/heads/master@{#445994}
sigbjornf
Devirtualize Visitor and remove inline visitor specialization.
The Blink GC infrastructure requires its managed objects to provide
a "trace()" method which will visit all the heap references it keeps
into the Blink GC heap, by calling the "trace()" method on each of
these via an incoming |visitor| argument (a Visitor.)

The Visitor interface is really only used for that, i.e., to perform GC
marking, so the flexibility it provides by way of overridable virtual
methods, is unused. And it slows down the GC marking phase, something
the specialized "inline visitor" (InlineGlobalMarkingVisitor) demonstrated,
which devirtualized the mark() method, with noticable improvements to
overall GC marking times.

Given that and Visitor's use, devirtualize Visitor entirely and make
it a GC marking visitor and nothing else. Besides removing code complexity,
this also allows the removal of InlineGlobalMarkingVisitor along with
all the specialized trace() implementation methods that we emit for each
Blink GC managed object.

Performance numbers show a ~10% improvement on marking times for
oilpan_gc_times.{tough_animation_cases, blink_perf_stress}; code size
(Android(ARM) official build, content shell) is 180k less.

R=
BUG=683019

Review-Url: https://codereview.chromium.org/2652923002
Cr-Commit-Position: refs/heads/master@{#445993}
fs
Don't "repack" parameters in SVGElement::attributeChanged
Instead of making a AttributeModificationParams which always uses the
"directly" modification reason, just forward the original reason.
The 'reason' argument was added by [1] which did not indicate why SVG
elements would be subject to different treatment than regular elements.

[1] https://codereview.chromium.org/14234005

Review-Url: https://codereview.chromium.org/2652653002
Cr-Commit-Position: refs/heads/master@{#445698}
mstensho
Merge list of orthogonal writing mode roots into depth-ordered layout list.
If we're going to perform a series of subtree layouts, rather than one layout
from LayoutView, and we at the same time have a list of orthogonal writing mode
roots that need to be laid out before their ancestors, we need to make sure
that subtrees are laid out in an overall tree depth ordered manner, or we risk
skipping layout of a subtree needing layout. That would cause trouble for the
column balancer (which examines the tree after layout and expects everything to
be laid out), and quite possibly other kinds of trouble elsewhere too.

BUG=680224

Review-Url: https://codereview.chromium.org/2635143003
Cr-Commit-Position: refs/heads/master@{#445497}
mstensho
Don't cancel out scroll offset when calculating the clip rectangle for multicol.
We still want the clip rect to be relative to the multicol container, but we
cannot get there by using the location() of the flow thread's PaintLayer,
because then we'll then cancel out the scroll offset that's also baked into
offsetOfPaginationLayerFromRoot.

This CL will cause paint/invalidation/paged-with-overflowing-block-rl.html to
regress, but it turned out that it just passed by accident anyway. Having that
test broken is way less serious than barely being able to scroll at all in a
regular multicol container.

BUG=674640
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2643123004
Cr-Commit-Position: refs/heads/master@{#445478}
fs
Move 'id'-related invalidation to SVGElement::attributeChanged
There's no reason for 'id'-related invalidation to reside in
SVGElement::svgAttributeChanged since it has no interaction with an
(animated) SVG DOM attribute. Move it to SVGElement::attributeChanged
instead.
This will also enable us to make use of the old/new value that is
available in attributeChanged().

BUG=454767

Review-Url: https://codereview.chromium.org/2645383002
Cr-Commit-Position: refs/heads/master@{#445393}
fs
SVG objects with same idrefs conflict when under different shadow root
When SVG idrefs are the same, even though the
LayoutSVGResourcesContainers are created under different shadow roots,
they conflict and only the last one is available. The problem is that,
currently, the HashMap mapping id's to LayoutSVGResourcesContainers are
owned/scoped to the document instead of the treeScope.
This CL moves that hash map from document to treeScope, so that
LayoutSVGResourcesContainers with the same id in different shadow roots
won't conflict.

Currently the following 2 maps (which are wrapped into the
SVGDocumentExtensions class) are owned by document instead of treeScope:

  HashMap<AtomicString, LayoutSVGResourceContainer*> m_resources;
  HeapHashMap<AtomicString, Member<SVGPendingElements>> m_pendingResources;

Thus when a new LayoutSVGResourcesContainer with the same id is created,
it is inserted into m_resources and overwrites the one with the same
key (id).

This CL separates these 2 maps from SVGDocumentExtensions and wrap them
into a new class (named SVGTreeScopeResources), and lets TreeScope have
them as a member variable (m_svgTreeScopedResources).
This CL also moves the corresponding methods accessing these 2 maps into
the new class.

To make this work together with <use>, we need to make sure to use the
TreeScope of the "original" element. Move the helper from LayoutSVGTextPath
to SVGElement::treeScopeForIdResolution and then use that for this.

Based on https://codereview.chromium.org/2107153002 by Taijin Tei.

BUG=597080

Review-Url: https://codereview.chromium.org/2633143002
Cr-Commit-Position: refs/heads/master@{#445378}
tommyt
PaymentApp: Implement invokePaymentApp for Android
This change implements the
ServiceWorkerPaymentAppBridge.invokePaymentApp() function along with the
corresponding native InvokePaymentApp() function.

The signature of PaymentInstrument.invokePaymentApp() has also been
changed to add the payment details modifiers field, and to align the
ordering and naming of the arguments with the definition of the
PaymentAppRequest dictionary in the specification:

    https://w3c.github.io/webpayments-payment-apps-api/#sec-app-request

BUG=669876

Review-Url: https://codereview.chromium.org/2640743005
Cr-Commit-Position: refs/heads/master@{#445301}
sigbjornf
Disable g++ inlining of eager-tracing mark() method.
Versions of g++ (with -Os) are over-eager about inlining the mark()
method that's used for all non-mixin Oilpan objects, resulting in
a code size increase that's unwanted (for Android official builds.)
Other compilers and g++ (with -O2/-O3) are more discriminate about
inlining the method, with no comparable code size increase delta.

Tuning the compiler's optimization option set to avoid the problem
hasn't proven successful, so bluntly address the problem by disabling
inlining for the method.

R=haraken
BUG=681991

Review-Url: https://codereview.chromium.org/2643403003
Cr-Commit-Position: refs/heads/master@{#445288}
rune
Initially load new_tab.css with a timestamp for chrome://apps.
This is what incognito_tab.html already does. Changing the url to add a
timestamp query on DOMContentLoaded caused a FoUC.

BUG=681495
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2647653002
Cr-Commit-Position: refs/heads/master@{#445285}
sigbjornf
Have VisitorHelper<> handle moving object registration.
As the registration of objects is only done by a compacting
GC, there isn't any need to be indirect about registering
them - remove a layer of Visitor virtual methods and have
the VisitorHelper<> do the registration directly.

R=haraken
BUG=681991

Review-Url: https://codereview.chromium.org/2642933005
Cr-Commit-Position: refs/heads/master@{#445245}
perja
Enable more unittests for BlueZ and ChromeOS.
This patch fixes an issue with the DBUS naming needed for the generic unittests.
This again made it possible to enable a couple of more tests for BlueZ and
ChromeOS.

Review-Url: https://codereview.chromium.org/2640883002
Cr-Commit-Position: refs/heads/master@{#445117}
fs
'*' is not a valid attribute selector
Per the CSS Selectors specification [1], a '*' is not allowed as the
name of an attribute.

[1] https://drafts.csswg.org/selectors-4/#typedef-attribute-selector

BUG=681814

Review-Url: https://codereview.chromium.org/2646493002
Cr-Commit-Position: refs/heads/master@{#445046}
wdzierzanowski
Stop requiring a reader in MultibufferDataSource::SetBitrateTask()
Callers of MultibufferDataSource::SetBitrate() must not be required to
be aware of whether or not there is a |reader_| available, because
that's internal MultibufferDataSource state that changes for several
reasons, some of which aren't necessarily visible to the client calling
SetBitrate(), e.g., OnBufferingHaveEnough().

Note that UpdateBufferSizes(), called from SetBitrate(), handles the
case of a null |reader_| gracefully.

Review-Url: https://codereview.chromium.org/2647483003
Cr-Commit-Position: refs/heads/master@{#444867}
fs
Add SVGResources helper for resource-bounds invalidation
Add a new helper method removeClientFromCacheAffectingObjectBounds to
SVGResources to better describe the intention of code that performs this
operation (removeFromCacheAndInvalidateDependencies.) It also makes
LayoutSVGResourceContainer not depend on its derived classes.
Also make use of it in the generic SVGResources::removeClientFromCache.

Review-Url: https://codereview.chromium.org/2647443004
Cr-Commit-Position: refs/heads/master@{#444811}
fs
Serialize type and attribute selectors as identifiers
Per [1], both the element name of a type selector and the attribute name
of an attribute selector - as well as their corresponding namespace
prefix (if any) - should be serialized as identifiers [2].

[1] https://drafts.csswg.org/cssom/#serialize-a-simple-selector
[2] https://drafts.csswg.org/cssom/#serialize-an-identifier

BUG=681814

Review-Url: https://codereview.chromium.org/2645563002
Cr-Commit-Position: refs/heads/master@{#444766}
sigbjornf
Adjust placement of non-compaction checks.
The registration of movable objects and their callbacks should be
ignored when running non-compaction GCs. Move the GC kind check one
level out.

At the same time, make these registration methods untyped -- the
Allocator interface for heap collections already provide a typed view,
so unnecessary to extend that one more level.

R=haraken
BUG=

Review-Url: https://codereview.chromium.org/2645873002
Cr-Commit-Position: refs/heads/master@{#444760}
sigbjornf
LocalFileSystem::deleteFileSystem() is no longer used.
This method stopped being used when DevTools retired
its FileSystem API support (crbug.com/588817); follow
through and remove the unused implementation.

R=nhiroki,kinuko,haraken
BUG=

Review-Url: https://codereview.chromium.org/2640963002
Cr-Commit-Position: refs/heads/master@{#444667}
mstensho
[LayoutNG] Initial support for multicol, introducing NGBlockBreakToken.
We can now lay out block-level floats and in-flow blocks inside a multicol
container. Note that painting and hit testing doesn't work too well, since
those operations are still performed on the legacy LayoutObject tree, and
there's no way to fragment a LayoutObject.

No attempt has been made at integrating this with out-of-flow positioning or
inline-level layout.

Review-Url: https://codereview.chromium.org/2632523002
Cr-Commit-Position: refs/heads/master@{#444512}
mstensho
Percent-width blocks cannot form a re-layout boundary.
A block with non-visible overflow can only form a re-layout boundary if both
width and height are fixed.

The block may be inside a shrink-to-fit container (there's no cheap and
reliable way to detect that), so that changes inside it may affect its width.

BUG=681657

Review-Url: https://codereview.chromium.org/2643703002
Cr-Commit-Position: refs/heads/master@{#444467}
fs
Split svg/dom/transform-parser.html
This CL splits the mentioned test into two to alleviate the potential
for test timeouts.
The bulk of the test is moved to a JS file, and the js-test dependency
is dropped since the only useful output of this test is the console log
generated.
The TestExpectations entry is dropped.

BUG=664849

Review-Url: https://codereview.chromium.org/2646503002
Cr-Commit-Position: refs/heads/master@{#444418}
sigbjornf
Leave out empty-valued Access-Control-Request-Headers: on preflights.
Following https://github.com/whatwg/fetch/issues/459 , the above
preflight header should not be included if the request following CORS
has no headers to enumerate in a preflight.

R=tyoshino,yhirano
BUG=633729

Review-Url: https://codereview.chromium.org/2633423003
Cr-Commit-Position: refs/heads/master@{#444303}
fs
Resolve CSS url(...) non-<image> values against the correct base
In an external stylesheet, the url(...) should resolve against the URL of
the stylesheet. We were always resolving against the document base URL,
meaning that 'filter' url(...)'s referencing external files could resolve
to the wrong URL.
Besides this, add a more generic mechanism to determine whether a CSSValue
contains a URL (and hence may need to be re-resolved if it's within an
inline style declaration, and it's context element is moved to a different
document.)
Also adjust the <canvas> 'filter' implementation to resolve against the
elements document when applicable.

BUG=405315

Review-Url: https://codereview.chromium.org/2625873010
Cr-Commit-Position: refs/heads/master@{#444179}
bratell
Split renderer.lib on Windows to avoid files larger than 2GB.
In certain configurations renderer.lib can exceed 2GB in size which is
too much for the 32 bit build tools. Splitting it avoids that problem.

BUG=679644

Review-Url: https://codereview.chromium.org/2622583005
Cr-Commit-Position: refs/heads/master@{#444143}
mstensho
Introduce LayoutObject::AncestorSkipInfo.
This replaces three optional parameters to container() and similar methods.

No behavioral changes intended.

Review-Url: https://codereview.chromium.org/2634493007
Cr-Commit-Position: refs/heads/master@{#444105}
sigbjornf
Document::shutdown(): remove unnecessary static_cast<>.
R=
BUG=

Review-Url: https://codereview.chromium.org/2638883002
Cr-Commit-Position: refs/heads/master@{#444061}
mstensho
Try to avoid working on zero-height column sets, when possible.
We may end up with an empty column set between two column spanners, if there is
zero-height column content "separating" them.

We typically have no business inside a zero-height column set, since
fragmentation is impossible there. Fragmentation requires a positive
fragmentainer block size to ensure content progression. So keep looking for a
column set that has a height, and use that one instead, as long as its flow
thread start offset is the same as the one we were requested to map to a
column set.

BUG=675100

Review-Url: https://codereview.chromium.org/2631013002
Cr-Commit-Position: refs/heads/master@{#443998}
sigbjornf
Do not initiate fetch() on a detached FetchManager.
R=
BUG=681378

Review-Url: https://codereview.chromium.org/2631153002
Cr-Commit-Position: refs/heads/master@{#443897}
fs
Provide a CSSParserContext to CSSSyntaxDescriptor
Add a CSSParserContext* argument to CSSSyntaxDescriptor::parse to allow
CSSValues to be resolve against a proper parser context, and resolve
relative URLs and other sourcing sensitive data.
Provide parser contexts as available on call-sites, or use the
strictCSSParserContext() if none is available. Move the TODO up the
callstack as needed.

BUG=618165

Review-Url: https://codereview.chromium.org/2632083002
Cr-Commit-Position: refs/heads/master@{#443882}
sigbjornf
Remove PageVisibilityObserver contextDestroyed() notifications.
PageVisibilityObserver allows a Page's lifetime states to be
observed, but none of the observers need to be notified of Page
destruction.

Adjust LifecycleNotifier<>::notifyContextDestroyed(), having it
call its corresponding LifecycleObserver's  contextDestroyed()
notification method if the observer implements it, but not require
that it does implement contextDestroyed(). With that in place,
only have the lifecycle observers that need a contextDestroyed()
notification (all but PageVisibilityObserver) declare it.

This allows the removal of all the empty
PageVisibilityObserver::contextDestroyed() overrides.

R=haraken
BUG=610176

Review-Url: https://codereview.chromium.org/2634713002
Cr-Commit-Position: refs/heads/master@{#443816}
bjornr
Fixed google::FindSymbol reading past end of a section
The symbol reading logic of google::FindSymbol was reading symbols in
blocks of N, not accounting for that a section might not have a multiple
of N symbols in it.

This makes it read in blocks of N or the number of symbols remaining,
whichever is smallest.

BUG=672481

Review-Url: https://codereview.chromium.org/2566623003
Cr-Commit-Position: refs/heads/master@{#443571}
perja
bluetooth: bluez: Fixed issue with missing notifications after reconnect.
BUG=680099

Review-Url: https://codereview.chromium.org/2625013003
Cr-Commit-Position: refs/heads/master@{#443451}
sigbjornf
Simplify visitor marking mode tracking.
Move the marking mode to VisitorHelper<>, so that
both Visitor and InlinedGlobalMarkingVisitor can access
and reuse it.

In order to do so, hoist out Visitor::MarkingMode as an
enum class.

R=
BUG=

Review-Url: https://codereview.chromium.org/2625363002
Cr-Commit-Position: refs/heads/master@{#443444}
fs
Look for favicon URLs (and similar <link>s) in SVG documents
Previously we were only looking for <link>s with icons within <head>,
and since SVG document don't have those, no icons would be found.
Instead, for SVG documents (with a root/document element of <svg>), just
collect all <link> (HTMLLinkElement) elements, regardless of position in
the document, using a pre-order traversal. This appears to match the
behavior of Gecko.

BUG=385466

Review-Url: https://codereview.chromium.org/2628873003
Cr-Commit-Position: refs/heads/master@{#443336}
sigbjornf
Revert ExtendableMessageEvent same heap verification.
Revert r440390's debug instrumentation of ExtendableMessageEvent.

R=
BUG=655926

Review-Url: https://codereview.chromium.org/2623273004
Cr-Commit-Position: refs/heads/master@{#443299}
mstensho
[LayoutNG] Make NGLayoutInputNode::AlgorithmForInputNode() more readable.
Use early returns and variables to avoid unwanted line breaks in statements.

Review-Url: https://codereview.chromium.org/2631513002
Cr-Commit-Position: refs/heads/master@{#443284}
mstensho
[LayoutNG] Put #includes in alphabetical order.
Review-Url: https://codereview.chromium.org/2623423003
Cr-Commit-Position: refs/heads/master@{#443279}
sigbjornf
Revert "Verify that FetchEvent::m_request holds same-thread reference."
Undo r440475's temporary use of SameThreadCheckedMember<>.

R=
BUG=655926

Review-Url: https://codereview.chromium.org/2629613002
Cr-Commit-Position: refs/heads/master@{#443257}
rune
Try to do less work clearing the font-cache in StyleEngine::didDetach.
Clearing the whole font-cache without considering css-connected fonts
could be cheaper. This is a speculative fix for issue 677415.

BUG=677415

Review-Url: https://codereview.chromium.org/2622673003
Cr-Commit-Position: refs/heads/master@{#443202}
tmoniuszko
Add missing url/gurl.h include
Functions declared in this file return GURL by value.

BUG=

Review-Url: https://codereview.chromium.org/2627883003
Cr-Commit-Position: refs/heads/master@{#443187}
fs
Add test for style 'transform' vs. presentation attribute 'transform'
The former should "win" over the latter.
Fixed by https://codereview.chromium.org/2478233002.

TBR=pdr@chromium.org
BUG=415950

Review-Url: https://codereview.chromium.org/2621153005
Cr-Commit-Position: refs/heads/master@{#442980}
fs
Update svg/wicd/test-rightsizing-b.xhtml Mac expectations
Less stale expectations (DRT format changes.)

TBR=schenney@chromium.org
NOTRY=true
BUG=639147

Review-Url: https://codereview.chromium.org/2628893002
Cr-Commit-Position: refs/heads/master@{#442935}
fs
Block animation of the SVGScriptElement
'href' should not be animatable for SVGScriptElements, but currently is.
This will "break" animation of 'className' on the same element.

R=mkwst@chromium.org,pdr@chromium.org
BUG=679291

Review-Url: https://codereview.chromium.org/2618323002
Cr-Commit-Position: refs/heads/master@{#442915}
sigbjornf
Remove redefinitions of ExceptionCode.
R=haraken
BUG=
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2625053002
Cr-Commit-Position: refs/heads/master@{#442878}
sigbjornf
Remove marking visitors' shouldMarkObject().
With per-thread heap handling being fully enabled, checking for any
cross-thread pointer marking (and not doing it), is no longer an issue.

Retire the should-mark predicate.

R=haraken
BUG=671856

Review-Url: https://codereview.chromium.org/2617393004
Cr-Commit-Position: refs/heads/master@{#442554}
sigbjornf
Drop MSVC pch warning avoidance.
Unable to reproduce the warning with VS2015; let's try to remove this
special case.

R=
BUG=

Review-Url: https://codereview.chromium.org/2621763002
Cr-Commit-Position: refs/heads/master@{#442368}
sigbjornf
Handle repeated and overlapping (re)starts of mock speechrecognizer.
R=tommi
BUG=678863

Review-Url: https://codereview.chromium.org/2617113002
Cr-Commit-Position: refs/heads/master@{#442337}
rune
Added trace for scheduleInvalidationsForRuleSets.
R=esprehn@chromium.org
BUG=678849

Review-Url: https://codereview.chromium.org/2620673002
Cr-Commit-Position: refs/heads/master@{#442332}
sigbjornf
Prefer ContextClient mixin over manual ExecutionContext handling.
The ContextClient mixin interface bundles up the safe handling of
references to ExecutionContexts. Prefer using it over keeping explicit
Member<ExecutionContext> references.

R=
BUG=610176

Review-Url: https://codereview.chromium.org/2622533002
Cr-Commit-Position: refs/heads/master@{#442250}
mostynb
avoid GCC content::CacheStorage::kSizeUnknown redeclaration error
Fixes:
../../content/browser/cache_storage/cache_storage.cc:62:29: error: redeclaration 'content::CacheStorage::kSizeUnknown' differs in 'constexpr'

BUG=617963

Review-Url: https://codereview.chromium.org/2607983002
Cr-Commit-Position: refs/heads/master@{#442242}
sigbjornf
CrossOriginAccessControl: separate access checks and error message generation
The checking and construction of legible error messages can with benefit
be separated, having the security access checks return an error status
which then can be used to generate a suitable error message.

Along with separating the two, switch to using StringBuilders.

R=
BUG=

Review-Url: https://codereview.chromium.org/2616323002
Cr-Commit-Position: refs/heads/master@{#442236}
tsniatowski
Add use_rtti gn arg to enable rtti globally in the build
Some sanitizer configs already enabled rtti, move the logic to the arg
default value to make experimenting easier. Can be useful when dealing
with some asan-instrumented build startup issued that may go away when
rtti is enabled globally, but don't fall into the existing enable-rtti
cases.

One example scenario I had was with a shared_library built with both rtti
and exceptions (in a downstream project) causing immediate asan failure
on startup around std::exception typeinfo alignment. Rebuilding with
rtti enabled globally made things work, so it helps if that's possible
with just a gn arg.

Note that targets that need rtti to be not disabled regardless of global
settings (e.g. third party libraries like icu that need rtti to build)
can still remove the //build/config/compiler:no_rtti config and add
//build/config/compiler:rtti in its place; this is unchanged.

BUG=webrtc:6468

Review-Url: https://codereview.chromium.org/2607903002
Cr-Commit-Position: refs/heads/master@{#442227}
rune
Use setNeedsActiveStyleUpdate instead of markTreeScopeDirty.
setNeedsActiveStyleUpdate checks if the document is active before
calling markTreeScopeDirty. This avoids marking shadow root tree scopes
dirty for non-active documents which caused a DCHECK fail in
markTreeScopeDirty.

R=esprehn@chromium.org
BUG=676441

Review-Url: https://codereview.chromium.org/2611053004
Cr-Commit-Position: refs/heads/master@{#442028}
sigbjornf
Enable type_traits fallback for all < gcc 5.0 releases.
Fixes compilation failures with various < gcc-5.0  toolchains lacking
std::is_trivially_copyable<T>. Without it, compile errors like

../../base/template_util.h:189:36: error: no type named 'is_trivially_copyable' in namespace 'std'
using is_trivially_copyable = std::is_trivially_copyable<T>;
                              ~~~~~^
../../base/template_util.h:189:57: error: expected ';' after alias declaration
using is_trivially_copyable = std::is_trivially_copyable<T>;
                                                        ^
                                                        ;
will be encountered.

R=danakj
BUG=555754

Review-Url: https://codereview.chromium.org/2612933003
Cr-Commit-Position: refs/heads/master@{#441985}
rune
Use master StyleEngine to evaluate MQ in html imports.
The StyleEngine for html import documents does not have a Frame which
means size media queries will always evaluate to true. We incorrectly
replaced a passed-in master document StyleEngine with the StyleEngine
from the DocumentStyleSheetCollection in https://crrev.com/90d4ea3d
That was wrong for evaluating media queries.

R=meade@chromium.org
BUG=677963

Review-Url: https://codereview.chromium.org/2618803002
Cr-Commit-Position: refs/heads/master@{#441899}
rune
Added layout test for issue 318468.
Check that adding a type selector rule only invalidates elements with
that type.

R=sashab@chromium.org
BUG=318468

Review-Url: https://codereview.chromium.org/2615713005
Cr-Commit-Position: refs/heads/master@{#441823}
rune
Revert of Don't post multiple task for executing blocked scripts. (patchset #2 id:20001 of https://codereview.chromium.org/2609763002/ )
Reason for revert:
Regression in test for time to first meaningful paint: https://crbug.com/678584

Original issue's description:
> Don't post multiple task for executing blocked scripts.
>
> We may post a lot of tasks for executing blocked scripts in the case
> where we insert multiple shadow trees each containing a style element.
> When we start parsing a style element, we mark it as blocking and
> unblock script execution after finishing parsing. Check if the previous
> task is active before posting.
>
> Found while measuring performance for issue 603621.
>
> BUG=603621
>
> Committed: https://crrev.com/26cb3bdcd2a353402b78b716862567226317dff0
> Cr-Commit-Position: refs/heads/master@{#441110}

TBR=pmeenan@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=603621

Review-Url: https://codereview.chromium.org/2617763002
Cr-Commit-Position: refs/heads/master@{#441783}
sigbjornf
eventTargetData(): pull (most of) this singleton off-heap.
Diagnose mutation of GCed object by pulling the collection
wrapper off heap also.

R=
BUG=678532

Review-Url: https://codereview.chromium.org/2616913002
Cr-Commit-Position: refs/heads/master@{#441668}
rune
Need to clear viewport dependent units when switching print mode.
Switching between print and screen changes the size of the initial
containing block. Viewport dependent lengths need to be recalculated
and the cache for matched properties cleared.

Normally, notifyResizeForViewportUnits() is called from
performPreLayoutTasks when the initial containing block size changes.
That does not happen when laying out for printing and going back to
screen layout. We skip setting m_lastLayoutSize in
sendResizeEventIfNeeded. We probably do that to avoid triggering resize
events going back and forth between the print (preview) size.

Make sure we clear the matched properties cache from StyleResolver when
updating the media type.

R=mstensho@opera.com
BUG=677799

Review-Url: https://codereview.chromium.org/2613733003
Cr-Commit-Position: refs/heads/master@{#441642}
sigbjornf
Tidy up XMLHttpRequest::endLoading().
R=tyoshino
BUG=

Review-Url: https://codereview.chromium.org/2610653002
Cr-Commit-Position: refs/heads/master@{#441618}
perja
bluetooth: bluez: Implement BluetoothRemoteGattCharacteristicBluez::SubscribeToNotifications and UnsubscribeFromNotifications.
BUG=636275

Review-Url: https://codereview.chromium.org/2613473002
Cr-Commit-Position: refs/heads/master@{#441456}
sigbjornf
Simplify WorkerGlobalScope::m_eventListeners.
Switch to using a 'mere' HashSet<> for these event listeners. Mainly
done to diagnose GC instability, but removing the use of an involved
abstraction like HeapListHashSet<> is something wanted regardless.

R=
BUG=677654

Review-Url: https://codereview.chromium.org/2609413002
Cr-Commit-Position: refs/heads/master@{#441364}
rune
Avoid unnecessary updateActiveStyle comparing shadow styles.
Found while checking performance for issue 603621.

Style sharing is done during style recalc at which point we know that
the active style is up-to-date. Instead of using the API for
document.styleSheets, compare active stylesheets in ScopedStyleResolver
directly.

BUG=603621

Review-Url: https://codereview.chromium.org/2610513003
Cr-Commit-Position: refs/heads/master@{#441357}
fs
Push attributeName handling down into SVGAnimateElement
SVGAnimateElement (and derived classes) is where 'attributeName' has any
meaning. Move setting/updating of the resolved 'attributeName' value
there. This allows setAttributeName to be devirtualized.
Storage is kept at the SVGSMILElement level because of how it's used at
schedule/unschedule time.

BUG=641437

Review-Url: https://codereview.chromium.org/2602423002
Cr-Commit-Position: refs/heads/master@{#441356}
sigbjornf
Enforce canCopyWithMemcpy constraint over TerminatedArray<T>.
R=
BUG=

Review-Url: https://codereview.chromium.org/2610113002
Cr-Commit-Position: refs/heads/master@{#441352}
fs
Use ShadowData in DropShadowFilterOperation
This replaces the "open-coded" (and somewhat compacted) version of a
ShadowData structure within DropShadowFilterOperation with an actual
ShadowData. While this makes the structure slightly larger, it allows
for some additional code-reuse - mostly around style resolution. It's
also a first step against more correct handling of the 'currentcolor'
value within the drop-shadow(...) filter function.
There's a slight change in behavior since ShadowData stores the relevant
values as 'float' rather than as 'int' like the "open-coded" version.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2609803002
Cr-Commit-Position: refs/heads/master@{#441351}
rune
Don't post multiple task for executing blocked scripts.
We may post a lot of tasks for executing blocked scripts in the case
where we insert multiple shadow trees each containing a style element.
When we start parsing a style element, we mark it as blocking and
unblock script execution after finishing parsing. Check if the previous
task is active before posting.

Found while measuring performance for issue 603621.

BUG=603621

Review-Url: https://codereview.chromium.org/2609763002
Cr-Commit-Position: refs/heads/master@{#441110}
sigbjornf
Always adjust container size when tracing HeapVectorBacking contents.
R=haraken
BUG=677738

Review-Url: https://codereview.chromium.org/2602363002
Cr-Commit-Position: refs/heads/master@{#441107}
sigbjornf
WindowAudioWorklet: gracefully handle detached use.
R=haraken
BUG=677612

Review-Url: https://codereview.chromium.org/2607353002
Cr-Commit-Position: refs/heads/master@{#441094}
sigbjornf
Add missing HeapCompact DCHECK().
R=
BUG=

Review-Url: https://codereview.chromium.org/2604403002
Cr-Commit-Position: refs/heads/master@{#441072}
sigbjornf
No longer clean out main thread's heap for LSan's benefit.
The extra GCing that cleanupMainThread() appears to be redundant, as
LSan will have performed leak detection prior to the main thread shutting
down.

R=
BUG=677684

Review-Url: https://codereview.chromium.org/2604413002
Cr-Commit-Position: refs/heads/master@{#441068}
sigbjornf
Retire speechrecognition-restart-onend.html leak expectation.
No longer reported as leaking.

TBR=jbroman@chromium.org
BUG=670324
NOTRY=true

Review-Url: https://codereview.chromium.org/2603273002
Cr-Commit-Position: refs/heads/master@{#441066}
sigbjornf
WorkerGlobalScope: verify same-heap event listeners.
To help narrow down failures during tracing of a WorkerGlobalScope's
event listeners, verify that the listeners added belong to the
same heap as the WorkerGlobalScope itself.

R=
BUG=677654

Review-Url: https://codereview.chromium.org/2608113002
Cr-Commit-Position: refs/heads/master@{#441058}
sigbjornf
Remove ThreadState::callThreadShutdownHooks() declaration.
No longer provided and used.

R=
BUG=

Review-Url: https://codereview.chromium.org/2608933002
Cr-Commit-Position: refs/heads/master@{#441041}
hugoh
Fix for building with ancient toolchain
At Opera we test our SDK on an old MIPS device with a
peculiar toolchain. To be able to compile ImageDocument.o,
we need to call std::round(), not just round().

BUG=none

Review-Url: https://codereview.chromium.org/2548783002
Cr-Commit-Position: refs/heads/master@{#440950}
tommyt
PaymentApp: Implement nativeGetAllAppManifests
This change connects the ServiceWorkerPaymentAppBridge to the service
worker payment app code in content/browser/payments. This allows
installed service worker payment apps to show up in the Payment Request
dialog.

I also replace "String scopeUrl" with "long registrationId" as the
identifier for service worker payment apps.

This code is protected by the kServiceWorkerPaymentApps feature flag.

BUG=661608

Review-Url: https://codereview.chromium.org/2586213002
Cr-Commit-Position: refs/heads/master@{#440746}
fs
Remove SVGAnimateElement::hasValidAttributeType
Incorporate said method into its only caller - hasValidTarget - and
override that one in SVGAnimateTransformElement instead.
Also fold animatedPropertyType() into hasValidTarget and get rid of
hasInvalidCSSAttributeType() in favor of "naked" access to the
underlying boolean flag.

BUG=641437

Review-Url: https://codereview.chromium.org/2599853003
Cr-Commit-Position: refs/heads/master@{#440716}
sigbjornf
Remove unwanted declaration of storage for NeedsAdjustAndMark<>.
This rolls back the change made in

 https://codereview.chromium.org/429793003/

We shouldn't have to do this if the class type has been fully
instantiated and "used". Traits used to direct compilation won't run
into this (as the expression will clearly have to be evaluated at
compile-time), but gtest usage of traits may end up evaluating their
predicate expressions in compiled code, thus requiring that the trait
has been instantiated in the compilation unit already. Declaring one
for all uses of NeedsAdjustAndMark<> is too strong, and isn't needed
really (now) -- retire, but avoid running into the issue for the
corresponding unit test.

R=
BUG=

Review-Url: https://codereview.chromium.org/2599643004
Cr-Commit-Position: refs/heads/master@{#440618}
fs
Fold SVGAnimatedTypeAnimator into SVGAnimateElement
This folds the functionality of SVGAnimatedTypeAnimator, mostly
verbatim, into SVGAnimateElement. Some methods are renamed, and a new
interface is defined, which allows <animateTransform> to be more
isolated from the rest of the <animate> implementation.
SVGAnimateElement::m_animatedProperty is renamed to m_animatedValue, and
SVGAnimatedTypeAnimator::m_animatedProperty is renamed to
m_targetProperty.
Dial down or remove some asserts in favor of other asserts.

BUG=641437

Review-Url: https://codereview.chromium.org/2595393002
Cr-Commit-Position: refs/heads/master@{#440613}
rune
Reschedule sibling invalidations as descendant on removal.
When removing elements we schedule sibling invalidations based on
element attributes and state as descendant invalidations when
necessary. However, that didn't work correctly if we removed an
attribute and then removed the element before the sibling invalidation
for the attribute was effectuated.

For instance, if you remove a class affecting succeeding siblings
through selectors, we schedule an invalidation set for that change, but
it will be cleared right after if we remove the element (see the added
test).

Instead we reschedule sibling invalidations on the parent node before
the invalidations for the removed element are cleared.

R=esprehn@chromium.org
BUG=674326

Review-Url: https://codereview.chromium.org/2592423002
Cr-Commit-Position: refs/heads/master@{#440598}
sigbjornf
Verify that FetchEvent::m_request holds same-thread reference.
To diagnose instability seen during GCs of FetchEvents, instrument
the m_request member, checking that we only create event object containing
references to Requests that reside in the current thread's heap.

R=
BUG=655926

Review-Url: https://codereview.chromium.org/2594423002
Cr-Commit-Position: refs/heads/master@{#440475}
sigbjornf
Make use of ContextClient in modules/speech/
Switch to reusing ContextClient rather than have SpeechSynthesis{Utterance}
explicitly hold ExecutionContext member references.

R=
BUG=610176

Review-Url: https://codereview.chromium.org/2595323002
Cr-Commit-Position: refs/heads/master@{#440432}
fs
Update TODO(s) in SVGTransform.idl
Update SVGMatrix vs. DOMMatrix{,ReadOnly} references to match
https://svgwg.org/svg2-draft/coords.html#InterfaceSVGTransform.

TBR=foolip@chromium.org

Review-Url: https://codereview.chromium.org/2599753002
Cr-Commit-Position: refs/heads/master@{#440400}
sigbjornf
Verify that ExtendableMessageEvent's message ports reside on the same heap
To potentially help diagnose a GC crash (see associated bug), verify
that ExtendableMessageEvent's MessagePortArray and MessagePorts belong
to the same thread heap as the event object.

R=haraken
BUG=655926

Review-Url: https://codereview.chromium.org/2589333005
Cr-Commit-Position: refs/heads/master@{#440390}
fs
Clamp rgba(...) alpha value in the CSS fast-path parser
The general CSS parser will clamp the alpha value to the [0, 1] range,
while the fast-path parser does not. This means that large alpha values
will result in overflow in the cast to int, yielding the wrong color
value.
Add a clamp to the [0, 1] range before converting to the [0, 256) range
and converting to int. Because negative values are handled separately,
we only need to apply the clamp for the range above zero.

BUG=675158

Review-Url: https://codereview.chromium.org/2588293004
Cr-Commit-Position: refs/heads/master@{#440374}
sigbjornf
Introduce ThreadState::isOnThreadHeap() helper predicate.
Simple helper to make testing for on-thread-heap conditions easier.

R=
BUG=

Review-Url: https://codereview.chromium.org/2599533002
Cr-Commit-Position: refs/heads/master@{#440370}
mstensho
Even empty block intervals should be associated with a fragmentainer.
We need to visit the fragmentainer that a block lives in even if said block has
zero height. If we find a column set, don't perform initial bounds checking.

BUG=675943

Review-Url: https://codereview.chromium.org/2597633002
Cr-Commit-Position: refs/heads/master@{#440361}
fs
Improve separation between "SMIL times" and timestamps
The 'elapsed' time does not need to be a SMILTime in general - it can
only be non-finite in the case where the document is not active, and
then the timeline should not be running/animations updated.
Thread the double value further from SMILTimeContainer down into
SVGSMILElement. Simplify some computations.

BUG=641437,676137

Review-Url: https://codereview.chromium.org/2592103002
Cr-Commit-Position: refs/heads/master@{#440171}
mostynb
fix mojom bindings generator exception error message
Followup to https://codereview.chromium.org/2171033002

Review-Url: https://codereview.chromium.org/2591123003
Cr-Commit-Position: refs/heads/master@{#440142}
sigbjornf
SameThreadCheckedMember<>: verify same-thread usage of heap references.
In debug builds, Member<> checks that the heap references stored resides
in a heap belonging to the same thread as the Member<> itself. The check
carries some overhead, hence it is not enabled outside of checked builds.

In order to be able to diagnose and catch code that incorrectly stores
heap pointers belonging to other threads in a Member<>, add the
SameThreadCheckedMember<> variant of Member<>. A drop-in replacement
for Member<> that can be used to selectively diagnose.

R=
BUG=

Review-Url: https://codereview.chromium.org/2592063002
Cr-Commit-Position: refs/heads/master@{#440117}
fs
Use double precision in SVGLengthContext::convertValueToUserUnits
This method does a bunch of <float> * <double> operations, which tickles
UBSANs float-overflow warning when the result is stored back into the
float (single precision) local variable.
We clamp the result to a narrow enough range already at the end (and
hence won't see any effects of the overflow, at least assuming IEEE754),
but might as well use a double precision local variable, since that
actually seems to save a few instructions while also avoiding the
overflowing conversion.

BUG=675140

Review-Url: https://codereview.chromium.org/2591663003
Cr-Commit-Position: refs/heads/master@{#440056}
rune
Clear active tree scopes on StyleEngine::didDetach().
clearResolver() is not only called on didDetach(). Make it private and
name it clearResolvers to reflect that it clears scoped resolvers as
well. The comments related to style resolver reconstructruction is
removed as that does not happen anymore.

Clearing m_treeBoundaryCrossingScopes is moved into didDetach()
which was a more natural place.

Clear active and dirty tree scopes in didDetach to not unnecessarily
hang on to any memory associated with them.

These changes were done investigating issue 675533, but won't
necessarily fix anything for that issue.

BUG=567021,675533

Review-Url: https://codereview.chromium.org/2593643002
Cr-Commit-Position: refs/heads/master@{#439973}
rune
Clear CSSGlobalRuleSet on StyleEngine::didDetach().
This could free up memory sooner. Found while investigating 675533, but
not confirmed that this fixes that issue.

BUG=675533

Review-Url: https://codereview.chromium.org/2589243002
Cr-Commit-Position: refs/heads/master@{#439935}
mstensho
Need to be inside the flow thread before converting a visual point.
Before we can convert from a visual point to a flow thread point, we need the
input point to be exactly relative to the flow thread, or we might end up
mapping it to the wrong column.

In other words, we need to add the flow thread object's location before
converting into the flow thread coordinate space. While the flow thread indeed
is at 0,0 (or at least close enough to 0,0) relatively to the multicol
container in very many cases, this isn't true when the multicol container is in
rtl writing-mode, or when it's scrollable, or even when the multicol container
has borders and/or padding.

BUG=663062

Review-Url: https://codereview.chromium.org/2593633002
Cr-Commit-Position: refs/heads/master@{#439855}
sigbjornf
Disallow heap objects containing unsafe on-heap iterators.
Do not allow BlinkGC managed objects to include unsafe iterators of
other heap objects; that is, do not allow them to keep iterator
part objects as fields.

These iterators contain untraced references, which is in general
unsafe practice and breaks the general rule that all heap references
must be known to the GC infrastructure, and be marked and traced
through.

This applies to all heap collection iterators but HeapListHashSet<>'s,
which can be safely traced. It is also the only collection iterator
which is kept as a field of an on-heap object (CSSSegmentedFontFace.)

R=haraken
BUG=672030

Review-Url: https://codereview.chromium.org/2588943002
Cr-Commit-Position: refs/heads/master@{#439784}
rune
Don't update global ruleset when active style is dirty.
CSSGlobalRuleSet should always be collected as part of the active style
update. RuleSets may have been cleared from StyleSheetContents as a
result of media query changes for instance.

For the given issue, we tried to limit to a global ruleset when lazy-
loading fullscreen UA style, but as part of going fullscreen we had
already cleared rule sets for stylesheets with media queries due to the
media feature change.

BUG=675439

Review-Url: https://codereview.chromium.org/2590793003
Cr-Commit-Position: refs/heads/master@{#439781}
mstensho
Make column snapping optional when translating to flow thread coordinates.
positionForPoint() wants this, but mapAncestorToLocal() requires that no
special behavior be applied.

While this CL doesn't fix bug 663062, it is a prerequisite for fixing it
without breaking existing tests (MulticolWithAbsPosNotContained in
MapCoordinatesTest unit test).

BUG=663062

Review-Url: https://codereview.chromium.org/2590463002
Cr-Commit-Position: refs/heads/master@{#439758}
sigbjornf
Tracing HeapListHashSet<> iterators.
The HeapListHashSet<> iterators keep a pair of heap references, which
really should be traced like any other such reference during GCs. This
isn't unsafe for the stack allocated uses of these iterators, but one
Blink object (CSSSegmentedFontFace) keeps an iterator as a field on the
heap, we really have to trace these on-heap part object iterators.

Add the needed infrastructure and use it for CSSSegmentedFontFace.

R=haraken
BUG=672030

Review-Url: https://codereview.chromium.org/2583363002
Cr-Commit-Position: refs/heads/master@{#439748}
rune
Removed expected Trusty dbg failure after fix.
R=rjkroege@chromium.org
BUG=675055

Review-Url: https://codereview.chromium.org/2586393002
Cr-Commit-Position: refs/heads/master@{#439723}
fs
Stricter float-to-int conversion in SVGIntegerOptionalInteger
SVGIntegerOptionalInteger parses values as floats but stores them as
integers. Add helpers to avoid issues with overflow and to make this
conversion the same way in all places it's needed.
The "normal" parsing code would truncate the float value while the parsing
code for animation values would round. Make them both use truncation (and the
avoid duplicating the code.)

BUG=675130

Review-Url: https://codereview.chromium.org/2590433002
Cr-Commit-Position: refs/heads/master@{#439533}
fs
Use a stricter limit for the exponent range in genericParseNumber
The exponent was being checked against numeric_limits<...>::max_exponent
which is the power-of-two limit. Use max_exponent10 instead. Also make
sure to apply any exponent sign prior to the range check so that
min_exponent10 can be used as the lower bound. This means computing the
base number before checking for/parsing the exponent part. This could
be slower in some cases, but reasonably only when an error is
encountered. Also, scientific notation should be fairly scarce to begin
with.

Also move declarations of local variables closer to their first use (and
in the inner-most scope possible.) Unravel the handling of/accumulation
into 'frac' when computing the decimal part.

BUG=675174

Review-Url: https://codereview.chromium.org/2588023002
Cr-Commit-Position: refs/heads/master@{#439522}
rune
Get rid of @font-face resource leak.
Clear the StyleEngine of css connected fonts on detach().

This used to be saved by an active stylesheet update, it seems. With
the new active stylesheet update this is done more selectively and it
might have been done when document going inactive before. Clearing the
font cache on detach fixes the leak issues in css3/fonts.

TEST=css3/fonts/
BUG=674934

Review-Url: https://codereview.chromium.org/2582413002
Cr-Commit-Position: refs/heads/master@{#439510}
rune
Fixed flaky fullscreen video test.
The media controls are (at least sometimes) painted twice. The second
time after figuring out how many buttons fit into the available width.
At least one of the fullscreen tests were flaky because the first paint
was dumped instead of the second one. Adding a layoutAndPaintAsyncThen
in the full-screen-test.js framework seems to fix the issue.

Although the issue was filed after landing changes for issue 567021,
the flakiness is also seen locally without those changes running the
test with --repeat-each=30 in debug.

R=fs@opera.com
TEST=virtual/android/fullscreen/full-screen-stacking-context.html
BUG=675055

Review-Url: https://codereview.chromium.org/2586243002
Cr-Commit-Position: refs/heads/master@{#439483}
fs
Clamp radii in FEMorphology::createImageFilter
Sk{Dilate,Erode}ImageFilter::Make take the radii as integers (int), so
make sure to convert the float FEMorphology stores avoiding overflow.

BUG=675164

Review-Url: https://codereview.chromium.org/2585233002
Cr-Commit-Position: refs/heads/master@{#439474}
fs
Fix HTML parser CDATA edge-case and sync state names with spec
When encountering a sequence of ']]]' at the end of a CDATA section, we
should only buffer one ']' (the first one) and "remember" the other two.

The states exists in the spec[1][2][3] nowadays, so sync the names and remove
the comment about the states not being in the spec.

Fixes two subtests of wpt/html/syntax/parsing/html5lib_tests21.html.

[1] https://html.spec.whatwg.org/multipage/syntax.html#cdata-section-state
[2] https://html.spec.whatwg.org/multipage/syntax.html#cdata-section-bracket-state
[3] https://html.spec.whatwg.org/multipage/syntax.html#cdata-section-end-state

BUG=674496

Review-Url: https://codereview.chromium.org/2576373002
Cr-Commit-Position: refs/heads/master@{#439396}
rune
Removed resolverChanged().
This method was now empty and has been replaced by asynchronous active
stylesheet update in updateActiveStyleSheets().

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2559613002
Cr-Commit-Position: refs/heads/master@{#439142}
rune
Setting preferred stylesheet simplified.
With active stylesheets being applied asynchronously, we no longer need
to avoid the synchronous stylesheet update during link processing. We
can just mark the treeScope dirty to trigger the preferred set to be
updated as part of updateActiveStyleSheets().

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2552353003
Cr-Commit-Position: refs/heads/master@{#439115}
rune
Remove unused lazyAppend from StyleResolver.
Active stylesheet update is now asynchronous and handled from
StyleEngine::updateActiveStyleSheets().

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2557773004
Cr-Commit-Position: refs/heads/master@{#439102}
rune
Removed unused StyleSheetInvalidationAnalysis class.
R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2546343006
Cr-Commit-Position: refs/heads/master@{#439097}
rune
Remove ensureResolver before invalidation set scheduling.
ensureResolver() used to make sure the invalidation sets were up-to-
date with the currently active stylesheets. This is no longer necessary
as ruleset invalidation of changes in active stylesheets will make sure
changes are applied correctly.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2555083002
Cr-Commit-Position: refs/heads/master@{#439096}
rune
Reland: Collect active stylesheets and and apply asynchronously.
This CL enables asynchronously updating the lists of active stylesheets
applying any style changes using rule set invalidations. This means we
more often avoid full style recalcs when we add or remove stylesheets
from the document as well as when the evaluation of media queries
change.

In general, we now alway compare new and old stylesheets by comparing
their rulesets and schedule style invalidations for removed and added
rulesets.

When media queries changes, we used to give completely in and
recalculate all style once we discovered a media query changed its
evaluation. With this patch, we clear rule sets for sheets which
contain media queries which means we will invalidate rules for the sets
before and after the query change. This can be further refined by only
clearing rule sets when the sheets has a media query which actually did
change evaluation, and also just schedule invalidations for rules which
are inside @media rules.

TreeScopeStyleSheetCollectionTest.cpp is removed as it is replaced by
ActiveStyleSheetsTest.cpp which landed earlier.

updateActiveStyle() has been added a few places where
ensureStyleResolver() previously caused active stylesheets to be up-to-
date. ensureStyleResolver() is now merely a method which creates the
StyleResolver if necessary and returns it.

There are some cleanups and code removal which needs to be done after
this CL, but I have left those out to make this CL as small as
possible. For instance resolverChanged(), which synchronously updated
the active stylesheets, has an empty implementation instead of
including a lot of removals in this CL. The code for lazy-appending
stylesheets in StyleResolver is still there, but not in use.

R=meade@chromium.org
BUG=567021

Committed: https://crrev.com/9fb5b60edfb769134733009f9447bad3eaf347b0
Review-Url: https://codereview.chromium.org/2557533005
Cr-Original-Commit-Position: refs/heads/master@{#438148}
Cr-Commit-Position: refs/heads/master@{#439092}
rune
Merge setTimeout calls with same timeout for webfont tests.
Landing async stylesheet update caused a regression in font-display
tests. The values "fallback" and "optional" block display for 100ms
according to the spec. The tests had a setTimeout call to trigger font
loading and a setTimeout call to trigger notifyDone() to render before
100ms has passed with the same timeout value. However, the timer for
allowing fallback display triggers before the notifyDone triggers in
Debug builds on Mac. Calling notifyDone from the same setTimeout
callback as triggering font loading.

The intention of the test is to trigger the screen dump when 0s has
passed, so this should be OK. I have not identified what exactly changed
with the async stylesheet patch and why the timeout methods are
interleaved with the timeout for enabling fallback rendering.

Removing one of the other tests or one of the font-display values from
the test array also makes the "fallback" and "optional" start passing
without this change, so there is clearly a timing issue here.

BUG=567021

Review-Url: https://codereview.chromium.org/2584473002
Cr-Commit-Position: refs/heads/master@{#439026}
sigbjornf
ActiveScriptWrappable: GC wrappers in detached ExecutionContexts.
Blink objects that implement (Active)ScriptWrappable have the ability
to keep their corresponding v8 wrapper object alive across GCs by
overriding and implementing ScriptWrappable::hasPendingActivity().

Once an ExecutionContext has become detached, we no longer want to
retain wrappers belonging to it, as that will lead to memory leaks.
With full bi-directional tracing of references across the v8 and Blink
heaps, it is possible to make the lifetime of objects "more accurate",
but not keeping a wrapper alive once in a detached setting, has proven
to work out well in practice.

Consequently, a ScriptWrappable in a detached ExecutionContext should
not be retained, even if hasPendingActivity() return |true|. That is,
we should simply ignore hasPendingActivity()'s result, freeing the
implementations of it from having to take care of this 'detached'
detail.

This behavior is already provided by the 'standard' Blink wrapper
visitors that v8 invokes during GC, but not with wrapper tracing,
which is what this CL brings.

It does so by extending ActiveScriptWrappable with a predicate for
checking if the object's ExecutionContext has signalled destruction.

(The natural(?) way to express that is to parameterize ActiveScriptWrappable<>
over the class that implements the interface. This makes for a CL
with a larger footprint.)

R=haraken, mlippautz
BUG=468240

Review-Url: https://codereview.chromium.org/2577053002
Cr-Commit-Position: refs/heads/master@{#438967}
fs
Ignore minimum font-size for SVG text
In some circumstances, the minimum font-size would be applied to the
"scaled font", messing up rendering. Because of how the font is scaled,
this would trigger much less than one might expect.
Change the useSmartMinimumForFontSize argument to the
FontSize::getComputedSizeFromSpecifiedSize function to be about entirely
ignoring the minimum font-sizes (this function only has two callsites.)
Refactor LayoutSVGInlineText::computeNewScaledFontForStyle a bit to deal
with this new flow. Also always keep the "original" font when we compute
a scale factor of 0 - it should be invisible regardless.

BUG=232332,335725,475795,626936,664961
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2575863002
Cr-Commit-Position: refs/heads/master@{#438794}
sigbjornf
Signal no pending activity in destructed contexts.
Various hasPendingActivity() overrides weren't taking the state of the
ExecutionContext into account, only considering if event listeners were
registered. We're not interested in holding onto a script environment
after an execution context has been destroyed, so adjust the predicates
to return false if the ExecutionContext has been destructed.

The V8GCController wrapper visitors already check if hasPendingActivity()
implementations incorrectly return |true| when used inside of destroyed
ExecutionContexts, but that check is not handled by trace wrappers
(ActiveScriptWrappable.)

R=
BUG=

Review-Url: https://codereview.chromium.org/2571193002
Cr-Commit-Position: refs/heads/master@{#438787}
fs
Make LayoutSVGViewportContainer -> SVGSVGElement association obvious
This LayoutObject type is only used for non-outermost SVGSVGElements, so
no need to do runtime checks of the type.

Review-Url: https://codereview.chromium.org/2570293002
Cr-Commit-Position: refs/heads/master@{#438532}
fs
Remove unused SVGTextMetrics constructor
Review-Url: https://codereview.chromium.org/2565173007
Cr-Commit-Position: refs/heads/master@{#438523}
sigbjornf
Eagerly dispose of ScheduledActions (reland.)
The DOMTimer's ScheduledAction hold on to the script source and
state needed to execute the timer action. Let go of ShceduledAction's
resource early.

Apart from reducing the lifetime of script source, this is a speculative
fix for crashes reported in v8::PersistentValueVector::Clear() during
lazy sweeping of ScheduledAction objects.

R=
BUG=

Committed: https://crrev.com/11bd50343795ed1dc1977da91e9a1588687522fd
Review-Url: https://codereview.chromium.org/2552673002
Cr-Original-Commit-Position: refs/heads/master@{#436298}
Cr-Commit-Position: refs/heads/master@{#438503}
mstensho
Only the first layout pass needs to go deep when pagination state changes.
Since we now re-use the LayoutState object in multipass layout (caused by
either fragmentation or the PaintLayerScrollableArea::FreezeScrollbarsScope
mechanism), we need to notify the LayoutState object when we have performed the
necessary deep layout pass, so that not all subsequent passes also go deep
needlessly.

BUG=672088

Review-Url: https://codereview.chromium.org/2570643002
Cr-Commit-Position: refs/heads/master@{#438353}
tommyt
PaymentApp: Implement the JNI bridge
Add two native methods to ServiceWorkerPaymentAppBridge, and implement
them in service_worker_payment_app_bridge.cc. The two methods are
GetAllAppManifests and InvokePaymentApp. At the moment, they are just
stubs, although GetAllAppManifest contains a bit of code, mainly
for illustration and to avoid compile errors for unused @CalledFromNative
methods in ServiceWorkerPaymentAppBridge.

BUG=661608

Review-Url: https://codereview.chromium.org/2556753002
Cr-Commit-Position: refs/heads/master@{#438269}
sigbjornf
Remove PreFinalizer{Callback} type aliases from view.
Internal types, no good reason to expose these to the outside.

R=
BUG=673645

Review-Url: https://codereview.chromium.org/2573783002
Cr-Commit-Position: refs/heads/master@{#438170}
rune
Collect active stylesheets and and apply asynchronously.
This CL enables asynchronously updating the lists of active stylesheets
applying any style changes using rule set invalidations. This means we
more often avoid full style recalcs when we add or remove stylesheets
from the document as well as when the evaluation of media queries
change.

In general, we now alway compare new and old stylesheets by comparing
their rulesets and schedule style invalidations for removed and added
rulesets.

When media queries changes, we used to give completely in and
recalculate all style once we discovered a media query changed its
evaluation. With this patch, we clear rule sets for sheets which
contain media queries which means we will invalidate rules for the sets
before and after the query change. This can be further refined by only
clearing rule sets when the sheets has a media query which actually did
change evaluation, and also just schedule invalidations for rules which
are inside @media rules.

TreeScopeStyleSheetCollectionTest.cpp is removed as it is replaced by
ActiveStyleSheetsTest.cpp which landed earlier.

updateActiveStyle() has been added a few places where
ensureStyleResolver() previously caused active stylesheets to be up-to-
date. ensureStyleResolver() is now merely a method which creates the
StyleResolver if necessary and returns it.

There are some cleanups and code removal which needs to be done after
this CL, but I have left those out to make this CL as small as
possible. For instance resolverChanged(), which synchronously updated
the active stylesheets, has an empty implementation instead of
including a lot of removals in this CL. The code for lazy-appending
stylesheets in StyleResolver is still there, but not in use.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2557533005
Cr-Commit-Position: refs/heads/master@{#438148}
tsniatowski
Roll third_party/icu from 73e24736 to 9cd28287
http://chromium.googlesource.com/chromium/deps/icu.git/+log/73e24736..9cd28287

One change in the range: deprecation warning suppresion for non-clang.

BUG=21515,637001

Review-Url: https://codereview.chromium.org/2575433002
Cr-Commit-Position: refs/heads/master@{#438139}
sigbjornf
Retire ThreadState::registerPreFinalizer<T>()
The registration of the finalization callback now happens under-the-hood
and automatically.

R=haraken
BUG=673645

Review-Url: https://codereview.chromium.org/2570463005
Cr-Commit-Position: refs/heads/master@{#438136}
sigbjornf
Simple BlinkGC heap compaction.
This implements heap compaction for the Blink GC infrastructure
(Oilpan), compacting the arenas of the BlinkGC heap which are most
susceptible to becoming fragmented during actual use.

Fragmentation is a real problem and a growing one while browsing anything
but static pages: the amount of unused, but allocated, memory is
fluctuating higher over time.

To avoid leaving increasing amounts of unused holes in our heaps,
heap compaction will periodically squeeze out the unused portions,
packing together the live objects. The heap pages that are then
left as unused, are subsequently released and returned to the OS.

Due to a fortunate property of Blink heap collection types, providing
such compaction is within relatively easy reach. Experiments show that
the arenas which hold such collection objects ("backing stores") are
the ones that develop fragmentation the most & persistently. While not
a complete heap compactor of all Blink GC arenas, it addresses the
fragmentation problem where it is most pressing. More can be done, later.

Explainer / design document:

 https://docs.google.com/document/d/1k-vivOinomDXnScw8Ew5zpsYCXiYqj76OCOYZSvHkaU

R=haraken
BUG=672030

Review-Url: https://codereview.chromium.org/2531973002
Cr-Commit-Position: refs/heads/master@{#438125}
fs
Remove SVGCursorElement
This allows significant cleanup of CSSCursorImageValue, so do that too.

Intent-thread:

 https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/r0lnh5Rw23M

TBR=timvolodine@chromium.org
BUG=650598

Review-Url: https://codereview.chromium.org/2522443002
Cr-Commit-Position: refs/heads/master@{#438116}
sigbjornf
Implicit prefinalizer registration.
Switch to implicit registration of prefinalizers along with removing
the ability to dynamically unregister a prefinalizer; the latter
being an unused feature.

The requirement to manually register a prefinalizer has proven to be
a chore and a source of bugs. Case in point: HTMLCanvasElement
currently declares a prefinalizer, but doesn't register it. Simplify
the programming model by automatically registering prefinalizers.

R=haraken
BUG=673645

Review-Url: https://codereview.chromium.org/2565983002
Cr-Commit-Position: refs/heads/master@{#438110}
sigbjornf
Avoid conditional Animation prefinalizers.
Recast the conditionally-eager finalization of Animation objects - only
needed if the Animation object has a CompositorAnimationPlayer attached -
wrapping instead the player object inside an eagerly-finalized object.

By doing so, we remove the need to support explicit prefinalizer
registration.

R=haraken
BUG=673645

Review-Url: https://codereview.chromium.org/2570503002
Cr-Commit-Position: refs/heads/master@{#438089}
rune
Use hash set instead of vector for changed RuleSets.
That way, we don't have to consider the same RuleSet multiple times for
invalidation on active stylesheet update. This fixes a regression in
PerformanceTests/CSS/StyleSheetInsert.html which would have been
introduced by https://codereview.chromium.org/2557533005

This works because the same style element source text used multiple
times will make us use the same StyleSheetContents from the cache and
hence the same RuleSet for all 50 sheets added in that test. It's a bit
like cheating, but this will also make sure we don't invalidate for the
same RuleSet twice if we re-order stylesheets by removing/inserting a
style element where the CSSStyleSheet pointer will be different, but
the RuleSet stays the same.

R=sashab@chromium.org,esprehn@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2569733003
Cr-Commit-Position: refs/heads/master@{#438062}
mstensho
Disable layout optimization when column height may be non-uniform.
We have no way of telling what changes beyond the first column break, so if we
cannot guarantee that the column height *is* and *was* non-uniform, we need to
re-lay out children that may stretch into the unknown.

Review-Url: https://codereview.chromium.org/2562273003
Cr-Commit-Position: refs/heads/master@{#437928}
fs
Perform "zoom compensation" for 'transform' on <svg:text>
SVGElement::calculateTransform would not compensate for effective zoom
on 'transform' for SVG <text> elements.
Refactor the code a bit so that the different parameter configurations
are selected first, and then use the same code for both <text> and non-
<text>. This makes sure that effective zoom is factored into the
computed transform for <text> as well.

BUG=665387,369942

Review-Url: https://codereview.chromium.org/2565403002
Cr-Commit-Position: refs/heads/master@{#437927}
sigbjornf
Revert of Eagerly dispose of ScheduledActions. (patchset #2 id:20001 of https://codereview.chromium.org/2552673002/ )
Reason for revert:
Speculative revert for reported perf decrease on system_health.memory_mobile, https://crbug.com/672098

Original issue's description:
> Eagerly dispose of ScheduledActions.
>
> The DOMTimer's ScheduledAction hold on to the script source and
> state needed to execute the timer action. Let go of ShceduledAction's
> resource early.
>
> Apart from reducing the lifetime of script source, this is a speculative
> fix for crashes reported in v8::PersistentValueVector::Clear() during
> lazy sweeping of ScheduledAction objects.
>
> R=
> BUG=
>
> Committed: https://crrev.com/11bd50343795ed1dc1977da91e9a1588687522fd
> Cr-Commit-Position: refs/heads/master@{#436298}

TBR=oilpan-reviews@chromium.org,haraken@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=

Review-Url: https://codereview.chromium.org/2568103002
Cr-Commit-Position: refs/heads/master@{#437889}
tommyt
PaymentApp: Make the PaymentAppFactory asynchronous
The code for fetching and filtering payment instruments in
PaymentRequestImpl is asynchronous anyway, so this change is not too
intrusive. The main thing is to insert an extra asynchronous step to
populate the mApps list before payment instrument filtering starts.

If we want to take this further, a good next step would be to start
showing apps as they are discovered, instead of waiting until we have
received all the payment apps. It would also be a good thing to
refactor some of this functionality out of the PaymentRequestImpl, as
it is growing quite complex.

Other changes that went into this commit:

* Change the PaymentAppFactory into a singleton, rather than being a
  holder class for static functions.

* Extend the AdditionalPaymentFactory functionality, so that the
  PaymentAppFactory can have many additional factories. This lets us
  make the ServiceWorkerPaymentAppBridge an additional factory, and
  normalize the relationship between the two classes.

* Add two unit tests for testing delayed payment app creation.

BUG=661608

Review-Url: https://codereview.chromium.org/2559153002
Cr-Commit-Position: refs/heads/master@{#437843}
sigbjornf
Simple BlinkGC heap compaction.
This implements heap compaction for the Blink GC infrastructure
(Oilpan), compacting the arenas of the BlinkGC heap which are most
susceptible to becoming fragmented during actual use.

Fragmentation is a real problem and a growing one while browsing anything
but static pages: the amount of unused, but allocated, memory is
fluctuating higher over time.

To avoid leaving increasing amounts of unused holes in our heaps,
heap compaction will periodically squeeze out the unused portions,
packing together the live objects. The heap pages that are then
left as unused, are subsequently released and returned to the OS.

Due to a fortunate property of Blink heap collection types, providing
such compaction is within relatively easy reach. Experiments show that
the arenas which hold such collection objects ("backing stores") are
the ones that develop fragmentation the most & persistently. While not
a complete heap compactor of all Blink GC arenas, it addresses the
fragmentation problem where it is most pressing. More can be done, later.

Explainer / design document:

 https://docs.google.com/document/d/1k-vivOinomDXnScw8Ew5zpsYCXiYqj76OCOYZSvHkaU

R=haraken
BUG=672030

Review-Url: https://codereview.chromium.org/2531973002
Cr-Commit-Position: refs/heads/master@{#437829}
fs
Strength-reduce the "scale-factor changed" condition in LayoutSVGRoot
Spend some cycles examining the difference between the old and new
local-to-border-box transforms, and only signal scale-factor changes
if that part of the transform changed.
This also means that we now detect changes scale that we previously
didn't (like [1].)

[1] paint/invalidation/svg/absolute-sized-content-with-resources.xhtml

BUG=603956,664961

Review-Url: https://codereview.chromium.org/2559123003
Cr-Commit-Position: refs/heads/master@{#437767}
mstensho
Rebaseline paint/invalidation/resize-iframe-text.html for Mac.
BUG=672676

Review-Url: https://codereview.chromium.org/2557743008
Cr-Commit-Position: refs/heads/master@{#437567}
sigbjornf
ImageResource: remove unnecessary vector copying during iteration.
Iterations that don't update the underlying collection, can be done
in-place.

R=
BUG=

Review-Url: https://codereview.chromium.org/2555103004
Cr-Commit-Position: refs/heads/master@{#437482}
mstensho
Hopefully deflake some tests, by preloading the Ahem font.
BUG=670846

Review-Url: https://codereview.chromium.org/2560073002
Cr-Commit-Position: refs/heads/master@{#437423}
rune
Missing style invalidation for :in-range and :out-of-range.
Added pseudoStateChanged calls for those pseudos where we already did
so for :valid and :invalid.

R=tkent@chromium.org
BUG=671745

Review-Url: https://codereview.chromium.org/2556423002
Cr-Commit-Position: refs/heads/master@{#437415}
mstensho
Fix path search-replace mistakes (?) that prevented resources from being loaded.
This was introduced in https://codereview.chromium.org/2321183002

Review-Url: https://codereview.chromium.org/2558263002
Cr-Commit-Position: refs/heads/master@{#437365}
fs
Unify "contributes to" and "requires mask" for clip-path child iteration
Since contributesToClip(...) and requiresMask(...) have a lot of overlap,
refactor them into a new (set of) function(s) that return an enumeration
based on the requirements for the element in question.

Review-Url: https://codereview.chromium.org/2563613002
Cr-Commit-Position: refs/heads/master@{#437248}
mstensho
Let LayoutBlockFlow::removeFloatingObject take LayoutUnit instead of int.
Review-Url: https://codereview.chromium.org/2559443002
Cr-Commit-Position: refs/heads/master@{#437221}
mstensho
[LayoutNG] Remove unnecessary #includes
NOTRY=true
BUG=591099

Review-Url: https://codereview.chromium.org/2561553002
Cr-Commit-Position: refs/heads/master@{#437217}
rune
Make sure media query results are re-collected.
When media attributes change on style elements, we need to re-append
all sheets in the scope in order to collect the viewport and device
dependent media results correctly. This already done forced by the
FullStyleUpdate in parseAttribute, but we want to minimize the changes
here with async style update and ruleset based invalidations by marking
the treeScope dirty, and if nothing changed, invalidate no style.

However, we need to re-add global rule data, or at least the media
query results.

Example: say that we have a window width of 800px below. After the
media attribute has been changed, we don't need to recalculate any
styles, but we need to make sure we detect style changes crossing the
width of 2000px instead of 1000px.

<style media="(min-width: 1000px)"> ... </style>

<script>
  styleElement.setAttribute("media", "(min-width: 2000px");
</script>

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2554193002
Cr-Commit-Position: refs/heads/master@{#437213}
rune
Make setNeedsActiveStyleUpdate mark treescope dirty only.
Pass the treeScope instead of a stylesheet pointer and remove the
synchronous resolverChanged() call. Instead add the resolveChanged()
calls where currently necessary and mark them for removal.

This makes the setNeedsActiveStyleUpdate implementation like what we
want to end up with [1]. I've done it this way to make the following
CLs easier to review.

Also, setNeedsActiveStyleUpdate calls are removed where we call
removeStyleSheetCandidateNode() since that method already marks the
tree-scope dirty.

[1] https://codereview.chromium.org/1913833002/

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2546393002
Cr-Commit-Position: refs/heads/master@{#437212}
rune
Mark correct tree-scope dirty removing link in shadow.
Noticed while working on 567021, StyleElement found the correct
tree-scope in from of a shadow root when applicable while
HTMLLinkElement would just use the document. This is what kept us from
being able to use AnalyzedStyleUpdate for removedFrom() for link
elements.

R=meade@chromium.org
BUG=671596

Review-Url: https://codereview.chromium.org/2554873002
Cr-Commit-Position: refs/heads/master@{#437210}
mstensho
Better isPageLogicalHeightKnown() implementation.
Need to consult the flow thread, if we have one. We may run into situations
where fragmentainer groups in the first column set have got their height
calculated, while later column sets still haven't calculated it [1]. So
checking if flow thread offset 0 is in a fragmentainer of known height isn't
good enough.

Also moved the implementation from LayoutBlock to LayoutBox, since it's pretty
coincidental that we currently don't need this particular method outside of
LayoutBlock.

[1] LayoutMultiColumnSet::recalculateColumnHeight() may reset the column
heights if it detects that the column set has been moved since previous layout
pass.

BUG=670902

Review-Url: https://codereview.chromium.org/2553133002
Cr-Commit-Position: refs/heads/master@{#437063}
fs
Don't check 'visibility' in LayoutSVGResourceMasker
Since 'visibility' does not work in the same way as 'display', it's not
possible to "prune" subtrees based on non-'visible' values of the
property. Remove the check from the two methods that use it, and leave
to lower levels to handle it.

BUG=672055

Review-Url: https://codereview.chromium.org/2558793002
Cr-Commit-Position: refs/heads/master@{#436996}
fs
Don't allow <use> <text> references in clip-path fast-path
The fast-path can't handle <text>, but a <use> referencing <text> was
not properly checked resulting in an incorrect clip.
Make the requiresMask(...) helper handle <use> elements and check the
referenced element.

BUG=604677,604679

Review-Url: https://codereview.chromium.org/2560773002
Cr-Commit-Position: refs/heads/master@{#436941}
rune
Use correct document for notifying of inserted import.
Notify the root document to update active stylesheets. If the import
child contains stylesheets, the StyleEngine for the import document
will be notified correctly.

Added a couple of sanity DCHECKs.

R=meade@chromium.org
BUG=671322

Review-Url: https://codereview.chromium.org/2551973003
Cr-Commit-Position: refs/heads/master@{#436887}
mstensho
Never position a float after it has been placed.
When a float is marked as "placed" (which happens in
LayoutBlockFlow::placeNewFloats()), it means that it has been added to a float
interval tree. It is not allowed to move a float afterwards (unless we remove
and re-insert the floats somehow, e.g. by re-laying out its containing block).
Otherwise, the interval tree may get out of sync with reality, and we may fail
to find the reference to a FloatingObject in the interval tree when deleting a
FloatingObject, so that we end up deleting the FloatingObject, but not the
reference to it in the interval tree (which will remain there, pointing to a
now dead object).

This could happen when LayoutBlockFlow::removeFloatingObjectsBelow() was called
during pagination. We sometimes need to re-lay out a line because the line or
floats next to the line get pushed to the next fragmentainer. As part of that,
we also need to get rid of the floats that we thought would sit beside the
line, and re-position them.

BUG=670927

Review-Url: https://codereview.chromium.org/2553923003
Cr-Commit-Position: refs/heads/master@{#436776}
fs
Rework SVGViewSpec<->SVGSVGElement integration
This turns SVGViewSpec into a more independent component, by moving
parsing (case) logic into it, and changing adding an accessor interface
on SVGSVGElement that allows access to, and handles invalidation of the
SVGSVGElement's view properties.

The m_useCurrentView is done away with, and instead the code just checks
if there's an SVGViewSpec attached. Naturally this also means that care
needs to be taken to "detach" the old SVGViewSpec when needed.

Review-Url: https://codereview.chromium.org/2552513002
Cr-Commit-Position: refs/heads/master@{#436704}
fs
Unify predicates for elements "contributing" to a <clipPath>
LayoutSVGResourceClipper has four loops that iterate the child elements
that contribute to the clip path. They are however all subtly different.

To remedy this and make it more obvious that the same set of elements
are iterated, add a helper contributesToClip(...) that handles the
checking of if an element is considered to be contributing to the clip
path or not. This yields four loops with a very similar structure.

Also move path-extraction to a helper, use helpers from Traversal<...>
for basic iteration, drop LayoutObject/ComputedStyle related checks
from the SVGUseElement helper (now handled elsewhere) and hoist the
PaintInfo out of the loop in createContentPicture since it is invariant.

Review-Url: https://codereview.chromium.org/2560513002
Cr-Commit-Position: refs/heads/master@{#436703}
fs
Don't fail clip-paths with empty bounds
An empty nested clip-path should result in an empty clip-path (clipping
away everything.)

BUG=671543
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2555483003
Cr-Commit-Position: refs/heads/master@{#436605}
fs
Properly simulate self-closing tags when in "foreign content" mode
When background parsing, a tag that "opens" foreign content mode and had
the "self-closing" flag set (<svg/> and <math/>), would place the
simulator in foreign content mode without a chance to get out of it.
Run the "end tag" steps in this case too, to properly balance the
namespace stack.

BUG=537642

Review-Url: https://codereview.chromium.org/2546373002
Cr-Commit-Position: refs/heads/master@{#436569}
mstensho
Refactor layoutBlock() and layoutBlockFlow(). Happens to fix bugs.
Move what only needs to be done once into layoutBlock(). Rename
layoutBlockFlow() to layoutChildren(). Establish LayoutState once, and compare
with the actual previous height to properly detect height changes.

This fixes two issues with the PaintLayerScrollableArea::FreezeScrollbarsScope
mechanism. Tests added.

1. We used to push LayoutState for the same object twice when freezing
scrollbars, which confused the fragmentation machinery.

2. We failed to detect height changes when freezing scrollbars, because we were
unable to compare against the original height (we compared against the height
we had when entering the second layout pass, rather than comparing against the
one we had when entering the first layout pass). We might therefore end up
skipping necessary re-layout of absolutely positioned descendants.

BUG=669039,670660

Review-Url: https://codereview.chromium.org/2553833002
Cr-Commit-Position: refs/heads/master@{#436414}
sigbjornf
Disallow off-heap containers containing raw on-heap pointers.
R=
BUG=

Review-Url: https://codereview.chromium.org/2553673002
Cr-Commit-Position: refs/heads/master@{#436351}
sigbjornf
Eagerly dispose of ScheduledActions.
The DOMTimer's ScheduledAction hold on to the script source and
state needed to execute the timer action. Let go of ShceduledAction's
resource early.

Apart from reducing the lifetime of script source, this is a speculative
fix for crashes reported in v8::PersistentValueVector::Clear() during
lazy sweeping of ScheduledAction objects.

R=
BUG=

Review-Url: https://codereview.chromium.org/2552673002
Cr-Commit-Position: refs/heads/master@{#436298}
tommyt
PaymentApp: Add classes for supporting Web Based Payment Apps
This adds an application class, an instrument class and a skeleton
bridging class which can later be implemented to communicate with the
service worker class in C++.

The app factory class has been extended to create instances of the new
web based payment apps in addition to the existing autofill payment app.

BUG=669876

Review-Url: https://codereview.chromium.org/2526293003
Cr-Commit-Position: refs/heads/master@{#436274}
kszatan
Fix Firefox bookmarks import.
Firefox abandoned usage of the moz_bookmarks_roots table since v. 30 and
removed the table in v. 31 in favor of storing relevant info in the
'guid' column of the moz_bookmarks table.

BUG=638977

Review-Url: https://codereview.chromium.org/2296633002
Cr-Commit-Position: refs/heads/master@{#436262}
rune
Schedule layout tree update for dirty tree scopes.
In preparation for async stylesheet update, schedule a layout tree
update when marking tree scopes dirty for active style sheets. This is
necessary to trigger a beginFrame which will in turn call
updateActiveStyle as part of the lifecycle update.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2547883002
Cr-Commit-Position: refs/heads/master@{#436248}
rune
Correctly re-collect active style for html imports.
- Need to re-collect active stylesheets when inserting already cached
  import documents.

- Missing markDocumentDirty() when inserting import documents.

- Added test for missing coverage of the need for marking for re-
  collection from HTMLImportChild::ownerInserted().

The fact that we need to recollect sheets in the document scope and
recalculate style for the whole document is not a perf regression, this
is how it used to be before considering the async stylesheet update
with ruleset invalidations, but ideally we would like to do better.
It's unlikely a common use case as html imports are typically loaded in
head as script and rendering blocking.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2551473002
Cr-Commit-Position: refs/heads/master@{#436238}
mstensho
Complete layout even if a block needs relayout due to widows or column balancing.
We cannot just abort in the middle of layoutBlockFlow() when we detect that we
need another layout pass (due to new column height or because we want an
earlier break to satisfy the widows requirement). We might miss our only
opportunity to detect size changes that way, and thus skip necessary layout and
repositioning of absolutely positioned descendants.

BUG=591637

Review-Url: https://codereview.chromium.org/2471623003
Cr-Commit-Position: refs/heads/master@{#436192}
fs
Drop SVGElement::accessDocumentSVGExtensions()
This method has a single user into which it can be folded without any
issues. The comment in the method seem to no longer apply.

Also drop an unused friend declaration while at it.

Review-Url: https://codereview.chromium.org/2548573003
Cr-Commit-Position: refs/heads/master@{#436051}
rune
Returned MediaQuerySet should be const.
The MediaQuerySet is never modified outside the class. We don't have
any evidence that this fixes the mentioned issue though.

R=sigbjornf@opera.com
BUG=669757

Review-Url: https://codereview.chromium.org/2547713003
Cr-Commit-Position: refs/heads/master@{#436031}
mstensho
Don't include ComputedStyle.h where not needed.
This reduces the dependency on ComputedStyle.h from more than 2000 compilation
units to less than 1000.

Review-Url: https://codereview.chromium.org/2539363003
Cr-Commit-Position: refs/heads/master@{#435928}
mstensho
Don't include CachedUAStyle.h from StyleResolver.h
Eliminates another 40+ compilation unit dependencies on ComputedStyle.h

Review-Url: https://codereview.chromium.org/2545953003
Cr-Commit-Position: refs/heads/master@{#435925}
rune
Make updateStyleInvalidationIfNeeded() private.
It is not invoked outside of Document.

This is split out of the larger CL for 567021.

R=mstensho@opera.com
BUG=567021

Review-Url: https://codereview.chromium.org/2537863006
Cr-Commit-Position: refs/heads/master@{#435922}
rune
Remove MediaQuerySet:createOffMainThread.
The implementation is identical to MediaQuerySet::create.
Removed old cruft from the unit test from when we had two media query
parsing implementation.

R=yoav@yoav.ws,timloh@chromium.org

Review-Url: https://codereview.chromium.org/2545663005
Cr-Commit-Position: refs/heads/master@{#435920}
mstensho
Margins that start at fragmentainer boundaries should be collapsed away.
This only applies if the fragmentainer break is unforced. If it's forced, the
margin is to be preserved.
See https://drafts.csswg.org/css-break/#break-margins

Get rid of LayoutBlock::nextPageLogicalTop(), since nobody calls it anymore.

BUG=440362

Review-Url: https://codereview.chromium.org/2542723002
Cr-Commit-Position: refs/heads/master@{#435917}
fs
Avoid repeating ourselves in SVGAnimatedEnumerationBase::setBaseVal
After performing the range checks on the value, we can call our "generic"
setBaseVal and avoid repeating this code-sequence.

Review-Url: https://codereview.chromium.org/2548533003
Cr-Commit-Position: refs/heads/master@{#435715}
fs
Only communicate CSSPrimitiveValue references from SVGLength
Make asCSSPrimitiveValue() return a reference to a CSSPrimitiveValue,
rather than a pointer. The CSSPrimitiveValue contained in the SVGLength
can/should never be null.
Add a helper to SVGAnimatedLength to cut down on some boilerplate for
accessing the current CSSValue.

Review-Url: https://codereview.chromium.org/2549563002
Cr-Commit-Position: refs/heads/master@{#435688}
fs
Neuter the "screen scale factor" computation for SVG <text>
This removes the PaintLayer-factor and DSF from the "screen scale factor",
leaving only the transform to the <svg> root and the "content transform" (used
by <pattern>, <mask> and <clipPath>.)

BUG=664961

Review-Url: https://codereview.chromium.org/2492013004
Cr-Commit-Position: refs/heads/master@{#435599}
tommyt
PaymentApp: Allow multiple payment method names for one instrument.
This changes the name and signature of the
PaymentInstrument.getInstrumentMethodName method to:

    Set<String> getInstrumentMethodNames()

This is to match the "enabledMethods" field in the PaymentAppOption
dictionary in the Payment Apps specification, which is defined to be a
sequence of strings.

See: https://w3c.github.io/webpayments-payment-apps-api/#payment-app-options

I also change the name of PaymentInstrument.getInstrumentDetails to
"invokePayment" in order to convey better that this is where the payment
method specific stuff happens. For a Web Based Payment App, this method
is an appropriate point to launch the payment request event into the
service worker.

BUG=669876

Review-Url: https://codereview.chromium.org/2530793002
Cr-Commit-Position: refs/heads/master@{#435587}
fs
Cleanup after removal of the SVGViewSpec interface
With DOM requirements gone, we can turn this into something a bit simpler.
Remove the SVGFitToViewBox inheritance in favor of direct references to
the relevant objects. Similarly drop/unwrap the SVGAnimatedTransformList.

The above gets rid of the only users of SVGAnimatedProperty::setReadOnly
and associated state, as well as the corresponding state in the tear-off.

Also drop an unused methods from SVGSVGElement and rename currentView()
to ensureViewSpec(), making it private in the process.

Review-Url: https://codereview.chromium.org/2537223006
Cr-Commit-Position: refs/heads/master@{#435485}
mstensho
Introduce resetLayout(), to offload layoutBlockFlow().
Review-Url: https://codereview.chromium.org/2529423003
Cr-Commit-Position: refs/heads/master@{#435471}
mstensho
Avoid rogue line float re-layout.
We cannot just lay out an object without setting its position first. That would
confuse the fragmenation machinery. Fortunately, it's not even necessary to lay
out here. Changed the comment, as an attempt to explain why.

BUG=663942

Review-Url: https://codereview.chromium.org/2539813002
Cr-Commit-Position: refs/heads/master@{#435442}
tsniatowski
Remove android build dir nesting restriction
It appears that android builds no longer have to be nested exactly two
levels under //. A build with one level works, so the assert in gn is
no longer helpful.

BUG=412935
R=agrieve@chromium.org

Review-Url: https://codereview.chromium.org/2544493002
Cr-Commit-Position: refs/heads/master@{#435410}
sigbjornf
CSSSelectorWatch: avoid unnecessary hash table lookups.
Review-Url: https://codereview.chromium.org/2541853002
Cr-Commit-Position: refs/heads/master@{#435361}
tmoniuszko
Rename 'interface' parameter
It conflicts with define from combaseapi.h from Windows SDK.

BUG=

Review-Url: https://codereview.chromium.org/2524733003
Cr-Commit-Position: refs/heads/master@{#435169}
fs
Use the right point for marker orientation when closing a subpath
Path::apply doesn't pass a point along for the PathElementCloseSubpath
command. This would yield the wrong orientation on the last marker-mid
on the path (see crbug.com/633012#c1 for an example.)
Use m_subpathStart where needed instead.

BUG=633012

Review-Url: https://codereview.chromium.org/2539763002
Cr-Commit-Position: refs/heads/master@{#434988}
fs
Cleanup SVGMarkerData::updateFromPathElement
Make the updateFromPathElement "closure" a simple thunk-style function,
to make it a little less unwieldy. Also pass PathElement& rather than
PathElement*.

BUG=633012,450368

Review-Url: https://codereview.chromium.org/2540513005
Cr-Commit-Position: refs/heads/master@{#434987}
mstensho
[LayoutNG] Correct inline size for children of multicol containers.
This will lay out multicol containers in one single tall column, without any
support for fragmentation or column balancing.

Also had to disable creation of the anonymous LayoutMultiColumnFlowThread child
of multicol containers, since that's not going to be used in LayoutNG.

The algorithm for calculating the used values of column-width and column-count
can be found here: https://drafts.csswg.org/css-multicol-1/#pseudo-algorithm

Review-Url: https://codereview.chromium.org/2528203002
Cr-Commit-Position: refs/heads/master@{#434971}
mstensho
Position a float before laying it out.
We'll no longer perform inaccurate layout from insertFloatingObject(), but
defer all layout to positionAndLayoutFloat(). We need to do this correctly
everywhere. One crucial thing is also to pay attention to the resulting
pagination strut before the float, if any. There's only one place where we do
this, and that's in positionAndLayoutFloat().

At most call sites, insertFloatingObject() is followed by a call to
placeNewFloats(), which will call positionAndLayoutFloat(). There are
exceptions to this in line layout, though. In some cases we just insert floats
without laying them out and placing them. This happens when we need to figure
out the height of the current line before we can place floats below it. In
order to figure out if a float fits on the current line, though, we first need
to lay it out without marking it as placed.

We lacked some test coverage, so I added
float-pushed-to-next-fragmentainer-by-floats.html . This also passed prior to
this CL, but I nearly broke it while working on this.

BUG=663942

Review-Url: https://codereview.chromium.org/2532573003
Cr-Commit-Position: refs/heads/master@{#434969}
mstensho
[LayoutNG] No need to search for inline children inside a block-children block.
Also type-check that we're dealing with a LayoutBlockFlow before casting.

Review-Url: https://codereview.chromium.org/2527393002
Cr-Commit-Position: refs/heads/master@{#434968}
mstensho
No longer store page logical height in LayoutState.
That height may not be uniform throughout the entire fragmentation context
anyway, so it's not reliable to do it like this. For multicol, the value was
only used as a flag (0=unknown height, 1=known height).

Move calculation of available column height to LayoutMultiColumnFlowThread. It
no longer needs to live in LayoutBlockFlow.

Review-Url: https://codereview.chromium.org/2529073002
Cr-Commit-Position: refs/heads/master@{#434965}
fs
Update svg/wicd/test-rightsizing-b.xhtml expectations
Attempt to compensate for some recent changes to DRT output. Also try
to get some more "correct" reference images.

TBR=schenney@chromium.org
NOTRY=true
BUG=639147

Review-Url: https://codereview.chromium.org/2537083003
Cr-Commit-Position: refs/heads/master@{#434962}
rune
Introduce markAllTreeScopesDirty.
When we need to recollect active stylesheets for all scopes, have an
explicit markAllTreeScopesDirty method instead of relying on
FullStyleUpdate which will go away for async active stylesheet updates.

This CL does not contain functional changes.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2534863002
Cr-Commit-Position: refs/heads/master@{#434940}
fs
Make 'transform' a presentation attribute on SVG elements
This makes 'transform', 'gradientTransform' and 'patternTransform'
presentation attributes on SVGGraphicsElements, SVGGradientElements
and SVGPatternElements respectively.

Spec:

 http://www.w3.org/TR/css3-transforms/#svg-transform
 http://www.w3.org/TR/css3-transforms/#svg-syntax
 http://www.w3.org/TR/css3-transforms/#svg-gradient-transform-pattern-transform

Salvaged from https://codereview.chromium.org/423093014, but takes a
different approach to bridge the syntax gap and avoid crbug.com/577219.

The strategy taken here is to use the SVGTransformList to generate a
CSSValue for the presentation attribute style, and hence postponing
both support for the full transform syntax and a way around the bug
mentioned above. Essentially softening the blow. These two "features"
are expected to be implemented eventually, so this is just a "first
step".

BUG=369942
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2478233002
Cr-Commit-Position: refs/heads/master@{#434934}
sigbjornf
Fix speech-synthesis-speak-multiple.html flakiness.
Follow up on r420711 (crbug.com/589632) and adjust the expected lower
bound on ".elapsedTime" to also include zero for 'start' events.

TBR=dmazzoni
BUG=660448

Review-Url: https://codereview.chromium.org/2540623002
Cr-Commit-Position: refs/heads/master@{#434931}
sigbjornf
Handle overlapping uses of MockWebSpeechRecognizer.
More than one speech recognition object may exist at the same time,
all sharing a single MockWebSpeechRecognizer underneath when
running layout tests.

Overlapping uses of speech recognizer objects weren't something
the mock object was designed to gracefully handle, hence fuzzer
inputs would leave the mock object in an invalid state and crash,
when they attempted to do so.

Rather than try to ignore and prevent overlapping uses from going
ahed, we extend MockWebSpeechRecognizer with support for handling
them, queueing recognizer context switching tasks that will run
upon completion of the currently ongoing sequence of tasks that
a speech recognizer object expects.

R=
BUG=668019

Review-Url: https://codereview.chromium.org/2525933002
Cr-Commit-Position: refs/heads/master@{#434777}
fs
Rework the "rules for parsing dimension values" implementation
This CL reworks the current implementation of the "rules for parsing
dimension values" [1] (HTMLElement::addHTMLLengthToStyle) into a
separate function and moves it to HTMLDimension.{cpp,h}.
In general, behavior deviating from the specced version is kept with the
following exceptions:

 * Allow all of the "space characters" [2], rather than just U+0020.

 * Cases with multiple full stops (ex: "1.2.3") now parse the same as
   "1.2" rather than failing.

Comments are added where the implementation is known to deviate from the
spec.

This also makes it possible to avoid calling into the CSS parser for
actual parsing, which should reduce the amount of special-cases needed
there. This requires a mechanism for disallowing percentage values
though, to properly handle 'cellspacing' on <table>.

[1] https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-dimension-values
[2] https://html.spec.whatwg.org/multipage/infrastructure.html#space-character

BUG=668478

Review-Url: https://codereview.chromium.org/2528673003
Cr-Commit-Position: refs/heads/master@{#434678}
mstensho
[LayoutNG] Remove all mentions of NGBox and NGInlineBox.
It's called NGBlockNode and NGInlineNode now.

Also removed an old TODO about common base class for NGBlockNode and
NGInlineNode. They do have a common base class now.

Review-Url: https://codereview.chromium.org/2530083003
Cr-Commit-Position: refs/heads/master@{#434630}
mstensho
Remove spurious Ctrl+Y character from paint invalidation test.
This caused the test to fail for me, when run locally.

Review-Url: https://codereview.chromium.org/2529843002
Cr-Commit-Position: refs/heads/master@{#434579}
mstensho
[LayoutNG] Simplify NGBox::CanUseNewLayout().
Review-Url: https://codereview.chromium.org/2535533002
Cr-Commit-Position: refs/heads/master@{#434555}
mstensho
[LayoutNG] Typos in ComputeMinAndMaxContentSizes() documentation.
Review-Url: https://codereview.chromium.org/2526223004
Cr-Commit-Position: refs/heads/master@{#434525}
mstensho
[LayoutNG] Unit tests for MinAndMaxContentSizes::ShrinkToFit().
Also DCHECK in the implementation that max_content isn't less than min_content.

Review-Url: https://codereview.chromium.org/2528433006
Cr-Commit-Position: refs/heads/master@{#434458}
rune
Check for styleResolver() in preparation for async style update.
Currently, active stylesheets are appended to ScopedStyleResolver
through the StyleResolver. When we move to async stylesheet update with
ActiveStyleSheets being appended from StyleEngine, styleResolver() is
typically null the first time we update the active stylesheets.

Add a null check before accessing styleResolver() when adding
@font-face rules.

R=nainar@chromium.org,meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2522423002
Cr-Commit-Position: refs/heads/master@{#434437}
mstensho
Set the inline position of floats a bit later.
No need to do it so early, since nobody cares about its position at this point.
This means that there's also no need to update it after having been pushed down
by pagination. As long as we set it before positioning subsequent floats or
other types of content, we're good.

Also store margins as local variables. No huge gain, apart from prettier code
with fewer breaks.

No behavior changes intended.

Review-Url: https://codereview.chromium.org/2511283003
Cr-Commit-Position: refs/heads/master@{#434388}
rune
Move MediaQueryResults to RuleFeatureSet.
The existing code only cleared the query results on the StyleResolver
when the StyleResolver was cleared. That meant we could end up in a
situation where the result list was ever-growing. That wasn't a big
issue in practice as the StyleResolver would be cleared quite often on
stylesheet changes. However, that will change when the RuleSet based
style invalidation is enabled.

We move the media query results to RuleFeatureSet so that:

- Results for @media rules are stored in RuleFeatureSet instead of
  RuleSet.
- Results for media attributes are stored in the ScopedStyleResolver
  when added instead of appending them directly to StyleResolver.
- Accumulated results for all scopes are stored in CSSGlobalRuleSet
  on StyleEngine instead of StyleResolver and are accumulated with
  other rule features in ScopedStyleResolver::collectFeaturesTo().

This CL introduces StyleEngine::ruleSetForSheet() for evaluating the
media attribute of the stylesheet node and create the RuleSet if the
media attribute matches. That way we are able to make the
MediaQueryEvaluator private to StyleEngine. Also, this method is
required when we start using ActiveStyleSheets.

R=meade@chromium.org
BUG=567021,614026

Review-Url: https://codereview.chromium.org/2528633003
Cr-Commit-Position: refs/heads/master@{#434383}
rune
Force adding sheets and recalc for html import re-ordering.
When we remove an import link and re-insert it into the document, the
import Document and CSSStyleSheet pointers are persisted. That means the
comparison of active stylesheets is not able to figure out that the
order of the stylesheets have changed after insertion.

We fall back to re-add all sheets to the scoped resolver and recalculate
style for the whole document if we remove an import in case it is re-
inserted into the document. The assumption is that removing html imports
is very rare.

For re-ordering of link rel=stylesheet the CSSStyleSheet object is
cleared on removal and recreated on insertion. Since the active
stylesheet list keeps references to CSSStyleSheet, CSSStyleSheet
pointers will not be re-used.

R=meade@chromium.org
TEST=fast/html/imports/import-readd-*
BUG=567021

Review-Url: https://codereview.chromium.org/2519393002
Cr-Commit-Position: refs/heads/master@{#434374}
rune
Check explicitly for style invalidation/recalc in @font-face test.
needsLayoutTreeUpdate will return true for needing to update the global
ruleset for async style update. Even if the test only tries to add a
@font-face rule, we unconditionally recollect the CSSGlobalRuleSet when
stylesheets are added or removed.

Instead check that adding a @font-face rule in a shadow tree does not
cause style invalidation or recalc.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2520263002
Cr-Commit-Position: refs/heads/master@{#434367}
wdzierzanowski
Adjust VideoRendererAlgorithm for |frame_dropping_disabled_|
This makes video frame hashing in tests immune to timing variations that
are inherent in the rendering algorithm.

BUG=663709
TEST=media_unittests pass, new unit test VideoRendererAlgorithmTest.EffectiveFramesQueuedWithoutFrameDropping

Review-Url: https://codereview.chromium.org/2502093002
Cr-Commit-Position: refs/heads/master@{#434350}
mstensho
EDisplay enum class: Rename [Inline]Box to Webkit[Inline]Box.
The "box" and "inline-box" values (or rather: "-webkit-box" and
"-webkit-inline-box") for "display" are for an early-stage version of the
flexbox spec, which the web embraced before the flexbox spec got around to
going CR (which uses the values "flex" and "inline-flex" instead).

Furthermore: Having both EDisplay::InlineBox enum value and the InlineBox class
(in Source/core/layout/line/InlineBox.h) confuses the symbol lookup in gdb,
which causes a ~40 seconds freeze [1] when working on something that involves the
InlineBox class.

[1] For component builds with gdb_index set to true in gn

BUG=655961

Review-Url: https://codereview.chromium.org/2524903003
Cr-Commit-Position: refs/heads/master@{#434316}
mstensho
No need to force relayout of children when page logical height changes.
Also removed an ignored out-parameter hasSpecifiedPageLogicalHeight from
checkForPaginationLogicalHeightChange().

Review-Url: https://codereview.chromium.org/2509323005
Cr-Commit-Position: refs/heads/master@{#434290}
rune
Move MediaQueryEvaluator from StyleResolver to StyleEngine.
The plan is to move active stylesheet update and viewport/device-
dependent media query results from StyleResolver to StyleEngine which
means it makes sense to move the MediaQueryEvaluator there as well.
That means that the StyleResolver will temporarily ask the StyleEngine
for the evaluator when needed.

See https://codereview.chromium.org/1913833002/ for planned changes.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2521063005
Cr-Commit-Position: refs/heads/master@{#434144}
fs
Apply the font scale factor when generating stroke geometry for <text>
Because of the special font scale factor applied to <svg:text> to bring
it into a pseudo "host" transform, the stroke geometry would end up
being generated in/relative to the wrong coordinate space.
Apply the same scale to dash-related properties as was previously
applied to stroke-width.

BUG=667453
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2513343005
Cr-Commit-Position: refs/heads/master@{#434135}
mstensho
Make auto-scrollbar shrink-to-fit test more evil.
Be sure to have laid out before making style changes.

Review-Url: https://codereview.chromium.org/2521193002
Cr-Commit-Position: refs/heads/master@{#434128}
mstensho
invalidateColumnSets() doesn't need to mark anything for layout.
Review-Url: https://codereview.chromium.org/2522453003
Cr-Commit-Position: refs/heads/master@{#433952}
mstensho
Add test for line float that removes a tall unbreakable block child.
Review-Url: https://codereview.chromium.org/2521963002
Cr-Commit-Position: refs/heads/master@{#433910}
mstensho
Move stuff from layoutBlockFlow() into new method addOverhangingFloatsFromChildren().
+ some cleanup in the vicinity.

Review-Url: https://codereview.chromium.org/2515303003
Cr-Commit-Position: refs/heads/master@{#433886}
sigbjornf
Drop finalization for ElementShadows.
The empty destructor serves no purpose now, so let it go.

R=
BUG=

Review-Url: https://codereview.chromium.org/2485373003
Cr-Commit-Position: refs/heads/master@{#433844}
sigbjornf
XMLHttpRequest.abort(): follow spec wrt readyState transitions.
readyState is now only set to UNSENT if abort() is called on an object
with readyState in a DONE state.

R=tyoshino,yhirano
BUG=667294

Review-Url: https://codereview.chromium.org/2517173002
Cr-Commit-Position: refs/heads/master@{#433840}
sigbjornf
Enable precompiled headers for Blink on Windows.
One reason Blink is slow to compile is that there is a lot of code
included in every compilation unit. This is partly because everything
depends on either LayoutObject.h or Document.h and those in turn
include huge portions of the rest of Blink.

By precompiling LayoutObject.h and Document.h, the compilation of
core/ and modules/ in Blink can be considerably reduced;
some numbers:

@ r433149       config      build (mins)  size (Kb)
------------------------------------------------
master:         Debug       149:30        9410487
master:         Release     176:16        6118938

opera-pch[2]:   Debug       134:59        9337121
opera-pch[2]:   Release     160:42        6110812

opera-pch[3]:   Debug        93:06        8935714
opera-pch[3]:   Release     108:34        5029242

This for a clean build of target 'blink_tests', i.e., building
both chromium and blink parts. The gains are all local to Blink,
clearly. Host is an i7-3770 (4 phys cores); 32G + 256 SSD -
Win7 Pro.

The precompiled header file is judiciously (and forcefully) included
while compiling the core/ + web/ (and some of modules/) sources. Except
for some name disambiguation trivia when compiling the XPath grammar,
no source changes are needed to make this work out.

Note that distributed compilation system disables precompiled headers
globally so this will *not* make trybots faster. But many developers
don't have access to such super powers.

This already landed[1] in the gyp/VS2013 world some time ago but
unclear & unexplained bot failures caused a revert. Now with gn and
VS2015 the world should be a better place. This CL actually takes over
where [2] got stuck / ran out of time, extending its scope quite
considerably (i.e., 40 mins faster builds wrt the above pch numbers.)

[1] https://codereview.chromium.org/1167523007/
[2] https://codereview.chromium.org/2152783002/
[3] this CL.

Note sheriffs: should unexplained Windows build errors surface on the bots,
similar to the ones seen in crbug.com/511945, then please consider this CL a suspect.
This was with GYP and earlier MSVC toolchains; we have no reason to believe the problem
was fixed with GN and MSVC2015, we're just hoping for the best.

R=
BUG=495697
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2520863002
Cr-Commit-Position: refs/heads/master@{#433832}
fs
Repaint SVG subtree on viewport changes (resize)
When the (outermost) <svg> is sized using percentages, and an ancestor
changes size, the LayoutSVGRoot will be marked for layout (even though
the dimension/initial viewport changes.)
Since changed dimensions can imply a new scale factor (for instance from
interactions with a viewBox) or previously clipped content being
exposed, we need to issue paint invalidations for the entire SVG.

BUG=665912

Review-Url: https://codereview.chromium.org/2511353002
Cr-Commit-Position: refs/heads/master@{#433622}
sigbjornf
HashTable: bring per-table stats tracking back to life.
Recording per-hash table stats (DUMP_HASHTABLE_STATS_PER_TABLE)
broke with the introduction of Oilpan, as the feature depended
on finalizable HashTable<>s, something Oilpan heap hash tables
are not.

If the hash table resides on the Oilpan heap, arrange for the
stats object to also reside there.

While here, also unify the handling of global HashTable stats
recording and the per-table representation.

R=
BUG=

Review-Url: https://codereview.chromium.org/2511983003
Cr-Commit-Position: refs/heads/master@{#433494}
sigbjornf
DOMMatrix: add missing propagation of exceptions.
R=
BUG=659899,388780

Review-Url: https://codereview.chromium.org/2514453005
Cr-Commit-Position: refs/heads/master@{#433449}
mstensho
Force re-layout of a float when we just became unfragmented.
We need to re-lay out a float if we cease to be fragmented, in order to remove
any pagination struts that may previously have been set inside.

This is an addition to https://codereview.chromium.org/2454083002 , which fixed
something similar for regular in-flow blocks.

Review-Url: https://codereview.chromium.org/2512163002
Cr-Commit-Position: refs/heads/master@{#433221}
mstensho
If an object's containing block is in a flow thread, so is the object.
Remove harmful condition in LayoutState that the object not be out-of-flow.

Boring details:

In simplified layout of an absolutely positioned object inside a multicol
container we'd fail to realize that we were paginated, and therefore wouldn't
insert pagination struts. This was only problematic for simplified layout. In
normal non-simplified layout, we'd pass a non-zero page logical height to
LayoutState() when entering the flow thread, and, even if the LayoutState of
the absolutely positioned descendant would have no flow thread associated with
it, it would still become m_paginated, thanks to the non-zero page logical
height. Which was enough to get the machinery to insert struts.

BUG=589004

Review-Url: https://codereview.chromium.org/2516463003
Cr-Commit-Position: refs/heads/master@{#433220}
mstensho
Improve strut handling in initial column balancing pass.
Only use the pagination strut from the first object or line (in each parallel
flow [1]) that we find at a page break. When we need to break before some
content, we may end up setting the pagination strut on some ancestor of said
content, rather than on the content (layout object or line box). This happens
when there's no break opportunity (class A, B or C break point [2]) before the
content that doesn't fit in its current fragmentainer (there's no break
opportunity before the first line in a block, for instance). In such cases we
need to propagate the strut to some ancestor that comes after a valid break
opportunity. In such situations, there'll be severeal layout objects or line
boxes that start at the exact top of the next fragmentainer. Only the first
object in layout tree order will have the strut. Subsequent objects (children,
typically) or lines that also are flush with the top of the fragmentainer will
have a strut of 0. We shouldn't overwrite the actual strut with 0, or we risk
overstretching the columns. At each break we need to know the exact amount of
space that was "wasted" because of the break, and subtract it, in order to
calculate a minimal column height.

[1] https://www.w3.org/TR/css-break-3/#parallel-flows
[2] https://www.w3.org/TR/css-break-3/#possible-breaks

We also need to make sure that we associate breaks with the right column when
balancing, i.e. the former column, not the latter. This distinction matters if
the pagination strut is 0 and we're at the exact top/bottom of some column.

This CL also enables using specified column height even when balancing a
multicol container. It may be that the final column height will actually be the
same as the specified height, which means that if we set it right away, we
might be able to eliminate a subsequent layout pass [1]. Almost more importantly,
doing this will exercise code in the column balancer that was previously only
used when balancing inside nested multicol. This in turn means that it will
become less cumbersome to write tests for this code, and hopefully more
difficult for bugs to hide in there as well.

[1] LayoutTests/paint/invalidation/column-rules-fixed-height.html no longer
requires the contents of the multicol container to be relaid out when
column-rule changes.

Review-Url: https://codereview.chromium.org/2509813004
Cr-Commit-Position: refs/heads/master@{#433166}
sigbjornf
XMLHttpRequest: check if 'loadstart' handler cancelled send().
'loadstart' is dispatched to both 'download' and upload event handlers
while initiating a send() operation. Should those event handlers cause
the ongoing send operation to be aborted/stopped/cancelled, this outer
send() operation shouldn't proceed upon return.

R=yhirano
BUG=642242

Review-Url: https://codereview.chromium.org/2507773002
Cr-Commit-Position: refs/heads/master@{#433157}
mstensho
isPageLogicalHeightKnown() doesn't need a parameter.
If page logical height is (un)known, it's (un)known throughout the entire
fragmentation context, so location doesn't matter.

Review-Url: https://codereview.chromium.org/2514573002
Cr-Commit-Position: refs/heads/master@{#433145}
mstensho
Introduce adjustFloatLogicalTopForPagination(), to offload positionAndLayoutFloat().
Also renamed a variable from childBox to child in positionAndLayoutFloat().

BUG=663942

Review-Url: https://codereview.chromium.org/2513643002
Cr-Commit-Position: refs/heads/master@{#433143}
mstensho
Rename positionNewFloats() to placeNewFloats().
This will distinguish it better from the method named "positionAndLayoutFloat".

Also be explicit about the fact that we use the top margin edge when
positioning floats, as opposed to the top border edge, which is common for all
other object types. So "logicalTop" usually means the logical top of the border
edge. Therefore, use "logicalTopMarginEdge" for floats.

No behavioral changes, just cleanup.

BUG=663942

Review-Url: https://codereview.chromium.org/2505943003
Cr-Commit-Position: refs/heads/master@{#432895}
mstensho
Let lowestFloatLogicalBottom() take EClear instead of FloatingObject::Type
Review-Url: https://codereview.chromium.org/2505853004
Cr-Commit-Position: refs/heads/master@{#432801}
sigbjornf
DOMParser: handle use from contexts without an "active document".
Handle detached uses of parseFromString(), where there is no context
document to inherit the security origin from.

Relevant spec reference,

 https://w3c.github.io/DOM-Parsing/#dom-domparser-parsefromstring

R=
BUG=664399

Review-Url: https://codereview.chromium.org/2509813002
Cr-Commit-Position: refs/heads/master@{#432782}
rune
No forced active stylesheet recollect when pending sheets reach 0.
We forced a FullStyleUpdate which causes an active stylesheet update
for all tree scopes in the presence of placeholder style. What we need
to do for placeholder style is to trigger a full style recalc. For
instance, we don't need to update active stylesheets in shadow trees
if the last blocking resource that finishes loading is a document scope
stylesheet or import.

BUG=567021

Review-Url: https://codereview.chromium.org/2500923002
Cr-Commit-Position: refs/heads/master@{#432630}
mstensho
When placing a float, pay attention to its final logical top.
Subsequent floats may not be placed above this location.

BUG=665804

Review-Url: https://codereview.chromium.org/2504173002
Cr-Commit-Position: refs/heads/master@{#432503}
rune
Let querySelector(All) match (nth-)last with unclosed parent.
While parsing, we don't match :last*, :nth-last* etc until we finish
parsing children to avoid alternating between different computed styles
during loading. For querying selectors, however, we should. I couldn't
find this explicitly mentioned in w3c or whatwg specs for
querySelector(All), but Firefox and IE does this.

This could happen if you have:

<body>
  <p></p>
  <p></p>
  <script>document.querySelector("p:last-of-type")</script>
</body>

Adding expectations file for a wpt which now fails. The modifications
to the test has been upstreamed to the github repo. See PR [1].

[1] https://github.com/w3c/web-platform-tests/pull/4216

R=sashab@chromium.org
BUG=662036

Review-Url: https://codereview.chromium.org/2505543004
Cr-Commit-Position: refs/heads/master@{#432493}
hugoh
Add missing include of errno.h
This allows us to build the object file independently.

BUG=none

Review-Url: https://codereview.chromium.org/2501323002
Cr-Commit-Position: refs/heads/master@{#432459}
sigbjornf
Media element: avoid v8 allocations in hasPendingActivity().
Blink code is not allowed to allocate objects on the v8
heap while its GC calls out to hasPendingActivity();
re-entrancy is not supported.

Hence, disable 'officialPlaybackPosition' updates while
in hasPendingActivity(), as that will trigger v8
allocations by way of microtask allocations.

R=haraken
BUG=

Review-Url: https://codereview.chromium.org/2498033002
Cr-Commit-Position: refs/heads/master@{#432453}
fs
Use an SVGElementProxy in ReferenceClipPathOperation
This transforms ReferenceClipPathOperation into using the SVGElementProxy
mechanism. Currently only for PaintLayer clients.

PaintLayerFilterInfo is generalized to PaintLayerResourceInfo and used as
the proxy/resource client for the 'clip-path' property. This enables change
notifications to flow back to the PaintLayer from the <clipPath> subtree.

The SVGElementProxySet is made a little bit generic by moving it to
SVGElementRareData, however it's still only made available for the few element
types that are used with it.

BUG=391604
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2484153003
Cr-Commit-Position: refs/heads/master@{#432193}
rune
Make updateStyleAndLayoutTree ready for async stylesheet update.
Introduce Document::updateActiveStyle() and corresponding
updateActiveStyle()/updateActiveStyleSheets() methods in StyleEngine to
prepare for doing active stylesheet updates as part of
updateStyleAndLayoutTree.

We move updateViewport() to updateActiveStyle() as the first step. This
is done by removing the synchronous calls to ViewportStyleResolver::
updateViewport() and instead schedule a layout tree update. In order to
trigger actual work to be done when the layout tree update happens, we
need to return true from Document::needsFullLayoutTreeUpdate() when we
need an active style update (for viewport atm).

BUG=567021

Review-Url: https://codereview.chromium.org/2484863003
Cr-Commit-Position: refs/heads/master@{#432182}
sigbjornf
Tidy up ScriptLoader (MIME) type matching.
MIME is case-insensitively handled within Blink, so remove some
unnecessary normalization of MIME type (and "language=") strings
in ScriptLoader.

R=
BUG=

Review-Url: https://codereview.chromium.org/2497873002
Cr-Commit-Position: refs/heads/master@{#432162}
sigbjornf
XMLHttpRequest: implement "send() flag" tracking and updating per spec.
The implementation has until now tracked/approximated the spec's
"send() flag"[1] by checking if the XMLHttpRequest object had an active
loader. That object does not have lifetime equal to what the spec
requires for the "send() flag", nor is the loader set for sync XHR
send()s.

There's no good reason to hold out on tracking this flag per spec,
so introduce it here.

[1] - https://xhr.spec.whatwg.org/#send-flag

R=yhirano
BUG=649516

Review-Url: https://codereview.chromium.org/2496933002
Cr-Commit-Position: refs/heads/master@{#432148}
sigbjornf
ContentSecurityPolicy: avoid defining static String singletons.
As CSP is used by multiple threads, we cannot define string literals
in terms of DEFINE_STATIC_LOCAL(). Follow what is done elsewhere
for ContentSecurityPolicy and resort to using plain string literals.

R=
BUG=

Review-Url: https://codereview.chromium.org/2497543003
Cr-Commit-Position: refs/heads/master@{#431956}
fs
Refactor CSS property mapping for SMIL Animation
Currently the SMIL code relies on 'attributeName' mapping 1:1 to the
CSS property name. This would not work with for instance with
'gradientTransform', which is supposed to map to the 'transform'
property.

To support this, store a CSS property id in SVGAnimatedTypeAnimator, and
use the CSS property id stored in SVGAnimatedProperty to populate it when
possible (using the current method in other cases.)

While doing this, also remove the stored 'context element' from
SVGAnimatedTypeAnimator, since it's only used in the reset(...) method,
and hence can simply be passed as an argument.

Also cleanup the uses of a CSSPropertyID in SVGAnimateElement (the sole
user of SVGAnimatedTypeAnimator) by using the stored CSS property id.

Make SVGAnimateElement::shouldApplyAnimation return bool, and use the
data from the SVGAnimatedTypeAnimator instead to determine which
animation code-path to use.

BUG=369942,641437

Review-Url: https://codereview.chromium.org/2496583002
Cr-Commit-Position: refs/heads/master@{#431862}
pmajewski
gn: Include source files outside the source root for Xcode workspace
This change unifies Xcode workspaces with projects for other IDEs.

BUG=n/a

Review-Url: https://codereview.chromium.org/2489673004
Cr-Commit-Position: refs/heads/master@{#431856}
sigbjornf
Remove Deque<>::findIf<>().
This function template is unused, and any future uses are
better served by using <algorithm>'s std::find_if().

R=
BUG=

Review-Url: https://codereview.chromium.org/2500763002
Cr-Commit-Position: refs/heads/master@{#431855}
sigbjornf
Internals.setValueForUser(): add argument type check.
R=tkent
BUG=642066

Review-Url: https://codereview.chromium.org/2500793002
Cr-Commit-Position: refs/heads/master@{#431845}
mstensho
InitialColumnHeightFinder needs to take all expected rows into account.
When a balanced multicol is nested inside another balanced multicol, it will
not be able to create any fragmentainer groups in the first layout pass, since
the height of the outer columns is still unknown.

We need to detect this situation, so that we don't limit the number of content
runs (content portions without explicit breaks) to the used value of
column-count. We are going to need ALL content runs, and group them into
imaginary rows, to figure out a minimal height of the entire inner multicol
container in the first balancing pass.

This will help set a better initial outer column height, and, more importantly,
set some sensible height on the inner multicol container right away, so that
we're not going to believe that it's super-short, which might prevent us from
marking it for re-layout when the outer coulmns have been sized.
childNeedsRelayoutForPagination() would simply fail to see that it's actually
going to cross outer column boundaries, and just bail.

We also treat tallestUnbreakableLogicalHeight() somewhat differently in such
situations. We require that the last "row" alone (rather than the entire
multicol container) be at least as tall as this.

Broke a newFragmentainerGroupsAllowed() out of
appendNewFragmentainerGroupIfNeeded(), since the column balancer code now also
needs to know when we're nested but are not allowed to create fragmentainer
groups.

Some, but not all, new tests used to fail before the code changes in this CL.
The passing ones are there to point out regressions that I nearly introduced
while working on this CL.

This is a patch in preparation for removing the relayoutChildren = true thing
in LayoutBlockFlow::layoutBlockFlow() when page logical height changes.

Review-Url: https://codereview.chromium.org/2493833004
Cr-Commit-Position: refs/heads/master@{#431844}
sigbjornf
Make FileReader.abort() (synchronously) follow the spec.
It is problematic to cancel a ThreadableLoader (by way of FileReaderLoader)
while it is on the stack, which is one of the steps involved when
abort()ing a reader (as part of the "terminate" step.) To avoid such
potential trouble, the loader termination is done asynchronously.

However, there's no good reason to delay performing the other (user
visible) abort() steps, so arrange for that to happen and align with
the spec & others.

R=jsbell
BUG=288349

Review-Url: https://codereview.chromium.org/2491363003
Cr-Commit-Position: refs/heads/master@{#431639}
rune
Match camelCased SVG attributes selectors in html documents.
Attribute names are stored lower-case in stylesheets in HTML documents.
SVG attribute names are normalized to the camelCase form in HTML
documents. That meant SVG attributes with camelCase like viewBox never
matched in HTML documents.

We had the same issue for camelCased element names in [1]. In that CL
we decided to allow insensitive matching for non-html elements in order
to avoid having to store the tag names twice in CSSSelector, even if
that is wrong according to the HTML spec. This CL does exactly the same
for attribute selectors.

[1] https://crrev.com/bab4aa7b9

R=sashab@chromium.org,esprehn@chromium.org
BUG=663798

Review-Url: https://codereview.chromium.org/2490393002
Cr-Commit-Position: refs/heads/master@{#431544}
sigbjornf
Support fetching attribute listeners from outside v8 context scopes.
A number of the <body> element's event handler attributes represent
and expose event handlers on the window object, hence the parser
will update & replace attribute event listeners while parsing the
attributes. This may well happen while executing outside any v8
context; adjust the lookup of attribute event listeners
to support such usage.

R=haraken
BUG=659911

Review-Url: https://codereview.chromium.org/2492793002
Cr-Commit-Position: refs/heads/master@{#431509}
rune
Skip independent inherited property propagation to pseudo elements.
UpdatePseudoElements and IndependentInherit conflict in the following
way. If we both have an independent inherit change on the actual dom
element, and we detect that we need to update the style for the pseudo
element we need to signal the inheritance propagation to the real dom
children and signal the pseudo element recalc to the pseudo element
children. If we return IndependentInherit, we lose the information
about the need for a pseudo element recalc, and if we return
UpdatePseudoElement, we lose the inheritance propagation for the actual
dom children.

We could introduce a new IndependentInheritAndUpdatePseudoElements, but
if there exists pseudo element, we would always return this constant,
so instead just force recalc on pseudo elements on IndependentInherit.

R=sashab@chromium.org
BUG=660735,660089,657283

Review-Url: https://codereview.chromium.org/2492783002
Cr-Commit-Position: refs/heads/master@{#431430}
mstensho
Split positionAndLayoutFloat() off positionNewFloats().
Float layout is somewhat broken when it comes to fragmentation (multicol,
printing). We're going to have to make sure that we always position the
float before laying it out, and, after layout, insert a break before it if
needed. This is a preparatory CL for that.

We currently lay out a float e.g. in insertFloatingObject() without
worrying about setting the position first.

No behavior changes intended.

BUG=663942

Review-Url: https://codereview.chromium.org/2486413002
Cr-Commit-Position: refs/heads/master@{#431422}
sigbjornf
IDBObserver does not need to be GC finalizable.
R=haraken
BUG=

Review-Url: https://codereview.chromium.org/2493713002
Cr-Commit-Position: refs/heads/master@{#431268}
fs
Reland of "Tracking reference filter mutation via SVGElementProxy"
This introduces SVGElementProxy - a new piece with the functionality of
DocumentResourceReference and the ReferenceFilterBuilder merged. It
provides the means to track clients of a certain element (only
SVGFilterElements for now, but will likely be extended to other types if
it ends up sticking.) An SVGElementProxy is created, and primarily
owned, by CSSURIValue. The proxy also handles loading of a resource
document, if requested.

Clients are SVGResourceClients, like before, with methods/callbacks
renamed. Some of the old functionality of SVGResourceClient has either
been moved to clients, to the proxy or been replaced with different
solutions.

Mutations to the element/subtree is signaled separately from any
potential changes to the actual reference (anything that might
invalidate the element reference.)

Fixed an issue from [1] where an observer would be removed too early if
there was several clients sharing it, causing crashes.

[1] https://codereview.chromium.org/2401343002

BUG=439970
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2490163002
Cr-Commit-Position: refs/heads/master@{#431235}
fs
Store CSSPropertyID in SVGAnimatedPropertyBase
With an increasing amount of SVG attributes being "promoted" to
presentation attributes, it makes sense to try to keep the property
mapping with the other attribute related data.
To make room for these additional bits in SVGAnimatedPropertyBase, pack
some of its fields into a bitfield:

 * m_isReadOnly only needs a single bit.
 * m_type only need room for 21 different values, so 5 bits should
   suffice.

With this new field in place, plumb it through for SVG element
attributes, then, as a start, use the SVG property map to simplify the
implementations of isPresentationAttributeWithSVGDOM and
isPresentationAttribute.

This could also be used to provide storage for attribute initial values
in the future (crbug.com/225807.)

BUG=225807,369942

Review-Url: https://codereview.chromium.org/2485663002
Cr-Commit-Position: refs/heads/master@{#431229}
rune
Moved applyRuleSetChanges functions to StyleEngine.
A lot of the side effects were calls to StyleEngine, so moved the
method there instead. Also fixed the TODO for adding the call to make
CSSGlobalRuleSet dirty.

BUG=567021

Review-Url: https://codereview.chromium.org/2487653002
Cr-Commit-Position: refs/heads/master@{#431227}
mstensho
Let positionNewFloats() take a logicalTop parameter.
It seemed ugly to temporarily change the logical height before calling
positionNewFloats(), just to make the method behave.

Review-Url: https://codereview.chromium.org/2483023002
Cr-Commit-Position: refs/heads/master@{#431115}
tsniatowski
Fix a subtle proguard incremental build error
Prevent a confusing incremental build failure where proguard would
read and write to the same file accidentally, failing hard. Can
happen after switching the build from not using proguard, where the
output jar is a gn-copy hardlink to the input jar, to using proguard,
where the output is written to by a script reading from the input jar.

Fix by checking if the output is not a hardlink to the input in the
wrapper script.

NB. The build normally uses proguard on an apk, but makes it possible
to try and only proguard a single jar, and the bug potentially only
happens in this case.

Review-Url: https://codereview.chromium.org/2485663003
Cr-Commit-Position: refs/heads/master@{#430890}
mstensho
Before turning objects into spanners, check that they are not already spanners.
During style recalculation, we may end up in a situation where we think that we
go from a state where an object couldn't contain spanners, to being able to
contain them, while in reality, the object was able to contain spanners all
along.

This happens when changing the writing mode on the multicol container and all
objects in the parent chain between the spanner and the multicol container (and
there is nothing that prevents the descendant from being a spanner). The
problem is that when determining whether an object is a writing mode root, we
compare the object's writing mode to that of its parent. If they are different,
we decide that it's a writing mode root. However, if we're in styleWillChange()
for said object, and its writing mode is actually about to change to the same
value as that of the parent, there'll be no writing mode root in the end.
Still, we're going to think that we used to be a writing mode root (i.e. not be
able to contain spanners).

It would be possible to fix it for writing mode roots, to provide a reliable
implementation of isWritingModeRoot(), by using a bit in LayoutObject to
specify whether it's a writing mode root, rather than using current computed
style to determine that. Using computed style during style recalculation is
risky. That said, it's probably better to be fault-tolerant for such situations
in toggleSpannersInSubtree() instead, especially since may be other (unknown,
at the time being) scenarios where this situation may occur.

BUG=662754

Review-Url: https://codereview.chromium.org/2485173002
Cr-Commit-Position: refs/heads/master@{#430887}
rogerj
Build v8 snapshot with correct default float configuration on Linux ARM
V8 currently defaults to arm_float_abi="hard" and arm_use_neon=true but
the V8 snapshot defaults to arm_float_abi="softfp" and arm_use_neon=false
on Linux ARM builds.

This patch makes both targets default to hard + neon by changing the
"is simulator build" check from comparing current_cpu with v8_current_cpu
to comparing target_cpu with v8_target_cpu instead. Similarly to how it is
checked in v8/BUILD.gn.

BUG=662856

Review-Url: https://codereview.chromium.org/2483153004
Cr-Commit-Position: refs/heads/master@{#430776}
fs
Tracking reference filter mutation via SVGElementProxy
This introduces SVGElementProxy - a new piece with the functionality of
DocumentResourceReference and the ReferenceFilterBuilder merged. It
provides the means to track clients of a certain element (only
SVGFilterElements for now, but will likely be extended to other types if
it ends up sticking.) An SVGElementProxy is created, and primarily owned,
by CSSURIValue. The proxy also handles loading of a resource document, if
requested.

Clients are SVGResourceClients, like before, with methods/callbacks
renamed. Some of the old functionality of SVGResourceClient has either
been moved to clients, to the proxy or been replaced with different
solutions.

Mutations to the element/subtree is signaled separately from any
potential changes to the actual reference (anything that might invalidate
the element reference.)

BUG=439970
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2401343002
Cr-Commit-Position: refs/heads/master@{#430550}
mstensho
There should never be unplaced floats from other blocks.
When positioning new floats in a block, all unplaced floats should belong to
said block. If we find unplaced floats from other blocks, someone somewhere
must have forgotten to place them on their own.

No need for code to skip such floats. DCHECK instead.

Review-Url: https://codereview.chromium.org/2479173002
Cr-Commit-Position: refs/heads/master@{#430544}
fs
Use range-based for in toCompositorTransformOperations
Avoids the awkward-looking indexing expressions. Make casted operations
const while at it.

Review-Url: https://codereview.chromium.org/2473013002
Cr-Commit-Position: refs/heads/master@{#430247}
rune
Don't use url from ImageResource for computed style.
ImageResource objects are shared between urls which only differ in
fragment identifier. The fragment identifier of the first requested url
is stored on ImageResource. That gave incorrect results when requesting
computed style values of backgroundImage for pseudo elements.

Use the url which is stored on StyleFetchedImage instead.

R=timloh@chromium.org
BUG=661998

Review-Url: https://codereview.chromium.org/2474093003
Cr-Commit-Position: refs/heads/master@{#430246}
mstensho
Don't include LayoutObject-derived headers where not needed.
Or, if a LayoutObject-derived header is still required, pick the most generic
one possible.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2474603002
Cr-Commit-Position: refs/heads/master@{#430165}
mstensho
Descendants may become or cease to be spanners when an ancestor changes style.
When building the tree, when inserting something that looks like a
column spanner, we first examine all the parents all the way up to the
multicol container, to make sure that they are all valid spanner
containers. This already works fine.

In our implementation, a valid column spanner container is, roughly, a
"regular" in-flow block. Among other things, it may not establish a
new block formatting context. Nor transforms. And a few other
things.

If the style of a valid column spanner container changes, it may end
up as no longer being a valid spanner container, and vice versa: an
invalid spanner container may become a valid spanner container, all of
a sudden.

Detect this during style change. If a block ceases to be a valid
spanner container, we need to check its subtree for spanners, and turn
them into regular column content. And, vice versa, if a block is
turned into a valid spanner container, we need to check its subtree
for column-span:all objects, which may have to be changed from regular
column content into spanners.

BUG=661761

Review-Url: https://codereview.chromium.org/2479873002
Cr-Commit-Position: refs/heads/master@{#430005}
rune
Link stylesheets in shadow trees do not belong to document scope.
We have incorrectly kept DCHECKs checking that stylesheets in shadow
trees come from style elements. That is no longer true, and modifying
link elements in shadow trees would trigger some of these DCHECKs.

Also, we simply used Document as the TreeScope handling link elements.
Always use the treeScope() from the associated node instead. Using the
wrong TreeScope in these cases would cause missing updates of active
stylesheets in ShadowTreeStyleSheetCollections for AnalyzedStyleUpdate.
I have not been able to find a triggering test case for this.

R=hayato@chromium.org,kochi@chromium.org
BUG=661914

Review-Url: https://codereview.chromium.org/2472973002
Cr-Commit-Position: refs/heads/master@{#429877}
tmoniuszko
Add missing web_contents.h include
BUG=

Review-Url: https://codereview.chromium.org/2473793002
Cr-Commit-Position: refs/heads/master@{#429853}
fs
Mark TranslateTransformOperation final
Nothing derives from it. This also allows devirtualization of the call
to apply() for the 'translate' (independent) property.

BUG=369942

Review-Url: https://codereview.chromium.org/2468303005
Cr-Commit-Position: refs/heads/master@{#429840}
rune
Remove ShadowRoot::numberOfStyles().
This probably used to be an optimization which made sense when we had
<style scoped> implemented. Now, it should be equally cheap to just
check the ScopedStyleResolver member. The ScopedStyleResolver is null
when there are no active stylesheets in the tree-scope.

This also caused issue 659596 because we only registered style elements
and not link elements, which lead the code to believe there were no
rules to match from the scope when there were only link stylesheets
present.

R=kochi@chromium.org,hayato@chromium.org
BUG=659596

Review-Url: https://codereview.chromium.org/2472613004
Cr-Commit-Position: refs/heads/master@{#429824}
mstensho
Properly avoid breaking inside a float's top margin.
We used to depend on stumbling upon unbreakable content (such as lines) at
column boundaries for this to work, but we failed in the really simple cases
(where there was no content at all, for instance).

Move the logic for this to float-specific code, so that we don't have to be
aware of it at several other locations in the code.

Doing this correctly during layout also helps the balancer find the right
column height. Added a test for something that used to fail in this area.

Review-Url: https://codereview.chromium.org/2479483002
Cr-Commit-Position: refs/heads/master@{#429641}
mstensho
Don't let a column spanner affect the self-margin-collapsing state of the parent.
When a spanner is removed from the tree, we mark the container chain for
layout, just like we do when removing any other kind of object. The container
of a spanner is the multicol container, though, so the direct parent of the
spanner may not be marked for layout. And that should not be necessary either,
since the spanner is essentially taken out of normal flow.

We get some marking for layout for free in layoutBlockFlow(), if
pageLogicalHeightChanged, but that only goes one level deep. Eliminate the need
for layout in situations like this.

Prior to this change, we'd fail on an assert that required that the cached
state of self-collapsing be in sync with reality.

Review-Url: https://codereview.chromium.org/2473953003
Cr-Commit-Position: refs/heads/master@{#429638}
mstensho
logicalHeightWithVisibleOverflow() needs to include overhanging floats.
Otherwise we might end up skipping layout of blocks that contain floats
that really need to be relaid out.

We get some marking for layout for free in layoutBlockFlow(), if
pageLogicalHeightChanged, but that only goes one level deep.

Review-Url: https://codereview.chromium.org/2474883002
Cr-Commit-Position: refs/heads/master@{#429611}
fs
Tidy up ComputedStyle::applyTransform
Use range-based for-loops when iterating transform operations (also in
ComputedStyle::requireTransformOrigin), since it's both tidier and
avoids unnecessary index-checks (in operator[].)
Move computation of offsetX/offsetY closer to their point of usage.
Extract the size of the bounding box once, and also drop some unneeded
qualifications of enumeration values.

BUG=369942

Review-Url: https://codereview.chromium.org/2474043002
Cr-Commit-Position: refs/heads/master@{#429598}
karlo
Make offsetTop/Left handle a relative positioned inline offsetParent correctly.
offsetTop and offsetLeft happily ignored the fact that offsetParent could
be a relative positioned inline.

I used the opportunity to change some variable names in
LayoutBoxModelObject::adjustedPositionRelativeTo() in order to hopefully
make it clearer what's going on.

BUG=638184

Review-Url: https://codereview.chromium.org/2414683002
Cr-Commit-Position: refs/heads/master@{#429571}
tsniatowski
Fix a bunch of generated file build flakes in //extensions
Several files in //extensions could randomly fail to build due to
missing dependencies on header generator targets, mostly mojo
and grit. Add the dependencies so builds are not flaky.

BUG=655123

Review-Url: https://codereview.chromium.org/2452943003
Cr-Commit-Position: refs/heads/master@{#429543}
karlo
adjustedPositionRelativeTo() couldn't find offsetParent.
LayoutBoxModelObject::adjustedPositionRelativeTo() could get confused
by inline continuations, and could fail if offsetParent itself was a split
continuation.  If the child belongs to the second part of the continuation,
we'll instead race to the root of the tree.  By comparing with the node instead,
we correctly identify the offsetParent and stop the search.

BUG=638187

Review-Url: https://codereview.chromium.org/2454693003
Cr-Commit-Position: refs/heads/master@{#429541}
fs
Simplify SVG pending resource (re)validation
The contents of the m_pendingResourcesForRemoval map has a lifespan that
does not extend beyond the scope of SVGElement's
buildPendingResourcesIfNeeded() method.
So instead of passing through the map in SVGDocumentExtensions, just
take the corresponding set for the pending 'id' and iterate that
directly, avoiding indirection and complicated removal sequence.
This also allow SVGDocumentExtensions::removeElementFromPendingResources
to be simplified, so do that, and then remove the
m_pendingResourcesForRemoval map from SVGDocumentExtensions.

BUG=661598

Review-Url: https://codereview.chromium.org/2473483004
Cr-Commit-Position: refs/heads/master@{#429539}
mstensho
Remove pageLogicalHeightChanged() from LayoutState.
It was only used from insertFloatingObject(), and in a bogus manner at that.
Added a TODO instead. We haven't even positioned the float at this point, so
attempting layout for pagination here is essentially bad.

We make sure to relayout correctly for pagination when we get to
positionNewFloats() later, anyway.

Review-Url: https://codereview.chromium.org/2467353003
Cr-Commit-Position: refs/heads/master@{#429533}
mstensho
Reland of Improve how the column balancer handles top margins on floats. (patchset #1 id:1 of https://codereview.chromium.org/2468193002/ )
Reason for revert:
csspaint/invalidation-background-image.html was also failing (flaky) before landing this CL.

Original issue's description:
> Revert of Improve how the column balancer handles top margins on floats. (patchset #3 id:40001 of https://codereview.chromium.org/2465363003/ )
>
> Reason for revert:
> Speculative revert to fix csspaint/invalidation-background-image.html failure on "WebKit Win7 (dbg)" bot.
>
> Failed build:
> https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win7%20%28dbg%29/builds/7961
>
> Original issue's description:
> > Improve how the column balancer handles top margins on floats.
> >
> > Float margins do not collapse with column boundaries, so we should make room
> > for them after the break, if the border box of the float starts in the next
> > column.
> >
> > Let the balancer work on the margin box of the float (and the border box for
> > all other objects). For floats, we want to insert breaks before the
> > margin-before edge, not the border-before edge. This lets us remove
> > some special-code for unbreakable floats in InitialColumnHeightFinder, which
> > was the only place that previously bothered about this.
> >
> > Changed how we determine which objects to process. We used to include the
> > overflow both before and after the border box, but we really don't have to
> > bother with content preceding it, since that shouldn't undergo fragmentation
> > anyway.
> >
> > Discovered (one test regressed) that logicalHeightIncludingOverflow() also
> > included clipped overflow, which certainly wasn't the intention. This didn't
> > make much of a difference as long as the method was only called to check if we
> > could skip re-layout. But now we also use it to determine the column height.
> > Fixed it to only include visible overflow and renamed it to
> > logicalHeightWithVisibleOverflow().
> >
> > Committed: https://crrev.com/7c82da727f64121aa34aa1decf82452c37ef7a2d
> > Cr-Commit-Position: refs/heads/master@{#429245}
>
> TBR=eae@chromium.org,mstensho@opera.com
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://crrev.com/58f81484437d367285de9f0fc1fdd4034eb5c333
> Cr-Commit-Position: refs/heads/master@{#429265}

TBR=eae@chromium.org,rouslan@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2471933002
Cr-Commit-Position: refs/heads/master@{#429415}
mstensho
Move LayerHitTestRects to a separate file.
This way, ScrollingCoordinator.h doesn't need to include LayoutObject.h
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2468073002
Cr-Commit-Position: refs/heads/master@{#429311}
mstensho
Move MapCoordinatesMode and MapCoordinatesFlags to a separate header.
This way, LayoutGeometryMap.h doesn't need to include LayoutObject.h

Review-Url: https://codereview.chromium.org/2472573002
Cr-Commit-Position: refs/heads/master@{#429294}
mstensho
Improve how the column balancer handles top margins on floats.
Float margins do not collapse with column boundaries, so we should make room
for them after the break, if the border box of the float starts in the next
column.

Let the balancer work on the margin box of the float (and the border box for
all other objects). For floats, we want to insert breaks before the
margin-before edge, not the border-before edge. This lets us remove
some special-code for unbreakable floats in InitialColumnHeightFinder, which
was the only place that previously bothered about this.

Changed how we determine which objects to process. We used to include the
overflow both before and after the border box, but we really don't have to
bother with content preceding it, since that shouldn't undergo fragmentation
anyway.

Discovered (one test regressed) that logicalHeightIncludingOverflow() also
included clipped overflow, which certainly wasn't the intention. This didn't
make much of a difference as long as the method was only called to check if we
could skip re-layout. But now we also use it to determine the column height.
Fixed it to only include visible overflow and renamed it to
logicalHeightWithVisibleOverflow().

Review-Url: https://codereview.chromium.org/2465363003
Cr-Commit-Position: refs/heads/master@{#429245}
rune
Make siblingRules and uncommonAttributeRules private.
These vectors only need to be modified inside the RuleFeatureSet class.
Added methods for const access.

R=meade@chromium.org

Review-Url: https://codereview.chromium.org/2469143002
Cr-Commit-Position: refs/heads/master@{#429220}
mstensho
Don't always have to relayout a child when fragmentainer height is unknown.
Fragmentainer height is unknown in the first multicol layout pass, before
the initial balancing attempt. It also happens when we have to restart the
column balancing algorithm (due to dynamic content change, containing block
logical width change, etc.). In this case we only need to relayout if the child
did previously break (because then there may be pagination stuts inside that we
need to clear).

Review-Url: https://codereview.chromium.org/2473433002
Cr-Commit-Position: refs/heads/master@{#429135}
mstensho
Avoid unnecessary relayout of floats when not paginated.
Made a mistake when excluding floats from being considered for pagination
relayout skipping, by ALWAYS marking them for layout, EVEN WHEN NOT PAGINATED.
Make sure that we check that we're paginated first. No need to slow down layout
when not paginated.

Broke the logic for determining whether we need layout or not into a separate
method, so that we don't need a quarter of a dozen calls to
setChildNeedsLayout(). The logic is now reversed; rather than checking if we
don't need layout, we check if we DO need layout. Tried to make the code a bit
clearer, and document what goes on at each step.

Review-Url: https://codereview.chromium.org/2459293004
Cr-Commit-Position: refs/heads/master@{#429051}
rune
Reduce CSSStyleSheet size by moving bool member.
Grouping bool members together saved 8 bytes from 120 to 112 on 64 bit
Linux.

Also started using class initializers, removed unnecessary nullptr
initialization of Member<>, and a 0 -> nullptr.

R=mstensho@opera.com

Review-Url: https://codereview.chromium.org/2469693002
Cr-Commit-Position: refs/heads/master@{#428977}
fs
Rewrite css3/filters/effect-reference-delete.html
Make sure we get a layout+paint before removing the <svg> (w/ descendant
filter) so that we test a proper transition.

Review-Url: https://codereview.chromium.org/2453403002
Cr-Commit-Position: refs/heads/master@{#428706}
fs
Make sure to always reset the cached filter in ReferenceFilterOperation
BUG=658305
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2453033004
Cr-Commit-Position: refs/heads/master@{#428678}
mstensho
Be more restrictive about forcing relayout of children for pagination.
Avoid full subtree re-layouts that could especially occur in tables. This could
slow down printing and multicol by a lot.

This change makes PerformanceTests/Layout/multicol/deeply-nested-tables.html
about 1300 times faster (from 5.1 runs/s to 6813 runs/s when tested
locally). The test in bug 487026 will now show print preview instantly, rather
than taking a couple of minutes to finish.

Store the amount of space used (including the trailing strut) before the first
break (if any) instead of the offset from the top of the first fragmentainer.
We'll use this information in markChildForPaginationRelayoutIfNeeded() to
determine if we really need to force re-layout of some child. We really only
need to force re-layout of a child if there's a chance that it needs to
recalculate its pagination struts. It won't need to recalculate anything if we
know that there were no fragmentainer breaks AND that there won't be any if
we re-lay out. Even if there ARE fragmentainer breaks in there, we can still
skip layout if we know that the breaks will remain at the exact same locations
relative to the child. Store this information after layout by calling
updateFragmentationInfoForChild(). We need to include the overflow portion
after the bottom border edge of the child, since overflow also gets fragmented.

The old implementation of markChildForPaginationRelayoutIfNeeded() re-laid out
everything as long as LayoutState's pageLogicalHeightChanged() was true.
However, this flag is only set when entering layout of some fragmentation
context. Some objects, such as tables, requires multi-pass layout. If the flag
was true the first time the object was laid out, it's going to be true in all
subsequent re-layouts as well, potentially resulting in numerous deep layouts.

BUG=487026

Review-Url: https://codereview.chromium.org/2462643002
Cr-Commit-Position: refs/heads/master@{#428626}
tsniatowski
Add missing generator dependencies in content/renderer/mus
Building //content/renderer/mus could fail due to transitive
dependencies on header generators pulled in via render_frame_impl.h
and render_thread_impl.h (building render_widget_mus_connection.cc
or compositor_mus_connection.cc could fail).

Unfortunately //content/renderer deps on //content/renderer/mus,
so there's no easy way to get these deps for free (cyclic dep).

BUG=655123

Review-Url: https://codereview.chromium.org/2461643002
Cr-Commit-Position: refs/heads/master@{#428428}
tsniatowski
Add a //chrome/common dep to //chrome/browser/devtools
Devtools include chrome/common headers which include the generated
features header, so without the dep the build is flaky.

BUG=655123

Review-Url: https://codereview.chromium.org/2454943004
Cr-Commit-Position: refs/heads/master@{#428413}
rune
Move Document global rule data to CSSGlobalRuleSet.
This CL is split out from [1] with some modifications.

Instead of storing these data in the StyleResolver, create a new class
to store them in StyleEngine instead. See the design document linked
from issue 401359 which talks about moving this content off of
StyleResolver. Also made a note that we should further try to contain
as much of this data as possible per TreeScope to avoid the need for
constantly having to update these meta data for shadow tree
modifications.

We get rid of some of the duplicate storing of some of these features.
See what was previously set on StyleEngine (resetCSSFeatureFlags()).

This is also in preparation for async stylesheet update (issue 567021).
There are few places where we synchronously update this new rule set
directly after marking it as dirty which will happen later when all
parts of [1] lands.

Another synchronous update we will be able to remove later is making
the RuleFeatureSet up-to-date when scheduling style invalidations
(marked as TODOs for sync calls to ensureResolver()). The need for
these calls is supported by the added invalidation tests which would
otherwise fail.

[1] https://codereview.chromium.org/1913833002/

BUG=401359,567021

Review-Url: https://codereview.chromium.org/2451893003
Cr-Commit-Position: refs/heads/master@{#428327}
rune
Missing document null pointer check in Internals.
updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks did not check
if the document was null before using it.

R=nainar@chromium.org
BUG=657443

Review-Url: https://codereview.chromium.org/2461633002
Cr-Commit-Position: refs/heads/master@{#428312}
rune
Use StyleEngine::resetAuthorStyle instead of clearScopedStyleResolver.
The former will make sure the shadow root is removed from
treeBoundaryCrossingScopes appropriately.

This code is not in production yet, so there were no observable bug.

R=meade@chromium.org

Review-Url: https://codereview.chromium.org/2456753003
Cr-Commit-Position: refs/heads/master@{#428275}
mstensho
Provide a dedicated getter for the offset to a repeatable THEAD.
pageLogicalOffset() is otherwise only used as an optimization during layout,
and the way we're optimizing for fragmenting is soon going to change.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2455733003
Cr-Commit-Position: refs/heads/master@{#428203}
mstensho
Don't establish LayoutState for LayoutTableRow objects.
Table rows are not the containing block of anything. The real containing block
of a table cell is their table section, not the table row.

With this change, we no longer need to pass the object's location to
LayoutState(). Just call locationOffset() on the object in the constructor
instead, rather than doing it at all call sites.

Review-Url: https://codereview.chromium.org/2458823002
Cr-Commit-Position: refs/heads/master@{#428190}
mstensho
Need to remove line pagination struts when no longer fragmented.
We only used to recalculate pagination struts on lines when we were inside a
fragmentation context, but if said fragmentation context ceases to be one, we
need one final strut recalculation pass, to get rid of them all.

BUG=658019

Review-Url: https://codereview.chromium.org/2460673002
Cr-Commit-Position: refs/heads/master@{#428161}
mstensho
Add a couple of regression tests for float fragmentation.
These tests change the fragmentainer heights, so that the float will fit in the
first fragmentainer afterwards, rather than in the second one.

Review-Url: https://codereview.chromium.org/2445193007
Cr-Commit-Position: refs/heads/master@{#428160}
mstensho
Need a deep layout pass when becoming (un)fragmented.
When an object ceases to be fragmented (e.g. when leaving print preview), there
may be pagination struts that need to be removed. Therefore, we need to lay out
all descendants of a block that ceased to establish a fragmentation context.

Similarly, when becoming fragmented (e.g. when entering print preview), we need
to go through every descendant. There may both be implicit and forced breaks to
insert.

BUG=658019

Review-Url: https://codereview.chromium.org/2454083002
Cr-Commit-Position: refs/heads/master@{#428062}
mstensho
Allow pagination struts to push objects below the exact top of the next column.
The top margin of a float may push its border box below the top of the next
column.

Similarly, a repeated table header may do the same to the first row in the next
column, to make room for itself above it.

The column balancer had assertions to boom at such situations, but it's pretty
clear now that it's an unreasonable requirements that sturts take us to the
exact top of the next column.

Added visual tests that crashed before (in debug). No behavioral changes here,
apart from the fact that the tests no longer crash.

Review-Url: https://codereview.chromium.org/2456003002
Cr-Commit-Position: refs/heads/master@{#428047}
rune
Removed unused StyleEngine::didRemoveShadowRoot().
Also tried to figure out and document why we are clearing
ScopedStyleResolvers for shadow trees in clearResolver().

R=meade@chromium.org

Review-Url: https://codereview.chromium.org/2454903002
Cr-Commit-Position: refs/heads/master@{#427950}
rune
Removed unnecessary rule feature reset when no ScopedStyleResolver.
Resetting rule features when a shadow tree did not contain any
stylesheets, and hence didn't have a ScopedStyleResolver, caused a
performance regression in the select-single-remove performance test.

UA shadow trees typically don't have any stylesheets.

This is a regression from [1].

[1] https://codereview.chromium.org/2443933002

R=meade@chromium.org
BUG=659535
TEST=PerformanceTests/DOM/select-single-remove.html

Review-Url: https://codereview.chromium.org/2452733004
Cr-Commit-Position: refs/heads/master@{#427949}
mstensho
LayoutState doesn't need to store both layout and pagination offset.
We only ever used those two in combination to figure out how far away we were
from the start of the pagination context. So, let's just store that directly instead.
This allows us to clean up quite a bit. Also changed LayoutState() to do more
early returns, when we have no more work left to do.

Also consolidated two sections that disabled pagination for unsupported content
(one for SVG and one for other unbreakable content).

Review-Url: https://codereview.chromium.org/2444193009
Cr-Commit-Position: refs/heads/master@{#427945}
rune
Clear m_treeBoundaryCrossingScopes when reconstructing StyleResolver.
When m_treeBoundaryCrossingScopes were part of StyleResolver, they were
cleared when the StyleResolver was cleared. Now that they outlive the
StyleResolver, they need to be cleared separately.

R=meade@chromium.org
BUG=659653

Review-Url: https://codereview.chromium.org/2450353002
Cr-Commit-Position: refs/heads/master@{#427912}
tsniatowski
Fix a large number of missing dependencies in the blink gn build
Make all blink_core_sources targets public_dep on all the code
generators in core to ensure required headers are always generated first
and a successful build does not depend on lucky ordering. Manually fix
similar dep issues in core/inspector.

There are now more dependencies than strictly necessary, but they will
only trigger the generators with no effect on build commands (tested by
checking that the patch doesn't trigger a rebuild of any c++ code).

The end result is that the total number of targets that don't have proper
deps in the 'chrome' target build goes down from over 1800 to about 40,
and no missing dependencies on gen/blink files exist.

BUG=655123
R=dpranke@chromium.org

Review-Url: https://codereview.chromium.org/2452473004
Cr-Commit-Position: refs/heads/master@{#427856}
mstensho
The column balancer needs to look inside inlines.
There may be floats there.

Split traverseSubtree() into traverseLines() and traverseChildren(), so that
traverseChildren() can easily be called directly when at inlines.

BUG=586956

Review-Url: https://codereview.chromium.org/2453743002
Cr-Commit-Position: refs/heads/master@{#427724}
tsniatowski
Fix some mojo dependencies in blink
Several places in blink were using mojo headers without a dependency on
mojo targets that generate said headers, causing build flakiness.

BUG=655123

Review-Url: https://codereview.chromium.org/2453653003
Cr-Commit-Position: refs/heads/master@{#427659}
mstensho
No longer mark two tests in ietestcenter/css3/multicolumn as failing.
They pass now, probably because of the fix for bug 291616.

BUG=396940

Review-Url: https://codereview.chromium.org/2446023003
Cr-Commit-Position: refs/heads/master@{#427370}
wdzierzanowski
Call willInsertBody() in MediaDocument::createDocumentStructure()
Follow up on https://codereview.chromium.org/1343493002 and add the same
willInsertBody() call that ImageDocument has.

Review-Url: https://codereview.chromium.org/2427563002
Cr-Commit-Position: refs/heads/master@{#427312}
wonko
Don't assume python is in /usr/bin in js_minify.py
BUG=658218

Review-Url: https://codereview.chromium.org/2438293002
Cr-Commit-Position: refs/heads/master@{#427304}
jb
Deal with canceled requests when flushing deferred messages.
Flushing deferred messages might lead to a request being canceled
(e.g. when an ImageResource loads a corrupt image). The code didn't
fully take this into account which would cause crashes (and resource
leaks if it would have survived).

BUG=

Review-Url: https://codereview.chromium.org/2425173003
Cr-Commit-Position: refs/heads/master@{#427298}
rune
Move TreeBoundaryCrossingScopes to StyleEngine.
This is split out of the work for async stylesheet updates [1], but is
also part of the work on componentized style resolving in general.

The moved resetAuthorStyle method on StyleEngine may soon be gone
altogether as it does so in [1].

The plan is that TreeBoundaryCrossingScopes will also be completely
gone when we remove support for Shadow DOM v0. For Shadow DOM v1 we can
look up the scoped resolvers for the affecting scopes directly like we
already do in StyleResolver::matchScopedRules for the pure v1 case.

The documentation of the special casing of VTT and custom pseudo
elements is updated to not suggest that these rules are handled as part
of boundary crossing scopes as the current solution is better once v0
shadows go away.

[1] https://codereview.chromium.org/1913833002

R=meade@chromium.org
BUG=567021,401359

Review-Url: https://codereview.chromium.org/2443933002
Cr-Commit-Position: refs/heads/master@{#427284}
fs
Fix more null-checks in SVGLengthContext::convertValueFrom*
The following methods in SVGLengthContext:

 convertValueFromUserUnitsToCHS
 convertValueFromUserUnitsToEXS
 convertValueFromEXSToUserUnits

needs the same treatment as convertValueFromCHSToUserUnits got in
https://chromiumcodereview.appspot.com/2445463002.

R=pdr@chromium.org,eae@chromium.org
BUG=657438,658585,658613

Review-Url: https://codereview.chromium.org/2449433002
Cr-Commit-Position: refs/heads/master@{#427080}
mstensho
Remove unused hasPendingResourceUpdate bit from LayoutObject.
Also recounted, updated and corrected total bit count.

Review-Url: https://codereview.chromium.org/2442283002
Cr-Commit-Position: refs/heads/master@{#427050}
rune
Rename collectTreeBoundaryCrossingRules.
Include V0Cascade order to reflect that this is the legacy code for
Shadow DOM V0 cascading order in pure V0 documents.

R=kochi@chromium.org

Review-Url: https://codereview.chromium.org/2445673002
Cr-Commit-Position: refs/heads/master@{#427042}
fs
Use a converter for building style value for 'transform'
Also change TransformBuilder::createTransformOperations to return the
TransformOperations rather than use an out argument.

Review-Url: https://codereview.chromium.org/2435413002
Cr-Commit-Position: refs/heads/master@{#427036}
fs
Avoid copying value in ComputedStyle CoW comparions (compareEqual)
Because of the cast of the RHS, |u|, a copy would be generated, with
code and cycle bloat as the result. In some cases this can even have
prevented inlining. Particularly nasty examples:

 bool compareEqual(const Vector<LengthPoint>&, const Vector<LengthPoint>&) [210 bytes]
 bool compareEqual(const Vector<CSSPropertyID>&, const Vector<CSSPropertyID>&) [274 bytes]
 bool compareEqual(const Vector<GridTrackSize>&, const Vector<GridTrackSize>&) [182 bytes]
 bool compareEqual(const HashMap<String, GridArea>&, const HashMap<String, GridArea>&) [308 bytes]
 bool compareEqual(const TransformOperations&, const TransformOperations&) [441 bytes]
 bool compareEqual(const LengthBox&, const LengthBox&) [249 bytes]

Remove the U->T cast in compareEqual to avoid the copies. Nothing seems
to require this coercion (anymore?) This eliminates the above symbols
entirely. A total binary size reduction of >30k (x86-64; non-official) also
indicates even the simpler cases/types may have benefited.

Review-Url: https://chromiumcodereview.appspot.com/2438353002
Cr-Commit-Position: refs/heads/master@{#426990}
rune
Always evaluate media features to true without MediaValues.
Having a constructor taking bool made it possible to construct a
MediaQueryEvaluator passing a pointer to an object of an arbitrary
type as the pointer was converted to a bool without a warning.

By closer inspection, the use of the m_expectedResult value had two
purposes. One was to return true for matching media type ignoring the
rest of the media query. The other cases were for testing purposes
where there was no media rules to match, so the result didn't matter.

Since there are no useful applications for returning false for media
queries containing expressions in addition to type, we can safely
return true for all query expression when no MediaValues object is
present.

There is one place we change the behavior. The StyleResolver
constructor has a fallback evaluator when we have no FrameView. That
should never happen, though, and it would yield incorrect results
regardless of whether we would always return true or false for media
query expressions.

R=timloh@chromium.org,meade@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2432153005
Cr-Commit-Position: refs/heads/master@{#426752}
jb
Fix NULL pointer dereference in FinishedAsyncCopyRequest()
Due to undefined (favorably right to left) argument evaluation order,
the tracker might have been passed and set to NULL before the window
is looked up which results in a NULL pointer dereference.

BUG=

Review-Url: https://chromiumcodereview.appspot.com/2435033002
Cr-Commit-Position: refs/heads/master@{#426748}
rune
MediaValuesInitialViewport passed to MediaQueryEvaluator as bool.
The test coverage for [1] was not good enough. We tried to pass a
MediaValues pointer into the MediaQueryEvaluator constructor, but since
none of the constructors took such a type, it was converted into a bool
for which there was a constructor.

I'm planning to change the bool parameter to an enum in a follow-up CL
to avoid such mistakes in the future.

[1] https://codereview.chromium.org/2414343002/

R=timloh@chromium.org
BUG=332763

Review-Url: https://chromiumcodereview.appspot.com/2430923005
Cr-Commit-Position: refs/heads/master@{#426747}
mstensho
Pay attention to tall rowspanned cells in the first layout pass.
If a rowspanned cell gets fragmented, and this cell needs to stretch the table
rows in order to fit, only stretch the last row (i.e. the one we're currently
laying out). That's the only thing we can do if we don't want mess up
fragmentation (pagination struts) of earlier content.

Furthermore, to leave those rows completely alone, don't let a subsequent
rowspanned cell that shares at least one row with the previous rowspanned cell
stretch those rows, either, as that would lead to unfair height distribution
anyway (since the last row has already got all the extra space).
table-overlapping-rowspan.html tests this.

BUG=534751

Review-Url: https://chromiumcodereview.appspot.com/2433403002
Cr-Commit-Position: refs/heads/master@{#426590}
mstensho
Clean up LayoutTableSection::calcRowLogicalHeight() a bit.
Since nobody apparently wants to deal with a rowspanned cell unless we're at
its first row, just skip that cell for subsequent rows, instead of having
checks for this everywhere.

Also removed a debug hashmap that was just used to assert that we didn't add
duplicate cells to a vector. Check the vector directly instead.

Review-Url: https://chromiumcodereview.appspot.com/2434033003
Cr-Commit-Position: refs/heads/master@{#426555}
mstensho
Remove last-minute row height stretching for pagination.
This code no longer has any effect, since we now fragment and set the correct
row heights way BEFORE cell alignment and flexing. It was also buggy, in that
it didn't recalculate intrinsic padding after resizing the row.

BUG=534751

Review-Url: https://chromiumcodereview.appspot.com/2433413002
Cr-Commit-Position: refs/heads/master@{#426512}
mstensho
Performance test for deeply nested tables inside multicol.
This is similar to printing deeply nested tables, and we have serious
performance issues with this.

Landing the performance test separately from the actual fix, so that we can
observe the improvement when the fix eventually lands.

BUG=487026

Review-Url: https://chromiumcodereview.appspot.com/1695193006
Cr-Commit-Position: refs/heads/master@{#426461}
mstensho
Specified row height should be applied during initial section layout.
BUG=534751

Review-Url: https://chromiumcodereview.appspot.com/2434543004
Cr-Commit-Position: refs/heads/master@{#426441}
mstensho
Remove first-line-in-cell strut subtraction workaround.
This is no longer needed. In fact, it was causing some trouble.

BUG=534751

Review-Url: https://chromiumcodereview.appspot.com/2438613004
Cr-Commit-Position: refs/heads/master@{#426435}
fs
Simplify SVGAnimated* initialization
In several cases, all initial values are the same, so callers of
SVGAnimated<TYPE>::create can be relieved of the duty of calling
SVG<TYPE>::create() explicitly.

This affects:

  SVGAnimatedBoolean,
  SVGAnimatedNumberList,
  SVGAnimatedPreserveAspectRatio,
  SVGAnimatedString and
  SVGAnimatedTransformList

These should hopefully also all reset to the correct value when
encountering an invalid (string) value.

BUG=225807

Review-Url: https://chromiumcodereview.appspot.com/2436793002
Cr-Commit-Position: refs/heads/master@{#426429}
rune
Collect @viewport before constructing RuleSets.
- Move ViewportStyleResolver to StyleEngine.

- Only create a ViewportStyleResolver for top level documents.

- Collect @viewport rules via the DocumentStyleSheetCollection.

- Use the initial viewport size for resolving viewport relative
  lengths.

- Introduce initialViewportChanged() and viewportRulesChanged() in
  StyleEngine to trigger re-collection and resolution of the actual
  viewport. These currently trigger an immediate call to updateViewport
  which will later be a part of the document lifecycle phase for
  updating active stylesheets.

This finally fixes issues 332763, 455136, and 463098.

R=timloh@chromium.org
BUG=567021,463098,455136,332763

Review-Url: https://chromiumcodereview.appspot.com/2420413005
Cr-Commit-Position: refs/heads/master@{#426427}
rune
Initial viewport is not the same as FrameView rect.
FrameView rect is also changed by the visual viewport.

Set the initial viewport size on FrameView whenever it changes in
WebViewImpl and use it for matching media queries when collecting
@viewport rules. See [2] for spec reference.

This is fixing what was introduced in [1].

[1] https://codereview.chromium.org/2414343002/
[2] https://www.w3.org/TR/css-device-adapt-1/#media-queries

R=bokan@chromium.org,timloh@chromium.org
BUG=332763

Review-Url: https://chromiumcodereview.appspot.com/2431613002
Cr-Commit-Position: refs/heads/master@{#426424}
mstensho
Move table row pagination strut insertion to the first layout pass.
Pagination struts are inserted before a table row, when we should avoid
breaking inside it, and it doesn't fit as a whole in its current fragmentainer.
We should avoid breaking inside rows when their break-inside is "avoid", or
when there are repeating table headers (which turns on break-inside:avoid for
all rows in the table).

This CL also includes the code that deals with repeating headers, since it
proved hard to separate it from the rest.

We need to make sure to subtract the struts from previous rows' height now;
just like we don't include border spacing in the rows, we should also omit the
pagination strut of the next row. In order to be consistent about this,
layoutRows() in LayoutTableSection now uses the rows' logical heighs more
extensively than before (rather than using the m_rowPos array to calculate
heights). This has an implication for rowspanned cells. We now need to wait
until we are at their last row before processing them, since we calculate row
heights on the fly. There's a small fix here. Previously, the strut wasn't
baked into the logical top of a table row, unlike all other layout objects.
This resulted in wrong offsets for table rows after fragmentainer breaks,
but the cells in there still had correct offsets, so it wasn't possible
to observe this bug in any visual test. It does affect a couple of
dump-render-tree printing tests, though. Added a couple of tests for this
on my own, which use offsetTop and offsetHeight.

table-disable-fragmentation.html is just a regression test. We need to be
careful to ignore struts when not fragmented. It passed before and it passes
now, but I nearly broke it while working on this.

BUG=534751

Review-Url: https://chromiumcodereview.appspot.com/2433473002
Cr-Commit-Position: refs/heads/master@{#426265}
mstensho
Clean up break-inside restriction propagation from table headers.
If a table header has break-inside:avoid, our implementation currently
propagates that to all table rows in the table. Make this more obvious (and
consistent) with a getPaginationBreakability() override in LayoutTableRow,
rather than checking it at only one place (paginationStrutForRow()), although
that may very well have been the only place that needed to care.

No behavioral changes expected.

Review-Url: https://chromiumcodereview.appspot.com/2426553004
Cr-Commit-Position: refs/heads/master@{#426020}
mstensho
Set logical top and height of table rows and cells in the first layout pass.
This gives the fragmentation machinery an opportunity to insert breaks at the
right places. We previously assumed that all cells were at the top of their
table section, so break insertion was completely bogus. While we'd get a second
chance to break correctly in the second layout pass, this doesn't always work
too well. There's currently some code in layoutRows() in LayoutTableSection
that attempts to adjust the row height when we change where we break inside a
table cell, but it doesn't re-align cells vertically after this adjustment.
That code must die, and this CL is a preparatory step.

BUG=534751

Review-Url: https://chromiumcodereview.appspot.com/2423403002
Cr-Commit-Position: refs/heads/master@{#426015}
rune
Removed unused includes from Internals.cpp.
R=mstensho@opera.com

Review-Url: https://codereview.chromium.org/2428543004
Cr-Commit-Position: refs/heads/master@{#425945}
rune
Implement collection of @viewport rules from DocumentStyleCollection.
The @viewport rules will be recollected and re-resolved from a new
updateViewport() method. Rule will need to be re-collected when
stylesheets are added, or when media queries change. Re-resolution
needs to happen when the viewport descriptors contain vh/vw units, or
after a re-collection of rules.

Store the viewport and device dependent mq results on the
ViewportStyleResolver as these may be different from the results
collected when constructing the rulesets because of the initial/actual
viewport difference. The device dependent will not be different, but
nested media queries may cause some media queries to be skipped for
ruleset construction which would not be skipped for @viewport rule
collection.

We also change the existing code to lazily reset() in preparation for
the re-collect/re-resolve distinction.

R=timloh@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2424823002
Cr-Commit-Position: refs/heads/master@{#425942}
mstensho
Separate method for calculating logical height based on CSS properties.
Move it out of LayoutTable::layout(), since that method is more than crowded
enough as it is.

Had to make convertStyleLogicalHeightToComputedHeight() a const method, since I
decided to make the new method const. Constified
convertStyleLogicalWidthToComputedWidth() as well, for the sake of consistency.

Review-Url: https://codereview.chromium.org/2422103003
Cr-Commit-Position: refs/heads/master@{#425757}
mstensho
Disable row stretching for tables crossing fragmentainer boundaries.
Edge also does this.

Allowing rows to be stretched and thus moved after fragmentation would require
us to re-fragment (since the fragmentainer boundaries would be elsewhere, due
to row stretching), then re-stretch, the re-re-fragment, and so on (cyclic
dependencies).

BUG=534751

Review-Url: https://codereview.chromium.org/2421133002
Cr-Commit-Position: refs/heads/master@{#425705}
tmoniuszko
Add missing exclusive_access_manager.h includes
BUG=

Review-Url: https://codereview.chromium.org/2424773002
Cr-Commit-Position: refs/heads/master@{#425670}
rune
Spell-checking and proof-reading WhitespaceLayoutObjects.md.
R=nainar@chromium.org,bugsnash@chromium.org

Review-Url: https://codereview.chromium.org/2423963002
Cr-Commit-Position: refs/heads/master@{#425663}
rune
Removed incorrect comment about raw pointer.
LocalFrame now traced as Member of MediaValuesDynamic.

R=meade@chromium.org

Review-Url: https://codereview.chromium.org/2417973002
Cr-Commit-Position: refs/heads/master@{#425629}
rune
Implement MediaValues for initial viewport.
Viewport-dependent media queries evaluate in the context of the initial
viewport when collecting @viewport rules as specified in [1]. Implement
a MediaValuesInitialViewport which returns the initial viewport
dimensions instead of the actual viewport. This change doesn't fix
issue 332763 until we start collecting author @viewport rules before
creating RuleSets.

[1] https://www.w3.org/TR/css-device-adapt-1/#media-queries

R=timloh@chromium.org
BUG=332763

Review-Url: https://codereview.chromium.org/2414343002
Cr-Commit-Position: refs/heads/master@{#425628}
mstensho
Lay out table children in visual order, and set position and size.
Set caption and section positions before the first layout pass, and set the
logical height right after. This will help the fragmentation code break at the
right places.

By doing it in visual order right away we can also get rid of some code that
dealt with sections being moved after layout.

BUG=534751

Review-Url: https://codereview.chromium.org/2421613002
Cr-Commit-Position: refs/heads/master@{#425425}
mstensho
Correctly check if we have a valid page height before checking remaining space.
LayoutState::pageLogicalHeight() is bogus, and the sooner we convince it to
take a long walk on the short pier, the better. :(

Additionally, bail out earlier from fragmentation-specific code. No need to
waste time on calling crossesPageBoundary() when not fragmented.

BUG=655911

Review-Url: https://codereview.chromium.org/2413413003
Cr-Commit-Position: refs/heads/master@{#425420}
rune
Simpler viewportAndroid.css setup for WebFrameTests.
Enable use of viewportAndroid.css by setting WebViewportStyle::Mobile
instead of explicitly parsing the sheet as part of the tests.

Also corrected some typos.

R=bokan@chromium.org

Review-Url: https://codereview.chromium.org/2423463002
Cr-Commit-Position: refs/heads/master@{#425355}
fs
Clean up SVGViewSpec::parseViewSpecInternal
Make this function slightly more readable by partitioning it as:
  1) Parse outer function ("svgView")
  2) For all functions:
  2.1) Match/parse "function name"
  2.2) Parse arguments to said function

This gets rid of a lot of the parameter list boilerplate that every case
shares. (I.e handling '(' and ')'.)

Also change to use skipExactly and skipUntil from ParsingUtilities.h.

Review-Url: https://codereview.chromium.org/2421863002
Cr-Commit-Position: refs/heads/master@{#425315}
rune
Don't generate RuleSets for viewport UA sheets.
Start collecting UA @viewport rules from the StyleSheetContents instead
of the RuleSet. The reason is that we need to collect viewport rules
before creating the RuleSet in order to use the correct actual viewport
for evaluating media queries. This is split out from [1].

Also introducing a separate MediaQueryEvaluator in the
ViewportStyleResolver which should eventually be based on the initial
viewport and not the actual viewport as described in the CSS Device
Adaptation spec.

[1] https://codereview.chromium.org/2405143003

R=timloh@chromium.org
BUG=463098

Review-Url: https://codereview.chromium.org/2410283005
Cr-Commit-Position: refs/heads/master@{#425284}
rune
Add hasViewportRule() flag to StyleSheetContents.
This is a pre-requisite for collecting viewport rules before generating
the RuleSet. The RuleSet contents depends on media query evaluation,
which in turn depends on viewport size resolution, which means we are
currently may generate the RuleSet, and recalculate style, twice in the
presence of both @media and @viewport.

This CL is split out from [1] which in turn is split out from [2].

[1] https://codereview.chromium.org/2405143003/
[2] https://codereview.chromium.org/1913833002/

R=timloh@chromium.org
BUG=463098

Review-Url: https://codereview.chromium.org/2408353003
Cr-Commit-Position: refs/heads/master@{#425273}
karlo
Support margin-top for legend in fieldset.
The implementation aligns with Edge, Gecko centers the legend+margins, which
looks undesirable to me.  The specs say nothing about this.

The new behaviour causes two tests to change, both have been rebaselined. One
was additionally modified to not trigger the scrollbar, which in turn would
render differently on various platforms.

BUG=554077
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2396813002
Cr-Commit-Position: refs/heads/master@{#425127}
mstensho
Top-align table cells in rows that cross fragmentainer boundaries.
Ignore whatever vertical-align says and force everything to be top aligned in
those cases. Edge also behaves like this.

Doing both fragmentation and vertical alignment for table parts could cause
unresolvable situations (cyclic dependencies).

Two tests that depended on vertical alignment working under such circumstances
are now invalid, and were therefore removed.

BUG=534751

Review-Url: https://codereview.chromium.org/2412923002
Cr-Commit-Position: refs/heads/master@{#425112}
jb
Make HarfBuzzFace release SimpleFontData.
HarfBuzzFace did a retained look up of SimpleFontData from the
FontDataCache but never released the SimpleFontData. This caused the
SimpleFontData to remain in the cache, indefinitely holding on to
SkFontFaces and all associated data. This fix makes HarfBuzzFace
release the SimpleFontData when deleted.

BUG=617568

Review-Url: https://codereview.chromium.org/2411643002
Cr-Commit-Position: refs/heads/master@{#424993}
mostynb
Add the Ahem font license
Review-Url: https://codereview.chromium.org/2397303003
Cr-Commit-Position: refs/heads/master@{#424769}
rune
documentStyleSheetCollection() is always non-null.
Return a reference instead of a pointer to make that clear.

R=meade@chromium.org

Review-Url: https://codereview.chromium.org/2405793002
Cr-Commit-Position: refs/heads/master@{#424706}
fs
Push hasValidAttributeName/Type down into SVGAnimateElement
Introduce a new "validator" method for SVGSMILElements - hasValidTarget.
With this new method in place, the hasValidAttributeType and
hasValidAttributeName methods can be pushed down the hierarchy to where
they belong, namely SVGAnimateElement.
As a bonus, some conditions and assertions can be simplified.

BUG=641437

Review-Url: https://codereview.chromium.org/2408913002
Cr-Commit-Position: refs/heads/master@{#424389}
fs
Consolidate FilterOperation and FilterEffect mapRect implementations
The FilterOperations and FilterEffects for drop-shadow and gaussian blur
has very similar but slightly different implementations.
Restructure the code a bit so that the entire thing can be shared/reused
between the two different code-paths. The new canonical location is the
corresponding FilterEffect (FEGaussianBlur and FEDropShadow.)

Review-Url: https://codereview.chromium.org/2393993004
Cr-Commit-Position: refs/heads/master@{#424263}
davve
Remove davve@ from OWNERS files
Recently I haven't had, and don't expect to get, much time to
contribute to Blink.

NOTRY=true
BUG=none

Review-Url: https://codereview.chromium.org/2406823002
Cr-Commit-Position: refs/heads/master@{#424130}
rune
Document LayoutObject generation for whitespace nodes.
R=eae@chromium.org,esprehn@chromium.org,mstensho@opera.com

Review-Url: https://codereview.chromium.org/2402653002
Cr-Commit-Position: refs/heads/master@{#423947}
mstensho
Don't break before a first in-flow block container.
There's no break opportunity there, but break-inside:avoid used to trick us
into inserting a break there anyway in some cases.

As part of this work, we need allowsPaginationStrut() to check better if a
strut is allowed, or it might just end up getting eaten and forgotten about by
a first in-flow block further up in the tree. This matters for monolithic
content [1], such as lines and image blocks. We should never break inside
those, so allow breaking before them, even if they are the first piece of
content inside some block (just like we did before this change).
break-before-first-line-in-first-child.html and image-block-as-first-child.html
test that we don't regress in this regard.

Also removed a FIXME about checking for sufficient height. This would be
incorrect to fix. If there's no break point here, we have to propagate the
strut, if we're allowed to.

Had to update some tests, and even rename one, because they relied on the old
buggy behavior.

[1] https://drafts.csswg.org/css-break-3/#possible-breaks

BUG=653690

Review-Url: https://codereview.chromium.org/2400083003
Cr-Commit-Position: refs/heads/master@{#423926}
mstensho
A forced break inside a break-inside:avoid object may make it fit where it is.
If an object with break-inside:avoid is taller than what fits in the current
fragmentainer, but it has a forced break before we get to the end of the
fragmentainer, we don't have to push the object to the next one, since what's
before the forced break fits fine where it is.

BUG=533736

Review-Url: https://codereview.chromium.org/2401753002
Cr-Commit-Position: refs/heads/master@{#423884}
fs
Move isTargetAttributeCSSProperty to SVGAnimateElement
SVGAnimateElement is the only user. Move it and make it a free function.

BUG=641437

Review-Url: https://codereview.chromium.org/2395793004
Cr-Commit-Position: refs/heads/master@{#423817}
rune
Apply RuleSet changes for active stylesheet changes.
Introduce an applyRuleSetChanges method which will take the old and new
ActiveStyleSheetVector use the existing comparison method and apply the
RuleSet diff to invalidate style for the document.

The normal mode for style rules is to schedule RuleSet invalidations
which will decide what to recalculate based on the invalidation sets.
Universal selectors, the presence of Shadow DOM v0 combinators, or
@font-face rules for the document scope, will cause a subtree recalc
for the TreeScope.

@keyframes rules utilizes the existing functionality for invalidating
style in the TreeScope and the host TreeScope for running and
unresolved animations.

This CL introduces appendActiveStyleSheets which will eventually
replace the combination of the lazy appending of sheets in
StyleResolver and appending pending sheets into the ScopedStyleResolver
through appendCSSStyleSheet.

This CL is split out of https://codereview.chromium.org/1913833002 and
re-worked a bit.

The functionality is not yet in use.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2394353003
Cr-Commit-Position: refs/heads/master@{#423810}
rune
Allow active sheets to have nullptr for RuleSet.
CSSStyleSheets which have a non-matching media attribute may have a
nullptr for RuleSet since it's not needed. Handle that in active style-
sheet diffing. That means adding a sheet with non-matching media should
not cause any style recalculations.

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2401573002
Cr-Commit-Position: refs/heads/master@{#423804}
rune
Skip reflowed comments css/parser for git-blame.
R=thakis@chromium.org
BUG=563793

Review-Url: https://codereview.chromium.org/2396433006
Cr-Commit-Position: refs/heads/master@{#423712}
fs
Adjust some includes around SVGResourceClient and FilterOperation
Also drop an unused include of ReferenceFilterBuilder.h.

BUG=439970
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2400663002
Cr-Commit-Position: refs/heads/master@{#423708}
mstensho
Store physical location in LayoutTableRow, just like in all other objects.
BUG=652496

Review-Url: https://codereview.chromium.org/2399633002
Cr-Commit-Position: refs/heads/master@{#423701}
ckulakowski
Add missing dependencies to extensions BUILD.gns
Some files from guest_view include (not directly) file
extensions/common/api/events.h which is generated by target
//extensions/common/api. This dependency is missing and
sometimes it causes compilation errors. Build will fail if
no target which depends on //extensions/common/api is built
before guest_view. It happens quite rarely: it failed once
on ~10 rebuilds on my mac.

BUG=

Review-Url: https://codereview.chromium.org/2402453002
Cr-Commit-Position: refs/heads/master@{#423613}
rune
Skip reflowed comments css/invalidation for git-blame.
R=meade@chromium.org
BUG=563793

Review-Url: https://codereview.chromium.org/2393393002
Cr-Commit-Position: refs/heads/master@{#423503}
rune
Reflow comments in core/css/parser
R=timloh@chromium.org
BUG=563793

Review-Url: https://codereview.chromium.org/2398013002
Cr-Commit-Position: refs/heads/master@{#423482}
fs
Move handling of 'attributeType' to SVGAnimateElement
Another animation property that applies only to the SVGAnimateElement
part/subtree of the element hierarchy. Move it down for continued
"unlocking" of the structure.

BUG=641437

Review-Url: https://codereview.chromium.org/2391993006
Cr-Commit-Position: refs/heads/master@{#423467}
rune
Reflow comments in core/css/invalidation.
R=meade@chromium.org
BUG=563793

Review-Url: https://codereview.chromium.org/2398833004
Cr-Commit-Position: refs/heads/master@{#423441}
mstensho
Move table cell height flexing into a separate method.
TableSection::layoutRows() is long enough as it is. :)

Review-Url: https://codereview.chromium.org/2392353002
Cr-Commit-Position: refs/heads/master@{#423248}
fs
Move shouldApplyAnimation to SVGAnimateElement
Only used by SVGAnimateElement.

BUG=641437

Review-Url: https://codereview.chromium.org/2394583002
Cr-Commit-Position: refs/heads/master@{#422935}
fs
Hoist target element null-checks out of SVGAnimateElement::calculate*
The calculateFromAndToValues, calculateFromAndByValues and
calculateDistance share a common entrypoint (startedActiveInterval), so
we can tighten this code-path a bit checking for a target element up
front. (No target element makes for pretty useless animations anyway...)
calculateAnimatedValue gets similar treatment in its updateAnimation
(sole) entrypoint.

Also refill comments to 80 columns in SVGAnimateMotionElement.cpp.

BUG=641437

Review-Url: https://codereview.chromium.org/2386013002
Cr-Commit-Position: refs/heads/master@{#422484}
fs
Push animation value 'inherit' handling into SVGAnimateElement
Handling of 'inherit' doesn't need to live on SVGAnimationElement,
because only SVGAnimateElement makes use of it. Move it down the
class structure and simplify.

Also refill/wrap comments in the files touched to 80 columns.

BUG=641437

Review-Url: https://codereview.chromium.org/2384013002
Cr-Commit-Position: refs/heads/master@{#422446}
mostynb
remove obsolete(?) git attributes from old top-level WebKit settings
It is a little surprising (for automated scripts, mostly) for files to
be export-ignore'd from subdirectories.  This patch removes some old WebKit
export-ignore attributes that I suspect are no longer useful.

This was the original patch that added the attributes, I have not been able
to locate details of the review or why it was originally required:
https://chromium.googlesource.com/chromium/src.git/+/20706fd0c00d214a264439277e0bc8e90ccba203

Review-Url: https://codereview.chromium.org/2387033002
Cr-Commit-Position: refs/heads/master@{#422412}
mharanczyk
Add WebRange test for explicit empty ranges creation.
This is followup of https://codereview.chromium.org/2373613005/.

Review-Url: https://codereview.chromium.org/2385643002
Cr-Commit-Position: refs/heads/master@{#422405}
mstensho
Use ceil() when integerizing pagination struts before table rows.
Subpixel rendering is not supported in table parts, so everything needs to be
integers. However, instead of rounding the pagination strut down to the nearest
integer, round it up. This way we at least make sure that we manage to push all
the content over to the designated fragmentainer, rather than leaving one tiny
strip behind in the previous fragmentainer. There'll still be off-by-one
errors, but at least all the content is in the right fragmentainer.

Updated some tests to not use subpixel multicol heights, since what they
required cannot really be satisfied without adding full subpixel support to
tables.

Also added a new test that *does* use subpixel multicol height. This test
merely makes sure that nothing is left behind in the previous fragmentainer at
breaks, without worrying about the exact top position of the objects.

This problem was discovered while working on bug 487026, which is about
reducing the amount of forced re-layouts that we do for fragmentation, and it
turns out that table layout in general, and perhaps strut calculation there in
particular, tends to need more layout passes it explicitly asks for (so it
depends on other parts of the system dealing out layout passes for free). Added
body { overflow:hidden; } declarations to some tests, to reduce the number of
layout passes you get for free, i.e. make the tests more evil.

BUG=487026

Review-Url: https://codereview.chromium.org/2382043003
Cr-Commit-Position: refs/heads/master@{#422312}
fs
Fold bits of SVGAnimatedTypeAnimator into SVGAnimateElement
This folds non-property-construction methods from
SVGAnimatedTypeAnimator into SVGAnimateElement and gets rid of simple
forwarding methods. This leaves SVGAnimatedTypeAnimator as a property-
value factory.

BUG=641437

Review-Url: https://codereview.chromium.org/2387513002
Cr-Commit-Position: refs/heads/master@{#422188}
fs
Don't allow form-feed (U+000C) as a WebVTT signature separator
Per the WebVTT parser algorithm [1], only space, tab or newline (after
normalization) are allowed to follow the "WEBVTT" signature.

[1] https://w3c.github.io/webvtt/#webvtt-parser-algorithm

BUG=651777

Review-Url: https://codereview.chromium.org/2382173002
Cr-Commit-Position: refs/heads/master@{#422093}
fs
Don't use absolute bounding boxes in LayoutVTTCue
LayoutVTTCue was using absoluteContentBox()/absoluteBoundingBoxRect()
during overlap resolution. This would mean that boxes were computed
relative to the containing frame. The former also doesn't take
transforms into account, which would mean that the basic overlap check
against the title area would fail if a transform was present.

Instead compute the various bounding boxes relative to a common
ancestor, namely the text track container (which is also the containing
block of the cues.) Adjust the controls rect similarly to get it into the
same coordinate space.

BUG=647253

Review-Url: https://codereview.chromium.org/2377193003
Cr-Commit-Position: refs/heads/master@{#422072}
mstensho
Introduce markChildForPaginationRelayoutIfNeeded().
No behavioral changes intended.

This replaces markForPaginationRelayoutIfNeeded(). Since the method was always
called when it was the container that was being laid out, this is more
"correct", and in the same spirit as e.g.
updateBlockChildDirtyBitsBeforeLayout(), adjustBlockChildForPagination(), and
so on.

This is a preparatory patch to allow for calling
offsetFromLogicalTopOfFirstPage(), which uses LayoutState more heavily.
When using LayoutState, you generally need to be laying out the very same
object as the one LayoutState points to.

BUG=487026

Review-Url: https://codereview.chromium.org/2382733002
Cr-Commit-Position: refs/heads/master@{#421815}
fs
Move FilterOperation*.{cpp,h} to core/style/
Move the FilterOperation(s) structures to core/style to make them a
"style type". This is in preparation for an improved mechanism for
signaling mutations to "reference" filters.

This is essentially a pure move, with only minor modifications to fix
some presubmit issues and to facilitate (fix) building.
(ASSERT -> DCHECK; PLATFORM_EXPORT -> CORE_EXPORT)

BUG=439970
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2375453002
Cr-Commit-Position: refs/heads/master@{#421796}
rune
Avoid creating consecutive whitespace renderers.
In textLayoutObjectIsNeeded(), return false if we are a whitespace-only
text node, and our previous LayoutObject sibling is a whitespace
renderer. This avoids for instance creating a consecutive list of
whitespace renderers when we have multiple display:none sibling
elements.

This change makes [1] take ~900ms instead of ~2600ms on my computer.

[1] https://bugs.chromium.org/p/chromium/issues/attachmentText?aid=8037

BUG=399816

Review-Url: https://codereview.chromium.org/2369963005
Cr-Commit-Position: refs/heads/master@{#421794}
rune
Adding @keyframes rules only affects TreeScope plus host.
@keyframes rules may apply to animations in the same TreeScope as the
rule and the host element if the TreeScope is a shadow tree. Instead of
invalidating all keyframe animations or recalculating every element in
the document, limit such changes to the relevant TreeScopes.

Currently, this doesn't have an effect since analyzed style update only
happens in the document TreeScope, but that will change with RuleSet
invalidation for crbug.com/567021

R=alancutter@chromium.org,suzyh@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2361733004
Cr-Commit-Position: refs/heads/master@{#421781}
mstensho
Support for multiple block fragments in getClientRects().
Objects crossing column boundaries, for instance, should create one rectangle
for each column they live in.

Two old tests had to be updated, because they depended on the old and incorrect
behavior (pick the bigger / center column and create one huge rectangle there).

Add fragmentainerInFlowThread() to FragmentainerIterator. Removed the
updateOutput() thing. Instead, have the getters compute what they need on the
fly. This makes more sense now, since none of the (2) FragmentainerIterator
users need to calculate everything. Also don't require a clip rectangle.

Some extra attention is required when processing objects with a zero-height
bounding box now. Previously, we didn't need to worry about those, since no
bounding box means no painting, hit-testing, etc. But now, with
getBoundingClientRect(), life is different.

BUG=362232

Review-Url: https://codereview.chromium.org/2360913004
Cr-Commit-Position: refs/heads/master@{#421643}
fs
Add use counters for SVGCursorElement
This adds one counter for presence of an SVGCursorElement, and one for
if any ComputedStyle references the element (==the SVGCursorElement has
a client.)

BUG=650598

Review-Url: https://codereview.chromium.org/2376613004
Cr-Commit-Position: refs/heads/master@{#421630}
rune
Speculative fix for SelectorFilter crash.
It looks from the crash log that the string impl() is nullptr. Found no
possible way for a null string to be added to the SpaceSplitString, but
let's add a null check to see if it helps.

R=eae@chromium.org,timloh@chromium.org
BUG=646026

Review-Url: https://codereview.chromium.org/2376703002
Cr-Commit-Position: refs/heads/master@{#421492}
mharanczyk
Update DCHECK in WebRange constructor.
Currently creating empty range (0,0) triggers it, judging by
the comment it was intende to check null range only.

Review-Url: https://codereview.chromium.org/2373613005
Cr-Commit-Position: refs/heads/master@{#421252}
tmoniuszko
Reland of Force U.S. English keyboard layout for TextfieldTest.KeysWithModifiersTest
Reverted in
https://codereview.chromium.org/2349253002

Reason for revert:
Tests are failing on Mac ASAN builder. See details here:
https://uberchromegw.corp.google.com/i/chromium.memory/builders/Mac%20ASan%2064%20Tests%20(1)

BUG=633136

Review-Url: https://codereview.chromium.org/2353333002
Cr-Commit-Position: refs/heads/master@{#421191}
rchlodnicki
Fix GDI leak in NativeThemeWin::PaintIndirect
There was a GDI leak when hovering input elements. Reaching 10000 GDI objects
would cause process to crash.

Fixed by deleting HBITMAP that was selected onto the HDC. Deleting HDC does not
take care of that.

The skia utility function was removed and replaced with a custom scoped object
at call site as it was used only in one place and making it safe to use for
others would be a bit tricky as bitmap needs to be deleted before HDC and there
is no easy access to the bitmap after utility function returns HDC.

R=pkasting@chromium.org,fmalita@chromium.org,tomhudson@google.com

BUG=649712

Review-Url: https://codereview.chromium.org/2365903002
Cr-Commit-Position: refs/heads/master@{#421142}
rune
Missing sibling invalidation across removed element.
When removing B from siblings A B C, we scheduled invalidations for
features of A requiring two adjacent combinators to schedule an
invalidation at all. That is fine for rules already affecting C, but
for rules kicking in after B is removed, a single combinator is enough.
For instance ".a + .c".

R=ericwilligers@chromium.org
BUG=647780

Review-Url: https://codereview.chromium.org/2362463004
Cr-Commit-Position: refs/heads/master@{#421124}
fs
Make SVGAnimatedBoolean.h less popular
SVGAnimatedBoolean is only used by/for SVGFEConvolveMatrix, but was
being included in a lot of places. Remove the unnecessary includes of
SVGAnimatedBoolean.h, and also remove some other obvious unnecessary
includes in the vicinity.

Review-Url: https://codereview.chromium.org/2371593002
Cr-Commit-Position: refs/heads/master@{#420993}
fs
Reduce includes of some SVG*TearOff types
SVG*TearOff types are only of real interest to the bindings, so don't
need to be included in something that isn't direclty interacting with
bindings. Shuffle declarations and definitions to reduce the impact of
SVGPointTearOff and SVGRectTearOff.

Review-Url: https://codereview.chromium.org/2361973003
Cr-Commit-Position: refs/heads/master@{#420920}
fs
Move buildFilterOperations to FilterEffectBuilder
This puts all FilterOperations conversions (to FilterEffect and
CompositorFilterOperations) in one spot - FilterEffectBuilder.
This allows folding the functionality of resolveReferenceFilters into
FilterEffectBuilder, and hence get rid of the explicit extra step to
update the "cached" Filter chain in ReferenceFilterOperation.

This is one step on the way to turning FilterOperations into a core
style type, to allow for more straight-forward interaction with other
parts of the style system.

BUG=439970
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2357633003
Cr-Commit-Position: refs/heads/master@{#420844}
mostynb
unbreak builds with webrtc disabled
https://codereview.chromium.org/2123863004 broke non-webrtc non-android
builds.  Let's fix that.

BUG=487935

Review-Url: https://codereview.chromium.org/2370583002
Cr-Commit-Position: refs/heads/master@{#420832}
fs
Make SVG*StringList and SVGStringListTearOff scarcer
(Primarily) because of their inclusion in the SVGTests interface, these
two make their way into a lot more compilation units than has use for
them. The principal access to this data is the SVGTests::isValid()
method, so only the actual bindings should need any deeper insight into
these. Shuffle declarations and definitions to make their inclusion more
scarce. (From ~194 -> ~13 total dependencies for the latter, based on
"ninja -t deps".)

Review-Url: https://codereview.chromium.org/2360383003
Cr-Commit-Position: refs/heads/master@{#420614}
fs
Fold DisplayItem creation into paintFilteredContent in SVGFilterPainter
Brings uses of any form of "filter bounds" closer together.
Rename |filterRegion| and |boundaries| to |filterBounds|.

BUG=109224
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2367463002
Cr-Commit-Position: refs/heads/master@{#420397}
fs
Fix effect mapping computation for displacement-map w/ negative scale
When scale is negative, the displacement will be in the opposite
direction. Hence we need to only use the magnitude of the scale when
computing the effect of the filter.

BUG=641854

Review-Url: https://codereview.chromium.org/2359133003
Cr-Commit-Position: refs/heads/master@{#420396}
mstensho
Content that starts before the first fragmentainer should stay where it is.
It should not undergo pagination, but rather remain in the underflow area of
the first fragmentainer. There's no reason to pull everything into the content
area of the first fragmentainer.

BUG=591694

Review-Url: https://codereview.chromium.org/2360253002
Cr-Commit-Position: refs/heads/master@{#420353}
rune
Document* -> Document& for loadSubimages and friends.
Document* should never be nullptr in these places. Also made them const
and propagated the const-ness where necessary.

R=sashab@chromium.org

Review-Url: https://codereview.chromium.org/2352193004
Cr-Commit-Position: refs/heads/master@{#420319}
fs
Harmonize FilterEffect::mapRect and mapPaintRect
This CL terminates the FilterEffect::determineAbsolutePaintRect codepath,
replacing the last user (SVGFilterPainter) with mapRect().
A new structure for FilterEffect::mapRect is introduced (taking some
hints from the SkImageFilter implementation), where mapRect is the entry-
point (replacing mapRectRecursive), which in turn calls: 1) mapInputs,
2) mapEffect and 3) applyBounds. The last simply applies any clip bounds
set on the effect, while also adjusting for affectsTransparentPixels().
mapInputs() computes the contribution from inputs to the current effect,
while mapEffect() applies the contribution from the current effect
itself. The notion of forward/reverse is not retained since only forward
mapping is used.

BUG=642035, 640264, 611674, 600430
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2341923002
Cr-Commit-Position: refs/heads/master@{#420293}
fs
Remove SVGSVGElement dependency from SVGTransformListTearOff
Rather than having the latter depend on the former for code-sharing,
have them both depend on the underlying primitive (SVGTransformTearOff.)

Review-Url: https://codereview.chromium.org/2360083002
Cr-Commit-Position: refs/heads/master@{#420278}
rune
Implemented scoped invalidation for added/removed RuleSets.
Async stylesheet update will schedule invalidation sets based on the
RuleFeatureSets for added/removed stylesheets. Implement the
functionality in StyleEngine for scheduling invalidations in the
stylesheet's TreeScope, including host and slotted elements if
applicable.

R=ericwilligers@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2333693002
Cr-Commit-Position: refs/heads/master@{#420192}
fs
Drop the SVGLengthType enumeration
After the transition to using CSSPrimitiveValue, this enumeration is
not used by anything but the DOM-side of SVGLength (SVGLengthTearOff),
and for that we might as well use the interface constants directly.

The LengthTypeREMS and LengthTypeCHS values are dropped entirely because
they are not referenced by anything.

Review-Url: https://codereview.chromium.org/2354283002
Cr-Commit-Position: refs/heads/master@{#420150}
mstensho
Stay put at the top of the current page when inserting a forced break.
If we attempt to insert a forced break, and we're already at the top of a page
or column, we should stay right there, instead of leaving an entire page or
column blank. We used to ensure this by calling nextPageLogicalTop() with
AssociateWithFormerPage.

But it was broken, because AssociateWithFormerPage could take us to a column
set preceding a column spanner that we had actually moved past. This would
confuse various parts of the machinery, and could, among other things, find
unused space in the last column preceding a spanner, and use this as a
pagination strut on an object *following* the spanner.

Remove PageBoundaryRule from nextPageLogicalTop(), and let the forced break
insertion code handle this on its own instead, and do it correctly, without
looking back at preceding columns.

BUG=647475

Review-Url: https://codereview.chromium.org/2356183002
Cr-Commit-Position: refs/heads/master@{#420072}
mstensho
Need to consider the need for a soft break even when inserting a forced break.
A forced break will just take us to the next fragmentainer. However, the next
fragmentainer may not be tall enough to fit any part of the block we're laying
out, which means that we may have to skip to a fragmentainer further ahead -
one that is tall enough. This situation may arise in nested multicol, because
then we may get inner fragmentainers of variable height.

Another reason why we need this is that a forced break on an object is inserted
before we apply clearance. After we have applied clearance, we may have ended
up at a position where there's not enough space left to fit any part of the
block we're laying out. So, again, we may need to skip to the next
fragmentainer.

BUG=647475

Review-Url: https://codereview.chromium.org/2359733002
Cr-Commit-Position: refs/heads/master@{#420041}
fs
Widen Mac expectations for move_backward_line_import_crash.html
editing/selection/modify_move/move_backward_line_import_crash.html
appears to also Crash on Mac Debug.

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac10.11%20%28dbg%29/builds/4772

TBR=xiaochengh@chromium.org
BUG=648547,646323
NOTRY=true

Review-Url: https://codereview.chromium.org/2360593002
Cr-Commit-Position: refs/heads/master@{#420040}
rune
Make stylesheet owner node a reference instead of pointer.
The CSSStyleSheet owner node is always non-null when passed in on
sheet creation. Make it a reference in various APIs.

The real change here that triggered this was the realization that
StyleEngine::createSheet is always called with an owner node which
belongs to the very same Document/StyleEngine. So we can turn:

  e->document().styleEngine().addPendingSheet(context);

into:

  addPendingSheet(context);

Also made parseSheet non-static as it needed the StyleEngine pointer
anyway.

R=sashab@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2354773003
Cr-Commit-Position: refs/heads/master@{#420018}
fs
Consolidate read-only exception throwing for SVG*TearOffs
Where possible, use the "standard" message for read-only objects from
ExceptionMessages. Move the setup of the ExceptionState with this
message to SVGPropertyTearOffBase and reuse. It also saves a small chunk
of code-space.

Also drop a bunch of vspace, reorder checks in
SVGPreserveAspectRatioTearOff to check for immutability first and do
less work on error in SVGMatrixTearOff.

Review-Url: https://codereview.chromium.org/2357463002
Cr-Commit-Position: refs/heads/master@{#419875}
mstensho
Don't include LayoutObject.h from FrameView.h
This reduces the LayoutObject.h dependency by about 50 compilation units.

Needed to move data of DepthOrderedLayoutObjectList into a forward-declared
struct, since HashSet members need their T defined, even if it's a pointer.
This due to oilpan. See https://codereview.chromium.org/1999343002 for details.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2348993002
Cr-Commit-Position: refs/heads/master@{#419728}
rune
Prepare to use invalidation set for adding/removing RuleSets.
Currently, we sometimes use StyleSheetInvalidationAnalysis to be smart
about recalculating affected element when adding/removing a stylesheet.

The plan is to start using the StyleInvalidator to trigger style
recalculations When adding/removing stylesheets. We will then use the
invalidation sets from the stylesheet RuleSet and schedule them on
elements in the stylesheet's document or shadow tree.

We fall back to a full recalc for the document / shadow tree for if we
find selectors which don't have simple selectors for which we have an
invalidation set we can use. This is similar to what we do with the
universalSiblingInvalidationSet for DOM mutations.

This first implementation supports id, class, attribute, and type
selectors in the rightmost compound[1]. We could later support to use
invalidation sets for universal pseudo class rules like ":hover".

The invalidations are to be scheduled for elements in the same
TreeScope as the stylesheet, including the host element.

Rules which are boundary crossing have their features collected in
ScopedStyleResolver::addTreeBoundaryCrossingRules() and not in their
respective stylesheet's RuleSet. We fall back to full style recalc
for rules containing ::content, ::shadow, and /deep/. ::slotted rules
are currently also collected on the ScopedStyleResolver, but in order
to avoid full recalcs, we do LocalStyleChange on slot-distributed
elements for RuleSet invalidations when there are ::slotted rules in
the RuleSet.

As mentioned earlier we will schedule invalidations on the host element
as well, which means we will schedule the invalidation set for ".a" for
":host(.a)". :host-context() do also support RuleSet invalidation as
long as there are features in addition to the ones inside the
:host-context() pseudo.

As for sibling invalidations on DOM mutations, negated selectors like
":not(.a)" are considered universal.

This CL is split out of [2]. The next step is to land the invalidation
code in StyleEngine from the same CL.

[1] Even though we don't have invalidation sets for tag names, we can
check the presence of rules in the tag name hash map for the RuleSet.
This means "body *" will cause a full recalc, but "body" won't. Also
note that "div.enabled" will cause every div element to be invalidated
because the rule would end up in the class rule hashmap.

[2] https://codereview.chromium.org/1913833002/

R=ericwilligers@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2326033002
Cr-Commit-Position: refs/heads/master@{#419704}
fs
Replace FilterData::filter with lastEffect
This brings the FilterData+SVGFilterPainter (etc)  "complex" closer to
the PaintLayer+PaintLayerFilterInfo structure by keep the last effect
in the chain and accessing the Filter through that when needed.
In general we want these two "complexes" to closely resemble each other
as possible - because they are supposed to implement the same thing, with
only a difference in the parametrization (like which bounding-box to use.)
This also brings one tiny (tiny tiny) step closer to being able to get
shorthand filters working in the SVG code-path.

Also try to reduce dependencies a bit in the surrounding code.

BUG=439970,109224
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2350063002
Cr-Commit-Position: refs/heads/master@{#419700}
mstensho
Don't include LayoutBlock.h from MediaControlElementTypes.h
Reduces the dependencies on LayoutBlock.h by 5 compilation units.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2341423002
Cr-Commit-Position: refs/heads/master@{#419699}
fs
Turn FilterEffectBuilder into a stack-allocated helper
This moves the FilterEffect reference out of FilterEffectBuilder and
into the owner (PaintLayerFilterInfo), and then turns
FilterEffectBuilder into a more proper builder-style object that is
configured by the client and then has build...() called upon it to
construct the filter.
Rename the old build() method to buildFilterEffect().
Fix up PaintLayer to remove the indirection, and similarly adjust the
other users (CanvasRenderingContext2DState, SVGFilterPainter).

BUG=439970
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2349183002
Cr-Commit-Position: refs/heads/master@{#419697}
rune
Remove unused StyleElement::clearDocumentData().
Review-Url: https://codereview.chromium.org/2350743002
Cr-Commit-Position: refs/heads/master@{#419556}
tmoniuszko
Force U.S. English keyboard layout for TextfieldTest.KeysWithModifiersTest
BUG=633136

Review-Url: https://codereview.chromium.org/2197113002
Cr-Commit-Position: refs/heads/master@{#419454}
fs
Reland of Evacuate ComputedStyle references from the CSS*Value hierarchy
Fold uses of:

  CSSPrimitiveValue::create(..., const ComputedStyle&)
  CSSValuePair::create(..., const ComputedStyle&)

into the (few) users. Handle the fall-out.

Review-Url: https://codereview.chromium.org/2345893004
Cr-Commit-Position: refs/heads/master@{#419390}
fs
ConvolverOptions.buffer should be nullable
TBR=rtoy@chromium.org,foolip@chromium.org
BUG=626449,647693

Review-Url: https://codereview.chromium.org/2352463002
Cr-Commit-Position: refs/heads/master@{#419388}
fs
Slim includes in CSSValue.h
This drops includes from CSSValue.h that are not directly used by it.
Downstream dependents are fixed up as needed. Also strip some includes
from StyleImage.h and other places that includes CSSValue.h while
there.

Review-Url: https://codereview.chromium.org/2345223002
Cr-Commit-Position: refs/heads/master@{#419384}
fs
Evacuate ComputedStyle references from the CSS*Value hierarchy
Fold uses of:

  CSSPrimitiveValue::create(..., const ComputedStyle&)
  CSSValuePair::create(..., const ComputedStyle&)

into the (few) users. Handle the fall-out.

Review-Url: https://codereview.chromium.org/2345893004
Cr-Commit-Position: refs/heads/master@{#419382}
fs
Revert of Show ancestor hierarchy in accessibility panel (patchset #10 id:180001 of https://codereview.chromium.org/2322413003/ )
Reason for revert:
Fails the compile step on Linux ChromiumOS GN (headless_unittests)

Original issue's description:
> Show ancestor hierarchy in accessibility panel
>
> BUG=560525
>
> Committed: https://crrev.com/3558706c1b2a630557929b61fefc74e28975f3a6
> Cr-Commit-Position: refs/heads/master@{#419369}

TBR=dmazzoni@chromium.org,dgozman@chromium.org,pfeldman@chromium.org,aboxhall@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=560525

Review-Url: https://codereview.chromium.org/2351443003
Cr-Commit-Position: refs/heads/master@{#419371}
fs
Let clients of FilterEffectBuilder compute/provide the reference-box
Rather than having code to compute the reference box for the various
clients that use FilterEffectBuilder in the class itself, let clients
compute the desired reference box themselves and pass it along.
This separates concerns, and makes code for computing the reference box
less defensive. It also eliminates the need to add even more cases in
the future (like for SVG shorthand support.)

Also push calls to resolveReferenceFilters() in PaintLayer closer to the
filter-building calls, and rename computeFilterOperations to
addReflectionToFilterOperations. This allows us to eliminate a redundant
call to resolveReferenceFilters() in the mapRectForFilter() code-path.

BUG=439970
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2343173002
Cr-Commit-Position: refs/heads/master@{#419290}
mstensho
Don't include LineLayoutItem.h from SVGTextContentElement.h.
Review-Url: https://codereview.chromium.org/2342203004
Cr-Commit-Position: refs/heads/master@{#419274}
fs
Don't treat shorthand filters as errors on SVG content
We don't support filter shorthands yet, so we shouldn't treat them as
errors. Fix up the hasFilter() condition to also check if it's a filter
that we pretend we can handle.

Also straighten out the code-flow in applyFilterIfNecessary.

BUG=645995
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2349743003
Cr-Commit-Position: refs/heads/master@{#419267}
mstensho
Don't include LayoutViewItem.h from StyleResolverState.h
This reduces the number of compilation units that depend on files like
LayoutBlock.h by more than 200 (from around 500 to around 280).

Review-Url: https://codereview.chromium.org/2348853003
Cr-Commit-Position: refs/heads/master@{#419202}
fs
Clean up includes in SVGFE*Element and thereabouts
Drop inclusion of SVGParserUtilities.h in a number of places since it's
no longer used. Push FE*.h inclusion into the implementation where
possible, and don't include FilterEffect.h in those cases.
Also simplify a loop in SVGFEMergeElement::build.

Review-Url: https://codereview.chromium.org/2342353002
Cr-Commit-Position: refs/heads/master@{#419187}
rune
Setting the link title may change the preferred set.
Make sure we set the preferred style sheet set when setting the title
attribute as long as the preferred set name is not already set.

This used to somehow work if the title was set during loading of a
stylesheet since the preferred set name was set during active
stylesheet collection. In other cases, it didn't work until another
stylesheet operation caused a re-collection of active stylesheets.

When setting the preferred name was moved into the LinkStyle::process()
code, it didn't work at all to set the title after the stylesheet
starts loading.

Make sure we set the preferred set name and trigger an active
stylesheet update when the title is changed.

BUG=645699

Review-Url: https://codereview.chromium.org/2337193004
Cr-Commit-Position: refs/heads/master@{#419107}
fs
Push CompositorFilterOperations creation out of GraphicsLayer
Push knowledge of FilterOperations out of GraphicsLayer and into
PaintLayer. This eliminates one dependency from platform/ code to the
FilterOperations structure. The motivation is to try and make
FilterOperation(s) a core (style) type, to make interaction with the
style system and other parts of core easier. It will also aid in
enabling a more layered structure on the various filter-related data
structures.

Also change the various generator functions to return a
CompositorFilterOperations by-value rather than through a out-variable.

BUG=439970
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2335253002
Cr-Commit-Position: refs/heads/master@{#419029}
mstensho
Add PageBoundaryRule parameter to fragmentainerGroupAtFlowThreadOffset().
If it's an exclusive end offset, we need to know this, so that we map to the
former fragmentainer group, rather than the latter, if the offset is at a
column row boundary.

Review-Url: https://codereview.chromium.org/2345583004
Cr-Commit-Position: refs/heads/master@{#418958}
mstensho
Correct flowThreadTranslationAtOffset() for vertical-rl writing mode.
The problem was that a rectangle was shifted by offsetFromColumnSet() after
having been made physical. However, offsetFromColumnSet() is semi-logical
(flipped block direction coordinate, like e.g. LayoutBox::m_frameRect), so we
need to add it in before flipping the rectangle.

This caused all fragmentainer groups but the first one to be translated
incorrectly.

Review-Url: https://codereview.chromium.org/2344813003
Cr-Commit-Position: refs/heads/master@{#418870}
mstensho
Add PageBoundaryRule parameter to columnSetAtBlockOffset().
If it's an exclusive end offset, we need to know this, so that we map to the
former column set, rather than the latter, if the offset is at a column set
boundary.

Review-Url: https://codereview.chromium.org/2340213003
Cr-Commit-Position: refs/heads/master@{#418839}
fs
Unprefix -webkit-clip-path
This CL renames '-webkit-clip-path' to 'clip-path', and makes the former
an alias of the latter.
For LayoutSVGRoot, clip-path is now applied only by the PaintLayer and
not by SVGPaintContext.

Intent-to-ship:

https://groups.google.com/a/chromium.org/d/topic/blink-dev/FBE05hzCmPo

BUG=633028
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2312713002
Cr-Commit-Position: refs/heads/master@{#418827}
mstensho
Handle exclusive end offsets when translating from flow thread coordinates.
If we're in flipped blocks writing mode (i.e. vertical-rl), the flow thread
block offset we're dealing with may be a logical end point, and end points are
exclusive. This means that we need to pick the previous column, not the next,
if the offset is exactly at a column boundary.

Let flowThreadTranslationAtOffset() and columnIndexAtOffset() take a
PageBoundaryRule argument to handle this.

This makes offsetLeft and offsetTop work properly in vertical-rl writing mode
for elements that end at column boundaries. Added a test for that, and threw in
a vertical-lr test too, for good measure.

Remove ColumnIndexCalculationMode from columnIndexAtOffset(). It was partially
and inaccurately used to make sure we didn't escape the valid column range in
case an exclusive end offset was passed. Have the call sites that really need
to clamp the column index do it themselves. It's up to the callers to decide
how to treat offsets outside the range of columns anyway.

Review-Url: https://codereview.chromium.org/2339973002
Cr-Commit-Position: refs/heads/master@{#418800}
mostynb
//device/media_transfer_protocol depends on dbus
The build should fail early if //device/media_transfer_protocol is included with dbus explicitly disabled.

BUG=632297

Review-Url: https://codereview.chromium.org/2333573003
Cr-Commit-Position: refs/heads/master@{#418744}
fs
Add support for <basic-shape> to 'clip-path' on SVG elements
Use ClipPathOperation as storage for the property in SVGComputedStyle,
and add support for <basic-shape>s where needed. This also means that
nesting a <clipPath> with a <basic-shape> is added.
Since SVGPaintContext::applyClipIfNecessary can't fail in a useful way,
just drop the returned bool (test added.) An invalid clip-path will
just be ignored (per spec.)

BUG=633028
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2322343003
Cr-Commit-Position: refs/heads/master@{#418387}
fs
Fix baselines for media/video-zoom-controls.html
Attempt to tidy up after mid-flight collision.

TBR=mlamouri@chromium.org,kdsilva@google.com
BUG=601247

Review-Url: https://codereview.chromium.org/2328353002
Cr-Commit-Position: refs/heads/master@{#417973}
rune
Simplified compound feature extraction.
Started to return the last simple selector in the compound instead of
the pointer to the next compound from
extractInvalidationSetFeaturesFromCompound. That means we can update
feature flags for the combinator from updateInvalidationSets, which
also means we can get rid of the duplicated code for updating the
nthInvalidationSet(). Additionally, we can use the siblingFeatures as
initialized by updateFeaturesFromCombinator().

Removed unused UseFeatureTypes.

There should be no functional changes.

R=ericwilligers@chromium.org

Review-Url: https://codereview.chromium.org/2326783002
Cr-Commit-Position: refs/heads/master@{#417915}
mstensho
[LayoutNG] Remove unnecessary #inclusions of LayoutObject and derived class definitions.
That reduces the number of compilation units that depend on LayoutObject.h by 9
when building content_shell.

R=eae@chromium.org

Review-Url: https://codereview.chromium.org/2328243002
Cr-Commit-Position: refs/heads/master@{#417909}
fs
Drop FilterEffect::m_absolutePaintRect
This rect is a remnant of the old ImageBuffer-based implementation of
FilterEffect, and is likely doing more harm than good at this point in
time. If we want to cache the result of a call to
determineAbsolutePaintRect(), that can be done equally well by the
client code.

Since removing this state removes the last side-effect from the
determineAbsolutePaintRect() methods we can mark it and related methods
(affectsTransparentPixels) as const.

BUG=642035

Review-Url: https://codereview.chromium.org/2329803002
Cr-Commit-Position: refs/heads/master@{#417908}
mstensho
A container of out-of-flow positioned descendants should be an offsetParent.
This reflects a recent spec change [1]. Previously, the condition was that the
position property be different from 'static', but it's unreasonable that we
shouldn't also include other objects that serve as containing blocks for fixed
and absolutely positioned descendants, such as "transform". Gecko and Edge
already have this behavior.

[1] https://github.com/w3c/csswg-drafts/commit/180b348a1ac0931043cd195651fc5164463d2bce

BUG=645397

Review-Url: https://codereview.chromium.org/2328633003
Cr-Commit-Position: refs/heads/master@{#417903}
mstensho
Walk the entire offsetParent chain in fast/forms/resources/common.js utility functions.
They used to assume that the only offsetParent was the root node, but that's no
longer going to be true when https://codereview.chromium.org/2328633003/ lands.
One test that calls searchCancelButtonPosition() is inside a transformed
element, which will become an offsetParent.

R=tkent@chromium.org

Review-Url: https://codereview.chromium.org/2332553002
Cr-Commit-Position: refs/heads/master@{#417893}
fs
Revert of Make canceling Timers fast. (patchset #10 id:180001 of https://codereview.chromium.org/2319053004/ )
Reason for revert:
Wreaks havoc on the ASAN bots:

https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN

STDERR: =================================================================
STDERR: ==4==ERROR: AddressSanitizer: use-after-poison on address 0x7ed9a5616190 at pc 0x00000768b0da bp 0x7fff4bbca630 sp 0x7fff4bbca628
STDERR: READ of size 8 at 0x7ed9a5616190 thread T0 (content_shell)
STDERR:     #0 0x768b0d9 in operator-> third_party/WebKit/Source/wtf/RefPtr.h:68:50
STDERR:     #1 0x768b0d9 in revokeAll third_party/WebKit/Source/wtf/WeakPtr.h:146:0
STDERR:     #2 0x768b344 in ?? third_party/WebKit/Source/platform/Timer.cpp:124:22
STDERR:     #3 0x47a4461 in Run base/callback.h:56:12
STDERR:     #4 0x47a4461 in RunTask base/debug/task_annotator.cc:54:0
STDERR:     #5 0x79e2381 in ProcessTaskFromWorkQueue third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc:316:19
...
STDERR: AddressSanitizer can not describe address in more detail (wild memory access suspected).
STDERR: SUMMARY: AddressSanitizer: use-after-poison

Appears to be accessing a "user-poison" area, so maybe a timer in something that was swept? (Wild guess.)

Original issue's description:
> Make canceling Timers fast.
>
> base::Closure recently got an IsCancelled method. Taking advantage of
> that the scheduler can short circuit a bunch of logic for cancelled
> tasks and avoid running them and the rest of the task selection
> machinery.
>
> On the new TimerPerfTest benchmark this makes running 10000 cancelled
> tasks aprox 50x - 60x faster (measured on Android and Linux).
>
> Note this patch reverts many of the changes made in
> https://codereview.chromium.org/2258713004 in favor of
> WeakPtr based cancellation as favored by the base owners.
>
> BUG=605718, 638542
>
> Committed: https://crrev.com/e4e5868c5f32b015bf0d07a6eeace892d6a789a1
> Cr-Commit-Position: refs/heads/master@{#417621}

TBR=jochen@chromium.org,haraken@chromium.org,skyostil@chromium.org,alexclarke@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=605718, 638542

Review-Url: https://codereview.chromium.org/2326313003
Cr-Commit-Position: refs/heads/master@{#417846}
fs
Mark */fast/canvas/canvas-hit-regions-*-test.html are timing out on Win
Timing out on win_chromium_rel_ng. Maybe just Slow?

BUG=645389
TBR=junov@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2324333003
Cr-Commit-Position: refs/heads/master@{#417840}
fs
Update leak expectations after https://codereview.chromium.org/2321183002
Moved to paint/invalidation/japanese-rl-selection-clear.html from
fast/repaint/.

TBR=wangxianzhu@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2331723002
Cr-Commit-Position: refs/heads/master@{#417839}
mstensho
[LayoutNG] Handle border and padding when sizing a block and when placing its children.
BUG=635619

Review-Url: https://codereview.chromium.org/2325073002
Cr-Commit-Position: refs/heads/master@{#417827}
mstensho
Translate the clip rect correctly when iterating over fragmentainers.
The clip rect is visual, so we need to shift each fragmentainer group by its
visual translation. This matters for nested multicol.

BUG=642325

Review-Url: https://codereview.chromium.org/2321333002
Cr-Commit-Position: refs/heads/master@{#417563}
mstensho
Let LayoutNG handle childless block flows.
The fact that they are marked with childrenInline() doesn't matter if they have
no children.

BUG=635619

Review-Url: https://codereview.chromium.org/2320393002
Cr-Commit-Position: refs/heads/master@{#417543}
fs
Replace FilterEffect::maxEffectRect() with absoluteBounds()
This removes maxEffectRect(), determineMaximumEffectRect() and the
associated state (m_maxEffectRect) from FilterEffect. The replacement is
the new method absoluteBounds() that computes bounds for the node in
question using the filter primitive (sub)region and the filter region.
This should match what determineMaximumEffectRect() was computing for
use from SVGFilterPainter.

BUG=642035
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2319293004
Cr-Commit-Position: refs/heads/master@{#417530}
rune
Corrected variable name to not contain "Tag".
Incorrectly named. We don't include type selectors.

R=ericwilligers@chromium.org

Review-Url: https://codereview.chromium.org/2321013002
Cr-Commit-Position: refs/heads/master@{#417456}
ddyndo
Fixed access to `constraint_flags` array in ParseHEVCCodecId function.
This patch adds necessary offset when accessing this array.
`constraint_flags` is an array of 6 elements, however in
`for` loop it can be accessed with indices from 4 to 9
instead of indices from 0 to 5.

Review-Url: https://codereview.chromium.org/2320063002
Cr-Commit-Position: refs/heads/master@{#417351}
rune
Removed m_isSettingStyleSheetText from InspectorCSSAgent.
The variable supressed an unnecessary re-collection of inspector
stylesheets when the stylesheet text is modified from the inspector. If
the text added contains an @import rule with a data: uri, it also
suppresses the collection of that sheet, which is wrong.

R=pfeldman@chromium.org,lushnikov@chromium.org
BUG=644719

Review-Url: https://codereview.chromium.org/2319533004
Cr-Commit-Position: refs/heads/master@{#417290}
mstensho
Replace collectLayerFragments() with FragmentainerIterator.
No functional changes intended.

The way collectLayerFragments() and PaintLayer::collectFragments() cooperated
to populate the PaintLayerFragments was rather messy. collectLayerFragments()
set two members, and then, later on, PaintLayer::collectFragments() would set
the remaining members, translate and clip. With this change, the layout code no
longer uses PaintLayerFragments.

It should also be mentioned that collectLayerFragments() was a bad name,
because this functionality shouldn't be strictly for layers. We're soon going
to need it for getClientRects() as well.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2314763002
Cr-Commit-Position: refs/heads/master@{#417271}
mstensho
Don't include headers from the layout API from other headers needlessly.
Including layout API headers involves including some LayoutObject derivate,
which takes a lot of time to compile.

R=bashi@chromium.org,dsinclair@chromium.org,haraken@chromium.org,bokan@chromium.org,pilgrim@chromium.org
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2316533004
Cr-Commit-Position: refs/heads/master@{#417265}
rune
Store a single inspector stylesheet hidden from CSSOM.
Custom style rules can be added via the inspector. These were stored in
a stylesheet appended to <head>. That meant it was visible to the
document via CSSOM. Also, enabling/disabling the inspector would not
remember that a stylesheet was added, so the inspector started out with
a new blank stylesheet for editing, yet the existing rules still
applied.

This CL introduces a single inspector stylesheet in the StyleEngine
which takes part in the document collection to apply the rules, but it
is not appended to the document.styleSheets list. Neither is it
accessible through a <style> element in the DOM.

The stylesheet ends up after the author stylesheets in the order of
appearance. That is similar to how it was, but previously, sheets in
<body> would appear after the inspector sheet while sheets in <head>
would appear before.

The inspector sheet source is stored in a resource container like
changes for author stylesheets. This means the inspector sheet source
will persist across inspector enable/disable.

R=pfeldman@chromium.org,lushnikov@chromium.org
BUG=624139
TEST=http/tests/inspector-enabled/reattach-after-editing-styles.html

Review-Url: https://codereview.chromium.org/2312953002
Cr-Commit-Position: refs/heads/master@{#417021}
mstensho
Fix typo in enable-blink-features command line switch.
This one doesn't disable features, it *enables* them.

R=jochen@chromium.org

Review-Url: https://codereview.chromium.org/2319503002
Cr-Commit-Position: refs/heads/master@{#416968}
rune
Refactored invalidation set extraction.
Refactor into smaller more descriptive methods.

Implemented InvalidationSetFeatures::add() and hasFeatures() to add
features conditionally for selector lists like in :-webkit-any() instead
of tracking non-feature compounds using a foundFeatures variable.

Review-Url: https://codereview.chromium.org/2305593002
Cr-Commit-Position: refs/heads/master@{#416912}
fs
Remove dead uses of FilterEffect::determineMaximumEffectRect
Said method only computes m_maxEffectRect. The only users of this data
is SVGFilterPainter, directly and via determineAbsolutePaintRect (which
in turn uses mapPaintRect which uses maxEffectRect in one case.) Hence
all other callsites are calling determineMaximumEffectRect() without
making use of the side-effect is has. Remove those uses.
This also mean that we can tailor the method for the one remaining
user by cleaning up, and removing, the flags argument.

TBR=senorblanco@chromium.org
BUG=642035
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2307343002
Cr-Commit-Position: refs/heads/master@{#416888}
mstensho
Correct multicol dirty rect for scrolled and flipped blocks writing mode.
Calling LayoutBox::location() to make a physical rectangle relative to the
multicol container instead of the flowthread isn't going to work if writing
mode is with flipped blocks direction (vertical-rl), because location() returns
a semi-logical offset. It would have worked with topLeftLocation(), though.
But since we'd still have issues with scrolling, make the dirty rectangle
relative to the multicol container right away on the PaintLayer side instead,
since layers know how they have been scrolled. This also happens to be in line
with the comment there, so now we're actually doing what we say that we're
doing. :)

This makes fast/repaint/paged-with-overflowing-block-rl.html pass.
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2310233002
Cr-Commit-Position: refs/heads/master@{#416859}
fs
Update expectations for css3/filters/effect-reference-hw.html
TBR=pdr@chromium.org
BUG=642035

Review-Url: https://codereview.chromium.org/2310993002
Cr-Commit-Position: refs/heads/master@{#416563}
fs
New Win10 baselines for css3/filters/effect-reference-hw.html
TBR=pdr@chromium.org
BUG=642035

Review-Url: https://codereview.chromium.org/2311933002
Cr-Commit-Position: refs/heads/master@{#416555}
fs
Win10 needs new baselines for css3/filters/effect-reference-hw.html
TBR=pdr@chromium.org
NOTRY=true
BUG=642035

Review-Url: https://codereview.chromium.org/2311943002
Cr-Commit-Position: refs/heads/master@{#416546}
fs
Reland of Revamp filter primitive region calculations for Filter Effects
This moves the filter primitive region calculation to
SVGFilterPrimitiveStandardAttributes::setStandardAttributes, folding in
FilterEffect::applyEffectBoundaries and getting rid of
FilterEffect::m_effectBoundaries and related flags.
What's left of FilterEffect::determineFilterPrimitiveSubregion() is
renamed to determineMaximumEffectRect(), and callsites updated.

BUG=642035
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2303703002
Cr-Commit-Position: refs/heads/master@{#416537}
rune
Implemented RuleSet diff for active stylesheets.
This is an implementation of the diffing of active stylesheets outlined
in [1] to replace the current compareStyleSheets method in
TreeScopeStyleSheetCollection which currently cause a "Reconstruct" if
you both have insertions and removals. With async stylesheet update we
will more likely end up in those situations as changes to the list can
happen in a batches.

An important new aspect here is that together with each stylesheet keep
a traced pointer to the RuleSet it had reference last time the active
stylesheet list was updated. That way we can figure out what changed on
media query and CSSOM changes.

The comparison algorithm works like this:

INPUTS: The new and old active stylesheet vectors
OUTPUTS: A vector of added and removed RuleSets.
         Also a return value saying if we only appended stylesheets at
         the end. Given that sheets were only appended we can do certain
         optimizations updating rule data.

* First linearly walk the old and new active list as long as the
  stylesheet pointers are the same. If the ruleset changed for the
  given sheet, add the old and new rulesets to the list of changed
  rulesets.

* If we are finished walking any of the active lists, we have either
  appended a set of sheets to the end, or we have removed a set from
  the tail. Add the added/removed rulesets to the changed list and we
  are finished.

* If we have remaining sheets in both the old and new active list,
  merge the remaining items from both lists and sort the merged vector
  on stylesheet pointers. For stylesheet pointers occuring in pairs, if
  the rulesets are different for the two entries, the ruleset changed
  so we add them to the changed list. For stylesheets which do not occur
  in pairs, they are either added or removed and we add the ruleset to
  the changed list.

The time complexity for the algorithm is O(k) for the common prefix
and the complexity for std::sort for the m + n remaining sheets in the
new and old active lists. Note that each scope has its active list, so
the larger n's will be for the document scope as shadow trees most
often have a single stylesheet (I measured a max of three running some
Polymer apps).

An assumption here is that we will do ensureRuleSet() including media
query evaluation for the media attribute as we collect active
stylesheets. Currently, the analysis of which elements needs a style
recalc happens synchronously while updating the active sheets while the
rulesets are (re-)created asynchronously/on-demand via
lazyAppendAuthorStyleSheets in StyleResolver. The idea is that since
the active stylesheet update will be async, we can drop the lazyAppend
things from StyleResolver and add the stylesheets directly to the
ScopedStyleResolvers during the active stylesheet update.

Creating the RuleSets as we collect active stylesheets means we have
invalidation sets readily available to use style invalidation to
trigger style recalcs only on elements affected by the added/removed
stylesheets.

[1] http://bit.ly/25uxtnU

R=esprehn@chromium.org,timloh@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/1889993002
Cr-Commit-Position: refs/heads/master@{#416520}
fs
Revamp filter primitive region calculations for Filter Effects
This moves the filter primitive region calculation to
SVGFilterPrimitiveStandardAttributes::setStandardAttributes, folding in
FilterEffect::applyEffectBoundaries and getting rid of
FilterEffect::m_effectBoundaries and related flags.
What's left of FilterEffect::determineFilterPrimitiveSubregion() is
renamed to determineMaximumEffectRect(), and callsites updated.

BUG=642035
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2303703002
Cr-Commit-Position: refs/heads/master@{#416472}
fs
Compute better reference/visual boxes for clip-path in columns
clip-path's are applied before fragmentation, which means that we need
to adjust the coordinate space for the clip-path and its reference box
"manually" to get the correct visual coordinate space.

Also fix the origin used for clip-path to be the top-left corner of the
reference box. This only applies when SVG <clipPath> elements with
clipPathUnits='userSpaceOnUse' is referenced.

BUG=626097
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2300383002
Cr-Commit-Position: refs/heads/master@{#416451}
fs
css3/masking/clip-path-reference-userSpaceOnUse.html no longer fails
TBR=schenney@chromium.org
NOTRY=true
BUG=397255

Review-Url: https://codereview.chromium.org/2307063002
Cr-Commit-Position: refs/heads/master@{#416308}
fs
Tweak css3/masking/clip-path-reference-userSpaceOnUse.html
Turn the <svg> into a block to avoid having to compensate for the
baseline of an inline.

BUG=397255

Review-Url: https://codereview.chromium.org/2303043003
Cr-Commit-Position: refs/heads/master@{#416271}
fs
Align reference box computation for inline boxes with Gecko
For inline boxes, the reference box should be computed per-fragment, and
be subject to box-decoration-break. We're not quite there yet though, so
go for "local compat" for now and align with Gecko. This way we're
slightly closer to "correct" (the "single line" case ought to be fairly
correct for instance), and hopefully avoid getting sucked into a compat
"sinkhole".
Adjust css3/masking/clip-path-reference-box-inline.html to match.

BUG=641907
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2303773002
Cr-Commit-Position: refs/heads/master@{#416264}
davve
Simplify contain constraint calculation
We're selecting between two rectangles given by the intrinsic aspect ratio:
(defaultWidth / aspect ratio, defaultHeight) or (defaultWidth, defaultHeight x
aspect ratio). One rectangle is 'contained' and the other one 'covers'. Select
the 'contained' rectangle by trying out the first to see if its width fit, and
if so we're done. Otherwise compute and select the other rectangle.

Due to how floating point math works, it's possible that both computed
rectangles, or neither computed rectangle, will fit the case when the two ratios
are equal. See https://bugs.chromium.org/p/chromium/issues/detail?id=641221 for
one example. However, in this case it doesn't matter much which rectangle we
choose, the contained and and cover rectangle would be the same rectangle and
the floating point discrepancy has no known practical implication.

BUG=641221

Review-Url: https://codereview.chromium.org/2294683002
Cr-Commit-Position: refs/heads/master@{#416238}
rune
Don't cache matched properties for elements without a flat-tree parent.
When there's not flat tree parent for the element we are computing
style for, setHasExplicitlyInheritedProperties will not be set on the
ComputedStyle during property application. Without that flag set
correctly we allowed to add to the matched properties cache even though
we shouldn't.

There are some open questions here:

* How should body -> html propagation work when html has a shadow tree?
* Do children of a shadow host have a computed style at all when not
  distributed/slotted?

It should be noted that attachShadow is not allowed on the <html>
element. That is why the test case uses a v0 shadow tree.

R=andersr@opera.com,esprehn@chromium.org,hayato@chromium.org
BUG=636500

Review-Url: https://codereview.chromium.org/2283933003
Cr-Commit-Position: refs/heads/master@{#416200}
fs
Use LayoutSVGResourceClipper::resourceBoundingBox() in ClipPathClipper
Use the reference box to compute the clip-path bounds in ClipPathClipper,
using the resourceBoundingBox() method from LayoutSVGResourceClipper. This
should give reasonably tight-fitting bounds for the clip-as-mask code-path
which uses these bounds. It also means one less item to pass around.

This means that the clip-path code in PaintLayerPainter no longer needs
the |rootRelativeBounds| and associated bool, so that code can be pushed
down into FilterPainter with additional plumbing simplifications.

Also straighten out the code-flow in ClipPathClipper for less indented,
and hopefully easier to follow, code.

BUG=633028, 626097
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2279823002
Cr-Commit-Position: refs/heads/master@{#416073}
fs
Synthesize preserveAspectRatio='none' for non-viewBoxed <img>
For SVGs embedded in an image context, we will synthesize a viewBox that
matches the intrinsic dimensions of the SVGs, if no viewBox is
specified. This would result in an image where the aspect ratio
expressed by the intrinsic dimensions would be preserved.
This does not appear to match author expectations - they rather see that
the behavior in these cases match that of a "regular" raster-based
image. To achieve this, also synthesize a preserveAspectRatio-value of
"none" in these cases. This will result in the original image being
stretched in the most common cases. Any percentage dimensions will be
resolved against the computed dimensions (replaced size), and can hence
also produce a useful viewBox.

The implemented behavior is not currently specced (neither was the old
synthesizing of a viewBox), but matches Gecko.

BUG=110195

Review-Url: https://codereview.chromium.org/2290173005
Cr-Commit-Position: refs/heads/master@{#416059}
tommyt
We will not update the cached characteristic value when writing, nor will we call the observers' GattCharacteristicValueChanged method.
Update the documentation for WriteRemoteCharacteristic and change the name of the "new_value" parameter to "value".

See http://crbug.com/614534

BUG=551634

Review-Url: https://codereview.chromium.org/2287273002
Cr-Commit-Position: refs/heads/master@{#416028}
tmoniuszko
Clear HTTP auth data on clearing cache
BUG=108291

Review-Url: https://codereview.chromium.org/2097043002
Cr-Commit-Position: refs/heads/master@{#415919}
fs
Resolve percentage in <use> against the instance's viewport element
In LayoutSVGTransformableContainer::calculateLocalTransform, 'x' and 'y'
were resolved against the original (corresponding) element. For a <use>
nested within a <symbol>, this would mean that when were going to look
up the viewport element, we'd return the outer <symbol> element and thus
fail to get a viewport.
Use the instance element to setup the SVGLengthContext instead.

BUG=642524

Review-Url: https://codereview.chromium.org/2298783002
Cr-Commit-Position: refs/heads/master@{#415910}
fs
Move SVGAnimateElement::findElementInstances to SVGElement.cpp
There's now only a single user of this function, so fold the function
into that one.

BUG=640676

Review-Url: https://codereview.chromium.org/2293173003
Cr-Commit-Position: refs/heads/master@{#415901}
mstensho
Fragment blocks with non-visible overflow as normally when printing.
Splitting scrollbars into multiple fragmentainers is only problematic in
interactive media. We don't need to impose any such pagination restrictions
when printing, since printing is non-interactive,

BUG=641983

Review-Url: https://codereview.chromium.org/2298193002
Cr-Commit-Position: refs/heads/master@{#415645}
perja
bluetooth: Added script for converting the Web Bluetooth blacklist.
BUG=570121

Review-Url: https://codereview.chromium.org/2285663002
Cr-Commit-Position: refs/heads/master@{#415594}
fs
Don't add redundant references to animated target element
SVGSMILElement adds a reference to its target, and any instances of the
target should never be mutated, so the registration of reference to the
extended target element set in SVGAnimateElement::resetAnimatedType does
not add any value.

BUG=640676

Review-Url: https://codereview.chromium.org/2292983002
Cr-Commit-Position: refs/heads/master@{#415393}
fs
Stricter treatment of SVGSVGElement::m_useCurrentView
m_useCurrentView being true implies that m_viewSpec is non-null. Perhaps
defensively, most code that checks it is written in a way such that it
expects that m_viewSpec can be null if m_useCurrentView is true - which
is not the case, and adds unnecessary code.
Instead change the code to adhere to the rule above, and assert that in
the various places instead.
Also add some checks of the invariant in methods that set the flag and
m_viewSpec. Refactor SVGSVGElement::setupInitialView to avoid the need
to sprinkle invariant checks "all over" it.

BUG=110195

Review-Url: https://codereview.chromium.org/2290293003
Cr-Commit-Position: refs/heads/master@{#415346}
fs
Simplify SVGAnimatedTypeAnimator interface
The two methods startAnimValAnimation and resetAnimValToBaseVal share
the same implementation, but are called in two different branches of the
same if-statement. Fold the two and add a new method
createAnimatedValue() to provide the animated value, to make this appear
as straight-forward as it is. Also fold the stopAnimValAnimation()
method since it's only used once, and because this makes the start/stop
action somewhat symmetric.
Rename the constructFromString(...) method to
createAnimatedValueFromString() to illustrate its relation to the newly
minted method and make it a bit more clear what it does.

BUG=640676

Review-Url: https://codereview.chromium.org/2284263002
Cr-Commit-Position: refs/heads/master@{#415271}
fs
Don't use substring() for a simple prefix match
The language code match in SVGTests::isValid() uses String::substring()
to limit the match to the primary language subtag. In the case where the
defaultLanguage() only contains the/a primary language subtag, this will
not require a copy, but otherwise it would.

Using startsWith() and a length-check guarantees that no copies will be
made. (A valid primary language subtag is always 2 letter long, so
checking only for length == 2 should be enough, although previously the
code could theoretically match a 1 letter, or even a zero-length tag.)

Review-Url: https://codereview.chromium.org/2284273002
Cr-Commit-Position: refs/heads/master@{#415255}
fs
Tighten SVGAnimationElement::shouldApplyAnimation
Fold the targetIsUsable(...) helper from SVGAnimateElement into said
method, and then replace the uses of the former with the corresponding
'should apply' predicate.

BUG=640676

Review-Url: https://codereview.chromium.org/2287983002
Cr-Commit-Position: refs/heads/master@{#415253}
rune
Removed unused parentStyle in StyleAdjuster.
Parent style not used for HTML element adjustment.

Review-Url: https://codereview.chromium.org/2290623002
Cr-Commit-Position: refs/heads/master@{#415235}
fs
Tidy up some loops in SMILTimeContainer::updateAnimations
Use for-range style loops and get rid of the local 'size' variable.
Also move the sort() call down after the early-out when there are no
animations to apply.

BUG=641437

Review-Url: https://codereview.chromium.org/2287973002
Cr-Commit-Position: refs/heads/master@{#415165}
fs
Reorder the AnimatedPropertyType enumeration
By moving AnimatedUnknown first (giving it the ordinal value 0), we can
simplify SVGElement::animatedPropertyTypeForCSSAttribute by removing
the contains() call (avoiding a double hash/lookup for the common case.)

Review-Url: https://codereview.chromium.org/2288583002
Cr-Commit-Position: refs/heads/master@{#415069}
fs
Hoist updateAnimation() calls from SVGSMILElement::progress
The updateAnimation() calls in SVGSMILElement::progress() corresponds
to the timed element contributing to the animation "sandwich", so it's
trivial to hoist it out into the caller. Well there, the |resultElement|
logic can be replaced with a vector onto contributing timed elements are
appended. When all contributing timed elements are collected the value
is computed.

BUG=641437

Review-Url: https://codereview.chromium.org/2283843002
Cr-Commit-Position: refs/heads/master@{#414937}
rune
Allow multiple type and id selectors in invalidation set features.
:-webkit-any allows for more than one type selector in a compound
selector. Likewise, it may also allow for disjunct id selectors. Make
them vectors in InvalidationSetFeatures like we do for classes and
attributes to make style invalidation work for multiple id and type
selectors in :-webkit-any.

R=ericwilligers@chromium.org,sashab@chromium.org
BUG=641296

Review-Url: https://codereview.chromium.org/2284633002
Cr-Commit-Position: refs/heads/master@{#414933}
fs
Reduce 'iterate self and instances' helper-count in SVGElement.cpp
Generalizing updateInstancesAnimatedAttribute{,NoInvalidate} to one
higher-level helper to get rid of the subtle differences brought on
by the differences in invalidation semantics.

BUG=640676

Review-Url: https://codereview.chromium.org/2280923002
Cr-Commit-Position: refs/heads/master@{#414845}
fs
Fold SMIL animation value application helpers and simplify
Folds the following helper functions:

  applyCSSPropertyToTargetAndInstances
  removeCSSPropertyFromTargetAndInstances
  notifyTargetAndInstancesAboutAnimValChange

into their users, hoisting common predicates and simplifies
accordingly.

BUG=640676

Review-Url: https://codereview.chromium.org/2285473002
Cr-Commit-Position: refs/heads/master@{#414808}
fs
svg/animations/use-animate-width-and-height.html no longer time out
TBR=schenney@chromium.org
NOTRY=true
BUG=641398

Review-Url: https://codereview.chromium.org/2279263003
Cr-Commit-Position: refs/heads/master@{#414801}
fs
Move onclick handler in svg/animations/use-animate-width-and-height.html
We can no longer listen after events on something that is an instance in
a <use>. Move the executeTest() call to the <use> element instead.

Since the mentioned file is almost a stub, the actual change is in
svg/animations/script-tests/use-animate-width-and-height.js.

BUG=641398

Review-Url: https://codereview.chromium.org/2283893002
Cr-Commit-Position: refs/heads/master@{#414776}
fs
Fix clip-path reference box/coordinate space setup for hit-testing
Synchronize hit-testing code with rendering code with regards to how the
coordinate space is handled (for userSpaceOnUse <clipPath>s), and how
the reference boxes is computed.

Also "straighten" out code-flow a bit while here.

BUG=418484
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2280963002
Cr-Commit-Position: refs/heads/master@{#414730}
wdzierzanowski
Bundle fake Widevine component manifest for stub CDM
Encrypted media browser tests involving Widevine use the stub CDM when
branding != Chrome.  This change allows them to register the
preinstalled component containing the stub CDM.

BUG=622273

TEST=Widevine browser tests 'browser_tests --gtest_filter=*Widevine*' pass

Review-Url: https://codereview.chromium.org/2136983002
Cr-Commit-Position: refs/heads/master@{#414706}
jwalczak
Fix channel mapping for 8-ch audio in ffmpeg_aac_bitstream_converter
FFmpeg's AVCodecContext->channels contains "raw number of channels"
(e.g. "2" for 2 channels, "8" for 8 channels). The change ensures that:
- the value of "8" is correctly mapped to 0b111 ADTS channel
config (aka MPEG-4 Channel Configuration),
- the value of "7" becomes unsupported.

BUG=640610

Review-Url: https://codereview.chromium.org/2273203003
Cr-Commit-Position: refs/heads/master@{#414685}
rune
Use AnalyzedStyleUpdate for non-blocking sheets.
For no apparent reason we were always doing a full document recalc when
finishing loading a non-blocking stylesheet.

From webkit: https://bugs.webkit.org/show_bug.cgi?id=119236

BUG=284142

Review-Url: https://codereview.chromium.org/2278803002
Cr-Commit-Position: refs/heads/master@{#414682}
fs
Move animVal invalidation from SVGAnimateElement to SVGElement
BUG=640676

Review-Url: https://codereview.chromium.org/2281643003
Cr-Commit-Position: refs/heads/master@{#414543}
fs
Remove temporary file that was accidentally checked in
This file was added as part of https://codereview.chromium.org/2211473003
but looks like it was done so by mistake. Remove it again.

TBR=fdoray@chromium.org
BUG=616447

Review-Url: https://codereview.chromium.org/2276423002
Cr-Commit-Position: refs/heads/master@{#414467}
rune
Use LocalStyleChange for insertion point inheritance propagation.
For shadow dom v0, we used a SubtreeStyleChange for propagating
inherited style changes through insertion points to distributed nodes.
LocalStyleChange should suffice. We already use LocalStyleChange in the
HTMLSlotElement case.

We still need to use SubtreeStyleChange where we have a
SubtreeStyleChange/Force from further up the tree like:

<host>
  <:shadow-root>
    <style>.a::content * { background: green }</style>
    <div id="a">
      <content></content>
    </div>
  </:shadow-root>
  <div>Green when #a gets class a.</div>
</host>

R=kochi@chromium.org
BUG=638869

Review-Url: https://codereview.chromium.org/2258793003
Cr-Commit-Position: refs/heads/master@{#414386}
fs
Refactor SMIL animation value updates
Push updating of the animation value into SVGElement. This resembles the
Web Animations code-path to some degree and maybe we can make them even
more similar eventually. This is the first CL in a series that will
remove knowledge of <use>/shadow trees from the SMIL animation code.

BUG=640676

Review-Url: https://codereview.chromium.org/2272033002
Cr-Commit-Position: refs/heads/master@{#414366}
fs
Simplify SMIL animation CSS property updates
After https://codereview.chromium.org/2251073002 we should no longer
need to walk any <use> instances "manually", since setNeedsStyleRecalc
does that already. This should also avoid the potential double-work
because of this.

TEST=svg/W3C-SVG-1.1/animate-elem-30-t.svg
TEST=svg/W3C-SVG-1.1/animate-elem-40-t.svg

BUG=166438,355359,484552,637310

Review-Url: https://codereview.chromium.org/2270363004
Cr-Commit-Position: refs/heads/master@{#414358}
ingemara
Move JNI bindings for url_formatter from chrome to //components/url_formatter
By moving the url_formatter methods out of
org.chromium.chrome.browser.UrlUtilities to it's component, other emdedders than
Chrome can benefit from the Java version.

This CL removes the tests originally written for a Java implementation of the
methods replaced by FormatUrlForSecurityDisplay in
https://codereview.chromium.org/1357563002. It's not trivial to move the tests
over to the component as they depend on native library initialization performed
by //content which is disallowed in components/url_formatter/DEPS. Also, the
tests are redundant as the code is thoroughly tested by other means.

Currently there are no users of formatUrlForDisplay() in Chromium, but Opera
would like it exposed.

BUG=624407

Review-Url: https://codereview.chromium.org/2110543004
Cr-Commit-Position: refs/heads/master@{#414356}
rune
Consider pseudo classes as matching for shared style rejection.
The user action pseudo classes rely on affectedBy bits to be correctly
set on ComputedStyle in order to recalculate style for such changes
later on. If two elements may otherwise share style, but will have the
affectedBy bits set differently, they may not share style.

Example:

  <style>[attr]:hover {}</style>
  <div></div>
  <div attr></div>

The second div may share style with the first one when none of them is
hovered. However, matching the selector against the first div will fail
on the attribute selector before we try to match :hover, hence the flag
for affectedByHover will not be set. If we share that ComputedStyle
object with the second div, hovering the second div later will have no
effect.

Instead we always match :hover/:active/:focus/:-webkit-drag when
matching rules for style sharing (attribute and sibling rules). That
will lead to the attribute selector in the example above to match which
will cause style sharing to be rejected for the second div.

R=meade@chromium.org
BUG=639561

Review-Url: https://codereview.chromium.org/2272683002
Cr-Commit-Position: refs/heads/master@{#414221}
fs
Use border-box as the reference box for (-webkit-)clip-path
The 'clip-path' property should use the border box as the reference box
(per default; <geometry-box> not yet supported) [1].
The new behavior matches WebKit and Gecko (except for inline boxes,
see below.)

For inline boxes that span multiple lines we use the union of all the
lines. The test css3/masking/clip-path-reference-box-inline.html added
to track this behavior.

[1] https://drafts.fxtf.org/css-masking-1/#the-clip-path

BUG=418484
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2273733002
Cr-Commit-Position: refs/heads/master@{#414118}
mstensho
Don't skip column set interval tree search for flow thread offset == 0.
We cannot assume that offset 0 is in the first column set, since the first
column set may be empty.

Review-Url: https://codereview.chromium.org/2274683002
Cr-Commit-Position: refs/heads/master@{#413939}
mstensho
Update test that rendered incorrectly because orphans and widows are now 2 by default.
The test and the ref were rendered identically (so no failure was reported),
but the result was wrong according to the pass condition text.

Change the ref to not use multicol, to reduce the risk of something like this
going unnoticed in the future.

BUG=473509

Review-Url: https://codereview.chromium.org/2271633002
Cr-Commit-Position: refs/heads/master@{#413789}
markuso
Implement device::BatteryStatus support for UPower daemon 0.99.x
The org.freedesktop.UPower API was changed when upgrading the UPower daemon
from version 0.9.23 to 0.99.x. The BatteryStatusManagerLinux used the
"Changed" signal which was replaced by the "PropertyChanged" signal.

Change the BatteryStatusManagerLinux to use the new UPower API
(and keep compatibility with the 0.9.23 version, which is still used in
Ubuntu 14.04 LTS).

1. use dbus::PropertySet: the dbus::PropertySet provides simple access to
the properties and connection to the property-changed notifications.

2. Use UPower method GetDisplayDevice:
The 'DisplayDevice' is a composite battery device. That was added in UPower
version 0.99.0. If we don't get that device or if it is no battery, then we
continue to enumerate all devices.

3. Listen to 'DeviceAdded' and 'DeviceRemoved' signals:
Re-enumerate battery devices if a device is added/removed.

4. Compatibility with UPower version < 0.99
Only old UPower versions need to connect to the 'Changed' signal.

5. Rewrite the existing unittests to use a BatteryStatusManagerLinux instance
with a dbus::MockBus and mock the dbus-methods/properties for the test.
Add more unittests:
- for changing device properties
- for the DisplayDevice
- for enumerating devices
- for the DeviceAdded and DeviceRemoved signals

Review-Url: https://codereview.chromium.org/2066503002
Cr-Commit-Position: refs/heads/master@{#413745}
fs
Refactor ClipPathHelper in PaintLayerPainter.cpp for reuse
Separate out client concerns and move the helper class to a new file and
rename it to ClipPathClipper. This will allow sharing this code between
the PaintLayerPainter and SVGPaintContext code-paths.

BUG=633028
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2265123002
Cr-Commit-Position: refs/heads/master@{#413518}
landell
Use base::SizeTToString instead of std::to_string
std::to_string is disallowed by the chromium code style and we get into trouble with a custom mips toolchain that lacks support.

BUG=

Review-Url: https://codereview.chromium.org/2264993002
Cr-Commit-Position: refs/heads/master@{#413513}
fs
More const LayoutObject references in SVGLayoutSupport
BUG=633028

Review-Url: https://codereview.chromium.org/2265113002
Cr-Commit-Position: refs/heads/master@{#413501}
fs
Drop outdated comment in SVGClipPainter.h
This FIXME/comment can no longer be considered relevant. (Dates back
to when similar methods to prepareEffect/finishEffect lived in the
LayoutSVGResourceContainer hierarchy.)
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2261173003
Cr-Commit-Position: refs/heads/master@{#413479}
tommyt
Implement BluetoothGattNotifySession::Stop on Android, 2nd attempt
This change enables the stopNotifications function for remote GATT
characteristics on Android. In order to do so, two distinct refactorings have been done;

1) The session classes have been simplified so that platform specific versions are no longer required. All code that previously used BluetoothGattNotifySession[Mac|Win|BlueZ] now simply use the base BluetoothGattNotifySession class.

2) BluetoothRemoteGattCharacteristic::StartNotifySession and StopNotifySession have been rewritten so that all the code for keeping track of the different session objects and the notification state sits in the base class. Inheriting classes should no longer override these two functions, but instead override the much simpler SubscribeToNotifications and UnsubscribeFromNotifications.

BUG=584370

Committed: https://crrev.com/d41af3adfd8500c81c827ab03ed2736909cf1ee8
Review-Url: https://codereview.chromium.org/2051333004
Cr-Original-Commit-Position: refs/heads/master@{#412498}
Cr-Commit-Position: refs/heads/master@{#413417}
fs
Replace SMILTime with double for elapsed time in SMILTimeContainer
We don't really make use of of the special properties of SMILTime for
this case, and using double means slightly less impedance mismatching.

BUG=631879

Review-Url: https://codereview.chromium.org/2261443002
Cr-Commit-Position: refs/heads/master@{#413345}
fs
Don't schedule a wake-up if the timeline hasn't started
Before the timeline has started we shouldn't update animations. This
makes resume() symmetric with pause().

BUG=631879

Review-Url: https://codereview.chromium.org/2254303005
Cr-Commit-Position: refs/heads/master@{#413336}
fs
Refactor SMILTimeContainer can-schedule-frame predicate
begin() and updateAnimationsAndScheduleFrameIfNeeded() use the same
predicate to check if they should schedule an animation frame - although
they phrase it slightly differently (because of local knowledge.)
Move the generic version to a canScheduleFrame() method and use that in
both cases.

BUG=631879

Review-Url: https://codereview.chromium.org/2257803002
Cr-Commit-Position: refs/heads/master@{#413328}
fs
Simplify time tracking in SMILTimeContainer
Instead of 5 difference time fields, use two - one to track the last
seek/pause time in the container ("presentation time"), and one to
track the document time corresponding to that.
Use two bool flags for tracking 'paused' and 'started' state.

Also straighten out code-flow in SMILTimeContainer::begin() to make it
a bit more obvious that we're essentially mirroring the contents of
updateAnimationsAndScheduleFrameIfNeeded. begin() is also renamed into
start(). Pass double to SMILTimeContainer::scheduleAnimationFrame, do
some ASSERT->DCHECK transformations when touching code and touch up
some comments.

BUG=631879

Review-Url: https://codereview.chromium.org/2248643003
Cr-Commit-Position: refs/heads/master@{#413283}
sigbjornf
Avoid stack allocating StyleSheetCollections.
StyleSheetCollection is a GarbageCollected<>-derived object, which ideally
shouldn't be allocated on the stack (== outside the heap), as it leaves
the door open for it being attempted marked (and traced), which it the
allocation doesn't support (the allocation has no header information
preceeding it.)

R=
BUG=

Review-Url: https://codereview.chromium.org/2096653004
Cr-Commit-Position: refs/heads/master@{#413088}
rune
Remove unused StyleChangeReasons.
The removed reasons are no longer used because they have been replaced
by using invalidation sets.

R=kouhei@chromium.org

Review-Url: https://codereview.chromium.org/2256233002
Cr-Commit-Position: refs/heads/master@{#413034}
fs
Avoid setting timers from SVGImage::resetAnimation()
When resetting the timeline to t=0, we may up generating syncbase
notification, which sets up a timer (to update any possibly dependent
intervals.) Since resetAnimation() is what's called when the (SVG)Image
no longer has any clients, we should try to make sure it is indeed
idle after that happens. This avoids trying to update animation state
while the image is otherwise dead, leaving "reactivation" to the time
it is next painted.

BUG=627418

Review-Url: https://codereview.chromium.org/2247783003
Cr-Commit-Position: refs/heads/master@{#412798}
tsniatowski
gn: make gn gen preserve import statements passed in --args
Previously, gn gen would expand all imports and only record the final
arg keyvalue pairs in args.gn, if called as gn gen --args='import...'.

Now the actual import statement will be recorded. This allows avoiding
a manual args.gn edit of you want an actual import statement there, for
example if the imported gni houses a predefined set of default args
that you want to follow, and want to re-gn when it changes.

R=brettw@chromium.org,dpranke@chromium.org
BUG=588513

Review-Url: https://codereview.chromium.org/2250623004
Cr-Commit-Position: refs/heads/master@{#412687}
mostynb
remove duplicate atk GN config
The atk GN configs were moved to a separate GN file in
https://codereview.chromium.org/1909273002 but it appears
that the original configs were not removed, and are still
referenced.  Let's remove the old configs and just use
the new ones.

And while we're at it, add an assertion to check that glib
is enabled when atk is.

BUG=632297

TBR=agrieve@chromium.org

Review-Url: https://codereview.chromium.org/2251673004
Cr-Commit-Position: refs/heads/master@{#412680}
rchlodnicki
Make sure there is no crash on parsing empty manifest
Changes match the logic in SourceHighlighter in the same file and will
result in UI showing message akin to 'No source file available'. This is fine
as already the same happens for other source files in bundled extensions.

BUG=627896

Review-Url: https://codereview.chromium.org/2245143004
Cr-Commit-Position: refs/heads/master@{#412556}
mstensho
"Inline" auto-positioned out-of-flow objects are affected by pagination struts.
An out-of-flow positioned object that "belongs" to a line may need to adjust
its block position after the line has been laid out, since the line may have
been pushed to the next fragmentainer by a pagination strut.

BUG=291616

Review-Url: https://codereview.chromium.org/2249853007
Cr-Commit-Position: refs/heads/master@{#412546}
tommyt
Implement BluetoothGattNotifySession::Stop on Android
This change enables the stopNotifications function for remote GATT
characteristics on Android. In order to do so, two distinct refactorings have been done;

1) The session classes have been simplified so that platform specific versions are no longer required. All code that previously used BluetoothGattNotifySession[Mac|Win|BlueZ] now simply use the base BluetoothGattNotifySession class.

2) BluetoothRemoteGattCharacteristic::StartNotifySession and StopNotifySession have been rewritten so that all the code for keeping track of the different session objects and the notification state sits in the base class. Inheriting classes should no longer override these two functions, but instead override the much simpler SubscribeToNotifications and UnsubscribeFromNotifications.

BUG=584370

Review-Url: https://codereview.chromium.org/2051333004
Cr-Commit-Position: refs/heads/master@{#412498}
mstensho
Handle auto-positioned out-of-flow objects inside multicol containers correctly.
We used to get it all wrong for out-of-flow children of multicol containers
whose containing block were on the outside of the multicol container. Those
do not live in the flow thread coordinate space, so we have to convert their
location to visual coordinates.

BUG=291616

Review-Url: https://codereview.chromium.org/2250713002
Cr-Commit-Position: refs/heads/master@{#412375}
mostynb
-fno-auto-profile is only available beginning with stock GCC 5
This followup to https://codereview.chromium.org/2198253002
unbreaks stock GCC 4.8/4.9 builds.

(We suspect that the chromeos GCC 4.9 toolchain has a local patch for this feature.)

BUG=629593

Review-Url: https://codereview.chromium.org/2244983002
Cr-Commit-Position: refs/heads/master@{#412267}
mstensho
Correct offsetLeft and offsetTop calculation for column-span:all.
adjustedPositionRelativeTo() handled multicol incorrectly (the calls to
columnOffset()), which was especially hurtful for spanners. We should only call
it on objects in our containing block chain. This means that we need to walk
the ancestry using container() instead of parent(). The container() of a
spanner is the multicol container. We need to skip the inbetween flow thread,
since it only contains column content, and not spanners.

We also had bugs here with absolutely positioned objects inside multicol
containers whose containing block are on the outside of the multicol container,
but that's not really going to matter until we're able to lay out such objects
correctly. That's bug 291616. As such, this CL is also a preparatory patch for
fixing that bug.

This CL will also make it possible to write check-layout.js tests for spanners,
instead of having to resort to reftest or something even lesser.

BUG=563446

Review-Url: https://codereview.chromium.org/2251443002
Cr-Commit-Position: refs/heads/master@{#412255}
rune
Corrected :nth-child invalidation test description.
R=ericwilligers@chromium.org

Review-Url: https://codereview.chromium.org/2242113002
Cr-Commit-Position: refs/heads/master@{#411950}
rune
Ignored title in shadow should cause StyleSheet.title = null.
https://github.com/w3c/webcomponents/issues/535#issuecomment-239437022

R=hayato@chromium.org

Review-Url: https://codereview.chromium.org/2239353002
Cr-Commit-Position: refs/heads/master@{#411942}
rune
Use invalidation sets for nth invalidations.
Invalidate siblings of inserted/removed elements for :nth type changes
by scheduling a descendant invalidation set on the parent node of the
inserted element.

There is currently one such set for all structural pseudo classes with
the exception of :first-child, :last-child, and :only-child, which have
their own sets and may have so since they can't affect arbitrary
siblings.

The descendant set never has invalidatesSelf since it's scheduled on
the parent node of where the actual change happens.

Structural pseudo classes in the righmost compound adds rightmost
compound features to the descendant set:

  .a:nth-child(3n) {} => adds ".a" to the descendant set.

Righmost compound structural pseudo classes where there are no other
features makes the descendant set have wholeSubtreeInvalid since all
siblings where the mutation happens have to be invalidated:

  :nth-child(3n) {} => setWholeSubtreeInvalid()

Sibling selectors turns into descendant features:

  :nth-child(3n) + .a {} => adds ".a" to the descendant set.

Descendant selectors causes features to be added as normal:

  :nth-child(3n) .a {} => adds ".a" to the descendant set.

This approach isn't super optimal since having a rightmost structural
pseudo without other features in the compound will cause nth-
invalidations to still be full subtree invalidations, but it should be
a good first iteration.

What we could do is something along the lines of what sibling
invalidations do where they have a maximum number of siblings a set
applies to. The nth-invalidation where the pseudo is in the rightmost
compound really needs to invalidation all siblings and not their
descendants. We could have some notion of removing descendant sets
which should no longer apply walking down the tree.

Traversing siblings scheduling invalidation sets on them was not chosen
for the same reason we schedule siblings invalidations as descendant
invalidations on the parent node for sibling mutations already.

R=esprehn@chromium.org,ericwilligers@chromium.org
BUG=624277

Review-Url: https://codereview.chromium.org/2235723002
Cr-Commit-Position: refs/heads/master@{#411647}
mstensho
Need to roll back the multicol machinery state when re-laying out a block child.
If a block child contains a column spanner, and we need to re-lay it out
because the initial logical top estimate turned out to be wrong, we need to
roll back to the first column set that "contains" the block child.

Otherwise, LayoutMultiColumnFlowThread::columnSetAtBlockOffset() may return the
wrong column set.

BUG=633411

Review-Url: https://codereview.chromium.org/2231383002
Cr-Commit-Position: refs/heads/master@{#411352}
sigbjornf
Elide LifecycleObserver<T,O>::Context type alias.
No longer a need to bind LifecycleObserver<T, O>'s T parameter to a
separate alias/name; simplify to LifecycleObserver<Context, O>.

R=
BUG=

Review-Url: https://codereview.chromium.org/2238503002
Cr-Commit-Position: refs/heads/master@{#411271}
sigbjornf
ASan-exempt CrossThreadPersistentRegion::shouldTracePersistentNode().
CrossThreadPersistent<T>s can reside on heap objects which are lazily
swept. Consequently, when a (per-)thread GC runs and it iterates over the
CrossThreadPersistentRegion to determine what nodes point into its heaps,
it can in the general case also touch lazily sweepable heap objects.

This is a benign read access to a region of memory that Oilpan has poisoned;
therefore, shouldTracePersistentNode() must be exempt from ASan checks to
prevent false negatives from being caught and reported.

R=
BUG=635574

Review-Url: https://codereview.chromium.org/2230623002
Cr-Commit-Position: refs/heads/master@{#410980}
rune
Use elementAfter/Before, not nodeAfter/Before for nth-invalidation.
If the node after/before the inserted element is a text node, and that
text node is the last/first sibling, then it shouldn't prevent the
optimization for skipping recalc for nth/nth-last selectors.

R=esprehn@chromium.org

Review-Url: https://codereview.chromium.org/2228933002
Cr-Commit-Position: refs/heads/master@{#410758}
mstensho
There's no class A break point before or after a float.
LayoutBox::classABreakPointValue() should only be called at class A break
points. Document the assertion there, and make sure that
needsForcedBreakBefore() only calls it when at in-flow objects.

BUG=619152
R=eae@chromium.org

Review-Url: https://codereview.chromium.org/2228803003
Cr-Commit-Position: refs/heads/master@{#410703}
rune
Style invalidation support for :first/last/only-child.
Got rid of SubtreeStyleChanges for those pseudo classes. Also fixed
issue 245914 by looking at next/previous element, not node, to figure
out if we are the first. The code in checkForSiblingStyleChanges could
be restructured quite a bit and made simpler now have changedElement
(changedNode => changeElement since the input is always an element).

BUG=245914

Review-Url: https://codereview.chromium.org/2229503002
Cr-Commit-Position: refs/heads/master@{#410472}
rune
Cached style element sheets may not have an owner node.
The assert for cacheability of shared StyleSheetContents required the
ownerNode to be a non-null style element. Referring to and modify a
stylesheet is however possible after the style element has been removed
and the ownerNode set to null. Change the assert to just check for the
two types of cacheability.

This was not triggered by stylesheets not having @media rules since the
cacheability of linked resources would be true and made the assert
true.

Also, made the ASSERT a DCHECK along with the other ASSERTs in the
modified file.

R=meade@chromium.org
BUG=635022

Review-Url: https://codereview.chromium.org/2220863002
Cr-Commit-Position: refs/heads/master@{#410305}
ckulakowski
Initialize MaterialDesignController in NativeThemeMacTest
This is fix for crash (CHECK) in NativeThemeMacTest.SystemColorsExist:
FATAL:material_design_controller.cc(66)] Check failed: is_mode_initialized_

BUG=625642

Review-Url: https://codereview.chromium.org/2120273002
Cr-Commit-Position: refs/heads/master@{#410108}
rune
Revert of Add a fast-path for independent inherited properties (patchset #13 id:240001 of https://codereview.chromium.org/2117143003/ )
Reason for revert:
Caused issues 634254 and 633859.

Original issue's description:
> Add a fast-path for independent inherited properties
>
> Add a fast-path for inherited properties which do not depend on and do
> not affect any other properties on ComputedStyle. When these properties
> are modified in a parent element, set them directly on ComputedStyle and
> skip doing a full recalc for elements only affected by this change.
>
> Also implemented two of these properties: visibility and pointer-events,
> storing an extra 2 bits per ComputedStyle. This increases the size of
> ComputedStyle by 1 byte on Windows and some Android builds (due to
> aligned fields), which increases the memory usage for a standard page
> with ~1000 elements by up to 1kb (although potentially up to 4/8kb on
> 32/64 bit builds due to packing, although this depends on the allocator
> implementation details) but realistically less since style sharing only
> creates one ComputedStyle object for each unique style.
>
> Benchmarks show a speed increase of up to 2x for setting these
> properties on the root element of a typical web page (Facebook, Twitter,
> Pinterest, Amazon, Wikipedia) and letting the change propagate directly
> onto the child ComputedStyle objects, rather than doing a full style
> recalc.
>
> Initial Benchmarks:
> https://docs.google.com/spreadsheets/d/1mUuJEs8cPWyNTR7tQw27oxq6fDTvWiAwgatf_g--B4w/edit#gid=1597242813
>
> Follow-up Benchmarks:
> https://docs.google.com/spreadsheets/d/1mUuJEs8cPWyNTR7tQw27oxq6fDTvWiAwgatf_g--B4w/edit#gid=918856082
>
> BUG=622138
>
> Committed: https://crrev.com/f24dba9f04dd093aac4298378c671ecd44d0fe97
> Cr-Commit-Position: refs/heads/master@{#409143}

TBR=esprehn@chromium.org,meade@chromium.org,timloh@chromium.org,sashab@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=622138

Review-Url: https://codereview.chromium.org/2213223004
Cr-Commit-Position: refs/heads/master@{#410030}
ljagielski
SSLPolicy::OnCertError: expired_previous_decision might be used uninitialized.
BUG=

Review-Url: https://codereview.chromium.org/2219463002
Cr-Commit-Position: refs/heads/master@{#409918}
hugoh
Remove unused includes of shell::InterfaceRegistry
This is a follow-up to:
https://codereview.chromium.org/2201183003/

Review-Url: https://codereview.chromium.org/2207873002
Cr-Commit-Position: refs/heads/master@{#409776}
rune
Use weak members to cache StyleSheetContents.
We used the client count to detect if we could remove a
StyleSheetContents from the StyleEngine cache or not. The problem is
that the client references are removed when the element is removed from
the DOM, but the StyleSheetContents is still referenced from the
CSSStyleSheet which is accessible from CSSOM. That caused bugs with
StyleSheetContents being marked as mutable without removing it from the
cache causing assertions, and mutating the sheet without copy-on-write
because we thought we only had a single client for the contents.

Instead use weak members in the cache and let garbage collection delete
the StyleSheetContents when no longer referenced. Also, add a flag to
StyleSheetContents to say that it is referenced by multiple sheets when
we use and already cached object instead of incorrectly relying on
client count.

R=timloh@chromium.org,haraken@chromium.org
BUG=633210,628488

Review-Url: https://codereview.chromium.org/2205843003
Cr-Commit-Position: refs/heads/master@{#409495}
tmoniuszko
Add option to not generate VS projects for targets deps
BUG=589099

Review-Url: https://codereview.chromium.org/2200123002
Cr-Commit-Position: refs/heads/master@{#409489}
rune
Removed unused accessor for StyleResolver::m_features.
R=timloh@chromium.org

Review-Url: https://codereview.chromium.org/2207693003
Cr-Commit-Position: refs/heads/master@{#409458}
mostynb
make use of existing gn args in net/BUILD.gn
BUG=632297

Review-Url: https://codereview.chromium.org/2188043002
Cr-Commit-Position: refs/heads/master@{#409209}
mostynb
make use of the use_gio gn arg
BUG=632297

Review-Url: https://codereview.chromium.org/2190793002
Cr-Commit-Position: refs/heads/master@{#409204}
mostynb
make use of existing gn args in ui build config
BUG=632297

Review-Url: https://codereview.chromium.org/2185163003
Cr-Commit-Position: refs/heads/master@{#409203}
sigbjornf
Have ResizeViewportAnchor derive from GarbageCollected<> only.
Drop use of GarbageCollectedFinalized<>; not needed for this
class.

R=
BUG=

Review-Url: https://codereview.chromium.org/2192373002
Cr-Commit-Position: refs/heads/master@{#408888}
sigbjornf
Remove unused function template overloads.
Leftover from r408135, remove the generated isT(*RefPtr<T>)
overloads also.

R=
BUG=

Review-Url: https://codereview.chromium.org/2201633002
Cr-Commit-Position: refs/heads/master@{#408887}
sigbjornf
Move DOMConvenienceAPI to stable.
Move ChildNode.{before,after,replaceWith}() +
ParentNode.{prepend,append}() to stable.

R=
BUG=255482

Review-Url: https://codereview.chromium.org/2184223004
Cr-Commit-Position: refs/heads/master@{#408582}
sigbjornf
Remove unnecessary eager finalization of PingLoaders.
A PingLoader instance controls its own lifetime, releasing its
self-keepalive reference upon completion of the load request. At that
time it also lets go of its loader object (and stops the timer), hence
there's no need to eagerly finalize this object -- it serves no real
purpose.

R=
BUG=

Review-Url: https://codereview.chromium.org/2180423005
Cr-Commit-Position: refs/heads/master@{#408417}
sigbjornf
Update and fix sendBeacon() redirect behavior.
Refresh the implementation to follow the specification changes in

 https://github.com/w3c/beacon/pull/33
 https://github.com/w3c/beacon/pull/34

In particular, correctly flag a CORS-disallowed redirect as not to
be followed by WebURLLoader.

R=
BUG=628762

Review-Url: https://codereview.chromium.org/2177383006
Cr-Commit-Position: refs/heads/master@{#408380}
mostynb
harfbuzz-ng: make use of the use_glib gn arg
BUG=632297

Review-Url: https://codereview.chromium.org/2187163002
Cr-Commit-Position: refs/heads/master@{#408370}
mostynb
make use of use_gconf & use_glib gn args in content/browser/
Review-Url: https://codereview.chromium.org/2191733002
Cr-Commit-Position: refs/heads/master@{#408362}
mostynb
power_save_blocker_x11.cc depends on dbus
Review-Url: https://codereview.chromium.org/2189523004
Cr-Commit-Position: refs/heads/master@{#408275}
fs
Move platform/ParsingUtilities.h to wtf/text/
Review-Url: https://codereview.chromium.org/2175123002
Cr-Commit-Position: refs/heads/master@{#408249}
mostynb
(gcc) fix compilation of os_exchange_data_provider_aurax11.cc
This fixes a gcc compilation error in os_exchange_data_provider_aurax11.cc:
error: cannot convert 'ret' from type 'std::unique_ptr<ui::OSExchangeDataProviderAuraX11>'
    to type 'std::unique_ptr<ui::OSExchangeDataProviderAuraX11>&&'

Tested with gcc 4.8.4.

Followup to https://codereview.chromium.org/2179813003

BUG=614037

Review-Url: https://codereview.chromium.org/2192533002
Cr-Commit-Position: refs/heads/master@{#408233}
sigbjornf
Remove unused function template overloads.
R=
BUG=

Review-Url: https://codereview.chromium.org/2182213005
Cr-Commit-Position: refs/heads/master@{#408135}
mostynb
(gyp): breakpad_host should push include_dirs to dependents
Followup to https://codereview.chromium.org/2169063002

BUG=internal b/30003601
TBR=thestig@chromium.org

Review-Url: https://codereview.chromium.org/2183613003
Cr-Commit-Position: refs/heads/master@{#407758}
fs
Disable svg/parser/whitespace-length-invalid-1.html
TBR=mpearson@chromium.org
BUG=630967

Review-Url: https://codereview.chromium.org/2178993003
Cr-Commit-Position: refs/heads/master@{#407580}
sigbjornf
Simplify ElementVisibilityObserver implementation.
Recast ElementVisibilityObserver's VisibilityCallback in a more
Blink-like manner by way of a Client interface. Thereby also addressing
on-off-heap cycle, a leak source.

Similarly, simplify the connection between ElementVisibilityObserver and
IntersectionObserver -- have the former directly implement the
IntersectionObserverCallback instead of indirectly using closure callbacks.

R=
BUG=627539

Review-Url: https://codereview.chromium.org/2173353002
Cr-Commit-Position: refs/heads/master@{#407450}
sigbjornf
Remove unnecessary finalization of IDBObserver classes.
Re-apply r402117 which r404283 accidentally reverted.

R=
BUG=609934

Review-Url: https://codereview.chromium.org/2177083002
Cr-Commit-Position: refs/heads/master@{#407418}
fs
Don't resolve non-local -webkit-clip-path references as local
Whether the reference was local or not was disregarded, meaning that
any URL with a valid fragment part could potential result in a valid
clip - regardless of whether it was local or not. I.e foo.svg#bar would
reference an element with the id 'bar' in the local document.

Check if the URL reference resolver flagged the reference as being local,
and only pass a non-null fragment if it was.

BUG=629826

Review-Url: https://codereview.chromium.org/2174813003
Cr-Commit-Position: refs/heads/master@{#407300}
fs
Make fragment-only URLs always be document-local references
This implements the 'local url' handling per:

  https://drafts.csswg.org/css-values/#local-urls

which is also referenced from:

  https://svgwg.org/svg2-draft/linking.html#linkRefAttrs

Most of the logic is handled by a new helper class named
SVGURLReferenceResolver, which keeps state, resolves the URL
and extracts the fragment identifier as needed.

BUG=470608

Review-Url: https://codereview.chromium.org/2174833002
Cr-Commit-Position: refs/heads/master@{#407299}
fs
Reland of Remove platform/text/ParserUtilities.h
platform/ParsingUtilities.h caters to the same needs, so transition
users of skipString(...) to skipToken(...) and remove
platform/text/ParserUtilities.h.

Review-Url: https://codereview.chromium.org/2176623003
Cr-Commit-Position: refs/heads/master@{#407259}
fs
Remove platform/text/ParserUtilities.h
platform/ParsingUtilities.h caters to the same needs, so transition
users of skipString(...) to skipToken(...) and remove
platform/text/ParserUtilities.h.

Review-Url: https://codereview.chromium.org/2176623003
Cr-Commit-Position: refs/heads/master@{#407187}
fs
Resolve URL/target reference at a single point in SVGUseElement
The <base> URL can change between the attribute (href) is updated and
the shadow tree constructed. This causes confusion in the target
resolving code since it can produce different results at different
points in time.
Only resolve the URL on changes (to 'href'), extract the fragment
identifier and store whether the reference is local or not.
Refactor the SVGUseElement target element lookup with an eye to
future handling of "fragment-only" (local) URLs.
This makes the externalDocument in
SVGURIReference::targetElementFromIRIString unused, so remove that
codepath and simplify the function accordingly.

This changes behavior from resolving the URL and target element when
needed (depending on when layouts happen), to only when the 'href' is
mutated. This new behavior matches Edge, but not Gecko.

BUG=601203, 470608

Review-Url: https://codereview.chromium.org/2173453002
Cr-Commit-Position: refs/heads/master@{#407128}
fs
Merge CSSSVGDocumentValue with CSSURIValue
These two CSSValue classes are used to represent the same semantic,
which is a reference to an element by means of a "url(...)" function.
CSSSVGDocumentValue carries additional state to be able to handle
references to external documents, by caching a DocumentResource.

Move all the DocumentResource state to CSSURIValue, while also keeping
the naming of the URL string (m_url). Also do some minor cleanup, for
instance by removing "SVG" from the cachedSVGDocument() method name and
dropping some unnecessary .get()s.

This bloats CSSURIValue a bit for the cases where the DocumentResource
is not utilized, but this bloat will be reduced (in relative terms) with
future developments. On the "pro"-side is naturally that we now don't
have to extend two CSSValue classes with additional functionality and
state.

BUG=470608, 405315

Review-Url: https://codereview.chromium.org/2165833006
Cr-Commit-Position: refs/heads/master@{#407126}
tsniatowski
Use absolute namespace references in //base/logging.h macros
Macros can be used in various namespace contexts, and macros that expand
to "logging::Something" can end up choosing some_namespace::logging
if used in a context wher ethere exists a nested namespace logging with
a conflicting name like LogMessage. It's fixable by using "::logging::"
instead of "logging::" in the macros.

No examples of such issues in chrome, but this can help downstream and
seems a good thing to do consistently.

BUG=

Review-Url: https://codereview.chromium.org/2045203004
Cr-Commit-Position: refs/heads/master@{#406910}
mostynb
rebaseline huge-image-viewport-scale.html
This test was not being run with correctly initialized
preferences, and an invalid baseline.  This fixes the
initialization, and rebaselines the test.

This is a prerequisite of https://codereview.chromium.org/2155273002/

BUG=331654, 464295

Review-Url: https://codereview.chromium.org/2163953002
Cr-Commit-Position: refs/heads/master@{#406679}
mostynb
Remove WebContents::InsertCSS since it is unused
This looks like it hasn't been used since CL923463003 landed
over a year ago.

BUG=331654

Review-Url: https://codereview.chromium.org/2157153002
Cr-Commit-Position: refs/heads/master@{#406656}
fs
Simplify URL-resolving in targetElementFromIRIString
Use Document::completeURL for URL resolving, rather than using
String::substring et.c to reproduce essentially the same code.
Use KURL::fragmentIdentifier and friends to extract the fragment
identifier.

Fold urlFromIRIStringWithFragmentIdentifier into its only user.
Open-code isExternalURIReference in targetElementFromIRIString, since we
already have the URL resolved and ready.

BUG=470608

Review-Url: https://codereview.chromium.org/2170453002
Cr-Commit-Position: refs/heads/master@{#406578}
fs
Simplify "is external URL" in filter operations resolving
We've already resolved the URL, so we might as well just use
equalIgnoringFragmentIdentifier on that rather than potentially
re-resolve and compare. No functional change.
Eventually we'll need to have the URL resolved before style resolution.

BUG=470608, 405315

Review-Url: https://codereview.chromium.org/2167733002
Cr-Commit-Position: refs/heads/master@{#406574}
mharanczyk
Fix uninitialized variable in PrefServiceSyncable class.
Review-Url: https://codereview.chromium.org/2165943002
Cr-Commit-Position: refs/heads/master@{#406571}
fs
Only flag the LayoutObject on CSP error if one is attached
When instantiating a plugin through the (somewhat special) code-path
that does not require a LayoutObject to be present, we would end up
dereferencing a null-pointer if a CSP error was flagged, failing the
plugin load sequence.

BUG=627694

Review-Url: https://codereview.chromium.org/2162473003
Cr-Commit-Position: refs/heads/master@{#406295}
rchlodnicki
[net-internals] Fix JS exception on stopping capturing while in Capture view
Store a map of link enabled states so that we can use it to enable next
visibile view on hidding active view. Map is ordered so it works to iterate it.

BUG=616382
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2121763002
Cr-Commit-Position: refs/heads/master@{#405942}
mostynb
gyp: url_mojom should be a hard_dependency
The url/url.gyp:url_mojom target depends on url_interfaces_mojom,
which generates header files, and sets itself as a
hard_dependency.  Thhat hard_dependency status is not propagated
to url_mojom. Let's add it explicitly.

Review-Url: https://codereview.chromium.org/2153093002
Cr-Commit-Position: refs/heads/master@{#405794}
tmoniuszko
Fix TouchSelectionControllerImpl tests failing with DPI=125%
Make textfield a bit larger so text fits it when system DPI is set to 125%.

Fixes following tests:
TouchSelectionControllerImplTest.DoubleTapInTextfieldWithCursorHandleShouldSelectText
TouchSelectionControllerImplTest.SelectRectCallbackTest
TouchSelectionControllerImplTest.SelectRectInBidiCallbackTest
TouchSelectionControllerImplTest.SelectionInBidiTextfieldTest
TouchSelectionControllerImplTest.SelectionInTextfieldTest

BUG=626264

Review-Url: https://codereview.chromium.org/2120353003
Cr-Commit-Position: refs/heads/master@{#405743}
mfiglarowicz
Fix invalidating the text track indexes after append or remove text track from the list
There was a trivial bug in 'for' loop which iterates through the array
indexes but always uses the initialisation value of the iterator instead of
real value of the iterator.

BUG=

Review-Url: https://codereview.chromium.org/2144543002
Cr-Commit-Position: refs/heads/master@{#405709}
kolczyk
In ChromeVox Next, create a text edit handler on "LoadComplete" if there is already a focused text field in order not to miss the initial value change on such.
BUG=628110
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2151763003
Cr-Commit-Position: refs/heads/master@{#405704}
wdzierzanowski
Reland of "Fix build of Widevine CDM stub on Mac"
The combination of 'branding=Chromium' and 'enable_widevine=1' causes
'widevinecdm' to be a 'shared_library' build of the CDM stub.
Additionally combined with 'mac_strip_release=1', this triggers
'strip_save_dsym', which fails, because it doesn't support
'product_dir'.

This fix does to 'widevinecdm' what has already been done to
'clearkeycdm': Split the target into 'widevinecdm_binary' which builds
and strips the stub binary, and 'widevinecdm' which just copies the
binary.

This CL relands https://codereview.chromium.org/2117343005/ with the
following change:

The new 'widevinecdm_binary' target is now defined conditionally for the
case when it is really needed, to fix the ninja error "multiple rules
generate WidevineCdm/_platform_specific/win_x86/widevinecdm.dll".

BUG=622282

TEST='build/gyp_chromium -Gconfig=Release -Dbranding=Chromium -Denable_widevine=1 -Dmac_strip_release=1 && ninja -C out/Release widevinecdm' is successful

Review-Url: https://codereview.chromium.org/2149233003
Cr-Commit-Position: refs/heads/master@{#405635}
sigbjornf
Drop unnecessary finalization of NavigatorShare::ShareClientImpl.
R=
BUG=

Review-Url: https://codereview.chromium.org/2151803002
Cr-Commit-Position: refs/heads/master@{#405488}
wdzierzanowski
Fix build of Widevine CDM stub on Mac
The combination of 'branding=Chromium' and 'enable_widevine=1' causes
'widevinecdm' to be a 'shared_library' build of the CDM stub.
Additionally combined with 'mac_strip_release=1', this triggers
'strip_save_dsym', which fails, because it doesn't support
'product_dir'.

This fix does to 'widevinecdm' what has already been done to
'clearkeycdm': Split the target into 'widevinecdm_binary' which builds
and strips the stub binary, and 'widevinecdm' which just copies the
binary.

BUG=622282

TEST='build/gyp_chromium -Gconfig=Release -Dbranding=Chromium -Denable_widevine=1 -Dmac_strip_release=1 && ninja -C out/Release widevinecdm' is successful

Review-Url: https://codereview.chromium.org/2117343005
Cr-Commit-Position: refs/heads/master@{#405371}
mostynb
fix gyp build after proto_zero_plugin skeleton landed
Followup to https://codereview.chromium.org/2147613002 / crrev.com/2147613002

BUG=608721

Review-Url: https://codereview.chromium.org/2146063003
Cr-Commit-Position: refs/heads/master@{#405330}
mharanczyk
Expose final download URL (actual url after redirects) in the extension API.
BUG=620630

Review-Url: https://codereview.chromium.org/1706193002
Cr-Commit-Position: refs/heads/master@{#404619}
fs
Drop the adding and removing of the 'running' class in SVGTestCase.js
This class will trigger layouts that could hide the intended effects of
the tests using this "framework". Since the same elements are marked as
being hidden, this will not affect the graphical output.

BUG=231560

Review-Url: https://codereview.chromium.org/2104943005
Cr-Commit-Position: refs/heads/master@{#404380}
davve
Fallback to 300x150 instead of 0x0 size for SVG inside content()
Prior to r379801, the fallback 300x150 in SVGImage::dataChanged() was
used. Post r379801 we instead used the empty rect as fallback. Both
are probably wrong but 300x150 matches what we did previously more
closely and we are less likely to end up with an empty image.

BUG=623528

Review-Url: https://codereview.chromium.org/2121973002
Cr-Commit-Position: refs/heads/master@{#404374}
fs
Allow 'alphabetic' for alignment-baseline and dominant-baseline
This keyword is not included in any of the ranges used, so needs to be
mentioned specifically.

BUG=620618

Review-Url: https://codereview.chromium.org/2131483003
Cr-Commit-Position: refs/heads/master@{#404338}
fs
Refine cull rect for SVGInlineTextBox painting
The PaintInfo cull rect can (will) change between paints, so use
the moral equivalent of logicalOverflowRect() to compute a more
accurate cull rect instead.

This fixes under-invalidation in the following tests:

 svg/dynamic-updates/SVGTextElement-dom-lengthAdjust-attr.html,
 svg/dynamic-updates/SVGTextElement-dom-textLength-attr.html,
 svg/dynamic-updates/SVGTextElement-svgdom-lengthAdjust-prop.html and
 svg/dynamic-updates/SVGTextElement-svgdom-textLength-prop.html

Exposed by https://codereview.chromium.org/2104943005

BUG=231560

Review-Url: https://codereview.chromium.org/2124553002
Cr-Commit-Position: refs/heads/master@{#404265}
fs
Use the outermost SVG as base when computing offsetX/Y for SVG elements
This reverts the behavior back to what it was prior to
https://codereview.chromium.org/1747223002. In short, the closest
ancestor CSS layout box is used for any SVG element. This will always
be the outermost SVG root (LayoutSVGRoot.)

BUG=624996

Review-Url: https://codereview.chromium.org/2124283002
Cr-Commit-Position: refs/heads/master@{#404217}
fs
Update FilterEffect colorspace on color-interpolation-filters changes
Changes to the 'color-interpolation-filters' property would not get
propagated to any built (cached) filter chains, and hence any future
paints would still use the old chain.
Add support for updating this FilterEffect property down in the filter
primitive element base-class setFilterEffectAttribute, and then make
sure any derived classes forward to it.

BUG=625732

Review-Url: https://codereview.chromium.org/2128193004
Cr-Commit-Position: refs/heads/master@{#404200}
mostynb
gyp: don't build gamepad_platform_data_fetcher_linux.cc when udev is disabled
Fixup after https://codereview.chromium.org/2081583002

BUG=612330

Review-Url: https://codereview.chromium.org/2125223003
Cr-Commit-Position: refs/heads/master@{#404168}
fs
Use the correct bounding rect in SVGInlineTextBox::nodeAtPoint
When writing-mode was unprefixed, SVGInlineTextBoxes started getting the
same treatment as their base-class, and hence we need to be careful when
we consider sizes for the inline boxes.
Use logicalWidth() and logicalHeight() instead of size().

BUG=587455

Review-Url: https://codereview.chromium.org/2124793002
Cr-Commit-Position: refs/heads/master@{#403913}
fs
Consider 'order' when updating feConvolveMatrix 'target*'
SVGFEConvolveMatrixElement's 'targetX' or 'targetY' attribute depend on
'order' for their initial value. When updating the target value of
an instantiated FEConvolveMatrix, order would however not be considered,
instead using the initial value of the attribute (zero.)

Refactor the code a bit to make it easy to consider the correct initial
value even when updating an existing FEConvolveMatrix, introducing
new methods matrixOrder() and targetPoint(). Clean up and simplify
as appropriate.

This fixes the following tests:

 svg/dynamic-updates/SVGFEConvolveMatrixElement-dom-targetX-attr.html
 svg/dynamic-updates/SVGFEConvolveMatrixElement-dom-targetY-attr.html
 svg/dynamic-updates/SVGFEConvolveMatrixElement-svgdom-targetX-prop.html
 svg/dynamic-updates/SVGFEConvolveMatrixElement-svgdom-targetY-prop.html

with https://codereview.chromium.org/2104943005 applied.

BUG=231560

Review-Url: https://codereview.chromium.org/2124583002
Cr-Commit-Position: refs/heads/master@{#403814}
mostynb
remove duplicate friend declaration
This unbreaks GCC builds after https://codereview.chromium.org/2036403002

BUG=587025
TBR=lfg@chromium.org, dcheng@chromium.org

Review-Url: https://codereview.chromium.org/2121953003
Cr-Commit-Position: refs/heads/master@{#403795}
rune
Don't schedule wholeSubtreeInvalid sets.
The StyleInvalidator asserts if we scheduled such sets. Mark element
for SubtreeStyleChange instead.

R=esprehn@chromium.org,ericwilligers@chromium.org
BUG=624607

Review-Url: https://codereview.chromium.org/2106063007
Cr-Commit-Position: refs/heads/master@{#403663}
rune
Skip scheduling sibling invalidation based on direct adjacent count.
When scheduling sibling invalidation sets for sibling insertion/removal
we schedule sets for N preceding siblings where N is the maximum number
of consecutive direct adjacent combinators, or infinite for indirect
adjacent combinators.

However, the further left of the mutation we schedule, the more direct
adjacent combinators are required to affect siblings following the
mutation. The maximum adjacent number is stored for every sibling
invalidation set, which means we can drop scheduling the set if that
count is too low.

Example:

Selectors:

  .a + div + div + span {}
  .b + span {}
  .c + span {}

Siblings:

  div.x div.a div.b div.c div#remove span

When removing #remove we start scheduling sibling invalidations for
div.c which needs at least one adjacent combinator to reach the span or
any subsequent elements. div.b needs at least two, and so on. For the
case above, we schedule the set for .c, but not for .b since the max
adjacent combinator count for .b is 1 and it needs to be at least 2.
.a needs to have at least 3, which is the case, so we schedule the set
for .a. We never consider the div.x element because the max adjacent
combinator count for the document is 3.

R=esprehn@chromium.org
BUG=624782

Review-Url: https://codereview.chromium.org/2116503002
Cr-Commit-Position: refs/heads/master@{#403530}
fs
Relocate tests from fast/svg/ to svg/
Some files are renamed to avoid name clashes on case-insensitive
file-systems:

 svgangle.html  => svgangle-units.html
 svglength.html => svglength-units.html
 svglist.html   => svglist-basic-interface.html

(The last one did not actually clash, but was renamed for easier
 differentiation.)

BUG=625231

Review-Url: https://codereview.chromium.org/2118903003
Cr-Commit-Position: refs/heads/master@{#403511}
fs
Fold fast/svg/script-tests/animation-events.js into the test using it
There's only one test using this "framework", so fold it into the test
itself. Move the result to svg/animation/.

Straight copy of the .js file into the .html file. Whitespace is adjusted
and some redundant things are removed (';' and <div>.)

BUG=625231

Review-Url: https://codereview.chromium.org/2112373002
Cr-Commit-Position: refs/heads/master@{#403510}
sigbjornf
Robustify Internals entry points against detached uses.
Fuzzers generate pointless overhead using these test-only methods from
frame-detached contexts. Add required nullchecks throughout.

Simple test case for each of these entry points (w/ --run-layout-test):

 <a href="javascript:'replaced'" id=anchor>click</a>
 <script>
 anchor.click();
 internals.someMethod();
 console.log('no crash');
 </script>

R=
BUG=624549

Review-Url: https://codereview.chromium.org/2109613007
Cr-Commit-Position: refs/heads/master@{#403421}
rune
0 -> nullptr for UseCounter pointer in CSSParserContext.
I repeatedly find myself looking for constructors taking flags through
unsigned before realizing this is actually a pointer.

Review-Url: https://codereview.chromium.org/2101143005
Cr-Commit-Position: refs/heads/master@{#403256}
fs
Use a converter for -webkit-clip-path
Add StyleBuilderConverter::convertClipPath and use it for computing
the ClipPathOperation.

BUG=610854

Review-Url: https://codereview.chromium.org/2105383002
Cr-Commit-Position: refs/heads/master@{#403153}
rune
Optimize style recalc when adding @keyframes.
We only need to recalculate the elements with running animations unless
we tried to find an @keyframes rule and couldn't, for which we fall
back to a full document recalc.

The motivation for doing this is that the current WIP for issue 567021
shows that we're still getting full document recalcs due to the
presence of @keyframes rules.

R=dstockwell@chromium.org,alancutter@chromium.org
BUG=623911,567021

Review-Url: https://codereview.chromium.org/2105743002
Cr-Commit-Position: refs/heads/master@{#403118}
fs
Wire up invalidation for flood-{color,opacity} on <feDropShadow>
Make sure to call primitiveAttributeChanged() for this element and
property combination. Implement the required infrastructure in
SVGFEDropShadowElement::setFilterEffectAttribute and FEDropShadow.

Because of an issue with SVGTestCase.js the tests below would not
previously fail as expected. That is being addressed by the CL at
https://codereview.chromium.org/2104943005.

TEST=svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-color-attr.html
TEST=svg/dynamic-updates/SVGFEDropShadowElement-dom-shadow-opacity-attr.html
TEST=svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-color-prop.html
TEST=svg/dynamic-updates/SVGFEDropShadowElement-svgdom-shadow-opacity-prop.html
BUG=231560

Review-Url: https://codereview.chromium.org/2112563002
Cr-Commit-Position: refs/heads/master@{#403025}
fs
Notify context element after changes in SVGPreserveAspectRatioTearOff
Without this the associated LayoutObject will not be notified of the
change.

TEST=svg/dynamic-updates/SVGFEImageElement-svgdom-preserveAspectRatio-prop.html
TEST=svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop.html
BUG=231560

Review-Url: https://codereview.chromium.org/2108333002
Cr-Commit-Position: refs/heads/master@{#402960}
fs
Move ClipPathOperation.h to core/style/
This is stored as part of ComputedStyle, so style/ seems a better fit
than layout/.

BUG=610854

Review-Url: https://codereview.chromium.org/2108213002
Cr-Commit-Position: refs/heads/master@{#402935}
sigbjornf
Tidy CrossThreadCopier.h inclusion.
This header file declares a set of types as being cross-copiable; avoid
bringing in all of Oilpan for its two cross-thread persistent types.

Tidy up some downstream header files which were implicitly depending on
Oilpan being included here.

R=
BUG=597856, 624419

Review-Url: https://codereview.chromium.org/2104283002
Cr-Commit-Position: refs/heads/master@{#402823}
rune
Schedule sibling invalidation sets for sibling insert/remove.
Invalidation sets have been used only for changes which do not alter the
tree structure, like changing id, class names, other attributes, and
pseudo states. For dom tree changes, style invalidation relies on attach
and detach of the layout tree for the inserted/removed element. For
subsequent siblings of inserted/removed elements, we have been marking
siblings for subtree recalc (when we know we have tried to match
adjacent combinators on one of the siblings before) based on the maximum
number of consecutive direct adjacent combinators or all subsequent
siblings for indirect adjacent combinators.

This CL starts using sibling invalidation sets on siblings instead of
doing subtree recalcs.

The following properties of invalidation sets affected how this
implementation was done:

* Even though we invalidate descendants/siblings based on tag names, we
  don't have invalidation sets for tag names as elements do not change
  tag names dynamically. For inserted/removed elements, we could have
  used invalidation sets for tag names. Take the selector "div + span".
  If we remove a div we could have scheduled an invalidation set for div
  which invalidates a span sibling.

* Invalidation sets for simple selectors and their negated versions, for
  instance ".a" and ":not(.a)", share invalidation sets and they may do
  so because invalidation sets have been applied when they change. That
  is, "a" is either part of old or the new class attribute when the
  invalidation set needs to be scheduled. When removing/inserting
  elements, a selector like ":not(.a) + .b" will need to schedule a
  sibling for ".a" for all elements not having the class "a".

* Consider the selector "* + .a". We have to schedule a sibling
  invalidation for any inserted/removed element to invalidate a sibling
  with class "a". However, invalidation set construction has only
  created an invalidation set for ".a" with the invalidateSelf flag set.

For this CL, we create a single universal sibling invalidation set to
handle the cases above. In fact this CL only do sibling invalidations on
element insert/remove for id, class, and attribute in addition to
scheduling the universal sibling invalidation set. Also, we skip
selector lists (that is, :not() and :-webkit-any() as :host()
:host-context() and :slotted() never match when followed by an adjacent
combinator).

For the following set of selectors:

  :not(.a) + .b + .c
  #x:not(.a) + .d
  div + span
  :-webkit-any(.x) + .f .g

We end up with the following universal sibling invalidation set with the
descendant invalidation set, containing ".g", to the right.

  { .c, span, .f, invalidatesSelf } => { .g }

Note that if a compound contains both :not() and for instance an id
selector, we will not add it to the universal sibling invalidation set
as we can properly invalidate ".d" siblings above using the invalidation
set for "#x".

== Scheduling sibling invalidations

For changes not modifying the tree, we schedule sibling invalidation
sets on the changed element and invalidate the siblings with descendant
sets during the invalidation process. When removing an element, however,
the element is not left in the tree, so we need to associate the
invalidation set with another element.

When we remove an element, we instead schedule the sibling invalidation
set, and the sibling invalidation set's descendant set, as descendant
invalidation sets on the parent element or shadow root.

Likewise for inserting an element. When inserting an element, we have
elements to schedule the sibling sets on, but the sets would need to be
scheduled on elements further to the right in the sibling list in order
to reach the siblings we needed to invalidate. Also, they would have to
be moved further right on subsequent insertions.

== The effect on amazon.com

This CL gets rid of all post-page-load full recalcs before you start
interacting with the page. The full recalcs after you start interacting
needs to be investigated further.

R=esprehn@chromium.org,ericwilligers@chromium.org
BUG=542082

Review-Url: https://codereview.chromium.org/2089063005
Cr-Commit-Position: refs/heads/master@{#402770}
rune
Mark stylesheet as having media queries at consume time.
Marking the stylesheet as having media queries for @media at insertion
time meant we didn't mark the stylesheet when @media was a child rule
of another @-rule like @supports. Instead do the marking from the
consume method like we already did for @font-face rules.

Removed unnecessary marking from insertion methods and an unnecessary
boolean parameter which was always true.

R=timloh@chromium.org
BUG=621502

Review-Url: https://codereview.chromium.org/2081893003
Cr-Commit-Position: refs/heads/master@{#402766}
ckulakowski
Fix for cross compiling 32bit linux on 64bit host machine
Right now when custom sysroot is provided as gn parameter (target_sysroot)
only 32 bit custom sysroot will be used. 64 bit sysroot (which is also needed
by 32 bit build by - for example - protobuf) is expected to be found in default
location. This change adds possibility to provide path to directory containing
both sysroots for linux (32 bit and 64 bit).

BUG=622616

Review-Url: https://codereview.chromium.org/2096323002
Cr-Commit-Position: refs/heads/master@{#402742}
sigbjornf
Handle cross-thread weak persistents during global weak processing.
r401880 changed the handling of weak persistents, clearing
and releasing their underlying PersistentNodes once their
weak references point to otherwise unreferenced objects.

However, performing that weak processing step cannot reliably
be done as part of thread-local weak processing if the
weak persistent is a CrossThreadWeakPersistent<T> (CTWP) as the
object it refers to may reside on a different thread's heap than
where the CTWP resides. If both locations need to be accessed,
doing that as part of thread-local weak processing is too
late and unsafe.

Instead we process the cross-thread weak persistents along with the
'weak cells' during global weak processing. WeakPersistent<>s are
still handled during thread-local weak processing.

R=
BUG=623985

Review-Url: https://codereview.chromium.org/2106863003
Cr-Commit-Position: refs/heads/master@{#402734}
sigbjornf
Disable HeapTest.TraceDeepEagerly for Android targets.
This test is heavy on allocation and considered too slow to be
running w/ asserts enabled. Disable it entirely for Android,
as the overhead is bogging down bots too much.

R=
BUG=623779

Review-Url: https://codereview.chromium.org/2101363002
Cr-Commit-Position: refs/heads/master@{#402470}
sigbjornf
Allow lazy removal of (context) lifecycle observers while stopping.
r402141 imposed the restriction on ContextLifecycleObservers behavior
during stop() notifications of no longer being allowed to remove
observers while handling stop(). That constraint enables iteration
to be handled without allocating a snapshot of the observer set.

That restriction proves too constraining for media elements indirectly
holding onto AssociatedURLLoader objects while being stopped
(see associated bug for info.) Consequently, we allow observer removals
while keeping observer set iteration safe & allocation-free -- removals
are recorded while iterating, and removed in one go afterwards.

This is only done for notifyStoppingActiveDOMObjects(), as the other
notifications over context lifecycle observers do not require this
flexibility.

R=
BUG=623755

Review-Url: https://codereview.chromium.org/2109553002
Cr-Commit-Position: refs/heads/master@{#402445}
sigbjornf
Fix DUMP_NODE_STATISTICS compilation.
R=
BUG=

Review-Url: https://codereview.chromium.org/2099183003
Cr-Commit-Position: refs/heads/master@{#402406}
sigbjornf
Retire http/tests/htmlimports/redirect.html leak exemption.
Back to normal, retire expectation.

TBR=yoichio
BUG=366477
NOTRY=true

Review-Url: https://codereview.chromium.org/2096373002
Cr-Commit-Position: refs/heads/master@{#402152}
sigbjornf
Avoid snapshotting ContextLifecycleObservers when iterating.
To allow safe iteration over the set of ExecutionContext observers,
a snapshot of the set was taken before iterating over it. So as to
allow observers to unregister themselves while being notified.

Apart from PostMessageTimer unregistering itself while being stop()ed,
the ContextLifecycleObservers do not mutate the observer set, hence
we can avoid the snapshot step and iterate directly over the observers.
Attempts to remove an observer while iterating is caught and
asserted for.

As the observer set is a set of weak references, some care is needed
to keep those references strong while iterating. That and other details
surrounding observer iteration is now handled by the auxiliary scope object
LifecycleNotifier<>::IterationScope.

Should the constraint of not being allowed to remove observers while
iterating prove too cumbersome, supporting lazy removal of observers
(post iteration) would be straightforward.

R=
BUG=451132

Review-Url: https://codereview.chromium.org/2094143002
Cr-Commit-Position: refs/heads/master@{#402141}
rune
Move preferred stylesheet set out of active sheet update.
There are two reasons for this:

1. In preparation for async active stylesheet update, in which case
   setting the preferred stylesheet set would otherwise be happening
   too late.

2. Doing it during the active stylesheet update means only the
   alternate stylesheets following the link with the title setting the
   preferred sheet set would be enabled appropriately. crbug.com/621479

This CL is split out of https://codereview.chromium.org/1913833002

R=timloh@chromium.org
BUG=567021,621479

Review-Url: https://codereview.chromium.org/2079303002
Cr-Commit-Position: refs/heads/master@{#402139}
sigbjornf
Remove unnecessary finalization of IDBObserver classes.
IDBObserver and IDBObserverChanges do not need to be finalized,
nor have user-defined empty destructors.

R=
BUG=609934

Review-Url: https://codereview.chromium.org/2098243002
Cr-Commit-Position: refs/heads/master@{#402117}
rune
Don't create m_style for option element in display:none subtree.
Instead create a ComputedStyle on demand in rare data like we do for
other display:none elements. This caused out-of-date computed style for
option elements in display:none subtrees because recalcOwnStyle is
skipped for elements without a parentComputedStyle().

R=tkent@chromium.org
BUG=621965

Review-Url: https://codereview.chromium.org/2095973002
Cr-Commit-Position: refs/heads/master@{#402095}
perja
On Android there is no notification when a device is lost. This change keeps track of when a device was last seen and removes outdated devices.
This was already implemented for OSX and the code has been moved to make it accessible to Android as well.

BUG=581544

Review-Url: https://codereview.chromium.org/1842223003
Cr-Commit-Position: refs/heads/master@{#401940}
sigbjornf
Completely clear weak persistent references.
If weak processing determines that a WeakPersistent<T> is now pointing
to an otherwise unreferenced object, clear out and deallocate its
underlying PersistentNode.

We previously would only clear the persistent reference, but keep the
PersistentNode. This would lead to imprecise counts of live persistents,
potentially triggering false asserts of leaking persistents during thread
termination GCs.

R=
BUG=

Review-Url: https://codereview.chromium.org/2094973002
Cr-Commit-Position: refs/heads/master@{#401880}
fs
Update baselines for svg/text/text-viewbox-rescale.html
Incorporate changes from https://codereview.chromium.org/1920833002.

TBR=pdr@chromium.org
BUG=603956

Review-Url: https://codereview.chromium.org/2085413003
Cr-Commit-Position: refs/heads/master@{#401584}
sigbjornf
gn: add Blink GC plugin options
The Blink GC clang plugin supports a couple of extra options which the
Blink GN configuration does not currently expose. Do so here, but without
depending on the 'flags' script used by the gyp build system
(tools/clang/scripts/blink_gc_plugin_flags.py).

Specifically, this adds the following Blink GN variables:

 - blink_gc_plugin_option_do_dump_graph [ = false ]
     emit JSON-serialized representation of class graph.
 - blink_gc_plugin_option_warn_unneeded_finalizer [ = false ]
     warn of unnecessary destructor usage.

TBR=thakis
BUG=

Review-Url: https://codereview.chromium.org/2097433002
Cr-Commit-Position: refs/heads/master@{#401568}
fs
Update expectations for crbug.com/621915
These tests no longer appear flaky:

 svg/custom/createImageElement2.xhtml
 svg/custom/pointer-events-image.svg
 svg/custom/pointer-events-image-css-transform.svg

TBR=pdr@chromium.org
BUG=621915

Review-Url: https://codereview.chromium.org/2097443002
Cr-Commit-Position: refs/heads/master@{#401566}
sigbjornf
gn: define and use clang_base_path
Replace uses of "//third_party/llvm-build/Release+Asserts"
with the configurable option clang_base_path.

TBR=thakis
BUG=

Review-Url: https://codereview.chromium.org/2088373002
Cr-Commit-Position: refs/heads/master@{#401551}
fs
Fix Mac10.9 baselines for two svg/custom/ tests
Remove incorrect baselines for:

 svg/custom/createImageElement2.xhtml
 svg/custom/pointer-events-image.svg

TBR=pdr@chromium.org
NOTRY=true
BUG=621915

Review-Url: https://codereview.chromium.org/2082253004
Cr-Commit-Position: refs/heads/master@{#401387}
sigbjornf
Add ASan exemption when iterating cross-thread-persistents.
When running a termination GC or tracing, the set/region of live
CrossThreadPersistent nodes are iterated over, checking if the objects
they point to belong to the current thread.

As heap objects can have CrossThreadPersistent<> fields, it is possible
for there to be CrossThreadPersistent nodes which point back to heap
objects about to be swept. When ASan is enabled, the page sweeping takes
care of poisioning all to-be-swept objects first.

The combination of the above two means that persistent iteration can
try to inspect one of these poisoned objects, which will trigger an
ASan error. The persistent will not be further used, as it doesn't
belong to the thread. To accommodate this, we do disable ASan while
performing the object lookup while iterating the CrossThreadPersistent
node set.

R=
BUG=620754

Review-Url: https://codereview.chromium.org/2087253002
Cr-Commit-Position: refs/heads/master@{#401354}
fs
Deflake svg/custom/createImageElement2.xhtml
Need to wait for the image to load before ending the test.

BUG=621915

Review-Url: https://codereview.chromium.org/2086383002
Cr-Commit-Position: refs/heads/master@{#401347}
fs
Deflake svg/custom/pointer-events-image*.svg
Rewrite these two tests (which are essentially the same, modulo a
transform) to first wait for all the images to load, and then perform
all the clicks.

BUG=621915

Review-Url: https://codereview.chromium.org/2088733006
Cr-Commit-Position: refs/heads/master@{#401343}
fs
Update/tighten expectations for crbug.com/552433
Passing after getting updated baselines:

 svg/dom/length-list-parser.html
 svg/transforms/text-with-pattern-with-svg-transform.svg

Failing (a few pixels differ) on Win7 Debug:

 svg/W3C-SVG-1.1/coords-units-02-b.svg

TBR=schenney@chromium.org
BUG=552433

Review-Url: https://codereview.chromium.org/2090553002
Cr-Commit-Position: refs/heads/master@{#401270}
perja
bluetooth: android: removed duplicate restart of scanning.
This is a followup fix to commit 3a38a46. There is no need to restart the search in this callback as this will be done from native code (BluetoothChooserAndroid::SetAdapterPresence).

BUG=543060

Review-Url: https://codereview.chromium.org/2065893002
Cr-Commit-Position: refs/heads/master@{#401257}
mostynb
content/public/common should depend on the mojo_bindings target
Rather than the mojo_bindings_mojom target, which exports sources, and
causes multiple definition errors in component builds.

Followup to https://codereview.chromium.org/2089823002

BUG=622076
TBR=jam@chromium.org,rockot@chromium.org

Review-Url: https://codereview.chromium.org/2088163002
Cr-Commit-Position: refs/heads/master@{#401230}
fs
Common up SVG transform "change detection" (classification)
This moves the transform change classification to a helper class
(SVGTransformChangeDetector) and move
LayoutSVGContainer::TransformChange along with it, renaming it to
SVGTransformChange.

BUG=603956

Review-Url: https://codereview.chromium.org/2086583004
Cr-Commit-Position: refs/heads/master@{#401111}
sigbjornf
Stop PingLoader's cancellation timer early.
If the ping completed, stop the loader's cancellation timer.

R=japhet
BUG=

Review-Url: https://codereview.chromium.org/2083023002
Cr-Commit-Position: refs/heads/master@{#401068}
fs
Reland of "Remove redundant "layout size changed" state from LayoutSVGRoot"
In LayoutSVGRoot::layout, two slightly different "layout size changed"
values are computed - one which is used for propagation to children
via SVGLayoutSupport::layoutSizeOfNearestViewportChanged
(|m_isLayoutSizeChanged|), and one which is used to mark direct
descendant children (local |layoutSizeChanged|).
Ultimately their use is the same though, so only using the more narrow
predicate for both of these cases should yield the same result.
It also has the side-effect of making it more obvious that changes to
layout-size is only of interest when there exist clients of the SVG
root that have relative lengths.

BUG=603956

Review-Url: https://codereview.chromium.org/2065093002
Cr-Commit-Position: refs/heads/master@{#400987}
fs
Rebaseline svg/dom/length-list-parser.html
TBR=schenney@chromium.org
BUG=552433

Review-Url: https://codereview.chromium.org/2083983003
Cr-Commit-Position: refs/heads/master@{#400976}
fs
Rebaseline svg/W3C-SVG-1.1/coords-units-02-b.svg
TBR=schenney@chromium.org
BUG=552433

Review-Url: https://codereview.chromium.org/2088733003
Cr-Commit-Position: refs/heads/master@{#400971}
fs
Rebaseline svg/transforms/text-with-pattern-with-svg-transform.svg
TBR=schenney@chromium.org
BUG=552433

Review-Url: https://codereview.chromium.org/2080243004
Cr-Commit-Position: refs/heads/master@{#400970}
fs
Rebaseline svg/hixie/perf/006.xml
TBR=schenney@chromium.org
BUG=552433

Review-Url: https://codereview.chromium.org/2082963002
Cr-Commit-Position: refs/heads/master@{#400961}
fs
Avoid using forced layout to trigger paint invalidation for SVG containers
Currently, SVG containers in the LayoutObject hierarchy force layout of
their children if the transform changes. The main reason for this is to
trigger paint invalidation of the subtree. In some cases - changes to the
scale factor - there are other reasons to trigger layout, like computing
a new scale factor for <text> or re-layout nodes with non-scaling stroke.

Compute a "scale-factor change" in addition to the "transform change"
already computed, then use this new signal to determine if layout should
be forced for the subtree. Trigger paint invalidation using the
LayoutObject flags instead.

The downside to this is that paint invalidation will walk into "hidden"
containers which rarely require repaint (since they are not technically
visible). This will hopefully be rectified in a follow-up CL.

For the testcase from 603850, this essentially eliminates the cost of
layout (from ~350ms to ~0ms on authors machine; layout cost is related
to text metrics recalculation), bumping frame rate significantly.

BUG=603956,603850

Review-Url: https://codereview.chromium.org/1996543002
Cr-Commit-Position: refs/heads/master@{#400950}
sigbjornf
Delay resetting image animation, if possible.
When the last client of an ImageResource removes itself, the animations
of the image is explicitly reset. That resetting can happen either while
finalizing objects after a GC or as part of other explicit removals of
ImageObserver clients.

Having that reset happen as part of a garbage collection is interacting badly
with code in the middle of updating animations (which happen to trigger a
conservative GC.) So, to avoid introducing such abrupt & harmful resets, delay
the reset'ing until back at the event loop (and the animations update step
having completed.)

R=
BUG=613709, 581546

Review-Url: https://codereview.chromium.org/2004263003
Cr-Commit-Position: refs/heads/master@{#400934}
sigbjornf
Clean up WeakIdentifierMap<> implementation.
Avoid (literal) code duplication between (non)GC versions
of WeakIdentifierMap<>.

Other changes (for the GC version):

  - Do not separately allocate the HeapHashMap<>s, but keep these
    as part objects on WeakIdentifierMap<> instead.
  - Support explicit removal (via notifyObjectDestroyed()).

R=
BUG=

Review-Url: https://codereview.chromium.org/2086643002
Cr-Commit-Position: refs/heads/master@{#400907}
rune
Reject invert for outline-color at parse time.
We don't support invert as outline-color, so we should drop it at parse
time as per spec[1]. Added test to check that the initial value of
outline-color is the computed value of currentColor.

Gecko also drops declarations with invert for outline-color.

[1] https://drafts.csswg.org/css2/ui.html#value-def-invert

R=timloh@chromium.org
BUG=620399

Review-Url: https://codereview.chromium.org/2081633002
Cr-Commit-Position: refs/heads/master@{#400902}
fs
Update baselines for svg/filters/filter-refresh.svg
TBR=pdr@chromium.org
NOTRY=true
BUG=613441

Review-Url: https://codereview.chromium.org/2086713002
Cr-Commit-Position: refs/heads/master@{#400818}
fs
Unprefix the CSS 'filter' property
Parse 'filter' in the same way as '-webkit-filter', and make the latter
an alias of the former.
For SVG content, only the "url(...)" function is allowed still, with the
exception of the outermost <svg> (LayoutSVGRoot), since that "has a box".

Update tests to use 'filter' where reasonable and applicable.

Intent to Ship: https://groups.google.com/a/chromium.org/d/topic/blink-dev/ZVT2kxuFMaA/discussion

Based on https://codereview.chromium.org/1987943002 by noel@chromium.org.

BUG=613441,618160,550249,535786,244295,109224

Review-Url: https://codereview.chromium.org/2065593002
Cr-Commit-Position: refs/heads/master@{#400752}
mostynb
add some missing power_save_blocker gyp deps
Followup to https://codereview.chromium.org/2075153002

BUG=612337, 612563, 257943

Review-Url: https://codereview.chromium.org/2073393002
Cr-Commit-Position: refs/heads/master@{#400723}
mostynb
skip neon intrinsics in libpng when neon is not available
Followup to https://codereview.chromium.org/2021403002

BUG=599917, 618061

Review-Url: https://codereview.chromium.org/2074363002
Cr-Commit-Position: refs/heads/master@{#400714}
sigbjornf
GC plugin: improve error reporting when tracing illegal fields.
Add detection of trace() calls over smart pointer types that either do not
wrap up references to heap objects, or are otherwise not meant to be traced
over. In particular, CrossThread(Weak)Persistent<T> fields are now detected
as being illegal to trace over. Also consider OwnPtr<T>, RefPtr<T> and
std::unique_ptr<T> as illegal to trace over & emit a more concise error
messages for these.

R=
BUG=619149

Committed: https://crrev.com/3ba6089cd6a901b62ff5a0d8f08a2bd818edcbe8
Review-Url: https://codereview.chromium.org/2060553002
Cr-Original-Commit-Position: refs/heads/master@{#399861}
Cr-Commit-Position: refs/heads/master@{#400653}
fs
Revert of Remove redundant "layout size changed" state from LayoutSVGRoot (patchset #1 id:1 of https://codereview.chromium.org/2065093002/ )
Reason for revert:
Possible cause of crbug.com/620228

Original issue's description:
> Remove redundant "layout size changed" state from LayoutSVGRoot
>
> In LayoutSVGRoot::layout, two slightly different "layout size changed"
> values are computed - one which is used for propagation to children
> via SVGLayoutSupport::layoutSizeOfNearestViewportChanged
> (|m_isLayoutSizeChanged|), and one which is used to mark direct
> descendant children (local |layoutSizeChanged|).
> Ultimately their use is the same though, so only using the more narrow
> predicate for both of these cases should yield the same result.
> It also has the side-effect of making it more obvious that changes to
> layout-size is only of interest when there exist clients of the SVG
> root that have relative lengths.
>
> BUG=603956
>
> Committed: https://crrev.com/30770a70834c73670884f0de91bb7624df0ba003
> Cr-Commit-Position: refs/heads/master@{#399791}

TBR=pdr@chromium.org,schenney@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=603956

Review-Url: https://codereview.chromium.org/2071953004
Cr-Commit-Position: refs/heads/master@{#400411}
mostynb
remove leftover forward declaration of OnscreenDisplayClient
BUG=487471
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/2079513002
Cr-Commit-Position: refs/heads/master@{#400267}
sigbjornf
Remove unnecessary MemberHash<> templates.
Directly define the hash traits of all heap reference template types
(Member<T> - or Persistent<T>-derived) in terms of MemberHash<T>,
and avoid introducing ad-hoc templates for these.

Add missing (CrossThread)WeakPersistent<T> hash traits also.

R=
BUG=

Review-Url: https://codereview.chromium.org/2067223005
Cr-Commit-Position: refs/heads/master@{#400155}
joleksy
Align the Mac Omnibox items vertically again
OmniboxViewMac::GetBoldFieldFont() needs to request a bold font, then make it larger. Resource bundle will do the opposite, which makes a large system normal font a non-system bold font. That gives a different baseline to making the non-system bold font larger. And while the omnibox locks the baseline in ApplyTextStyle(), OmniboxPopupCellData does not.

BUG=617144

Review-Url: https://codereview.chromium.org/2068163002
Cr-Commit-Position: refs/heads/master@{#400144}
sigbjornf
GC plugin: improve error reporting when tracing illegal fields.
Add detection of trace() calls over smart pointer types that either do not
wrap up references to heap objects, or are otherwise not meant to be traced
over. In particular, CrossThread(Weak)Persistent<T> fields are now detected
as being illegal to trace over. Also consider OwnPtr<T>, RefPtr<T> and
std::unique_ptr<T> as illegal to trace over & emit a more concise error
messages for these.

R=
BUG=619149

Review-Url: https://codereview.chromium.org/2060553002
Cr-Commit-Position: refs/heads/master@{#399861}
sigbjornf
Allow prolonged CanvasAsyncBlobCreator lifetime, avoid indirect leaks.
Weakly keeping this async object to avoid resource leaks is problematic
(r399445 + r399675), as the object must remain alive until completed.

Undo that experiment and instead keep the object alive until all its
posted tasks have been processed. But for the task that wins and
is processed first, have it clear out the heap references that
would otherwise keep heavy objects alive.

R=
BUG=

Review-Url: https://codereview.chromium.org/2065913003
Cr-Commit-Position: refs/heads/master@{#399856}
fs
Remove redundant isLayoutSizeChanged check in LayoutSVGText::layout
SVGLayoutSupport::layoutChildren takes care to propagate the needs for
metrics updates via the |screenScalingFactorChanged| and
|layoutSizeChanged| arguments.

BUG=603956

Review-Url: https://codereview.chromium.org/2061793003
Cr-Commit-Position: refs/heads/master@{#399796}
fs
Remove redundant "layout size changed" state from LayoutSVGRoot
In LayoutSVGRoot::layout, two slightly different "layout size changed"
values are computed - one which is used for propagation to children
via SVGLayoutSupport::layoutSizeOfNearestViewportChanged
(|m_isLayoutSizeChanged|), and one which is used to mark direct
descendant children (local |layoutSizeChanged|).
Ultimately their use is the same though, so only using the more narrow
predicate for both of these cases should yield the same result.
It also has the side-effect of making it more obvious that changes to
layout-size is only of interest when there exist clients of the SVG
root that have relative lengths.

BUG=603956

Review-Url: https://codereview.chromium.org/2065093002
Cr-Commit-Position: refs/heads/master@{#399791}
asaka
gn BUILD fixes for disabling enable_extensions and use_ash feature flags.
BUG=

Review-Url: https://codereview.chromium.org/1950003002
Cr-Commit-Position: refs/heads/master@{#399693}
sigbjornf
Revert of Remove ineffective PendingScript prefinalizer (2nd attempt.) (patchset #1 id:1 of https://codereview.chromium.org/2060853002/ )
Reason for revert:
Canary crashes reported,

 https://bugs.chromium.org/p/chromium/issues/detail?id=615977#c12

Original issue's description:
> Remove ineffective PendingScript prefinalizer (2nd attempt.)
>
> With the missing case from r397106 aboard, retire the prefinalizer
> for PendingScript. Script loader and runner objects are expected
> to explicitly dispose of these upon success or failure.
>
> R=
> BUG=
>
> Committed: https://crrev.com/fbf7f01ae80f666a5b37acf0ef38fd174443787f
> Cr-Commit-Position: refs/heads/master@{#399504}

TBR=haraken@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2069573002
Cr-Commit-Position: refs/heads/master@{#399691}
sigbjornf
Have CanvasAsyncBlobCreator's delayed task keep a weak |this| also.
Followup r399445 and dually have the delayed task that's
posted to check if the idle task has gone ahead, also keep
a weak |this| reference. The non-winning CanvasAsyncBlobCreator
posted main thread tasks can safely be cancelled & dropped if
a GC happens to go ahead.

R=
BUG=

Review-Url: https://codereview.chromium.org/2069533002
Cr-Commit-Position: refs/heads/master@{#399675}
robertn
Clear the SharedBuffer when clearing the image
Previously, in the case of the image failing to be decoded, the buffer
was cleared because error() was called. This was changed in the
following patch:

 https://chromium.googlesource.com/chromium/src/+/61e34ff7dd4ac48b8c4275eb3f541ebfb8a50266%5E%21/

The patch changes it so that only clear() is called, which does not
clear the m_data buffer. This patch changes clear() to also clear the
buffer.

BUG=

Review-Url: https://codereview.chromium.org/2060193002
Cr-Commit-Position: refs/heads/master@{#399668}
sigbjornf
gc plugin: remove ScriptWrappable destructor special case.
With Blink having exited its Oilpan transition phase, no need for the
plugin to catch & allow GarbageCollected<>-derived classes that also
derive from ScriptWrappable (but could safely not provide a destructor.)

Remove the unused IsRawPtr(name), IsDummyBase(name) predicates, as well.

R=
BUG=

Review-Url: https://codereview.chromium.org/2061143002
Cr-Commit-Position: refs/heads/master@{#399667}
fs
Rename StyleLayoutData to StyleGeometryData
The term 'geometry' better matches what is stored here (and is also more
in line with the SVG spec chapter [1] that defines most of the properties
here.)
Rename the SVGComputedStyle::layout field to 'geometry' to match.

This is a mechanical rename-only CL, with the exception of some
additional whitespace fixups.

[1] https://svgwg.org/svg2-draft/geometry.html ("Geometry Properties")

BUG=603956

Review-Url: https://codereview.chromium.org/2066563002
Cr-Commit-Position: refs/heads/master@{#399649}
sigbjornf
Remove ineffective PendingScript prefinalizer (2nd attempt.)
With the missing case from r397106 aboard, retire the prefinalizer
for PendingScript. Script loader and runner objects are expected
to explicitly dispose of these upon success or failure.

R=
BUG=

Review-Url: https://codereview.chromium.org/2060853002
Cr-Commit-Position: refs/heads/master@{#399504}
sigbjornf
Have CanvasAsyncBlobCreator speculative idle tasks keep a weak 'this'.
If image encoding should be attempted done via idle tasks,
CanvasAsyncBlobCreator schedules an idle task along with a delayed
task on the main thread to check if the idle task has been scheduled
before too long. If not, the delayed task will handle the encoding
instead (still on the main thread.)

The idle tasks represent opportunistic work, and should not keep the
CanvasAsyncBlobCreator alive until they eventually do get to run.
Consequently, make them keep a weak 'this' reference.

This addresses leaks exposed by r399181.

R=
BUG=
NOTRY=true

Review-Url: https://codereview.chromium.org/2060153002
Cr-Commit-Position: refs/heads/master@{#399445}
sigbjornf
Promptly release cross-thread websocket bridge/proxy references
To prevent other threads using cross-thread persistents from accessing
to-be-finalized websocket Peer and Bridge abstractions, promptly free
them on becoming garbage. Delaying this until lazy sweeping runs risks
(benignly) touching poisoned objects.

R=
BUG=619373

Review-Url: https://codereview.chromium.org/2064633002
Cr-Commit-Position: refs/heads/master@{#399442}
sigbjornf
Move SourceRange and CSSPropertySourceData classes off-heap.
SourceRange is a value/POD class that has no complex
sharing or lifetime handling associated with it. It does not
meet minimal requirements that we've now settled on for when
an object ought to be Oilpan managed -- doesn't have other
heap references nor sharing&lifetime issues that would benefit
from Oilpan use -- hence, we should move it off-heap.

With SourceRange off-heap, a number of classes that package up
SourceRanges in various ways can be converted to off-heap
classes also.

R=
BUG=

Review-Url: https://codereview.chromium.org/2060433002
Cr-Commit-Position: refs/heads/master@{#399428}
sigbjornf
Make trace() over persistents private.
Persistent references register a trace callback with the underlying persistent
node, allowing the Blink GC to trace the persistent root set when marking.

Consequently, there's no need to expose their trace() methods as public
methods. Make them private and thereby disallow calling trace() from
Blink code.

R=
BUG=

Review-Url: https://codereview.chromium.org/2060683002
Cr-Commit-Position: refs/heads/master@{#399423}
sigbjornf
Fix unsafe handling of part object in RuleFeatureSetTest.
The part object needs to be traced; the ad-hoc and unused
trace method used prevented GC plugin detection.

R=
BUG=
NOTRY=true

Review-Url: https://codereview.chromium.org/2063603002
Cr-Commit-Position: refs/heads/master@{#399416}
sigbjornf
Rename and improve "traceable" templates.
The NeedsTracing<T>::value expression would previously return true
if T had a trace() method or T == Member<U>. It would not be
true if T == WeakMember<U>; something that was convenient when
using NeedsTracing<> in connection with hash table backing stores,
needing to determine whether to trace the elements of the table, but
not if they were weak references & delegate that to weak processing.

As NeedsTracing<T> has grown an increasing number of uses besides
the handling of backing store tracing, where exempting WeakMember<>
makes no great sense, it is time to alter its meaning to accommodate
those uses better. And at the same time rename it to follow the various
other predicate templates we provide over types. So,

 NeedsTracing<T> => IsTraceable<T> (includes weak)
 NeedsTracingLazily<T> => IsTraceableInCollection<T> (excludes weak)
 NeedsTracingTrait<Trait> => IsTraceableInCollectionTrait<T>

Along with these changes, tidy up the static_assert() error messages in
a few places.

R=
BUG=

Review-Url: https://codereview.chromium.org/2065443002
Cr-Commit-Position: refs/heads/master@{#399389}
fs
Add use counter for parsing of filter functions with no arguments
Count before deciding the future for this, and related, "features".

BUG=618960

Review-Url: https://codereview.chromium.org/2051233003
Cr-Commit-Position: refs/heads/master@{#399378}
rune
Removed unnecessary mutable in SiblingData.
Seemingly no reason for this mutable anymore.

R=ericwilligers@chromium.org

Review-Url: https://codereview.chromium.org/2057093002
Cr-Commit-Position: refs/heads/master@{#399354}
sigbjornf
Drop unecessary use of CrossThreadPersistent by CanvasAsyncBlobCreator.
The callback object that the CanvasAsyncBlobCreator passes along to a
background thread can be kept as a simple Member<>; no need to
involve CrossThreadPersistent<> and risk inadvertently introducing
leaks.

R=
BUG=

Review-Url: https://codereview.chromium.org/2051993002
Cr-Commit-Position: refs/heads/master@{#399181}
fs
Clamp filter functions {grayscale, invert, opacity, sepia} to 100%
The spec says the following for these functions:

 "Values of amount over 100% are allowed but UAs must clamp the values
  to 1."

So do that rather than failing. This matches the behavior of Gecko and
Edge.

This fixes

http://test.csswg.org/suites/filters-1_dev/nightly-unstable/html/filter-grayscale-005.htm

from the CSS WG Filter Effects testsuite (w/ the property unprefixed.)

BUG=618607

Review-Url: https://codereview.chromium.org/2052883002
Cr-Commit-Position: refs/heads/master@{#399144}
fs
Clean up script-tests in css3/filters
Rewrite the parsing tests using
css-parser/resources/property-parsing-test.js and also use testharness
for the computed style test.

Drop css3/filters/filter-property.html since that is already covered by
the wider parsing tests. Also remove the template html file and inline
the scripts for effect-reference-reset-style-delete-crash.html [1] and
effect-reference-delete-crash.html, clearing out the script-tests sub-
directory.

[1] This test was actually referencing the
    effect-reference-delete-crash.js file, meaning it was a duplicate.

BUG=618607

Review-Url: https://codereview.chromium.org/2055733002
Cr-Commit-Position: refs/heads/master@{#399136}
sigbjornf
Remove unnecessary use of CrossThreadPersistent<>.
The CompositorMutatorImpl object that WebFrameWidgetImpl creates and
controls the lifetime of, should be referenced as a normal Member<>

R=
BUG=

Review-Url: https://codereview.chromium.org/2056833003
Cr-Commit-Position: refs/heads/master@{#399125}
fs
Move ReferenceFilterBuilder::build to FilterEffectBuilder
This function resolves a filter reference and then builds a filter
(sub)DAG for painting. Split it into the two fairly distinct parts,
leaving ReferenceFilterBuilder as a class that only does element
lookup/resolution, while the DAG-building takes place in
FilterEffectBuilder (with a little help from SVGFilterBuilder.)
Use the new function in SVGFilterPainter.

Also pass Element& to ReferenceFilterBuilder::build, and remove a
redundant null-check of ComputedStyle in
PaintLayer::updateOrRemoveFilterEffectBuilder (already checked by
paintsWithFilters and assumed later in the function.)

BUG=109224,533457

Review-Url: https://codereview.chromium.org/2044153002
Cr-Commit-Position: refs/heads/master@{#398866}
sigbjornf
Limit live Document tracking to debug builds.
liveDocumentSet() is only used by a debug entry point, so only extend
it on Document creation in debug builds.

R=
BUG=611702

Review-Url: https://codereview.chromium.org/2052583003
Cr-Commit-Position: refs/heads/master@{#398839}
rune
Make sure CSS agent messages flush before testing.
While working on updating active stylesheets as part of the style and
layout tree update in [1], two inspector tests started failing. The
reason was these tests rely on a console message to trigger a step in
the test after the active stylesheets have been pushed to the inspector
client. But even if the stylesheets were updated in InspectorCSSAgent
before the console message was sent, the console message arrived in the
client before the new active stylesheets. The reason was that the
console message is immediately flushed, while the messages from the
InspectorCSSAgent are lazily flushed from WebDevToolsAgentImpl::
didProcessTask.

I tried to force the active stylesheet update with a forced layout tree
update like this:

  document.documentElement.offsetTop;
  console.log(...);

But, due the console.log message being dispatched first as described
above, I ended up postponing the console.log with a rAF which means it
will run in a later task and the didProcessTask will trigger in between
to flush the active stylesheet message(s).

Note that this was not currently causing any failures. It's done in
preparation for landing changes for 567021 without breaking anything.

Looking at TestExpectations, I noticed crbug.com/597572, which might be
a similar issue.

[1] https://codereview.chromium.org/1913833002/

R=pfeldman@chromium.org,dgozman@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2049283002
Cr-Commit-Position: refs/heads/master@{#398825}
sigbjornf
Mark shouldMarkObject(), arenaForNormalPage() accessors as const.
Also remove some redundant checkHeader() asserts while doing a code
tidying pass.

R=
BUG=

Review-Url: https://codereview.chromium.org/2054673002
Cr-Commit-Position: refs/heads/master@{#398813}
sigbjornf
Simplify contextDestroyed() notifications.
With all lifetime observers now being managed by Oilpan, the
handling of the destruct notification can be made simpler.

R=
BUG=

Review-Url: https://codereview.chromium.org/2045703004
Cr-Commit-Position: refs/heads/master@{#398490}
fs
Drop FilterEffectBuilder::m_referenceFilters
The job of this Vector used to be to keep a reference to the nested
"reference" filters, to avoid them being destroyed. The entire filter
graph/chain is now on the GC heap, and traced via
FilterEffectBuilder::m_lastEffect, so this additional reference is of no
use.

Review-Url: https://codereview.chromium.org/2043013002
Cr-Commit-Position: refs/heads/master@{#398341}
sigbjornf
Clean up markClientsAndObserversFinished().
Simplify transferring a counted element entry from one set to another.

To do so, add generalized version of add() over HashCountedSet that lets
the caller specify a count.

R=
BUG=

Review-Url: https://codereview.chromium.org/2045883002
Cr-Commit-Position: refs/heads/master@{#398275}
mboc
Support underline on Linux again.
BUG=617055

https://codereview.chromium.org/1819753003/ accidentally removed
UNDERLINE style support on Linux. This CL fixes the issue.

Review-Url: https://codereview.chromium.org/2031223003
Cr-Commit-Position: refs/heads/master@{#398102}
rune
Remove unused InspectorFrontend declarations.
There seems to be nothing called InspectorFrontend. Removed unused
forward declarations for it and changed comments to say "frontend"
instead.

R=pfeldman@chromium.org,dgozman@chromium.org

Review-Url: https://codereview.chromium.org/2046433002
Cr-Commit-Position: refs/heads/master@{#398080}
sigbjornf
Remove pre-Oilpan protections from LocalFileSystem.
R=
BUG=

Review-Url: https://codereview.chromium.org/2039713002
Cr-Commit-Position: refs/heads/master@{#398000}
sigbjornf
Improve the HeapListHashSet no-weakness static assert message.
Mention the alternate HeapLinkedHashSet<> if WeakMember<>s are
attempted used with HeapListHashSet<>; for non-trivial reasons,
we only support weakness with the former.

R=
BUG=614112

Review-Url: https://codereview.chromium.org/2034423002
Cr-Commit-Position: refs/heads/master@{#397999}
sigbjornf
Add documentation of SafePointBarrier internal state.
Renamed |m_canResume| to |m_parkingRequested| while doing so,
its (inverted) meaning seems clearer imho in this context.

R=
BUG=

Review-Url: https://codereview.chromium.org/2039793002
Cr-Commit-Position: refs/heads/master@{#397988}
fs
SVGFE{Spot,Distant,Point}LightElement can have non-SVGFE*Lighting parent
Replace ASSERT_NOT_REACHED with a return statement. We already
thoroughly check for valid parent type and only notify them if so.

BUG=518649

Review-Url: https://codereview.chromium.org/2031353002
Cr-Commit-Position: refs/heads/master@{#397941}
fs
Fix Win baselines for r397915
https://chromium.googlesource.com/chromium/src/+/81c0fc6d4

BUG=24826
TBR=robhogan@gmail.com

Review-Url: https://codereview.chromium.org/2040713002
Cr-Commit-Position: refs/heads/master@{#397927}
fs
Fix Win baselines for r397912
https://chromium.googlesource.com/chromium/src/+/59fd991c4

BUG=416535
TBR=chrishtr@chromium.org

Review-Url: https://codereview.chromium.org/2041613002
Cr-Commit-Position: refs/heads/master@{#397926}
sigbjornf
Update thread-local weak processing comments following r397904.
R=haraken
BUG=611702
NOTRY=true

Review-Url: https://codereview.chromium.org/2040703002
Cr-Commit-Position: refs/heads/master@{#397925}
fs
Updated Win10 baselines for SVG shape-rendering tests
 svg/custom/use-referencing-nonexisting-symbol.svg
 svg/custom/shape-rendering.svg

Baselines are the same as the Win7 ones.

TBR=pdr@chromium.org
BUG=614063

Review-Url: https://codereview.chromium.org/2036163002
Cr-Commit-Position: refs/heads/master@{#397923}
sigbjornf
Reset ThreadState weak callback stack before GCing.
In the event a thread gets to participate in more than
one GC before it manages to leave its safe point, clear
out its weak callback stack before initiating a new
GC. Otherwise we risk keeping around weak callbacks to
duplicate or dead objects.

R=
BUG=611702

Review-Url: https://codereview.chromium.org/2036803004
Cr-Commit-Position: refs/heads/master@{#397904}
fs
Reduce LayoutSVGResource*Gradient building dependency on GradientData
The buildGradient() method can just create and return a Gradient instead
of populating the GradientData struct it's being passed.
Also make calculateGradientTransform() use the return value rather than
an out variable, and make it const qualified. Make
platformSpreadMethodFromSVGType static and use Traversal<> sugar in
SVGGradientElement::buildStops.

BUG=614368

Review-Url: https://codereview.chromium.org/2031053004
Cr-Commit-Position: refs/heads/master@{#397763}
rune
Clear media query rulesets on page zoom changes.
Otherwise, resolution media queries won't update properly when page
zoom changes. Changing the deviceScaleFactor already did this. Also,
matchMedia listeners already worked.

BUG=617095

Review-Url: https://codereview.chromium.org/2038793002
Cr-Commit-Position: refs/heads/master@{#397697}
fs
Update Win7 baseline for fast/text/emoji-web-font.html
TBR=bashi@chromium.org
BUG=616969

Review-Url: https://codereview.chromium.org/2033403002
Cr-Commit-Position: refs/heads/master@{#397687}
sigbjornf
Shrink weak hash tables when adding elements, if needed.
Hash tables containing weak references tend to be asymmetrically
handled -- Blink "user code" will add elements to the hash table,
with the garbage collector taking care of removing references
to elements that have no other strong references to keep them
alive. The weak processing of hash tables isn't capable of
shrinking and allocate a new hash table backing store while
running, hence the table entries are only cleared.

Blink code will rarely do manual removals from these
collections, which gives the hash table no opportunity
to actually shrink the capacity of the backing store.
This can lead to hash tables with a very low load factor,
the majority of the entries be deleted and empty slots.

To allow for shrinking to happen over hash tables with
weak references, add() will check if shrinking is required.

R=
BUG=

Review-Url: https://codereview.chromium.org/2034883002
Cr-Commit-Position: refs/heads/master@{#397667}
fs
Revert of Switch WTF::find on LChar to use memchr. (patchset #1 id:1 of https://codereview.chromium.org/1948543004/ )
Reason for revert:
LSAN and MSAN bots appear unhappy:

http/tests/media/media-source/mediasource-is-type-supported.html

crash log for renderer (pid <unknown>):
STDOUT: <empty>
STDERR: =================================================================
STDERR: ==4==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6030000982af at pc 0x00000045811f bp 0x7fff2f309830 sp 0x7fff2f308fe0
STDERR: READ of size 5006 at 0x6030000982af thread T0 (content_shell)
STDERR:     #0 0x45811e in memchr ??:0
STDERR:     #1 0x3c5c419 in find third_party/WebKit/Source/wtf/text/StringImpl.h:532:9
STDERR:     #2 0x3c5c419 in find third_party/WebKit/Source/wtf/text/StringImpl.h:660:0
STDERR:     #3 0x3c5c419 in find third_party/WebKit/Source/wtf/text/WTFString.h:214:0
STDERR:     #4 0x3c5c419 in find third_party/WebKit/Source/wtf/text/WTFString.h:215:0
STDERR:     #5 0x3c5c419 in parameter third_party/WebKit/Source/platform/ContentType.cpp:50:0
STDERR:     #6 0x8d64b7d in isTypeSupported third_party/WebKit/Source/modules/mediasource/MediaSource.cpp:244:33
STDERR:     #7 0x9251198 in isTypeSupportedMethod ./out/Release/gen/blink/bindings/modules/v8/V8MediaSource.cpp:234:32
STDERR:     #8 0x9251198 in isTypeSupportedMethodCallback ./out/Release/gen/blink/bindings/modules/v8/V8MediaSource.cpp:239:0
STDERR:     #9 0x444b759 in Call v8/src/api-arguments.cc:16:3

(https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux_ASAN/24421/layout-test-results/results.html)

Original issue's description:
> Switch WTF::find on LChar to use memchr.
>
> BUG=607208
>
> Committed: https://crrev.com/c9f9af30569ac2cd353e234f569052db6ab436f4
> Cr-Commit-Position: refs/heads/master@{#397568}

TBR=thakis@chromium.org,jbroman@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=607208

Review-Url: https://codereview.chromium.org/2036993002
Cr-Commit-Position: refs/heads/master@{#397664}
fs
Revert of ImageCapture: move mojom from WebKit/public to media/ (patchset #4 id:60002 of https://codereview.chromium.org/2027023002/ )
Reason for revert:
Appears to cause:

imagecapture/getphotocapabilities.html
imagecapture/takephoto.html

to timeout.

(https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Win7/42976/layout-test-results/results.html)

Original issue's description:
> ImageCapture: move mojom from WebKit/public to media/
>
> This CL moves image_capture.mojom from
> {third_party/WebKit/public/platform/modules => media/mojo/interfaces}
> so the generated data types (e.g. PhotoCapabilities{Ptr})
> can be used from both Blink and media/capture locations.
>
> Also capture.gypi is trivially relocated to capture/ folder.
>
> Note that gyp files are -yay!- close to being finally
> removed.
>
> BUG=518807
> CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel,mac_blink_rel,win_blink_rel
>
> Committed: https://crrev.com/64aec45d94682ae3b38c0f1c18ff74cd937ff9b5
> Cr-Commit-Position: refs/heads/master@{#397644}

TBR=dcheng@chromium.org,avi@chromium.org,haraken@chromium.org,rockot@chromium.org,xhwang@chromium.org,dalecurtis@chromium.org,esprehn@chromium.org,mcasas@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=518807

Review-Url: https://codereview.chromium.org/2034003002
Cr-Commit-Position: refs/heads/master@{#397663}
sigbjornf
Sync LeakExpectations following r397405.
TBR=guidou,pkasting
BUG=589802
NOTRY=true

Review-Url: https://codereview.chromium.org/2037613003
Cr-Commit-Position: refs/heads/master@{#397493}
sigbjornf
Adjust representation of liveDocumentSet() to help diagnose instability.
The liveDocumentSet singleton keeps a

 Persistent<HeapHashSet<WeakMember<Document>>,

collection of all the currently live documents. Some crashes are
being reported when this HeapHashSet<>'s weak references are
being processed, indicating that the pointer to the hash table
is misshapen.

To potentially throw some light on how that could come to be,
switch representation to PersistentHeapHashSet<WeakMember<Document>>,
which will keep the hash table wrapper off-heap. That could
help determine if we're dealing with an (Oilpan) heap object
overwrite here.

R=
BUG=611702

Review-Url: https://codereview.chromium.org/2033643003
Cr-Commit-Position: refs/heads/master@{#397436}
sigbjornf
Delay leak reporting until worker in-process proxies have been finalized.
If a document creates a number of workers, terminating these and having
their destruction ripple all the way back to the in-process proxy objects
isn't immediate. But something that needs to complete before the leak
detector can initiate reporting -- an in-process proxy object maintains a
strong reference to the document, and would generate a leak if not
destructed and its garbage having been collected afterwards.

Address the reliability of multi worker shutdown by maintaining a
counter of how many in-process proxy objects are still alive and run
GCs until it drops to zero. Do that at most two times around.

R=haraken,kouhei
BUG=589802, 616714

Review-Url: https://codereview.chromium.org/2026993004
Cr-Commit-Position: refs/heads/master@{#397405}
sigbjornf
Avoid unnecessary uses of GarbageCollectedFinalized<>.
R=
BUG=

Review-Url: https://codereview.chromium.org/2027333003
Cr-Commit-Position: refs/heads/master@{#397402}
mboc
Allow various font weights in gfx. These changes make Chromium's gfx::Font more closely match native font APIs &
capabilities.

BUG=597533
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review-Url: https://codereview.chromium.org/1819753003
Cr-Commit-Position: refs/heads/master@{#397368}
fs
Remove expectation for svg/W3C-SVG-1.1/struct-frag-02-t.svg
No longer appears to exhibit the behavior described. Give it a try
again.

TBR=davve@opera.com
BUG=518005,463358

Review-Url: https://codereview.chromium.org/2033663002
Cr-Commit-Position: refs/heads/master@{#397342}
sigbjornf
Delay leak reporting until worker in-process proxies have been finalized.
If a document creates a number of workers, terminating these and having
their destruction ripple all the way back to the in-process proxy objects
isn't immediate. But something that needs to complete before the leak
detector can initiate reporting -- an in-process proxy object maintains a
strong reference to the document, and would generate a leak if not
destructed and its garbage having been collected afterwards.

Address the reliability of multi worker shutdown by maintaining a
counter of how many in-process proxy objects are still alive and run
GCs until it drops to zero. Do that at most two times around.

For documents not creating any workers, monitoring this proxy count
avoids having to perform a third GC, something that was conservatively
done before to address worker shutdown (but not reliably.)

R=haraken,kouhei
BUG=589802

Review-Url: https://codereview.chromium.org/2026993004
Cr-Commit-Position: refs/heads/master@{#397333}
fs
Don't use hasAttribute in SVGFilterPrimitiveStandardAttributes
Use isSpecified() to query for existance in setStandardAttributes. This
avoids triggering unnecessary attribute synchronizations.

While here, drop the "double precondition" checking since the only caller
of this function checks this already.

BUG=235256

Review-Url: https://codereview.chromium.org/2026343002
Cr-Commit-Position: refs/heads/master@{#397202}
sigbjornf
Have detached ScriptLoaders detach their PendingScripts.
A ScriptLoader that has become detached from its document will not
execute the script once the script resource has loaded.

If in such a detached state, make sure the ScriptLoader lets go
of its PendingScript promptly.

R=
BUG=

Review-Url: https://codereview.chromium.org/2028613002
Cr-Commit-Position: refs/heads/master@{#397106}
rune
Adjust color for printing list-item markers as we do for text.
BUG=459022

Review-Url: https://codereview.chromium.org/2027653004
Cr-Commit-Position: refs/heads/master@{#397099}
mostynb
remove unused courgette dep from the content layer
Review-Url: https://codereview.chromium.org/2024693002
Cr-Commit-Position: refs/heads/master@{#396968}
sigbjornf
Restore PendingScript prefinalizer.
Under some as yet unknown conditions, PendingScript objects can become garbage
without having been explicitly detached/disposed of first. Hence restore the
prefinalizer that r396656 removed.

R=
BUG=615977

Review-Url: https://codereview.chromium.org/2021773004
Cr-Commit-Position: refs/heads/master@{#396813}
sigbjornf
Address ThreadHeap::willObjectBeLazilySwept() corner case.
If willObjectBeLazilySwept(object) was used when finalizing an object on a
lazily swept page, and |object| happened to reside on the same heap page,
the predicate would return the wrong result if the object had been swept
past (and it had been deemed to be alive.)

Addressed by adding a special case for querying objects on the same page,
making willObjectBeLazilySwept() precisely determine liveness in the
face of lazy sweeping.

R=
BUG=

Review-Url: https://codereview.chromium.org/2015173003
Cr-Commit-Position: refs/heads/master@{#396798}
sigbjornf
Statically disallow delete' over heap collection objects.
Explicitly deleting heap-allocated heap collection objects isn't
allowed nor meaningful, the garbage collector handles their lifetimes
precisely. The implementation of 'delete' over these collection objects
delegate to a allocator-trait class's free() method, so by not providing
it for heap collection objects, compilation fails if 'delete' is ever
attempted instantiated & used over these objects.

As MSVC performs method instantiation more eagerly, we're unable to
statically catch such inappropriate uses of 'delete' at compile time.
Rely on a run-time NOTREACHED() instead.

R=
BUG=

Review-Url: https://codereview.chromium.org/2021103002
Cr-Commit-Position: refs/heads/master@{#396788}
sigbjornf
Make reallocation of large objects reliable.
If ThreadHeap::reallocate<T>() is called with a size that's
equal or greater to the large object threshold (64k, currently),
make sure it ends up being allocated as a large object.

Large objects would previously be attempted allocated on a normal arena,
hoping that the allocation couldn't be serviced by bump allocation, but
fall into an out-of-line allocation.

R=
BUG=

Review-Url: https://codereview.chromium.org/2019273002
Cr-Commit-Position: refs/heads/master@{#396712}
davve
Tune down debugging emergency for clearAnimatedType() a notch
Fixing re-entrancy into the animation code through the garbage
collector is proving to be a non-trivial task. Since we now know more
about the issue, downgrade the RELEASE_ASSERT to a DCHECK to not
affect more users than necessary while getting this bug sorted out.

BUG=613709

Review-Url: https://codereview.chromium.org/2019223003
Cr-Commit-Position: refs/heads/master@{#396705}
fs
Win7 baseline for svg/dynamic-updates/SVGFEBlendElement-dom-in2-attr.html
TBR=wkorman@chromium.org
BUG=614425

Review-Url: https://codereview.chromium.org/2008553009
Cr-Commit-Position: refs/heads/master@{#396702}
tmoniuszko
Fix Visual Studio warning on single file compilation
BUG=615402

Review-Url: https://codereview.chromium.org/2018733003
Cr-Commit-Position: refs/heads/master@{#396693}
sigbjornf
(Heap)TerminatedArrayBuilders are stack allocated.
HeapTerminatedArrayBuilder is currently only safe if kept on the stack,
restrict it accordingly + have it keep a Member<> reference to the
HeapTerminatedArray it is constructing.

R=tkent,haraken
BUG=

Review-Url: https://codereview.chromium.org/2021713002
Cr-Commit-Position: refs/heads/master@{#396677}
sigbjornf
Turn ResourceLoaderSet into a part object.
The abstraction is really a derived HashSet, so make it
a part object.

(Change done in part to diagnose what appears to be a
heap overwrite involving ResourceLoaderSet.)

R=
BUG=615673

Review-Url: https://codereview.chromium.org/2019903002
Cr-Commit-Position: refs/heads/master@{#396657}
sigbjornf
Tidy PendingScript.
No need for a prefinalizer as ScriptLoader is careful to eagerly and
explicitly dispose of PendingScripts already.

Remove unwanted copy constructor; not needed after PendingScript stopped
being a part object.

R=
BUG=

Review-Url: https://codereview.chromium.org/2023683002
Cr-Commit-Position: refs/heads/master@{#396656}
sigbjornf
Revert of Expand WTF::StringView's API to be more like StringPiece. (patchset #12 id:220001 of https://codereview.chromium.org/2007103003/ )
Reason for revert:
Many a heap-buffer-overflow ASan failures,

 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/builds/24329

Original issue's description:
> Expand WTF::StringView's API to be more like StringPiece.
>
> StringView no longer owns the string passed into it, and can now wrap
> a raw ptr to some characters.
>
> This allows us to leverage the inline strlen optimization where the
> compiler will embed the length of literal strings into the binary. It
> also allows the deletion many overloaded methods that used to take
> an LChar*, UChar* or String and can now just take a StringView instead.
>
> For example the two constructors in TextRun are now a single one that
> takes a StringView. This needed to be done in this patch to avoid
> ambiguous constructors.
>
> Future patches will replace CSSParserString with StringView, and also
> vastly simplify the huge number of overloads on various methods. We'll
> also expand the API surface of StringView to include the many useful
> operations that StringPiece has.
>
> BUG=615174
>
> Committed: https://crrev.com/330deea56e27bc760fa52101040a51428bb7f582
> Cr-Commit-Position: refs/heads/master@{#396493}

TBR=haraken@chromium.org,jyasskin@chromium.org,yutak@chromium.org,esprehn@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=615174

Review-Url: https://codereview.chromium.org/2025503002
Cr-Commit-Position: refs/heads/master@{#396641}
sigbjornf
Revert of Remove StringBuilder::appendLiteral. (patchset #1 id:1 of https://codereview.chromium.org/2017053003/ )
Reason for revert:
Will unfortunately have to back out this one so that the revert https://codereview.chromium.org/2025503002/ will cleanly apply.

(Don't want a tree with this many ASan failures over the long weekend.)

Original issue's description:
> Remove StringBuilder::appendLiteral.
>
> We can just rely on the append(StringView) version instead. This does
> mean we have to take 2 branches in some cases, but it should be
> very minimal and since the code is inline the compiler can also
> likely eliminate it.
>
> BUG=615174
>
> Committed: https://crrev.com/04157e8b89881d033f9eeca4466d9dd0c4e9aaea
> Cr-Commit-Position: refs/heads/master@{#396601}

TBR=haraken@chromium.org,yutak@chromium.org,esprehn@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=615174

Review-Url: https://codereview.chromium.org/2017303002
Cr-Commit-Position: refs/heads/master@{#396640}
sigbjornf
Lock CrossThreadPersistentRegion until end of weak processing.
Allocating & releasing a CrossThread(Weak)Persistent is something that
all threads are currently allowed, even those not attached to Oilpan and
having no heap of their own. It is however not safe for the set of
CrossThreadPersistents to be altered while a garbage collection is
underway.

Not just while the set of registered persistents are being marked and
traced, but up until and including the processing of weak (persistent)
references that happen after marking. If not, a thread would be able to
release a CrossThreadWeakPersistent node which the weak processing separately
maintains a pointer to, clearing & freeing its allocation. Which would
cause havoc, hence we impose a lock on CrossThreadPersistentRegion while
the marking and global weak processing is being performed -- any thread
attempting to create or free cross-thread persistents will be locked out
for the duration.

Following r396432, the use of CrossThreadPersistents from non-attached threads
has been reduced greatly and is slight.

R=
BUG=610477

Review-Url: https://codereview.chromium.org/2013173002
Cr-Commit-Position: refs/heads/master@{#396540}
sigbjornf
Move MainThreadTaskRunner off Oilpan heap to simplify posting.
Having the Document's MainThreadTaskRunner on the Oilpan heap
is preferable for three reasons:

 - Correctly accounts for the MainThreadTaskRunner::m_context
   back reference, by having it be traced Member<>.
 - The MainThreadTaskRunner must not perform tasks when
   it (and the Document) is in the process of being swept.
   By having the posted tasks keep a weak persistent reference
   to MainThreadTaskRunner, the Oilpan GC will ensure that
   the weak references will be cleared once MainThreadTaskRunner
   has been deemed garbage.
 - Similarly for the timer-initiated running of a
   MainThreadTaskRunner's pending tasks. The Timer<> abstraction
   takes care of not firing a timer if its owner is an
   Oilpan heap object that's about to be swept.

But it is not without downsides:

 - A CrossThreadWeakPersistent<> has to be created for every
   task closure posted to the main thread, and copying that
   persistent reference around while creating the closure,
   something that is not without overhead.
 - Threads not attached to Oilpan needing to post tasks to
   the main thread will have to create these persistents also.
   Having that happen when a GC is in progress is hard to support,
   as it risks introducing and removing persistent heap references
   in ways that interfere with the GC processing the heap.

The latter point is sufficient reason not to require the
allocation of CrossThreadWeakPersistent<>s when posting main
thread tasks, hence MainThreadTaskRunner is moved off the
Oilpan heap. By doing so, the benefits above that the Oilpan GC
infrastructure provided "for free" have to be taken care of
manually. C'est la vie.

R=
BUG=610477

Review-Url: https://codereview.chromium.org/1938313003
Cr-Commit-Position: refs/heads/master@{#396432}
rogerj
network_time_tracker: Add missing gyp dependencies
Fixup for https://codereview.chromium.org/1835823002.

That CL only added the required dependencies to BUILD.gn. This CL adds
the dependencies to the gyp target as well.

BUG=589700

Review-Url: https://codereview.chromium.org/2006733007
Cr-Commit-Position: refs/heads/master@{#396420}
sigbjornf
Test that failed sync scripts do not block later ones.
If an async=false script fails to load, it must not block later
sync scripts from executing; add missing test coverage.

R=
BUG=614855, 581425

Review-Url: https://codereview.chromium.org/2010983002
Cr-Commit-Position: refs/heads/master@{#396253}
sigbjornf
Tidy up MediaStreamSource details.
Follow up on r396039, undoing some inconsistencies.

R=
BUG=

Review-Url: https://codereview.chromium.org/2010963002
Cr-Commit-Position: refs/heads/master@{#396231}
mstensho
Don't explicitly initialize LayoutUnit to 0.
The default LayoutUnit() constructor sets it to 0. Explicitly passing 0 means
that LayoutUnit::setValue() will be involved, which performs (in this case:
very pointless) saturation checks.

Review-Url: https://codereview.chromium.org/2015523004
Cr-Commit-Position: refs/heads/master@{#396223}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in web/
BUG=614015
TBR=aelias@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2016673002
Cr-Commit-Position: refs/heads/master@{#396162}
mstensho
Remove unnecessary includes from Document.h
BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2007343002
Cr-Commit-Position: refs/heads/master@{#396148}
fs
Attempt to deflake svg/custom/animate-initial-pause-unpause.html
The timeout could race with load and that animation timeline start.
Happened at least once in 1000 runs.

Make sure to wait for an animation frame before setting the timer (the
animation timeline has its zero at the time of 'load'.) Also, rewrite
the test to use testharness.js. No failures in 1000 runs.

BUG=350828

Review-Url: https://codereview.chromium.org/2009263002
Cr-Commit-Position: refs/heads/master@{#396147}
mstensho
Remove assorted unnecessary includes in core/paint/
I was mainly looking at inclusions of LayoutObject-derived header files, but
removed some others as well, while I was at it.

BUG=614015
TBR=chrishtr@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2010823002
Cr-Commit-Position: refs/heads/master@{#396037}
fs
Rework timeline/frame scheduling logic for SVGImage
This CL provides the SVGImage/SVGImageChromeClient complex with the
capability of suspending and resuming the frame/animation tick.
This gives us the mechanism required to respond to
ImageObserver::shouldPauseAnimation, as well as stopping the animation
timer from running after the animation has been reset (via
Image::resetAnimation.)
In the context of the bug referenced this means an animating SVG image
will no longer cause wakeups because of (unnecessary) timer activity,
saving power (and CPU time.)

Implement willRenderImage() for the CrossfadeSubimageObserverProxy of
CSSCrossfadeValue so that it will not (falsely) claim that it won't
render its images.

While doing this, try to make a decent functional split between SVGImage
and the associated SVGImageChromeClient by putting all timeline/frame tick
related code in the latter, while keeping code related to the actual
animation/document lifecycle update in the former.

BUG=612540

Review-Url: https://codereview.chromium.org/2000483003
Cr-Commit-Position: refs/heads/master@{#396009}
mstensho
Move ScrollBehavior to ScrollTypes.h, so that ComputedStyle.h doesn't need to include ScrollableArea.h.
BUG=614015

Review-Url: https://codereview.chromium.org/2008343002
Cr-Commit-Position: refs/heads/master@{#395994}
mstensho
Remove assorted unnecessary includes in core/layout/
I was mainly looking at inclusions of LayoutObject-derived header files, but
removed some others as well, while I was at it.

BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2015583003
Cr-Commit-Position: refs/heads/master@{#395993}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in core/html/
BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2008843004
Cr-Commit-Position: refs/heads/master@{#395984}
mstensho
Enums recently moved to separate files should still be in the blink namespace.
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2007423002
Cr-Commit-Position: refs/heads/master@{#395978}
mstensho
ComputedStyle.h doesn't need CSSPrimitiveValue.h if adjustForAbsoluteZoom(int, float) isn't inline.
BUG=614015

Review-Url: https://codereview.chromium.org/2013833002
Cr-Commit-Position: refs/heads/master@{#395943}
mstensho
Move CSSPropertyID templates instantiations to a separate file.
core/CSSPropertyNames.h is needed a lot of places, but the template part there
was only required at a few places.

BUG=614015

Review-Url: https://codereview.chromium.org/2007073003
Cr-Commit-Position: refs/heads/master@{#395941}
mstensho
Move ContentChangeType enum to a separate file, so that WebGLRenderingContextBase.h doesn't need LayoutBoxModelObject.h
BUG=614015
TBR=bajones@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2013603003
Cr-Commit-Position: refs/heads/master@{#395934}
fs
Update baseline for svg/animations/smil-leak-element-instances.svg
This updates the baseline after the change made by
https://codereview.chromium.org/1992663003 (line number added to error
output.)

TBR=pdr@chromium.org
BUG=356900

Review-Url: https://codereview.chromium.org/2007323002
Cr-Commit-Position: refs/heads/master@{#395925}
mstensho
Remove unnecessary includes of LayoutBlock-derived headers.
BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2007133003
Cr-Commit-Position: refs/heads/master@{#395904}
mstensho
Remove unnecessary includes from ComputedStyle.h and from its includes.
BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2008263002
Cr-Commit-Position: refs/heads/master@{#395889}
mstensho
Remove unnecessary includes from LayoutBox.h, LayoutBoxModelObject.h and LayoutObject.h
Also removed a couple of unnecessary includes from files included via LayoutObject.h

BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2010713002
Cr-Commit-Position: refs/heads/master@{#395877}
mstensho
Move BorderEdgeFlags out of LayoutBoxModelObject.h, so that BoxBorderPainter.h doesn't have to include it.
BUG=614015
TBR=chrishtr@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2010613003
Cr-Commit-Position: refs/heads/master@{#395875}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in core/frame/
BUG=614015
TBR=dcheng@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2011883002
Cr-Commit-Position: refs/heads/master@{#395872}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in core/animation/
BUG=614015
TBR=alancutter@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2009583003
Cr-Commit-Position: refs/heads/master@{#395871}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in modules/accessibility/
BUG=614015
TBR=dmazzoni@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2012723003
Cr-Commit-Position: refs/heads/master@{#395870}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in core/dom/
BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2008053002
Cr-Commit-Position: refs/heads/master@{#395864}
mstensho
SnapCoordinator.h doesn't need to include LayoutBox.h
BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2010513004
Cr-Commit-Position: refs/heads/master@{#395859}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in core/editing/
BUG=614015
TBR=yosin@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2009013002
Cr-Commit-Position: refs/heads/master@{#395855}
mstensho
SVGTextContentElement.cpp doesn't need to include LayoutObject.h
BUG=614015
TBR=fs@opera.com,eae@chromium.org

Review-Url: https://codereview.chromium.org/2011603002
Cr-Commit-Position: refs/heads/master@{#395854}
mstensho
HitRegion.cpp doesn't need to include LayoutBoxModelObject.h
BUG=614015
TBR=junov@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2010633002
Cr-Commit-Position: refs/heads/master@{#395852}
mstensho
StyleGeneratedImage.cpp doesn't need to include LayoutObject.h
BUG=614015
TBR=eae@chromium.org

Review-Url: https://codereview.chromium.org/2005353002
Cr-Commit-Position: refs/heads/master@{#395851}
mstensho
WebGLRenderingContext.cpp doesn't need to include LayoutBox.h
BUG=614015
TBR=bajones@chromium.org,eae@chromium.org
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2010623002
Cr-Commit-Position: refs/heads/master@{#395846}
mstensho
Eliminate unnecessary includes and pointless forward declarations in LayoutBlock.h
BUG=614015
TBR=eae@chromium.org,szager@chromium.org,wkorman@chromium.org

Review-Url: https://codereview.chromium.org/2010473002
Cr-Commit-Position: refs/heads/master@{#395845}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in core/inspector/
BUG=614015
TBR=dgozman@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2002153004
Cr-Commit-Position: refs/heads/master@{#395838}
mstensho
Remove unnecessary inclusions of LayoutObject-derived headers in core/animation/
BUG=614015
TBR=alancutter@chromium.org,eae@chromium.org

Review-Url: https://codereview.chromium.org/2006223003
Cr-Commit-Position: refs/heads/master@{#395832}
sigbjornf
Remove unnecessary HelperResultType trait.
Leftover from Oilpan transition.

R=
BUG=

Review-Url: https://codereview.chromium.org/2015453003
Cr-Commit-Position: refs/heads/master@{#395831}
fs
Attempt to deflake svg/text/obb-paintserver.html
Use the ahem.js script to provide the "Ahem" font.

BUG=362501

Review-Url: https://codereview.chromium.org/2005253002
Cr-Commit-Position: refs/heads/master@{#395819}
mstensho
Move TextAutosizer::Cluster::Cluster() implementation to .cpp.
This way we won't have to include LayoutObject.h in the header.

Also need an explicit ~TextAutoSizer() in the .cpp file now, because
ComputedStyle is only forward-declared in the header file, and TextAutoSizer
has a ComputedStyle RefPtr Vector. The need for this was presumably introduced
by https://codereview.chromium.org/1999343002

BUG=614015

Review-Url: https://codereview.chromium.org/2004313005
Cr-Commit-Position: refs/heads/master@{#395773}
mstensho
Move BackgroundBleedAvoidance definition to a separate file.
This way BoxDecorationData.h doesn't need to include LayoutBoxModelObject.h

BUG=614015

Review-Url: https://codereview.chromium.org/2007673004
Cr-Commit-Position: refs/heads/master@{#395745}
mstensho
Add ScrollEnums.h, so that PaintLayerScrollableArea.h doesn't have to include LayoutBox.h
BUG=614015

Review-Url: https://codereview.chromium.org/2008063002
Cr-Commit-Position: refs/heads/master@{#395702}
sigbjornf
Drop unique audio thread ID requirement.
r391848 introduced the requirement that, once set, the audio thread ID
could not be changed. This is proving too burdensome a constraint to
keep, in case audio device threads do end up being stopped and new
ones created.

While r395182 took care of some cases where audio threads end up
stopping, carefully resetting the recordeed audio thread ID, other
cases remain (see associated bug.) While those could be similarly
handled, precisely tracking the current audio thread ID is proving
to not be worth the overhead. Hence, retire the constraint and let
the audio thread processing a render quantum set its thread ID as
part of executing, irrespective of what audio thread executed
the previous quantum.

This effectively reverts r395182.

R=
BUG=613902

Review-Url: https://codereview.chromium.org/2008903002
Cr-Commit-Position: refs/heads/master@{#395682}
mstensho
Move continuation getter and setter down to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1997033002
Cr-Commit-Position: refs/heads/master@{#395681}
sigbjornf
Gracefully handle dirtying of audio nodes while processing current set.
When processing the set of dirty output nodes, nodes further down the
chain may be marked as dirty as a result. Take that into account
when iterating over the current set.

R=hoch
BUG=610643, 613902

Review-Url: https://codereview.chromium.org/2006883002
Cr-Commit-Position: refs/heads/master@{#395643}
mstensho
Only re-use an anonymous block for continuations if it's contained by a block flow.
Be more strict about what kind of anonymous blocks we allow to be re-used for
continuations. The deprecated flex box implementation would actually let items
of a flexbox form a continuation chain. Continuations should only exist in
block formatting contexts.

This was discovered while attempting to land
https://codereview.chromium.org/1997033002/ , which, it turns out, made some
invalid assumptions about objects being block flows.

BUG=302024

Review-Url: https://codereview.chromium.org/2004363003
Cr-Commit-Position: refs/heads/master@{#395614}
mpawlowski
net::AddressList no longer privately inherits from std::vector
The private inheritance was not only against the style guide, it also
forbade anyone from using a standalone std::vector<net::IPEndPoint>,
since the manually defined AddressList ctor/dtor conflicted with
automatically generated ones for vector<T> instantiation.

This should be considered a first step of refactoring that class.
AddressList is neither a list, nor does it store addresses,
it's a vector of endpoints, so the name is misleading. It
should be changed.

The canonical_name_ member is only currently used in
PepperHostResolverMessageFilter, it's probably not the best idea to keep
it around in a generic class like this. Grepping AddressList reveals 500+
instances in the codeebase, and ony one use of canonical_name() outside
of unit tests. Perhaps a pair<AddressList, string> should be used for
that one particular use-case and a bare AddressList without that extra
member should be used everywhere else.

This "conservative" approach, with employing composition instead of
inheritance and delegating method calls was suggested by Nico Weber and
indeed that meant not having to change anything but the header.

Review-Url: https://codereview.chromium.org/2003973002
Cr-Commit-Position: refs/heads/master@{#395605}
fs
Fix typo in svg/dynamic-updates/SVGFEBlendElement-dom-in2-attr.html
This test is not intended to test error-handling, so add the missing '#'.

https://bugs.webkit.org/show_bug.cgi?id=158017

BUG=614306

Review-Url: https://codereview.chromium.org/2004023002
Cr-Commit-Position: refs/heads/master@{#395597}
rune
Rewrote :empty tests to avoid list-item bug.
Run :empty tests as js-tests instead of layout tree dumps. The issue
causing the original test to be flaky is reported as crbug.com/613957.

R=bugsnash@chromium.org
BUG=610180

Review-Url: https://codereview.chromium.org/2006633002
Cr-Commit-Position: refs/heads/master@{#395582}
ckulakowski
Added missing include to profile_helper.h
profile_helper.h uses ProfileMetrics::ProfileDelete defined in
profile_metrics.h so it should be included. Lack of this include
causes compilation error in our product.

BUG=

Review-Url: https://codereview.chromium.org/2002073003
Cr-Commit-Position: refs/heads/master@{#395573}
mstensho
Declare methods defined in LayoutObjectInlines.h as inline.
This way we'll detect a failure to include LayoutObjectInlines.h during
compilation, rather than during linking.

Test case: Remove inclusion of LayoutObjectInlines.h from LayoutBR.cpp.

See https://codereview.chromium.org/2008503003/ - I initially tried
to simply remove LayoutView.h from LayoutBR.cpp's include list, but
got "strange" linker errors in release builds, since the compiler
thought styleRef(bool) was an actual function, and not an inline.

BUG=614015

Review-Url: https://codereview.chromium.org/2007723002
Cr-Commit-Position: refs/heads/master@{#395558}
sigbjornf
Remove unwanted copyToVector() uses.
If a collection is being cleared while creating an iterable
view of its current contents, swap in an empty collection
rather than copy out the current contents into a temporary
vector (by way of copyToVector().)

R=tkent
BUG=

Review-Url: https://codereview.chromium.org/2004343002
Cr-Commit-Position: refs/heads/master@{#395547}
mstensho
Eliminate unnecessary includes of LayoutBlockFlow-derived headers.
BUG=614015

Review-Url: https://codereview.chromium.org/2008503003
Cr-Commit-Position: refs/heads/master@{#395472}
sigbjornf
Revert InstrumentingAgents back to being GarbageCollected<>.
Unnecessary to have this class be finalized, so switch back to
GarbageCollected<>.

R=
BUG=

Review-Url: https://codereview.chromium.org/2003033002
Cr-Commit-Position: refs/heads/master@{#395446}
tsniatowski
Fix a generated header build flake in //media/base/android
BUG=

Review-Url: https://codereview.chromium.org/2004813003
Cr-Commit-Position: refs/heads/master@{#395421}
mstensho
Move LineLayoutState forward declaration to LayoutBlockFlow.
And the friend declaration was unnecessary.

BUG=302024

Review-Url: https://codereview.chromium.org/2007543002
Cr-Commit-Position: refs/heads/master@{#395352}
mstensho
Move LayoutInline forward-declaration to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/2005813003
Cr-Commit-Position: refs/heads/master@{#395350}
davve
Apply scoped_ptr -> std::unique_ptr conversion to comment
date_time_picker_client_ is a std::unique_ptr now.

R=avi
NOTRY=true

Review-Url: https://codereview.chromium.org/2003963002
Cr-Commit-Position: refs/heads/master@{#395331}
sigbjornf
Split out Members, Persistents and SelfKeepAlive in separate headers.
Complete the migration of definitions out of Handle.h, adding new
header files for the family of Member<> types that Oilpan supports.
Similarly for Persistent<> and its variants, and the SelfKeepAlive<>
abstraction.

To further prune Handle.h, let go of the unused ScopedDisposal (light)
abstraction.

R=
BUG=

Review-Url: https://codereview.chromium.org/1999363002
Cr-Commit-Position: refs/heads/master@{#395318}
sigbjornf
Revert of MediaCaptureFromElement: add support for audio captureStream(). (patchset #6 id:760001 of https://codereview.chromium.org/1599533003/ )
Reason for revert:
The layout tests added are flakily crashing on various bots,

 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Leak/builds/19683
 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux/builds/65000

Original issue's description:
> MediaCaptureFromElement: add support for audio captureStream().
>
> This CL extends support for capturing the audio part of
> a <video> or <audio> tags ( "capture" here means creating
> a MediaStream out of the HTMLElement)
>
> It introduces an HtmlAudioCapturerSource is-a AudioCapturerSource
> wrapped into an ExternalMediaStreamAudioSource to produce data
> towards the audio track.
>
> HtmlAudioCapturerSource also plugs into the
> WebMediaPlayer's WebAudioSourceProviderImpl to get
> a copy of the audio being rendered.
>
> Unit tests are added, and the existing LayouTests
> revamped (and split into several files for clarity).
>
> BUG=569976, 575492
>
> TEST= run chromium with
>  --enable-blink-features=MediaCaptureFromVideo
>  against e.g.
> https://rawgit.com/Miguelao/demos/master/videoelementcapture.html
>
> Committed: https://crrev.com/77d0d446e58afbf7fab215113fcf9fe9c97e94e3
> Cr-Commit-Position: refs/heads/master@{#395205}

TBR=esprehn@chromium.org,avi@chromium.org,dalecurtis@chromium.org,haraken@chromium.org,miu@chromium.org,mcasas@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=569976, 575492
NOTRY=true

Review-Url: https://codereview.chromium.org/2007433002
Cr-Commit-Position: refs/heads/master@{#395298}
sigbjornf
Unify and provide one IsGarbageCollectedType<T> implementation.
Phase out the need and use of the older blink::IsGarbageCollected<T>
template, and go with the "marker-based" implementation that WTF
provides. But extended slightly to handle mixins without ambiguity +
it will now insist on T's definition being in scope when used so as to be
able to function reliably.

That latter change requires a few uses of collection types (vectors,
hash maps) to be adjusted so that the full element type of the collection
is in scope when code using the collection is compiled. The reason for
this constraint is that the collection types stringently checks that
Blink GCed objects aren't kept in off-heap collections.

R=
BUG=

Review-Url: https://codereview.chromium.org/1999343002
Cr-Commit-Position: refs/heads/master@{#395287}
sigbjornf
Tidy AutoplayExperimentHelper.
Remove unused and undefineds.

R=
BUG=

Review-Url: https://codereview.chromium.org/2000023002
Cr-Commit-Position: refs/heads/master@{#395286}
tposluszny
Exclude unit tests depending on FFMPEG, when FFMPEG is not used.
BUG=612164

Review-Url: https://codereview.chromium.org/1978263002
Cr-Commit-Position: refs/heads/master@{#395267}
sigbjornf
Clear DeferredTaskHandler's audio thread ID upon the thread going away.
Tracking the thread ID of the (current) audio thread is needed to both
sanity check that code paths and methods are performed on the expected
thread, and ensure safe operation.

In the rare cases where the recorded audio thread is stopped and
terminated by the embedder, first clear out the associated thread
ID. This is needed should a new thread be subsequently created.

R=
BUG=612127

Review-Url: https://codereview.chromium.org/2001533002
Cr-Commit-Position: refs/heads/master@{#395182}
mstensho
Remove LayoutInline::createAnonymous() - no callers
Review-Url: https://codereview.chromium.org/2001723002
Cr-Commit-Position: refs/heads/master@{#395132}
mstensho
LayoutInline continuation unit test.
Review-Url: https://codereview.chromium.org/2001623002
Cr-Commit-Position: refs/heads/master@{#395111}
mstensho
Keep writing-mode in sync between a column spanner and its placeholder.
Don't exclude LayoutMultiColumnSpannerPlaceholder (which is just a LayoutBox)
in propagateStyleToAnonymousChildren(). There was an optional requirement for
the child to be LayoutBlock or better, but there really doesn't seem to be
any point in doing this. We no longer create anonymous LayoutInline objects,
ever, anyway (will file a separate CL to remove some unneeded support code
for that in LayoutInline).

All we need to do now is to steer clear of such anonymous objects that have
custom ways of inheriting style. LayoutFullScreen and
LayoutFullScreenPlaceholder were already taken care of. Now that we always
try to propagate style to non-LayoutBlock objects as well, we need to avoid
LayoutListMarker too.

BUG=608123

Review-Url: https://codereview.chromium.org/2000683002
Cr-Commit-Position: refs/heads/master@{#395107}
mostynb
only use kAccessibilityEnabled inside USE_GCONF ifdef blocks
Followup to:
https://codereview.chromium.org/1990453002
https://codereview.chromium.org/1988213002

BUG=486077

Review-Url: https://codereview.chromium.org/1989233002
Cr-Commit-Position: refs/heads/master@{#395047}
sigbjornf
Sync LeakExpectations.
Retire some entries that are no longer leaking.

R=
BUG=506757, 538524, 546132
NOTRY=true

Review-Url: https://codereview.chromium.org/2001563002
Cr-Commit-Position: refs/heads/master@{#395042}
sigbjornf
Eagerly remove disposed DOMTimers as observers upon completion.
Once the coordinator lets go of a timer, no need to keep it
around as an observer of the ExecutionContext.

The previous, reverted, attempt (r392309) detached the DOMTimer too
soon, causing DOMTimer nesting levels to grow without being reset.

R=haraken
BUG=

Review-Url: https://codereview.chromium.org/1972663002
Cr-Commit-Position: refs/heads/master@{#395012}
sigbjornf
Graceful idle callback cancellation with invalid IDs.
R=
BUG=613073

Review-Url: https://codereview.chromium.org/1989363005
Cr-Commit-Position: refs/heads/master@{#394768}
mharanczyk
Clean up code and logic related to platform accessibility node destruction.
Review-Url: https://codereview.chromium.org/1987213002
Cr-Commit-Position: refs/heads/master@{#394733}
mstensho
Move m_lineBoxes and its getters down to LayoutBlockFlow.
Added SameSizeAsLayoutBlockFlow, since it was missing.

BUG=302024

Review-Url: https://codereview.chromium.org/1993943002
Cr-Commit-Position: refs/heads/master@{#394728}
davve
Lock animated property type of result animation during processing
There seems to be a crash due to the animated property type being
cleared too early. To catch this crash at the point of error, lock the
animated property type of the result animation during processing, and
guard for clearing the animation property while the lock is held (in
clearAnimatedType()).

This can potentially be removed when the source of the bug is found.

BUG=581546

Review-Url: https://codereview.chromium.org/1991513003
Cr-Commit-Position: refs/heads/master@{#394726}
davve
Move clearAnimatedType() up the stack
This is in preparation for locking the animated property type for the
resulting animation while the accumulated animation is computed. There
seems to be a crash due to the animated property type being cleared
too early. To catch this crash at the point of error, the plan is to
lock the animated property type of the result animation during
processing, and guard for clearing the animation property while the
lock is held (in clearAnimatedType()).

For SMILTimeContainer::updateAnimations() to have a chance of
unlocking the animated property _before_ clearAnimatedType() is
called, we need to move the call up to
SMILTimeContainer::updateAnimations(). (The assumption is that moving
the call shouldn't make a difference since
SMILTimeContainer::updateAnimations() is the only call-site for
SVGSMILElement::progress() and the intermediate code shouldn't depend
on the animated property.)

Since the clearing of property type and nullifying of resultElement
seems tied together, grouping them makes sense regardless of the crash
chase.

BUG=581546

Review-Url: https://codereview.chromium.org/1989033003
Cr-Commit-Position: refs/heads/master@{#394698}
mstensho
Move line painting to BlockFlowPainter.
Removed some unnecessary includes, since I had to modify the list of includes
anyway.

Also got rid of LayoutBlock(Flow)::paintFloats() in the process.

BUG=302024

Review-Url: https://codereview.chromium.org/1993713002
Cr-Commit-Position: refs/heads/master@{#394581}
mstensho
Remove LayoutBlock::deleteLineBoxTree().
The one in LayoutBlockFlow is all we need now.

BUG=302024

Review-Url: https://codereview.chromium.org/1991763002
Cr-Commit-Position: refs/heads/master@{#394467}
mstensho
Move dirtyLinesFromChangedChild() to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1987233002
Cr-Commit-Position: refs/heads/master@{#394463}
fs
Use SVGInlineTextMetricsIterator in updateLayoutAttributes
This reuses a pre-existing piece to do the "dual offset/variable"
iteration, hiding (and sharing) the complexity.

BUG=607906

Review-Url: https://codereview.chromium.org/1988063002
Cr-Commit-Position: refs/heads/master@{#394412}
sigbjornf
Limit WTF::getPtr() to native pointer types.
Remove Member<> and Persistent<> specializations, the generated bindings
code (only real user of getPtr()) use it to coerce references into
pointers only, nothing else.

R=haraken
BUG=

Review-Url: https://codereview.chromium.org/1989153003
Cr-Commit-Position: refs/heads/master@{#394371}
rune
Rename Pending to PendingScriptBlocking.
Pending sheets in StyleEngine are either script blocking or render
blocking (when they are render blocking they are simultaneously script
blocking). Rename methods and members to reflect that pending sheets are
script blocking where appropriate.

No functional changes.

R=pmeenan@chromium.org,esprehn@chromium.org
BUG=481122

Review-Url: https://codereview.chromium.org/1978083002
Cr-Commit-Position: refs/heads/master@{#394364}
mharanczyk
Destory base class when win platform accessibily node is destroyed.
Review-Url: https://codereview.chromium.org/1978223002
Cr-Commit-Position: refs/heads/master@{#394219}
mstensho
Move inlineElementContinuation() to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1974323002
Cr-Commit-Position: refs/heads/master@{#394167}
fs
Reland of Simplify LoadableTextTrack::trackElementIndex
Count preceding sibling <track> elements in a more straight-forward way.

Also clean-up null-checks of m_trackElement while here (should be non-
null on construction and then keeps a strong reference.)

Review-Url: https://codereview.chromium.org/1980013002
Cr-Commit-Position: refs/heads/master@{#394166}
fs
Remove mode-transition in TextTrack::setKind
This mode-transition gives rise to inconsistent state-updates, and isn't
specified [1]. Remove it, and with it the setKind override.

Also move all the mutators to TextTrack since that's the only type of
track where these fields can be mutated (and only if sourced via a
HTMLTrackElement.)

[1] https://html.spec.whatwg.org/multipage/embedded-content.html#attr-track-kind

BUG=460923,608772

Review-Url: https://codereview.chromium.org/1984663002
Cr-Commit-Position: refs/heads/master@{#394122}
tsniatowski
Use clang "--target=x" rather than "-target x" for icecc
Icecc is confused by the two-argument -target form and ends up compiling
everything locally. It works with the equivalent single argument form, so prefer
this in GN compiler configs.

Previously done just for android in https://codereview.chromium.org/1871813003

Review-Url: https://codereview.chromium.org/1977733003
Cr-Commit-Position: refs/heads/master@{#394065}
mstensho
Move line/continuation specific parts of willBeDestroyed() into LayoutBlockFlow.
Also moved beingDestroyed() down to LayoutBlockFlow, since it was no longer
called on other types.

Note that dirtyLinesFromChangedChild() is now called regardless of the object
having line boxes or not at the time of destruction. This should be safer and
more correct. If we're an inline-block, for instance, we definitely want to
notify our parent that we're going away, since that will affect the line box
tree in the parent. I assume that the reason why this hasn't been a problem
(use-after-free crashes, typically), is that the condition that previously
could block this from happening is never true. Looks like line boxes are always
deleted before we reach willBeDestroyed(). Added a TODO to investigate further.
We hopefully don't need that code.

BUG=302024

Review-Url: https://codereview.chromium.org/1977083002
Cr-Commit-Position: refs/heads/master@{#393939}
fs
Revert of Simplify LoadableTextTrack::trackElementIndex (patchset #1 id:1 of https://codereview.chromium.org/1980013002/ )
Reason for revert:
Seems "WebKit Win Builder (dbg)" didn't approve:

e:\b\build\slave\webkit-win-latest-dbg\build\src\third_party\webkit\source\core\html\track\loadabletexttrack.cpp(70) : warning C4706: assignment within conditional expression

Original issue's description:
> Simplify LoadableTextTrack::trackElementIndex
>
> Count preceding sibling <track> elements in a more straight-forward way.
>
> Also clean-up null-checks of m_trackElement while here (should be non-
> null on construction and then keeps a strong reference.)
>
> Committed: https://crrev.com/0537a6d11bf2ebefcf90fbfec7081e37ef78081a
> Cr-Commit-Position: refs/heads/master@{#393825}

TBR=davve@opera.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1985643003
Cr-Commit-Position: refs/heads/master@{#393828}
fs
Simplify LoadableTextTrack::trackElementIndex
Count preceding sibling <track> elements in a more straight-forward way.

Also clean-up null-checks of m_trackElement while here (should be non-
null on construction and then keeps a strong reference.)

Review-Url: https://codereview.chromium.org/1980013002
Cr-Commit-Position: refs/heads/master@{#393825}
davve
Remove workaround for multiple svg onload events
The bug referred to has been fixed. Let's see if the flakiness stays
away when removing the workaround.

BUG=372946

Review-Url: https://codereview.chromium.org/1983813002
Cr-Commit-Position: refs/heads/master@{#393818}
fs
Add TextTrack::isVisualKind helper
It's quite common to check for a text track being one of the kinds
'subtitles' or 'captions'. Add a helper to TextTrack and use that
in a bunch of places to simplify code.
Also convert one open-coded version of TextTrack::canBeRendered() with a
call to that method.

Review-Url: https://codereview.chromium.org/1976183002
Cr-Commit-Position: refs/heads/master@{#393814}
the_jk
Make SQL in DownloadDatabase SQLite pre 3.8.3 compatible
printf() was added in SQLite 3.8.3 so need to use other older
methods to generate the GUID.
third_party/sqlite/sqlite.gyp lists 3.6.1 as required version at the
time of writing

BUG=606772

Review-Url: https://codereview.chromium.org/1897153005
Cr-Commit-Position: refs/heads/master@{#393813}
fs
Clean up HTMLTrackElement.kind invalid/missing value default handling
Get rid of the isValidKind(...) and invalidValueDefaultKind() virtual
methods on TrackBase and do any required checking "up front" instead
as required. This should present less surprises and work in a less
side-effectful way.

Also start setting the 'kind' directly in the constructor rather than
invoking setKind() in (all) the constructor body (bodies).
Drop some redundant parenthesis and fix some obviously "wrong" names
in TextTrack.cpp.

BUG=608772

Review-Url: https://codereview.chromium.org/1973343002
Cr-Commit-Position: refs/heads/master@{#393812}
sigbjornf
With LSan, run initial heap cleaning GCs during shutdown.
Clean out as much as garbage as possible before releasing a
thread's static persistents, in preparation for LSan leak
detection. By doing so, finalizers for itinerant garbage
may access these static local persistents without restrictions,
_but_ any object kept alive by a static persistent may
not when the second phase of cleaning GCs are performed.

As collectAllGarbage() stops on reaching a fixed point,
extra overhead of having to perform GCs before and after
the static persistents isn't a concern.

R=
BUG=611333

Review-Url: https://codereview.chromium.org/1977343002
Cr-Commit-Position: refs/heads/master@{#393809}
kolczyk
Fix a typo in the gn gen help for QtCreator generator (introduced in https://codereview.chromium.org/1883093002/)
BUG=

Review-Url: https://codereview.chromium.org/1979813002
Cr-Commit-Position: refs/heads/master@{#393795}
sigbjornf
Remove C::swap(C*) where C = Hash{Map,Set}<T>.
Remove the swap() method over non-reference hash sets and
map arguments, along with their curious OtherType indirection,
the methods aren't of real use.

R=
BUG=

Review-Url: https://codereview.chromium.org/1979843002
Cr-Commit-Position: refs/heads/master@{#393770}
sigbjornf
Simplify HeapVectorBacking<> usage.
Reorder HeapAllocator.h declarations to let the compiler handle
supplying the default trait argument to HeapVectorBacking<>.

R=
BUG=

Review-Url: https://codereview.chromium.org/1985473002
Cr-Commit-Position: refs/heads/master@{#393749}
mstensho
LayoutFullScreen::m_placeholder is LayoutBlockFlow.
The code calls m_placeholder->beingDestroyed(), which is a method that
I believe belongs down in LayoutBlockFlow, not in LayoutBlock.

No need for the setter, BTW, so replaced it with resetPlaceholder().

BUG=302024

Review-Url: https://codereview.chromium.org/1975163002
Cr-Commit-Position: refs/heads/master@{#393545}
mstensho
Move makeChildrenNonInline() and childBecameNonInline() to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1977823002
Cr-Commit-Position: refs/heads/master@{#393543}
mstensho
Move collapseAnonymousBlockChild() to LayoutBlockFlow, and make it non-static.
Some cleanup in collapseLoneAnonymousBlockChild(). Specify a parent rather than
working it out on our own. Both callers have the parent readily available
anyway.

Remove canCollapseAnonymousBlockChild(), since nobody calls it anymore.

BUG=302024

Review-Url: https://codereview.chromium.org/1980473002
Cr-Commit-Position: refs/heads/master@{#393542}
kolczyk
Add support for generating QtCreator projects from GN.
This adds a new command line argument "--ide=" value to "gn gen"
which, when specified, generates a QtCreator project.

QtCreator is a quite powerful general-purpose (despite Qt in the name)
IDE when developing on Linux system with code completion and navigation.

Some interest in it has been demonstrated in the following thread:
https://groups.google.com/a/chromium.org/forum/#!topic/gn-dev/9U4_ytjrah8

BUG=

Review-Url: https://codereview.chromium.org/1883093002
Cr-Commit-Position: refs/heads/master@{#393514}
fs
Minor SVGFilterPainter cleanups
Simplify GraphicsContext handling in SVGFilterRecordingContext by
getting rid of the paintingContext() calls, since we'll promptly replace
that GraphicsContext with the recording context anyway. Get rid of the
|context| local and use m_context instead.

Drop the LayoutObject argument to paintFilteredContent(...) since it
isn't used.

Review-Url: https://codereview.chromium.org/1977793003
Cr-Commit-Position: refs/heads/master@{#393511}
sigbjornf
Avoid race on uninitializing CrossThreadPersistent nodes.
R=
BUG=611593, 611594

Review-Url: https://codereview.chromium.org/1974233002
Cr-Commit-Position: refs/heads/master@{#393488}
mstensho
Move makeChildrenInlineIfPossible to LayoutBlockFlow
It's now possible to move makeChildrenInlineIfPossible() to LayoutBlockFlow.

BUG=302024

Review-Url: https://codereview.chromium.org/1969203003
Cr-Commit-Position: refs/heads/master@{#393390}
mstensho
Don't use canCollapseAnonymousBlockChild() to determine whether to truncate text.
Doing that happened to do exactly what we wanted, but that seems like a rather
haphazard way of determining it.

We want to truncate text for block containers [1]. That's LayoutBlockFlow.
Additionally, in Blink, HTML button is implemented using LayoutFlexibleBox
(although the web insists that it too is a block container).

[1] https://www.w3.org/TR/css-ui-3/#propdef-text-overflow

Rather than manually testing for isLayoutBlockFlow() || isLayoutButton()
directly when deciding to truncate or not, I went and hijacked
canHaveFirstLineOrFirstLetterStyle(), and renamed it to behavesLikeBlockContainer().

Review-Url: https://codereview.chromium.org/1970183002
Cr-Commit-Position: refs/heads/master@{#393354}
mstensho
Move some reparenting and anonymous block merge functionality down to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1968413002
Cr-Commit-Position: refs/heads/master@{#393350}
fs
Don't store an SkPicture in the SourceGraphic FilterEffect
Instead of storing the SkPicture in the SourceGraphic FilterEffect, just
create a filter and pre-populate all the image filter "slots" when we've
recorded the content that should be filtered.
This avoids keeping an explicit reference to the SkPicture, and thus
avoids keeping this object alive when the Filter and it's associated
filter-chain is in limbo waiting for a Oilpan GC sweep.

BUG=610158

Review-Url: https://codereview.chromium.org/1961083006
Cr-Commit-Position: refs/heads/master@{#393280}
mstensho
LayoutBox (not LayoutBlock) is the common base for floats and out-of-flow objects.
We need to react on going out-of-flow or becoming floated in
LayoutBox::styleDidChange(), or we'll misbehave if the object in question is
e.g. an image.

Review-Url: https://codereview.chromium.org/1973843003
Cr-Commit-Position: refs/heads/master@{#393270}
mstensho
LayoutBlock::removeChild() override no longer needed.
It was all about anonymous block merging and collapsing, which is a thing that
only LayoutBlockFlow needs to do. So move everything there.

BUG=302024

Review-Url: https://codereview.chromium.org/1968403002
Cr-Commit-Position: refs/heads/master@{#393267}
mstensho
Move block container specific parts of addChild() to LayoutBlockFlow.
LayoutBlock still needs some basic support for anonymous block insertion, for
flexbox, and possibly others.

BUG=302024

Review-Url: https://codereview.chromium.org/1974753002
Cr-Commit-Position: refs/heads/master@{#393266}
rune
Unreachable code fixes in SelectorChecker.
Unknown selectors and pseudo page selectors should be dropped at parse
time for element selectors. Also did some simplifications for
ASSERT_NOT_REACHED code and consistently fail matching for such code.

R=timloh@chromium.org,rob.buis@samsung.com

Review-Url: https://codereview.chromium.org/1969203002
Cr-Commit-Position: refs/heads/master@{#393216}
sigbjornf
Remove dated NavigationScheduler TODO.
Task closures created by CancellableTaskFactory keep a weak reference back
to their owning GCed object, allowing the object to be garbage collected
without the task keeping it alive.

Retire the TODO in the NavigationScheduler suggesting otherwise along with
adding a unit test to verify the weakness property.

R=
BUG=585328

Review-Url: https://codereview.chromium.org/1976433003
Cr-Commit-Position: refs/heads/master@{#393210}
mstensho
Helper method for non-direct beforeChild in LayoutBlock::addChild().
A lot of what's in LayoutBlock::addChild() will eventually be moved down to
LayoutBlockFlow::addChild(), but both classes are expected to handle insertion
of children before a non-direct beforeChild.

One difference, compared to how it used to work when all of this was inside
addChild(), is that it's no longer allowed to continue if we fail to find a
suitable direct beforeChild replacement. Will always RELEASE_ASSERT() in such
situations now.

BUG=302024

Review-Url: https://codereview.chromium.org/1964203004
Cr-Commit-Position: refs/heads/master@{#393201}
mstensho
Helper for interesting things to do when a block becomes a float or out-of-flow.
Also added some requirements for the blocks involved to be LayoutBlockFlow. We
don't want to touch anything else.

BUG=302024

Review-Url: https://codereview.chromium.org/1966223002
Cr-Commit-Position: refs/heads/master@{#393121}
rune
Multiple :hover/:active incorrectly matching in quirks mode.
:hover and :active should only match links when not accompanied by
other simple selectors in quirks mode. We failed to adhere for
combinations of :hover and :active. Instead of just checking there is
either a selector preceding or following in the compound, check if
there is a selector preceding or a selector following in the compound
which is neither :hover nor :active.

R=rob.buis@samsung.com
BUG=611090

Review-Url: https://codereview.chromium.org/1972713002
Cr-Commit-Position: refs/heads/master@{#393090}
mstensho
Move updateDragState() override to LayoutBlockFlow.
Only continuations stuff there.

BUG=302024

Review-Url: https://codereview.chromium.org/1969103002
Cr-Commit-Position: refs/heads/master@{#393071}
mstensho
Move hoverAncestor() override to LayoutBlockFlow.
Only continuations stuff going on there.

BUG=302024

Review-Url: https://codereview.chromium.org/1970653004
Cr-Commit-Position: refs/heads/master@{#392963}
mstensho
Turn mergeContiguousAnonymousBlocks() into a proper method.
Some clean-up on the way, such as refactoring
canMergeContiguousAnonymousBlocks() into a function that deals with one object
at a time.

BUG=302024

Review-Url: https://codereview.chromium.org/1966153002
Cr-Commit-Position: refs/heads/master@{#392942}
sigbjornf
Simplify SVGSMILElement::notifyDependentsIntervalChanged loop breaker.
To catch out recursive notifications, notifyDependentsIntervalChanged()
keeps track of the SVGSMILElements that are on the stack and being
notified, so as to bail early in case of loops.

There's no need for that set of SVGSMILElements to be recorded using
a persistent static local as the objects are stack reachable should
a conservative GC be needed, so an 'ordinary' hash set will do.

Not using a persistent reference also addresses a bad interaction with
LSan (Blink has to release all static persistents before shutting
down to prevent false leaks w/ LSan enabled), but SVGImages containing
animations may end up in this code path as part of an image resource
being finalized. Which would then encounter an empty persistent
static reference and fail (see associated bug and stack trace.)

R=haraken
BUG=610855

Review-Url: https://codereview.chromium.org/1968683003
Cr-Commit-Position: refs/heads/master@{#392919}
sigbjornf
Move tracking of ActiveScriptWrappables to V8PerIsolateData.
R=
BUG=

Review-Url: https://codereview.chromium.org/1966743004
Cr-Commit-Position: refs/heads/master@{#392916}
fs
Change "invalid value default" for HTMLTrackElement 'kind' to "metadata"
Rename TrackBase::defaultKind() to invalidValueDefaultKind() to better
reflect its semantics. Also make sure that the "missing value default"
is set appropriately (in TextTrack constructors and on removal in
HTMLTrackElement parseAttribute) now that it differs from the "invalid
value default".

The test media/track/track-kind.html is adjusted so that it doesn't
check if a cue is displayed, since that depends on unspecified behavior
wrt how 'mode' changes when 'kind' does. (See comment in
TextTrack::setKind.)

The WPT tests will eventually get updated via Mozilla's automatic sync,
so adding expectations for now.
(Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=1269712)

Intent: https://groups.google.com/a/chromium.org/d/topic/blink-dev/6-oPQN4lZ2o/discussion

https://github.com/whatwg/html/issues/293
https://html.spec.whatwg.org/multipage/embedded-content.html#attr-track-kind

BUG=608772

Review-Url: https://codereview.chromium.org/1947033002
Cr-Commit-Position: refs/heads/master@{#392911}
sigbjornf
Revert of Eagerly remove disposed DOMTimers as observers. (patchset #1 id:1 of https://codereview.chromium.org/1959013002/ )
Reason for revert:
Caused issue 610606, reverting to locally investigate how/why.

Original issue's description:
> Eagerly remove disposed DOMTimers as observers.
>
> Once the coordinator lets go of a timer, no need to keep it
> around as an observer of the ExecutionContext.
>
> R=
> BUG=
>
> Committed: https://crrev.com/0a297738301705d02f57968334bd6f7c7dc95f4c
> Cr-Commit-Position: refs/heads/master@{#392309}

TBR=oilpan-reviews@chromium.org,keishi@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=

Review-Url: https://codereview.chromium.org/1968963002
Cr-Commit-Position: refs/heads/master@{#392901}
fs
Use the right TextRun length when checking for surrogate pairs
The isValidSurrogatePair helper in LayoutSVGInlineText.cpp operates on a
TextRun and an index, and checks if the character at the index is part
of a valid surrogate pair.
To check the trailing character, the next index is checked against the
length of the TextRun (to see if the character exists).
The TextRun used is a "sub run" of the entire text node, which means
that the operator[] implementation expects accesses to be within the sub
run rather than the "full run".
Since this function is always used for runs that are sub runs, it should
use TextRun::length() rather than TextRun::charactersLength() to stay
consistent with the iteration and the code using it.

BUG=610641

Review-Url: https://codereview.chromium.org/1961953004
Cr-Commit-Position: refs/heads/master@{#392880}
rune
Corrected assert for cacheable stylesheets.
We have two different caches for StyleSheetContents. One process-wide
for resources, and one document-wide for parsed text of style elements.
The cacheability differ between the two caches since for instance
sheets with @media rules may be shared between elements in the same
document as the media query evaluation will be the same, while we can't
do that for sheets cached across documents as they may have different
viewports.

The assert in CSSStyleSheet::willMutateRules triggered because we
checked for the resource cacheability of a style element sheet which
was shared even though it had a media query. Renamed the cacheability
method to make clear which cache we're referring to.

Removed the ASSERT in StyleSheetContents::copy(), as that really didn't
have anything to do with copy, only the fact that it is only called
from where cached stylesheets are cloned for rule mutation. The ASSERT
in willMutateRules right before we copy() should suffice.

R=timloh@chromium.org
BUG=551674

Review-Url: https://codereview.chromium.org/1961173003
Cr-Commit-Position: refs/heads/master@{#392859}
mstensho
Only LayoutInline needs to implement addChildIgnoringContinuation().
LayoutTable had to do it because LayoutBlock did it. But LayoutBlock really
doesn't have to do it anymore. This was probably some relic from the old
multicol implementation, which used *block* continuations to implement column
spanners. We no longer need or support block continuations.

Review-Url: https://codereview.chromium.org/1967823002
Cr-Commit-Position: refs/heads/master@{#392856}
sigbjornf
Remove redundant GC mixin instance decl for AudioBufferSourceNode.
R=
BUG=

Review-Url: https://codereview.chromium.org/1969453003
Cr-Commit-Position: refs/heads/master@{#392747}
mstensho
Move nodeForHitTest() to LayoutBlockFlow.
LayoutBlock shouldn't have to deal with continuations.

BUG=302024

Review-Url: https://codereview.chromium.org/1966713002
Cr-Commit-Position: refs/heads/master@{#392742}
mstensho
Move continuation and line box specific stuff to LayoutBlockFlow::removeChild().
BUG=302024

Review-Url: https://codereview.chromium.org/1970453002
Cr-Commit-Position: refs/heads/master@{#392730}
sigbjornf
Prevent audio thread access to finished, non-active AudioNodes.
Follow up r392110 and have the audio thread skip over m_activeSourceNodes
nodes it has already deemed to be finished & removable by the main thread.
Accessing these cannot be safely done.

R=
BUG=610643

Review-Url: https://codereview.chromium.org/1958333006
Cr-Commit-Position: refs/heads/master@{#392720}
mstensho
Turn adjacent out-of-flow sibling reparenters into proper methods.
This will make it possible to gradually move callers of these methods (and the
methods themselves) down to LayoutBlockFlow, which is where they belong, since
only LayoutBlockFlow may parent floats and out-of-flow objects.

BUG=302024

Review-Url: https://codereview.chromium.org/1964983002
Cr-Commit-Position: refs/heads/master@{#392696}
mstensho
Move invalidateDisplayItemClients() override into LayoutBlockFlow and eat the static helper.
It was only dealing with continuations, and that doesn't belong in LayoutBlock.

BUG=302024

Review-Url: https://codereview.chromium.org/1964083002
Cr-Commit-Position: refs/heads/master@{#392690}
sigbjornf
Handle overlapping CrossThreadPersistent<> releases.
When a CrossThreadPersistent<> is cleared, the associated PersistentNode is
freed. In the case when multiple threads attempt to do such clearing at
the same time, the freeing protocol ensured atomicity but failed to check
if the PersistentNode had been freed already.

This follows up on the freeing of PersistentNodes that r392263 added
for CrossThreadPersistent<>s.

R=haraken
BUG=

Review-Url: https://codereview.chromium.org/1964013002
Cr-Commit-Position: refs/heads/master@{#392689}
mstensho
Move absoluteRects() and absoluteQuads() overrides to LayoutBlockFlow.
They only deal with continuations.

BUG=302024

Review-Url: https://codereview.chromium.org/1968553002
Cr-Commit-Position: refs/heads/master@{#392685}
mostynb
IWYU: errno.h in third_party/webrtc_overrides
Without this, some toolchains may fail to build
third_party/webrtc/base/checks.cc because errno is undefined.

BUG=468375

Review-Url: https://codereview.chromium.org/1967643002
Cr-Commit-Position: refs/heads/master@{#392677}
mstensho
Adjust constness to avoid const_cast.
Review-Url: https://codereview.chromium.org/1961343002
Cr-Commit-Position: refs/heads/master@{#392642}
sigbjornf
Drop unnecessary uses of GarbageCollectedFinalized<>.
Objects with Member<> fields can derive from the non-finalized
GarbageCollected<> instead.

R=
BUG=389343

Review-Url: https://codereview.chromium.org/1961173004
Cr-Commit-Position: refs/heads/master@{#392641}
mstensho
nodeAtPoint(): Perform the early-check EARLY.
Hit-testing overflow controls before checking if we need to do anything at all
affected performance, so just remove the LayoutBlock override for nodeAtPoint()
and hit test overflow controls there, but do so AFTER we have made sure that
the point is within bounds.

Fixes 15% performance regression for
PerformanceTests/Events/hit-test-lots-of-layers.html

BUG=610250

Review-Url: https://codereview.chromium.org/1960373002
Cr-Commit-Position: refs/heads/master@{#392626}
mstensho
Set orphans and widows to 1 in lots-of-text-balanced multicol performance test.
https://codereview.chromium.org/1909233002 changed the initial values for
orphans and widows to match the spec. This could very well affect performance
slightly, although I cannot reproduce it myself. Speculatively set
orphans/widows to 1 and see if that helps. Add a new test that uses higher
values for orphans and widows, so that we still get to test that too.

BUG=606262

Review-Url: https://codereview.chromium.org/1964473003
Cr-Commit-Position: refs/heads/master@{#392625}
mstensho
Assert that continuations be either LayoutBlockFlow or LayoutInline.
Exploring the possibility of moving all continuation handling from LayoutBlock
down to LayoutBlockFlow.

BUG=302024

Review-Url: https://codereview.chromium.org/1958413003
Cr-Commit-Position: refs/heads/master@{#392621}
sigbjornf
Make ActiveScriptWrappable the GC mixin it is.
By switching it to derive from GarbageCollectedMixin, and
have the per-thread set of live wrappables keep WeakMember<>
references, the Oilpan GC takes care of pruning the live
set as part of its weak processing.

R=
BUG=

Review-Url: https://codereview.chromium.org/1962113003
Cr-Commit-Position: refs/heads/master@{#392618}
mstensho
Relayout an object that becomes a spanner.
It may be possible to collapse margins through a zero-height regular block, but
if it is turned into a spanner, this is no longer possible, because it then
becomes a BFC root.

An object that becomes a spanner also gets a new containing block, which may
affect its size.

In other words, there are good reasons to make sure that objects that become
spanners get relaid out.

Note that we already had code in place (in willBeRemovedFromTree()) that
scheduled for relayout in the opposite case, i.e. when an object ceased to be a
spanner.

BUG=610033

Review-Url: https://codereview.chromium.org/1962623002
Cr-Commit-Position: refs/heads/master@{#392438}
mstensho
Remove ColumnFill runtime setting.
It's been enabled by default for almost three months now.

BUG=492297

Review-Url: https://codereview.chromium.org/1956373002
Cr-Commit-Position: refs/heads/master@{#392389}
sigbjornf
Remove older and unused ScriptState methods.
R=
BUG=

Review-Url: https://codereview.chromium.org/1958963002
Cr-Commit-Position: refs/heads/master@{#392316}
mstensho
Move hit testing of lines and floats to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1956033002
Cr-Commit-Position: refs/heads/master@{#392311}
sigbjornf
Eagerly remove disposed DOMTimers as observers.
Once the coordinator lets go of a timer, no need to keep it
around as an observer of the ExecutionContext.

R=
BUG=

Review-Url: https://codereview.chromium.org/1959013002
Cr-Commit-Position: refs/heads/master@{#392309}
sigbjornf
Trim ResourceTimingInfoMap of non-relevant entries.
If the resource fetch fails or is otherwise uninteresting to report a
ResourceTimingInfo for, remove it (also) from the set of pending
map of such ResourceTimingInfos.

R=
BUG=608543

Review-Url: https://codereview.chromium.org/1955243002
Cr-Commit-Position: refs/heads/master@{#392307}
sigbjornf
Upon clearing, release PersistentNode of cross-thread-persistent also.
Persistent<>s will only allocate an associated PersistentNode when the
heap reference is non-null. And, dually, free the PersistentNode
when the reference is cleared out and set to null.

Extend that freeing of a PersistentNode upon clearing to also apply to
CrossThreadPersistent<>s, making the behavior and lifetimes of
PersistentNodes consistent across both variants of persistent references.

R=haraken
BUG=483380
NOTRY=true

Review-Url: https://codereview.chromium.org/1962513002
Cr-Commit-Position: refs/heads/master@{#392287}
sigbjornf
Accurately measure current persistent count while running termination GC.
Follow up on r392263 and have it really behave as wanted -- when measuring
|currentCount|, the live persistent count, while cleaning out the worker's
heap in ThreadState::runTerminationGC(), we need to initially sample it
_after_ having released thread-local static persistents. Otherwise the count
would be overestimated first time around, which could lead to prematurely
reaching a fixed point. And at a fixed point that would falsely indicate
that persistents were leaking.

R=haraken
BUG=
NOTRY=true

Review-Url: https://codereview.chromium.org/1963453002
Cr-Commit-Position: refs/heads/master@{#392272}
sigbjornf
Cleanly release thread-local static persistents during termination GCs.
Should worker termination GCs instantiate static persistent singletons
while running finalizers, ensure that these are released.

Also, for PersistentHeapCollectionBase<>s registered as such thread-local
singletons, clear out their collection backing store along with the
persistent reference when they are released. The contents and backing
store of the collection should not be accessible after such a forceful
release operation.

R=haraken
BUG=
NOTRY=true

Review-Url: https://codereview.chromium.org/1957523007
Cr-Commit-Position: refs/heads/master@{#392263}
mstensho
Move line-specific code into LayoutBlockFlow::positionForPoint().
BUG=302024

Review-Url: https://codereview.chromium.org/1957633003
Cr-Commit-Position: refs/heads/master@{#392251}
mstensho
Move line-specific parts of addOutlineRects() into LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1959623002
Cr-Commit-Position: refs/heads/master@{#392137}
mstensho
Less duplicated code between nodeAtPoint() in LayoutBox and LayoutBlock.
This is a preparatory patch for moving line/float-specific parts of
LayoutBlock::hitTestChildren() into LayoutBlockFlow.

BUG=302024

Review-Url: https://codereview.chromium.org/1957673002
Cr-Commit-Position: refs/heads/master@{#392116}
mstensho
LineBreaker doesn't need LayoutBlock(Flow) as a friend.
Review-Url: https://codereview.chromium.org/1956433003
Cr-Commit-Position: refs/heads/master@{#392115}
sigbjornf
Update AbstractAudioContext::m_activeSourceNodes on the main thread only.
Avoid mutating m_activeSourceNodes on the audio thread, leave the
main thread in control of that heap object.

R=haraken,rtoy
BUG=581660

Review-Url: https://codereview.chromium.org/1958583002
Cr-Commit-Position: refs/heads/master@{#392110}
sigbjornf
Initialize DeferredTaskHandler's audio thread ID once.
Avoid repeatedly recording the audio thread's ID, along with assertedly
verifying that this is done off the main thread.

R=
BUG=590108

Review-Url: https://codereview.chromium.org/1954663002
Cr-Commit-Position: refs/heads/master@{#391848}
mstensho
Move showLineTreeAndMark() to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1952763002
Cr-Commit-Position: refs/heads/master@{#391757}
mstensho
Move parts of baseline calculation over to LayoutBlockFlow.
LayoutBlock shouldn't deal with line boxes.

BUG=302024

Review-Url: https://codereview.chromium.org/1952753002
Cr-Commit-Position: refs/heads/master@{#391663}
mstensho
Move computeSelfHitTestRects() to LayoutBlockFlow.
BUG=302024

Review-Url: https://codereview.chromium.org/1946343002
Cr-Commit-Position: refs/heads/master@{#391639}
mstensho
Move LayoutDeprecatedFlexibleBox-specific line handling.
This is sort-of exotic functionality, in that it checks if the blocks have
visibility:visible and auto height, so it fits better together with the
LayoutDeprecatedFlexibleBox implementation. Nobody else needs this.

The pagination code also needs to count lines, though, so I kept lineCount(),
but moved it from LayoutBlock to LayoutBlockFlow, and threw away the parts that
weren't needed (visibility check, recursing into child block flows, among other
things).

On the LayoutDeprecatedFlexibleBox, there are some changes. The functions now
operate on LayoutBlockFlow instead of LayoutBlock, since it's dealing with
lines. As a result, we need to replace some former isLayoutBlock() checks with
isLayoutBlockFlow(). A similar change landed in WebKit years ago [1], so it
should be safe.

[1] https://bugs.webkit.org/show_bug.cgi?id=122969

BUG=302024

Review-Url: https://codereview.chromium.org/1952613002
Cr-Commit-Position: refs/heads/master@{#391492}
mstensho
Improve multicol overflow rect calculation when column width is 0.
If column-gap is larger than the content box width of the multicol container,
we'll end up with zero-width column boxes (that are allowed to overflow into
neighboring gaps).

BUG=607597

Review-Url: https://codereview.chromium.org/1927283002
Cr-Commit-Position: refs/heads/master@{#391477}
mstensho
Correct ietestcenter/css3/multicolumn/column-width-applies-to-010-expected.htm
Need to paint a red list item marker under the green one for it to match the
actual test perfectly.

BUG=396941

Review-Url: https://codereview.chromium.org/1947003002
Cr-Commit-Position: refs/heads/master@{#391467}
rune
Make sure computed style is up-to-date for custom properties.
For custom properties, we didn't call updateLayoutTreeForNode which
meant the computed style object might return out-of-date values for
custom properties.

Did some cleanup in getPropertyCSSValue for known properties.

R=shans@chromium.org
BUG=608690

Review-Url: https://codereview.chromium.org/1945623002
Cr-Commit-Position: refs/heads/master@{#391368}
fs
Simplify logical iteration in SVGTextLayoutEngine
By replacing m_logicalCharacterOffset == logicalTextNode->textLength()
by the corresponding metrics list equivalent, it becomes obvious that
we're just checking the same thing twice in succession. Remove the first
check and block of code.
Also reverse the test in the loop and refactor to avoid the 'continue'
when skipping whitespace.
The second part of the disjunction (w/ logicalMetrics.isEmpty()) does
not do anything useful, so is removed. This makes the condition match
what SVGTextLayoutAttributesBuilder does (which is the intention.)

BUG=607906

Review-Url: https://codereview.chromium.org/1941303003
Cr-Commit-Position: refs/heads/master@{#391281}
fs
Make servicing of SMIL animations require a FrameView
SMIL animations are not running (or even started) in inactive documents,
and scheduling frames requires a FrameView. Hence it makes sense to move
the call to SVGDocumentExtensions::serviceOnAnimationFrame into the
block that requires a FrameView.
Drop unused timestamp argument to SMILTimeContainer::serviceAnimations,
and let that propagate all the way out to PageAnimator.

Review-Url: https://codereview.chromium.org/1941403002
Cr-Commit-Position: refs/heads/master@{#391244}
sigbjornf
Deflake media/track/media-element-move-to-new-document-assert.html
R=fs@opera.com
BUG=518995

Review-Url: https://codereview.chromium.org/1943823002
Cr-Commit-Position: refs/heads/master@{#391224}
sigbjornf
Implement DOM methods: prepend, append, after, before and replaceWith.
As per https://dom.spec.whatwg.org/#childnode ChildNode interface
should contain after(), before() and replaceWith() API.

As per https://dom.spec.whatwg.org/#parentnode ParentNode interface
should contain append(), prepend() API.

Intent to Implement and ship link: https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/paritosh/blink-dev/efUPtYm1PP8/MGoTi17AYpcJ

( From paritosh.in@samsung.com's original CL https://codereview.chromium.org/1085843002 )

R=mkwst
BUG=255482

Review-Url: https://codereview.chromium.org/1934123002
Cr-Commit-Position: refs/heads/master@{#391196}
rune
Avoid style recalc and layout when not necessary for client size.
The clientWidth and clientHeight values do not rely on style recalc for
the documentElement in strict mode, and the body element in quirks mode
when we use overlay scrollbars. Skip the forced layout update in those
cases.

BUG=481412

Review-Url: https://codereview.chromium.org/1935043002
Cr-Commit-Position: refs/heads/master@{#391187}
fs
Remove the LayoutSVGInlineText* context in SVGTextLayoutAttributes
Most uses of the SVGTextLayoutAttributes* in vector owned by
LayoutSVGText, actually ends up doing ...->context() and dereferencing
the owning LayoutSVGInlineText rather than the attributes object itself.
It's also slightly more obvious what's going on when considering the
iteration over "text nodes" rather than their associated attributes.
Make LayoutSVGText collect the descendant LayoutSVGInlineTexts rather
than the "parts object" SVGTextLayoutAttributes, and rename as
appropriate to reflect that change.
Since removing the context pointer makes SVGTextLayoutAttributes a simple
wrapper around a SVGCharacterDataMap, just store the latter directly.
Rename SVGTextLayoutAttributes.h to SVGCharacterData.h
Also replace a HashMap::find+conditional copy with a HashMap::get.

BUG=607906

Review-Url: https://codereview.chromium.org/1937043002
Cr-Commit-Position: refs/heads/master@{#391052}
sigbjornf
Completely detach failed script loader before dispatching error event.
In case of failure, a ScriptLoader needs to be detached from its ScriptRunner
and associated Resource (if any) at the same time, and before dispatching
the corresponding error event. If the error event handler triggers cancellation
of the Resource, the ScriptLoader should not be notified of that again --
it isn't interested nor prepared. A speculative fix.

R=
BUG=602516

Review-Url: https://codereview.chromium.org/1939743002
Cr-Commit-Position: refs/heads/master@{#390955}
rune
Don't cache parsed stylesheet if it wasn't added to the memory cache.
The code expects the StyleSheetContents to be in the memory cache when
pointed to by m_parsedStyleSheetCache. Set m_parsedStyleSheetCache to
nullptr initially when the StyleSheetContents could not be added to the
memory cache.

R=sigbjornf@opera.com
BUG=606248

Review-Url: https://codereview.chromium.org/1941733002
Cr-Commit-Position: refs/heads/master@{#390949}
davve
Add test for zoomed -webkit-mask-box-image
BUG=607414

Review-Url: https://codereview.chromium.org/1937903002
Cr-Commit-Position: refs/heads/master@{#390935}
mstensho
LayoutBlock::m_descendantsWithFloatsMarkedForLayout doesn't need to be mutable.
R=rune@opera.com

Review-Url: https://codereview.chromium.org/1937023002
Cr-Commit-Position: refs/heads/master@{#390925}
jl
Use v8::Object::CreateDataProperty() for object construction
When creating objects (and arrays) internally, we should typically use
CreateDataProperty() rather than Set(), since the latter may invoke
setters defined by scripts. This could potentially be used by exploits to
do evil things, but more likely is just a potential source of breakage
and/or confusion.

Also, it is typically non-conforming in the cases where exact behavior is
defined in a specification.

BUG=

Review-Url: https://codereview.chromium.org/1938943002
Cr-Commit-Position: refs/heads/master@{#390924}
davve
Revert "Straighten out zoom and border-image"
This patch reverts https://codereview.chromium.org/1819083004 patchset
#3.

Fixing SVG zoom in border-image unfortunatly broke gradients
instead. There is a difference in how scale it applied for
zooming. For SVG a source rect (unzoomed) <-> destination rect
(zoomed) scale factor is computed and used for scaling. For gradients,
the source and destination rect are always the same (both zoomed). The
individual gradients stops are zoomed instead.

BUG=607414, 596075, 561519

Review-Url: https://codereview.chromium.org/1934953002
Cr-Commit-Position: refs/heads/master@{#390920}
mostynb
remove obsolete todo note for CSS property to histogram id mapping
It was decided not to move these (necessarily) hardcoded ids.

BUG=234940
NOTRY=true

Review-Url: https://codereview.chromium.org/1937773002
Cr-Commit-Position: refs/heads/master@{#390917}
sigbjornf
Weak HTMLMediaElement::m_audioSourceNode reference must be cleared.
Weak callbacks must clear the weak references deemed not to be alive.

R=
BUG=

Review-Url: https://codereview.chromium.org/1941693002
Cr-Commit-Position: refs/heads/master@{#390910}
mostynb
remove unused WTF::dataLogFString function
BUG=439559

Review-Url: https://codereview.chromium.org/1936893002
Cr-Commit-Position: refs/heads/master@{#390877}
mostynb
remove unused placeByteAsHex template
BUG=439559

Review-Url: https://codereview.chromium.org/1937723002
Cr-Commit-Position: refs/heads/master@{#390876}
sigbjornf
gc plugin: stop recognizing old and unused options.
The options "enable-oilpan" and "warn-raw-ptr" are following r390631 no
longer being passed in as options, hence we can finally stop recognizing
them.

R=
BUG=585328

Review-Url: https://codereview.chromium.org/1941603002
Cr-Commit-Position: refs/heads/master@{#390875}
sigbjornf
Tidy up releasing of AssociatedURLLoader's client references.
Make the releasing of client references a bit more solid and consistent.

R=
BUG=606998

Review-Url: https://codereview.chromium.org/1937743002
Cr-Commit-Position: refs/heads/master@{#390873}
sigbjornf
Have htmlcollection-reachable.html force the one GC needed.
Calling window.gc() slows down test running times, and is
preferably avoided unless needed to verify behavior across
a GC.

For htmlcollection-reachable.html, we only need the
one GC to determine liveness of custom properties for
various platform objects across a garbage collection.

R=
BUG=593888

Review-Url: https://codereview.chromium.org/1934183002
Cr-Commit-Position: refs/heads/master@{#390872}
mostynb
remove unused placeByteAsHexCompressIfPossible template
This template has been unused since https://codereview.chromium.org/1778743003
landed.

BUG=584999,439559

Review-Url: https://codereview.chromium.org/1936883002
Cr-Commit-Position: refs/heads/master@{#390870}
sigbjornf
Document registration of Oilpan weak callbacks.
R=
BUG=

Review-Url: https://codereview.chromium.org/1935943002
Cr-Commit-Position: refs/heads/master@{#390860}
mstensho
Remove replacedChildren vector from inline layout.
This vector was populated during child walking and consumed right after the
walk. There should be no reason not to just process the objects right away.

Review-Url: https://codereview.chromium.org/1933633002
Cr-Commit-Position: refs/heads/master@{#390765}
fs
Minor tweaks to m_needsReordering in LayoutSVGText::layout
Nit fixes from https://codereview.chromium.org/1933193002/.

BUG=607906

Review-Url: https://codereview.chromium.org/1933413002
Cr-Commit-Position: refs/heads/master@{#390753}
fs
Simplify SVG layout attribute reordering
findFirstAndLastAttributesInVector is an identity transform, since it
only search for first/lastContext in the layout attributes vector and
return that in the out variable. Remove it. This in turn means that the
vector of layout attributes is unused, and hence also removed. Finally
tidy up the reversing loop by moving more code into the swapping helper
function, and merge the two identical sequences of item swapping code.
Drop the ASSERT that disallows having no (nullptr) user-data for the
closure to collectLeafBoxesInLogicalOrder.

BUG=607906

Review-Url: https://codereview.chromium.org/1931303002
Cr-Commit-Position: refs/heads/master@{#390751}
fs
Refactor SVGTextLayoutEngine::currentLogicalCharacterMetrics
The two methods currentLogicalCharacterAttributes and
currentLogicalCharacterMetrics on SVGTextLayoutEngine are very
interdependent, since after calling the former, the latter will be
called.
So fold most of the former into the latter, keeping the bits of the
former that advances to the next layout attribute entry, while
renaming it to nextLogicalAttributes.
The methods are also changed from returning a bool and using out-
variables to return the active SVGTextLayoutAttributes structure
instead.

BUG=607906

Review-Url: https://codereview.chromium.org/1935493002
Cr-Commit-Position: refs/heads/master@{#390736}
mstensho
Move self-collapse checking to LayoutBlockFlow and cache it completely.
Only block containers (that's LayoutBlockFlow in Blinquese) can have adjoining
top and bottom margins, since all other LayoutBlock derivates establish some
kind of formatting context (table, flexbox, etc.).

Also cache self-collapsedness completely. Previously we only used the cached
result if we had previously found that the entire subtree is self-collapsing.
The new approach eliminates the need for "mutable" too.

BUG=302024

Review-Url: https://codereview.chromium.org/1933153002
Cr-Commit-Position: refs/heads/master@{#390729}
mstensho
Move markLinesDirtyInBlockRange() from LayoutBlock to LayoutBlockFlow.
And put the implementation in LayoutBlockFlowLine.cpp.

BUG=302024

Review-Url: https://codereview.chromium.org/1933643002
Cr-Commit-Position: refs/heads/master@{#390724}
fs
Restructure LayoutSVGText::layout
"Uncascade" LayoutSVGText::layout by separating the handling of the two
flags (m_needsTextMetricsUpdate, m_needsPositioningValuesUpdate) into
sequential blocks. Add assert to verify consistency.

BUG=607906

Review-Url: https://codereview.chromium.org/1933193002
Cr-Commit-Position: refs/heads/master@{#390691}
fs
Move isEmptyValue and emptyValue to SVGCharacterData
These two helpers have a stronger tie to SVGCharacterData (on which they
operate) than to SVGTextLayoutAttributes - where they are currently
defined.
Move them as described, and also add simple query helpers to make code
using them simpler and more readable.

BUG=607906

Review-Url: https://codereview.chromium.org/1933183002
Cr-Commit-Position: refs/heads/master@{#390649}
sigbjornf
Remove oilpan build configuration vestiges.
With the updated GC clang plugin that rolled out as part of issue 604993,
we no longer need to supply enable-oilpan to it. Stop doing so along
with removing the enable_oilpan configuration option entirely.

R=haraken,jochen
BUG=585328

Review-Url: https://codereview.chromium.org/1930913002
Cr-Commit-Position: refs/heads/master@{#390640}
sigbjornf
blink_gc_plugin: drop no-op options.
With the updated GC clang plugin that rolled out as part of issue 604993,
we can now assume that the enable-oilpan and warn-raw-ptr options are
by default always on & consequently doesn't need to be passed in by
blink_gc_plugin_flags.py

R=
BUG=604463,604476

Review-Url: https://codereview.chromium.org/1926003003
Cr-Commit-Position: refs/heads/master@{#390631}
jl
Use [[DefineOwnProperty]] when converting IDL array values
This means using v8::Object::CreateDataProperty() rather than Set(), and
is in line with how the conversion is defined in WebIDL. The incorrect use
of Set() is observable by scripts that define setters on Array.prototype
for the properties "0", "1", "2" and so on.

Also apply the same fix to conversion of Vector<std::pair<>> into object.

BUG=607483

Review-Url: https://codereview.chromium.org/1936433002
Cr-Commit-Position: refs/heads/master@{#390610}
mostynb
fix ipc_mojo_unittests.isolate dependencies
BUG=604847

Review-Url: https://codereview.chromium.org/1930773006
Cr-Commit-Position: refs/heads/master@{#390606}
philipj
Drop self from API_OWNERS, OWNERS, etc.
tkent@ takes over web-platform-tests/dom and chcunningham@ joins
wolenetz@ in mediasource/OWNERS.

Review-Url: https://codereview.chromium.org/1919183004
Cr-Commit-Position: refs/heads/master@{#390604}
mstensho
Old lines may be detached / extracted during layout.
Back out over-simplified code from https://codereview.chromium.org/1915803004/

Since lines from an old layout pass that haven't yet been relaid out may not be
in the line box list at all at some given point during layout, lastRootBox()
didn't work as expected. It would either return the wrong last-line, or even
nullptr.

BUG=607451

Review-Url: https://codereview.chromium.org/1927913002
Cr-Commit-Position: refs/heads/master@{#390508}
tsniatowski
Add simple bit_cast unittests, avoid static_assert on gcc+libc++
These should work provided that the is_trivially_copyable logic is not
broken, and will fail to compile of the type traits lie. They do on
Android where we have gcc+libc++, so avoid being too strict there.

BUG=607158

Review-Url: https://codereview.chromium.org/1925683002
Cr-Commit-Position: refs/heads/master@{#390472}
sigbjornf
Refresh LocalDOMWindow post-Oilpan.
The debug flag m_hasBeenReset no longer serves a purpose +
OwnedPtrDeleter<> usage doesn't either.

R=
BUG=585328

Review-Url: https://codereview.chromium.org/1932653003
Cr-Commit-Position: refs/heads/master@{#390436}
sigbjornf
Remove RefCountedGarbageCollected<> GC plugin handling.
The RefCountedGarbageCollected<> transition type is no longer used
and has been removed. Follow up and retire the GC plugin's
checks for it.

R=haraken
BUG=604481

Review-Url: https://codereview.chromium.org/1932713002
Cr-Commit-Position: refs/heads/master@{#390421}
rune
querySelector* fast-path missing namespace check for no namespace.
querySelector* does not allow selectors with namespaces, yet selectors
with no namespace are still allowed. Check for empty namespace before
hitting the fast path for tag names.

R=esprehn@chromium.org
BUG=605502

Review-Url: https://codereview.chromium.org/1932673002
Cr-Commit-Position: refs/heads/master@{#390417}
jl
Use correct creation context when converting sequences to V8
The |creationContext| argument is often a reference to a window proxy
object, that may become incorrect to use if the frame is navigated and/or
detached during the loop that converts values.

BUG=607483

Review-Url: https://codereview.chromium.org/1924073003
Cr-Commit-Position: refs/heads/master@{#390408}
sigbjornf
GC plugin: split out reporting of errors/warnings.
Move code to handle reporting of errors and notes out
into a class of its own.

R=haraken
BUG=531879

Review-Url: https://codereview.chromium.org/1926863002
Cr-Commit-Position: refs/heads/master@{#390350}
sigbjornf
Add sigbjornf as blink_gc_plugin/ owner.
R=
BUG=
NOTRY=true

Review-Url: https://codereview.chromium.org/1928743002
Cr-Commit-Position: refs/heads/master@{#390325}
sigbjornf
Remove unused GCObject class.
This dummy class was accidentally re-introduced in PersistentNode.cpp during the
r389469 revert; remove it.

R=
BUG=

Review-Url: https://codereview.chromium.org/1925973002
Cr-Commit-Position: refs/heads/master@{#390323}
sigbjornf
Make warn-unneeded-finalizer warning usable.
The Blink GC plugin option warn-unneeded-finalizer (enabled by including
"warn-unneeded-finalizer=1" in your  "blink_gc_plugin_flags" gyp defines)
is potentially useful in identifying classes which needlessly derive from
GarbageCollectedFinalized<> where GarbageCollected<> would do.

To avoid far too many false positives to make it practically useful on
the Blink codebase, make it be more forgiving about bases with virtual
destructors + recognize class declarations with
finalizeGarbageCollectedObject() methods defined. Neither of those
two cases should be reported as warnings.

R=
BUG=

Review-Url: https://codereview.chromium.org/1922913004
Cr-Commit-Position: refs/heads/master@{#390184}
sigbjornf
Remove unnecessary uses of GarbageCollectedFinalized<>.
Classes which finalize nothing on their own should derive from
GarbageCollected<> instead.

(As identified by the warn-unneeded-finalizer=1 GC plugin option.)

R=haraken
BUG=585328

Committed: https://crrev.com/e10d108bc9cabf82607b909f35fc541c313e2366
Cr-Commit-Position: refs/heads/master@{#390070}

Review-Url: https://codereview.chromium.org/1929493002
Cr-Commit-Position: refs/heads/master@{#390165}
fs
SVG <marker> painting TLC
* Use range-based loop.
* Hide checking for an empty 'viewBox' in LayoutSVGResourceMarker.
* Simplify handling of marker scale due to 'markerUnits'.
* Add some const qualification, reorder forward decls and add missing
  full stops.

Review-Url: https://codereview.chromium.org/1914293003
Cr-Commit-Position: refs/heads/master@{#390112}
sigbjornf
Have MessagePort use Oilpan-based weak pointers.
Using WeakPtr<>/WeakPtrFactory<> with Oilpan heap objects is problematic
in the face of lazy sweeping, WeakPtr<> references aren't cleared until
the finalizer runs. Should a posted task (like for MessagePort) run
before that happens, it might then access already finalized objects that
MessagePort refers to.

Hence WeakPtr<>s should not be used for Oilpan objects unless extra
finalization care is taken _and_ the object depends on WeakPtrFactory<>'s
support for explicit revocation. Use Oilpan weak references instead.

Also clear out various redundant WeakPtr.h includes throughout Blink.

R=haraken
BUG=522357

Review-Url: https://codereview.chromium.org/1922923003
Cr-Commit-Position: refs/heads/master@{#390105}
sigbjornf
Remove unnecessary uses of GarbageCollectedFinalized<>.
Classes which finalize nothing on their own should derive from
GarbageCollected<> instead.

(As identified by the warn-unneeded-finalizer=1 GC plugin option.)

R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1929493002

Cr-Commit-Position: refs/heads/master@{#390070}
fs
Don't use a magic value for 'auto' oriented <marker>s
The value -1 (degrees) is a valid angle, so using it to indicate that
'auto' orientation should be used does not work out.
Just check 'orientType' directly instead and simplify the angle getter.

BUG=606345

Review URL: https://codereview.chromium.org/1916173003

Cr-Commit-Position: refs/heads/master@{#390029}
sigbjornf
Simplify ownership handling of HTMLImportsController.
The controller is now simply referred to and kept alive from the
associated master Document, detached of and disposed during
Document detach.

R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1914183002

Cr-Commit-Position: refs/heads/master@{#389814}
sigbjornf
Deprecate window.postMessage(m, transferables, origin) overload.
This argument-swapped legacy overload has little use, hence it
is time to try to phase it out. Deprecate with view to removing
in M54.

Intent: https://groups.google.com/a/chromium.org/d/msg/blink-dev/h4ooaB_Y9JE/nh7vXshGBwAJ

R=
BUG=425896

Review URL: https://codereview.chromium.org/1903873004

Cr-Commit-Position: refs/heads/master@{#389800}
jl
Use correct creation context during Iterable.forEach iteration
Use |thisValue| instead of |scriptState->context()->Global()|, since this
is simpler and since Global() actually returns a WindowProxy object that
may change and become incorrect to use as creation context depending on
what the callback function does.

BUG=605910

Review URL: https://codereview.chromium.org/1918763002

Cr-Commit-Position: refs/heads/master@{#389785}
sigbjornf
Tidy up representation of ScrollState::m_data.
OwnPtr<> is preferable in this context.

R=
BUG=

Review URL: https://codereview.chromium.org/1916193004

Cr-Commit-Position: refs/heads/master@{#389781}
sigbjornf
Tidy up WebGeolocationController.
Get rid of impedance-matching wrapper now that Oilpan is enabled
always.

R=
BUG=585328

Review URL: https://codereview.chromium.org/1919153002

Cr-Commit-Position: refs/heads/master@{#389777}
davve
Manually rebaseline hidpi tests
The following pixel tests needed rebaselining after switch from quirks
mode to standards mode in r389730:

fast/hidpi/broken-image-icon-hidpi.html
fast/hidpi/image-srcset-invalid-descriptor.html
fast/hidpi/resize-corner-hidpi.html
fast/hidpi/broken-image-with-size-hidpi.html
fast/hidpi/video-controls-in-hidpi.html
fast/hidpi/focus-rings.html
fast/hidpi/clip-text-in-hidpi.html
fast/hidpi/image-set-as-background-with-zoom.html
fast/hidpi/gradient-with-scaled-ancestor.html

TBR=yoav@yoav.ws
BUG=605065

Review URL: https://codereview.chromium.org/1921263002

Cr-Commit-Position: refs/heads/master@{#389758}
sigbjornf
Remove unnecessary uses of GarbageCollectedFinalized<>.
R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1922763003

Cr-Commit-Position: refs/heads/master@{#389756}
fs
Out-of-line some methods on LayoutSVGResourceMarker
Move the definition of orientType() and markerUnits() to the .cpp file.
Also make use of these helpers where possible and remove some unused
or redundant includes.

Review URL: https://codereview.chromium.org/1914133002

Cr-Commit-Position: refs/heads/master@{#389747}
fs
Don't force layout of descendants of SVG containers needing self-layout
There isn't much "layout" required for a generic SVG container - it is
sensitive to changes to its descendants and any impact a filter it
itself references has. We would however always relayout the entire
subtree of a container that had been marked as needing layout.
Like he code removed by https://codereview.chromium.org/1907273002, this
remaining part of the condition is primarily a remnant of the old way of
performing paint invalidation.
This CL changes to not force layout unconditionally based on the
self-needs-layout flag, but instead relies on the scale-factor-changed
flag (and of course specific marking of descendants) to handle this job.
To achieve this, rudimentary scale-factor-changed "detection" is added
to LayoutSVGRoot, as well as code to propagate this state to
descendants. LayoutSVGResourceMarker is modified in a similar fashion.
This is needed to counter-act the removal of the forced layout, since
previously this would propagate to descendants (unconditionally) by
forcing layout in both the root and containers. This effect is now
achieved (for the root) by using the scale-factor-changed signal
instead. This signal will be improved in future CLs.

BUG=603956

Review URL: https://codereview.chromium.org/1920833002

Cr-Commit-Position: refs/heads/master@{#389742}
davve
Modernize fast/hidpi layout tests
 * Add <!DOCTYPE html> to all tests. None of them seem to test
   quirk-mode specific issues.

 * Remove unnecessary <html>, <head> and <body> tags.

 * 4 space indentation.

 * Remove stale FIXME.

 * Drop </img> tags. <img> is a void element.

BUG=605065

Review URL: https://codereview.chromium.org/1908463002

Cr-Commit-Position: refs/heads/master@{#389730}
mstensho
Remove LayoutFlowThread stuff from line layout code.
We used to force full line layout if we had a flow thread with no column sets.
This may have made sense at some point in the past, where we created column
sets on the fly during layout, but we don't do that anymore (because we don't
mutate the layout tree structure during layout anymore). If we have no column
sets, it means that we cannot have any lines, since there's no column content
(because if there were, we'd have at least one column set). So it was a
pointless (albeit harmless) check.

There was also a flow thread check around some code that checks if previously
created lines will be affected by floats in new ways. If this is the right
thing to do for flowthread based fragmentation, it's also the right thing to do
for non-flowthread based (e.g. printing) fragmentation, so just remove the
check.

Also reordered and cleaned up checkPaginationAndFloatsAtEndLine() somewhat. We
don't have to do anything at all unless we have floats. Let's figure this out
as early as possible and bail if we can.

Also locate the last line in the block flow in a simpler way. Call
lastRootBox() instead of walking some chain of lines all the way to the end.

Review URL: https://codereview.chromium.org/1915803004

Cr-Commit-Position: refs/heads/master@{#389720}
sigbjornf
Support WeakMember<const T>.
It is entirely valid to have weak references to const objects, but
this failed to compile tracing calls over such members.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1921733002

Cr-Commit-Position: refs/heads/master@{#389553}
fs
Return the 'active' value for SVGURIReference.href.animVal
Make animVal return the currently used ('active') value instead of always
returning that of 'href'.
This should re-establish the former "invariant" that baseVal === animVal
when '(xlink:)href' is not being animated.

BUG=606200

Review URL: https://codereview.chromium.org/1917843002

Cr-Commit-Position: refs/heads/master@{#389490}
sigbjornf
Unify and generalize thread static persistent finalization.
Make ThreadState's registerAsStaticReference() generally available,
and not specific to LSan-only registration of static persistents
that must be cleared prior to performing leak detection.

By doing so, it can be used to handle thread-local static persistents
also.

Upon a thread finalizing its ThreadState, these static persistents
will be cleared & released. In order to make that safe and not leave
dangling PersistentNode references around afterwards, generalize
the release mechanism to also clear the Persistent/PersistentCollectionBase
that registered the persistent node.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1919663002

Cr-Commit-Position: refs/heads/master@{#389448}
sigbjornf
Make DOMTokenList.prototype.toString enumerable.
As 'stringifier' implies an enumerable toString(), drop the use
of [NotEnumerable] for DOMTokenList's. This also aligns with other
implementations (FF, Edge.)

R=yoav@yoav.ws, philipj@opera.com
BUG=306606

Review URL: https://codereview.chromium.org/1916453002

Cr-Commit-Position: refs/heads/master@{#389442}
davve
Manually rebaseline two tests from r389158
TBR=fs
BUG=601011

Review URL: https://codereview.chromium.org/1916733002

Cr-Commit-Position: refs/heads/master@{#389437}
sigbjornf
Require that heap collections are used over traceable elements.
While it is fully supported, having Blink GC heap collection objects
with elements not themselves being heap objects nor containing
references to such, is unnecessary. And arguably a sign that the code
is unintentionally using a heap collection.

Thus, add static_assert()s which prevent heap collections containing
no traceable references.

R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1912093002

Cr-Commit-Position: refs/heads/master@{#389435}
sigbjornf
Make Selection.prototype.toString() enumerable.
The stringifier for Selection is enumerable,

 https://w3c.github.io/selection-api/#idl-def-Selection

so align with spec and other implementations, and remove the use
of [NotEnumerable].

R=yoichio
BUG=306606

Review URL: https://codereview.chromium.org/1908423003

Cr-Commit-Position: refs/heads/master@{#389427}
sigbjornf
Remove RefCountedGarbageCollected<>.
Exposing a garbage collected object as something ref-counted is
no longer needed, hence the functionality can be removed.

R=
BUG=604481

Review URL: https://codereview.chromium.org/1919643002

Cr-Commit-Position: refs/heads/master@{#389419}
fs
Order bounds update correctly for LayoutSVGShape and LayoutSVGImage
Since SVGResourcesCache::clientLayoutChanged can set the
m_needsBoundariesUpdate flag, make sure to check it, and act, after
that call. This ensures that state is consistent. when layout() return.
Also add a comment about the delicate situation in
LayoutSVGShape::layout wrt shape vs. bounds update. Additionally rename
the local variable used to notify the parent that its bounds needs to be
updated to |updateParentBoundaries|.

BUG=603956

Review URL: https://codereview.chromium.org/1907333002

Cr-Commit-Position: refs/heads/master@{#389410}
sigbjornf
Add DataPersistent<> for copy-on-modify and use for StyleFilterData.
Emulate what DataRef<T> provides over ref-counted objects, but
for persistent heap references. DataPersistent<T> values can
be freely copied, but when access()ed before being mutated,
DataPersistent<> ensures that the mutation will happen on
an unshared copy of the underlying heap object (of type T.)

The motivation for doing is to migrate the StyleFilterData fields
that StyleRareNonInheritedData keeps over to use DataPersistent<>
rather than DataRef<>. By doing so, StyleFilterData becomes
a simple GCed object without any ref-counting extras.

R=
BUG=604481

Review URL: https://codereview.chromium.org/1855213002

Cr-Commit-Position: refs/heads/master@{#389400}
sigbjornf
Simplify PointerEventFactory::getPointerIdsOfType() return type.
A Vector<int> is sufficient.

R=
BUG=

Review URL: https://codereview.chromium.org/1906213004

Cr-Commit-Position: refs/heads/master@{#389372}
sigbjornf
Remove unnecessary use of HeapHashMap for InspectorAnimationAgent::m_idToAnimationType.
R=
BUG=

Review URL: https://codereview.chromium.org/1907223002

Cr-Commit-Position: refs/heads/master@{#389369}
sigbjornf
CSSGradientValue::getStopColors(): unnecessary use of HeapVector<>.
No need to involve HeapVector<> over Color.

R=
BUG=

Review URL: https://codereview.chromium.org/1906363002

Cr-Commit-Position: refs/heads/master@{#389368}
sigbjornf
Remove unnecessary use of HeapHashMap for EventHandler::TouchRegionMap.
R=
BUG=

Review URL: https://codereview.chromium.org/1910173003

Cr-Commit-Position: refs/heads/master@{#389367}
fs
Remove unnecessary full-subtree layouts for filtered SVG containers
The presence of a filter on a container (or the SVG root) would force
a layout of the entire subtree if any child needed a layout. This used
to serve the purpose of making sure that the entire subtree would get
repainted (an artifact of how 'filter' is handled on SVG elements.)
With the current paint invalidation system, this should however make
no practical difference, since the layout of the subtree will only
end up marking descendant LayoutObjects as "maybe needing paint
invalidation" - which the ones that didn't actually change don't - and
hence for these nothing will be invalidated.
The container itself will be invalidated via the call to
SVGResourcesCache::clientLayoutChanged, which will mark it for paint
invalidation if it has instantiated a filter resource.

BUG=603956

Review URL: https://codereview.chromium.org/1907273002

Cr-Commit-Position: refs/heads/master@{#389283}
mstensho
Remove unused LayoutObject::mapAbsoluteToLocalPoint().
Review URL: https://codereview.chromium.org/1916543002

Cr-Commit-Position: refs/heads/master@{#389266}
mstensho
Support for mapping from outer/visual to flowthread coord space in nested multicol.
Review URL: https://codereview.chromium.org/1919453002

Cr-Commit-Position: refs/heads/master@{#389249}
mstensho
Don't allow column spanners inside transforms.
Spanners want the multicol container as their containing block. Transforms want
to be the containing block of everything inside. Since it's not possible to
fulfill both wishes, just refuse objects to become spanners when inside
transforms. We already do the same when inside out-of-flow objects, and also
for anything that establishes a new formatting context.

BUG=596863

Review URL: https://codereview.chromium.org/1908393002

Cr-Commit-Position: refs/heads/master@{#389207}
davve
Align image sizes for SVG with raster image size
The background geometry calculations has heuristics for tiling image
sizes optimized for integer image sizes (at least in effective zoom ==
1). Rounding SVG image sizes before zoom application makes SVG images
fit better into the existing heuristics.

BUG=601011

Review URL: https://codereview.chromium.org/1912063004

Cr-Commit-Position: refs/heads/master@{#389158}
mstensho
ColumnBalancer: Don't leak the break-after value from the previous sibling to children.
The break-after value of an object should only be considered and joined with
the break-before value of the next in-flow sibling. Said sibling should not let
its children see this value, or anything like that. Doing that might trick the
balancer into believing that we have more forced breaks than what we actually
have.

So there's no point in storing this state as a member in ColumnBalancer. Keep
it local to each object instead.

BUG=605902

Review URL: https://codereview.chromium.org/1913453002

Cr-Commit-Position: refs/heads/master@{#389144}
mstensho
Shift visual-to-flowthread coordinate space conversion one level up in the tree.
The same was done for the opposite operation, i.e. flowthread-to-visual
coordinate space conversion, in mapLocalToAncestor(), in
https://codereview.chromium.org/1819603003 . Let's do the same in
mapAncestorToLocal(), so that we're more consistent. This doesn't fix any known
bugs, but it sure makes sense that mapLocalToAncestor() be the opposite of
mapAncestorToLocal(). This also makes it less of a headache to write unit
tests, since you can now feed transformState1 into
obj->mapLocalToAncestor(parent) and get transformState2 back, then feed
transformState2 into obj->mapAncestorToLocal(parent) and then be back at
transformState1.

Review URL: https://codereview.chromium.org/1908353002

Cr-Commit-Position: refs/heads/master@{#389143}
mstensho
Spec-compliant parsing and initial values for 'orphans' and 'widows'.
The initial values for these properties should be '2', not 'auto'. 'auto' isn't
even an allowed value in the spec. So remove support for that completely.

FWIW: 'auto' used to mean pretty much the same as '1'.

Quite a few tests have to be updated because of this change, typically because
they assume that there are no orphans and widows requirements, meaning that
there'd be no breaking restrictions between lines. In those cases, now that the
initial value is '2', we need to set 'orphans' and 'widows' to '1' explicitly
if we don't want any restrictions. There are also some non-layout tests that
expect the initial value to be 'auto' or '1'. In those cases we need to just
update the expectations to be '2' instead.

BUG=473509

Review URL: https://codereview.chromium.org/1909233002

Cr-Commit-Position: refs/heads/master@{#389061}
mstensho
Don't lose the pagination strut when a line is re-created.
If there's not enough room for a line in a column, so that it gets pushed to
the next one, and there's a float at the top of the next column, the available
line width changes, and we need to re-create the line at the new position. Do
not lose the pagination strut in the process, or the column balancer might
over-stretch the columns, since it might fail to find the lowest possible space
shortage for the next layout pass. So store the strut so that we can re-apply
it when the new line has been created.

Since we now store the strut of such lines while they're being re-created, this
can be used as a flag to skip positioning of out-of-flow objects and floats. In
other words, we can retire the logicalWidthIsAvailable flag (which was a really
confusing name anyway).

Review URL: https://codereview.chromium.org/1905923002

Cr-Commit-Position: refs/heads/master@{#388884}
sigbjornf
Have (new URLSearchParams(initString)) skip initial '?'.
The spec now requires that when a URLSearchParams is initialized from
a string, an initial '?' should be ignored from that string,

 https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams

It accommodating usage like (new URLSearchParams(url.search))

R=
BUG=601425

Review URL: https://codereview.chromium.org/1906773002

Cr-Commit-Position: refs/heads/master@{#388842}
mstensho
Prioritize first-lines over orphans when deciding whether to propagate a strut.
The orphans code piece simply blindly propagates the strut to the block if the
orphans requirement isn't satisfied. It's incapable of inserting a break at a
class C break point [1] (i.e. before the first line in the block), while the
first-line code piece handles this just fine (since this is easy to do when at
the first line, but not when at a later line).

If we're at a non-first line at the time of breaking, there's no support for
going back to insert a break before the first line. That has to be done when
processing the first line, not later on. Flip the priority, so that orphans
requirements aren't even checked if we're at the first line. There's no need
then. We always try to avoid breaking before the first line anyway.

[1] https://drafts.csswg.org/css-break/#possible-breaks

Review URL: https://codereview.chromium.org/1908643003

Cr-Commit-Position: refs/heads/master@{#388838}
fs
Rename transformToRoot:ish names to screenScaleFactorChanged:ish ones
This better reflects the function of this machinery, since it's used to
update the scale of fonts based on the computed "screen scale factor".

BUG=603956

Review URL: https://codereview.chromium.org/1911473002

Cr-Commit-Position: refs/heads/master@{#388749}
philipj
Measure usage of generated documents (image/media/plugin/etc)
As discussed on blink-dev:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/u79ubJvsTbI/c_kSGKrEAgAJ

This *InFrame counters are intended as an estimate of cases where a
script in the containing document could look at the generated DOM.

BUG=597380
R=esprehn@chromium.org,pdr@chromium.org
TBR=isherman@chromium.org

Review URL: https://codereview.chromium.org/1866343002

Cr-Commit-Position: refs/heads/master@{#388723}
mstensho
Remove special-code for paginating floats followed by lines of text.
If a float is pushed to the next fragmentainer, we used to push any lines
established by consecutive sibling content along with it, even if they would
fit in the previous fragmentainer. As a contrast to this, we did not do the
same to consecutive blocks - only to lines!

What blocks do makes the most sense [1]. Do the same for lines.

[1] Discussed here: https://lists.w3.org/Archives/Public/www-style/2015Sep/0002.html

Added two new tests. The one that has a block with text following a float also
worked before this CL, but I added it to demonstrate how ridiculous it is to
behave differently here, simply depending on whether it's a line or a block.

Some existing tests needed an update, because they depended on the previous
behavior.

Review URL: https://codereview.chromium.org/1899193007

Cr-Commit-Position: refs/heads/master@{#388701}
mstensho
Translate flow thread coords to the nearest enclosing coord space when appropriate.
We used to always convert to the visual coordinate space, meaning that we
walked all enclosing fragmentation contexts. However, only the PaintLayer code
wants this behavior, while everyone else typically wants to do one
fragmentation context at a time, e.g. when walking the ancestry with
LayoutObject::mapLocalToAncestor().

For nested multicol, this caused invalidation bugs, problems with
getClientRects(), and maybe more.

Added an enum CoordinateSpaceConversion (with values "Containing" and "Visual")
for flowThreadTranslationAtOffset() to use to determine which conversion to
perform. The old behavior was to always do CoordinateSpaceConversion::Visual.

BUG=604883

Review URL: https://codereview.chromium.org/1907443003

Cr-Commit-Position: refs/heads/master@{#388692}
fs
Drop transform-change propagation from LayoutSVGHiddenContainer::layout
No real transform changes should be detected in LayoutSVGHiddenContainer
since it's used for things making up (==roots of) "isolated subtrees".

BUG=603956

Review URL: https://codereview.chromium.org/1905533003

Cr-Commit-Position: refs/heads/master@{#388578}
sigbjornf
Expose toString() as enumerable on some objects.
URL, WorkerLocation and implementations of HTMLHyperlinkElementUtils
are required per spec to expose an enumerable toString() method.

Remove uses of [NotEnumerable] for these.

R=philipj@opera.com, jochen
BUG=306606

Review URL: https://codereview.chromium.org/1905553002

Cr-Commit-Position: refs/heads/master@{#388521}
fs
Move the m_didTransformToRootUpdate flag to LayoutSVGContainer
By pushing the update of the m_didTransformToRootUpdate flag out of the
various calculateLocalTransform() implementations, we both get
implementations of those methods that are more to the point, and expose
the redundant calls to SVGLayoutSupport::transformToRootChanged().
This also means that didTransformToRootUpdate() is devirtualized,
although it was never called "virtually" before either.
Also turn m_needsBoundariesUpdate into a single-bit flag.

BUG=603956

Review URL: https://codereview.chromium.org/1904683002

Cr-Commit-Position: refs/heads/master@{#388516}
sigbjornf
Remove Disposed as a DocumentLifecycle state.
With Oilpan, Documents no longer have an observable 'disposed' state.

R=
BUG=585328

Review URL: https://codereview.chromium.org/1906483002

Cr-Commit-Position: refs/heads/master@{#388498}
sigbjornf
Avoid PageAllocator::s_allocPageErrorCode races.
R=
BUG=601579

Review URL: https://codereview.chromium.org/1903763002

Cr-Commit-Position: refs/heads/master@{#388491}
sigbjornf
Add missing IDL parser support for 'stringifier readonly attribute'.
R=
BUG=306606

Review URL: https://codereview.chromium.org/1900873006

Cr-Commit-Position: refs/heads/master@{#388484}
philipj
Make setBaseAndExtent's arguments non-optional
These arguments are already non-optional in Edge. Firefox doesn't
support setBaseAndExtent. In WebKit the arguments are still optional.

For the first three arguments, the risk is bounded by the
SelectionSetBaseAndExtentNull use counter, which rbyers@ reports as ~0%
on the stable channel. If the fourth argument is omitted the use counter
wouldn't catch that, however. (The use counter can also be triggered by
explicitly passing null, which is likely the most common case.)

BUG=460722

Review URL: https://codereview.chromium.org/1785663002

Cr-Commit-Position: refs/heads/master@{#388460}
davve
Compensate for source scaling in hidpi mode
In crrev.com/379801 scaling of hidpi nine piece image grids was
changed from using the real image size to using the "layout'ed" image
size (i.e. image size compensated by image scale factor) since that is
what Image::imageSize() returns. Instead the computed source rect was
scaled afterwards, right before drawing.

If GraphicsContext.drawTiledImage() is called with (stretch, stretch)
as tile rules, it ignores the passed scale factor and computes the
scale factor between source and destination itself. However, if one
rule is stretch and the other one repeat, or if both are repeat, the
tile scale factor is used when drawing and the relation between the
sizes of source and dest ignored.

What was missing from crrev.com/379801 was to compensate for the image
scale factor by adjusting tileScale. That meant that the (stretch,
stretch) worked fine but as soon as one repeat was specified, the
scale factor was wrong.

BUG=601544

Review URL: https://codereview.chromium.org/1901103002

Cr-Commit-Position: refs/heads/master@{#388451}
tmoniuszko
Fix GN freeze on generating Visual Studio projects
There's an infinite loop while searching for parent directory. It happens
when drive letter case is mixed in absolute paths on Windows (/C:/foo and
/c:/foo). It's easily reproducible on MSYS terminals when system-absolute
paths are used for some targets and source root-absolute (//foo/bar) paths
are used for other targets.

BUG=

Review URL: https://codereview.chromium.org/1897213002

Cr-Commit-Position: refs/heads/master@{#388443}
ljagielski
Build: disable icf for gcc builds with bundled gold
Gold doesn't respect section alignment when merging symbols
https://sourceware.org/bugzilla/show_bug.cgi?id=17704

BUG=576197

Review URL: https://codereview.chromium.org/1887303003

Cr-Commit-Position: refs/heads/master@{#388437}
fs
Pass first child to SVGLayoutSupport::layoutChildren
Since everything depending on the "subtree root" has now been hoisted
into the callers, we can pass firstChild() instead and avoid calling
slowFirstChild().

BUG=603956

Review URL: https://codereview.chromium.org/1897273002

Cr-Commit-Position: refs/heads/master@{#388337}
fs
Hoist "layout size changed" check out of SVGLayoutSupport::layoutChildren
For LayoutSVGRoot, this predicate can be computed quite easily, so
calling layoutSizeOfNearestViewportChanged() will be an unnecessary
detour.
Also rearrange layoutSizeOfNearestViewportChanged() to avoid an
unnecessary virtual call.

BUG=603956

Review URL: https://codereview.chromium.org/1902073002

Cr-Commit-Position: refs/heads/master@{#388332}
mstensho
Make MultiColumnFragmentainerGroup::m_columnSet const.
Ideally, I'd like to get rid of the member altogether, but that would require a
lot of refactoring.

This is a preparatory patch for a fix for bug 604609.

BUG=604609

Review URL: https://codereview.chromium.org/1898293003

Cr-Commit-Position: refs/heads/master@{#388326}
fs
Hoist transformToRootChanged() out of SVGLayoutSupport::layoutChildren
This function is really only relevant for LayoutSVG*Containers, and
hence has a stronger logical tie to that part of the hierarchy. For
LayoutSVGRoot it will always return false.
Also rename the |selfNeedsLayout| argument to |forceLayout|, and the
(somewhat) corresponding local variable |forceLayout] to
|forceChildLayout|.
Eliminate an unnecessary virtual call in transformToRootChanged().
Add const qualifier to didTransformToRootUpdate().

BUG=603956

Review URL: https://codereview.chromium.org/1897263002

Cr-Commit-Position: refs/heads/master@{#388292}
fs
Get rid of SVGLayoutSupport::filtersForceContainerLayout
Save the "has filter resource" part, and rename it to hasFilterResource.
Hoist the normalChildNeedsLayout() part into the callers together with
the comment. This makes the condition for forcing layout of children
of an <svg> (outermost) root or a container more obvious.

Also update a few places to use the new hasFilterResource helper.

BUG=603956

Review URL: https://codereview.chromium.org/1899243002

Cr-Commit-Position: refs/heads/master@{#388284}
fs
Improve default value handling for SVGSVGElement.width/height
When a length attribute is either removed or set to an invalid value,
it would get set to '0'. It should however be set to the initial value
specified for the attribute (possibly presentation attribute) in
question.

The test svg/custom/disallow-non-lengths-in-attrs.html is tweaked to
accommodate for this.

BUG=604093

Review URL: https://codereview.chromium.org/1901673003

Cr-Commit-Position: refs/heads/master@{#388250}
sigbjornf
Always enable warn-raw-ptr's check of raw heap pointers.
This warning option has been default-enabled with Oilpan since 3a192c3
(2015-11-25), checking that we do not keep unmanaged raw pointers or
references in class field types. With the Blink codebase adhering
to that (desirable) constraint, this extra warning has been working
well to keep the codebase in that state.

Make the check always apply with no possibility of opting out; we want
it permanently on.

R=
BUG=604476

Review URL: https://codereview.chromium.org/1901643003

Cr-Commit-Position: refs/heads/master@{#388222}
sigbjornf
Rename URLUtils interface as HTMLHyperlinkElementUtils and update.
Follow the HTML spec for HTMLAnchorElement + HTMLAreaElement, and have
them implement the [NoInterfaceObject] HTMLHyperlinkElementUtils
interface, rather than the previous URLUtils which has now been
retired / divided up.

The other implementation of URLUtils, URL, now define the attributes
directly (with the addition of a searchParams getter.)  Update its IDL
also.

R=
BUG=604644

Review URL: https://codereview.chromium.org/1902683003

Cr-Commit-Position: refs/heads/master@{#388209}
jl
IDL: Merge stringifier/serializer definition from implemented interface
A stringifier defined in a supplemental interface was not merged into the
primary interface, which meant that no 'toString' operation was defined.

Same for serializer definitions and the 'toJSON' operation.

This does not currently change generated code; no supplemental interface
defines a stringifier or serializer.

BUG=306606,469650

Review URL: https://codereview.chromium.org/1901983002

Cr-Commit-Position: refs/heads/master@{#388191}
sigbjornf
Update Blink GC plugin to reflect that Oilpan is now always enabled.
With the Blink codebase having migrated to an Oilpan only state, update
the GC plugin accordingly:

 - drop handling of RawPtr<T>, it no longer exists.
 - remove !ENABLE(OILPAN) specific checks.

R=haraken
BUG=604463

Review URL: https://codereview.chromium.org/1895943002

Cr-Commit-Position: refs/heads/master@{#388188}
mostynb
convert //gpu to std::unique_ptr
BUG=554298
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel
TBR=danakj@chromium.org

Review URL: https://codereview.chromium.org/1859703002

Cr-Commit-Position: refs/heads/master@{#388176}
sigbjornf
Leave out redundant includes for postMessage() method bindings.
R=
BUG=

Review URL: https://codereview.chromium.org/1893283004

Cr-Commit-Position: refs/heads/master@{#388148}
mstensho
Support multiple fragmentainer groups per ColumnBalancer run.
Instead of specifying a fragmentainer group for the operation, we now specify a
column set and a flow thread portion (which may be the portion of one group or
many contiguous groups within the same column set).

The reason for this change is that when calculating space shortage in an inner
multicol container, we need to walk through all fragmentainer groups in one
operation, or we'll miss the column boundaries between the fragmentainer
groups, and only find those that lie between two columns in the same
fragmentainer group. This is especially bad if the inner multicol container
only has one column per fragmentainer group (row), since then *all* column
boundaries lie between two fragmentainer groups, and we wouldn't be able to
find any shortage at all.

BUG=594833

Review URL: https://codereview.chromium.org/1891783002

Cr-Commit-Position: refs/heads/master@{#388070}
mstensho
Append fragmentainer groups in outer multicols first.
We need to evaluate the need for extra fragmentainer groups in ancestral
multicol containers first, so that the inner ones can calculate their column
height restrictions correctly.

BUG=572771

Review URL: https://codereview.chromium.org/1895003002

Cr-Commit-Position: refs/heads/master@{#388017}
mostynb
allow clang toolchains to strip libs as they are built
BUG=509771

Review URL: https://codereview.chromium.org/1882923005

Cr-Commit-Position: refs/heads/master@{#388016}
sigbjornf
Abandon prerenders upon render thread shutdown.
Have PrerenderDispatcher abandon its current prerenders when
the renderer is about to shut down -- doing so later isn't
supported as Blink is about to disappear.

Along with this, on the Blink side, weaken the reference that
a Prerender object keep to its PrerenderClient. The latter
should keep the former alive, but not vice versa -- if no one
is referring to the client within Blink, it can be GCed.
This avoids prolonged retention of prerendering Blink objects.

R=
BUG=604325

Review URL: https://codereview.chromium.org/1900583002

Cr-Commit-Position: refs/heads/master@{#387912}
sigbjornf
Simplify handling of Transferable objects while (de)serializing.
Avoid unnecessary allocations and abstractions in the handling of
transferables. The Transferables now collates the different kinds of
objects that can be transferred via postMessage().

R=
BUG=haraken

Review URL: https://codereview.chromium.org/1893983002

Cr-Commit-Position: refs/heads/master@{#387867}
fs
Refactor the current text position update in SVGTextLayoutEngine
The main change is around the handling of "delta" adjustments
('dx' / 'dy'), that is changed to not require keeping state.
Additionally text-on-a-path layout is changed to track the
displacement from the path (the accumulated delta adjustments
in the perpendicular direction.) Baseline adjustments are
consolidated between code-paths and part of the "fragmentation"
condition is hoisted out of the per-"glyph" loop.

BUG=486669

Review URL: https://codereview.chromium.org/1883553004

Cr-Commit-Position: refs/heads/master@{#387694}
mostynb
move track_audio_renderer.{cc,h} to private_renderer_webrtc_sources
This unbreaks the no-webrtc build after
https://codereview.chromium.org/1891183002

BUG=596174

Review URL: https://codereview.chromium.org/1888183003

Cr-Commit-Position: refs/heads/master@{#387688}
mstensho
Invalidate column rules when the width of a multicol container changes.
BUG=587794

Review URL: https://codereview.chromium.org/1892793002

Cr-Commit-Position: refs/heads/master@{#387624}
mstensho
No reason to prevent subpixel column heights in the initial height calculation.
One test had to be updated, because Element.offsetHeight returns integers. The
column height in the test went from 34 to 33.3333333ish with this code change,
which is 33 if you ask offsetHeight.

Review URL: https://codereview.chromium.org/1879253003

Cr-Commit-Position: refs/heads/master@{#387560}
sigbjornf
Remove remaining OILPAN uses from core/events/
R=
BUG=585328

Review URL: https://codereview.chromium.org/1888043003

Cr-Commit-Position: refs/heads/master@{#387549}
mstensho
Don't call paginatedContentWasLaidOut() until we have the final layout.
Blocks may need relayout because of pagination, and calling
paginatedContentWasLaidOut() before that has taken place could make us account
for a leading pagination strut twice (once before the block child, and once
before the first line inside the block). In a nested multicol context this
could trigger creation of additional fragmentainer groups that will be
unneeded in the end.

This fixes the assertion mentioned in bug 594833, but new ones will pop up
instead, because of brokenness in the column balancer. That will be fixed in a
separate CL.

BUG=594833

Review URL: https://codereview.chromium.org/1883163002

Cr-Commit-Position: refs/heads/master@{#387548}
sigbjornf
Remove OILPAN from core/dom/shadow/
R=
BUG=585328

Review URL: https://codereview.chromium.org/1884333002

Cr-Commit-Position: refs/heads/master@{#387541}
sigbjornf
Remove OILPAN from core/dom/custom/
R=
BUG=585328

Review URL: https://codereview.chromium.org/1887183002

Cr-Commit-Position: refs/heads/master@{#387540}
sigbjornf
Remove XMLHttpRequest's non-Oilpan support for eager finalization.
R=
BUG=585328

Review URL: https://codereview.chromium.org/1892453002

Cr-Commit-Position: refs/heads/master@{#387538}
mstensho
Correct inline-block baseline calculation for multicol containers.
The last line of something inside a multicol container is in the flow thread
coordinate space, so we have to translate the baseline block offset into the
visual coordinate space.

BUG=335861

Review URL: https://codereview.chromium.org/1887793002

Cr-Commit-Position: refs/heads/master@{#387472}
fs
Replace CR/NL by space - don't remove altogether when xml:space=default
This moves handling of xml:space=default closer to the more generic
white-space handling, by not removing CR and NL characters, but rather
just replacing them with a regular space.
This modifies behavior, but means aligning with non-WebKit browser
engines.
This also simplifies the code a bit - with promise of further
simplification (or rather assimilation.)

TEST=svg/custom/text-whitespace-handling.svg
BUG=602606, 366558

Review URL: https://codereview.chromium.org/1888823002

Cr-Commit-Position: refs/heads/master@{#387440}
sigbjornf
Remove RawPtr.h
No longer used, so retire this Oilpan transitional wrapper type.

R=
BUG=585328

Review URL: https://codereview.chromium.org/1884113002

Cr-Commit-Position: refs/heads/master@{#387300}
fs
Reorder metrics iteration in LayoutSVGInlineText::updateMetricsList
This changes iteration to iterate BidiRuns and then collect metrics for
all characters in each run.

BUG=594058

Review URL: https://codereview.chromium.org/1880453002

Cr-Commit-Position: refs/heads/master@{#387283}
sigbjornf
Remove remaining binding layer RawPtr<>s.
R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1883663005

Cr-Commit-Position: refs/heads/master@{#387278}
rune
Allow multiple host pseudos in same compound.
As part of optimizing away :host(-context) selectors which never may
match, we also skipped selectors with multiple :host(-context) pseudos
in the same compound.

Removed assert in findBestRuleSetAndAdd as that would now be required
to traverse the whole compound again to cover everything.

BUG=601585

Review URL: https://codereview.chromium.org/1872343002

Cr-Commit-Position: refs/heads/master@{#387263}
sigbjornf
Remove unnecessary CanvasAsyncBlobCreator keep alive protection.
Closures keep their GCed arguments and |this| alive until completed,
hence manual keep-alive handling on top of that isn't required
for CanvasAsyncBlobCreator.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1882563003

Cr-Commit-Position: refs/heads/master@{#387260}
rune
Check willValidate() for :in-range and :out-of-range.
:in-range and :out-of-range should only match elements which are
candidates for constraint validation[1], and they are not when they are
disabled or read-only.

https://html.spec.whatwg.org/multipage/scripting.html#selector-in-range

R=tkent@chromium.org
BUG=602568

Review URL: https://codereview.chromium.org/1890633002

Cr-Commit-Position: refs/heads/master@{#387258}
sigbjornf
Safely iterate over MediaStreamSource observers.
When changing the ready state of this object, the resultant dispatching of
events by its observers may extend the observer set. Take a snapshot of
the observers, so as to be able safely iterate over it across additions.

R=
BUG=602273

Review URL: https://codereview.chromium.org/1885053002

Cr-Commit-Position: refs/heads/master@{#387243}
mstensho
ColumnBalancer: don't skip bounds checking on first or last fragmentainer groups.
There should be no need for this special-code. Whatever manages to end up
before the first column or after the last one is totally uninteresting to the
column balancer.

Review URL: https://codereview.chromium.org/1886703002

Cr-Commit-Position: refs/heads/master@{#387150}
mstensho
ColumnBalancer: Count line box overflow as space shortage.
Even if the line itself fits nicely inside a column, it may have bottom
overflow that crosses a column boundary. This needs to be counted as space
shortage, or the column balancer might end up over-stretching the columns.

LayoutTests/ietestcenter/css3/multicolumn/column-width-applies-to-007.htm
now passes when opened manually. This used to fail, at least on my machine.

BUG=543487

Review URL: https://codereview.chromium.org/1880283006

Cr-Commit-Position: refs/heads/master@{#387072}
fs
Simplify SVGElement::addToPropertyMap
Shaves a few instructions off (most prominently a call to the QualifiedName
destructor.)

Review URL: https://codereview.chromium.org/1883773003

Cr-Commit-Position: refs/heads/master@{#387024}
rune
Compare font-feature-settings as part of Font::operator==().
We only did a pointer comparison which always failed when doing a style
recalc since a style recalc always creates a new FontFeatureSetting
object.

R=eae@chromium.org
BUG=602802,602959

Review URL: https://codereview.chromium.org/1887613002

Cr-Commit-Position: refs/heads/master@{#387001}
sigbjornf
Remove never instantiated methods from PartitionAllocator.
R=
BUG=585328

Review URL: https://codereview.chromium.org/1883593006

Cr-Commit-Position: refs/heads/master@{#386944}
sigbjornf
Remove ENABLE(OILPAN) from ScriptRunner and PendingScript.
R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1887573002

Cr-Commit-Position: refs/heads/master@{#386938}
mstensho
Introduce fragmentainerGroupCapacity().
During layout, the flow thread portion of the currently last fragmentainer
group is unknown. So instead of calling logicalBottomInFlowThread() or
logicalHeightInFlowThread(), we multiply the column height with the used value
of column-count.

Seems a bit cleaner to wrap this multiplication inside a method.

Review URL: https://codereview.chromium.org/1885513004

Cr-Commit-Position: refs/heads/master@{#386817}
mostynb
remove unneeded scoped_ptr.h inclusions
BUG=554298

Review URL: https://codereview.chromium.org/1855123002

Cr-Commit-Position: refs/heads/master@{#386791}
sigbjornf
include RefCounted.h where needed, only.
R=
BUG=
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review URL: https://codereview.chromium.org/1882003002

Cr-Commit-Position: refs/heads/master@{#386715}
mstensho
X11: Set window class for content_shell.
For Chrome, this happens in DesktopBrowserFrameAuraLinux::GetWidgetParams(),
but there was no counterpart for content_shell.

Setting a window class makes it easier to customize one's window manager for
content_shell.

R=peter@chromium.org

Review URL: https://codereview.chromium.org/1880643002

Cr-Commit-Position: refs/heads/master@{#386657}
fs
Move SVGTextMetricsCalculator to LayoutSVGInlineText.cpp
Mostly plain code move, with some fixups in the (now folded)
updateMetricsList method. Also removes the non-const getter for the
metrics list.

BUG=594058

Review URL: https://codereview.chromium.org/1879453003

Cr-Commit-Position: refs/heads/master@{#386630}
fs
Refactor SVGTextLayoutAttributesBuilder::collectTextPositioningElements
This moves the creation of a TextPosition element for the <text> into
collectTextPositioningElements too, getting rid of the special case.

BUG=594058

Review URL: https://codereview.chromium.org/1878583002

Cr-Commit-Position: refs/heads/master@{#386622}
sigbjornf
Have bindings layer assume and insist that all interface types are GCed.
All interface types are now garbage collected, hence assume that to
hold when generating bindings code. Various simplifications become
possible as a result, like removing WrapperTypeInfo fields to per-type
de/refObject() static functions.

At the .idl level, [GarbageCollected] no longer conveys anything hence
the support (and use) for it is retired here also.

R=
BUG=585328
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review URL: https://codereview.chromium.org/1873323002

Cr-Commit-Position: refs/heads/master@{#386620}
fs
Don't persist the SVGTextLayoutAttributesBuilder
No partial updates are performed on the structures contained within
the builder, so keeping them around between layouts only amounts to
memory wasted. With this change the builder is now more of a proper
builder. buildLayoutAttributesForTextRoot() is folded into
buildLayoutAttributes().

BUG=594058

Review URL: https://codereview.chromium.org/1871393003

Cr-Commit-Position: refs/heads/master@{#386616}
mostynb
convert //courgette to std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1855133002

Cr-Commit-Position: refs/heads/master@{#386511}
mostynb
Convert //sql to use std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1851913002

Cr-Commit-Position: refs/heads/master@{#386451}
tsniatowski
Use clang "--target=x" on android to help icecc
Icecc is confused by the two-argument "-target x" form, and decides to compile
everything locally. --target=x makes it happy.

Review URL: https://codereview.chromium.org/1871813003

Cr-Commit-Position: refs/heads/master@{#386419}
mstensho
Resurrect ASSERT(isFirstAfterBreak(flowThreadOffset()) || !box.paginationStrut()).
This assertion effectively became disabled by accident by
https://codereview.chromium.org/1856373002 , so that fuzzer bug 551312 stopped
asserting, although that bug is still very much present.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1876713003

Cr-Commit-Position: refs/heads/master@{#386418}
sigbjornf
Abandon Prerender upon finalizing PrerenderHandle.
Forcefully sever the connection to the embedder upon the PrerenderHandle
becoming unreachable and unused. Otherwise we risk Prerender leaks
and renderer shutdown crashes when the embedder tries to access Blink
after it has already been shut down.

R=haraken
BUG=602227

Review URL: https://codereview.chromium.org/1872383002

Cr-Commit-Position: refs/heads/master@{#386401}
sigbjornf
Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap.
Thereby having all ScriptWrappable-derived types on the Oilpan heap.

R=haraken,tkent,ortuno
BUG=585328
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review URL: https://codereview.chromium.org/1878463002

Cr-Commit-Position: refs/heads/master@{#386347}
fs
Only hit-test SVG <text> foreground
<text> doesn't have/paint any background, so performing hit-tests for
the various background is a both a waste of time, and gives rise to bugs
in some cases where poor precision renders false positives.
This also matches what LayoutSVGShape does (and <text> is a "graphics
element" just like the basic shapes.)
Rework the 'pointer-events: bounding-box' check to not rely on
nodeAtPoint. It's now somewhat consistent with how containers (<g>) are
handled.
This also affects how hit-testing works w/ 'textLength' ("artificial"
spaces will no longer be considered part of the <text> - this matches
the Firefox behavior.) Adjust svg/animations/svgenum-animation-3.html
to cater to this change in behavior.

BUG=601036

Review URL: https://codereview.chromium.org/1870983002

Cr-Commit-Position: refs/heads/master@{#386308}
fs
Use characters (not code units) when computing value list positions
The value list position is updated by one for each character, and not
at all when spaces are skipped (collapsed). When assigning value list
positions, we are currently counting surrogates as two (on for each
code unit.)
Use the text metrics data to count the number of (non-collapsed)
characters instead.

BUG=597312, 594058

Review URL: https://codereview.chromium.org/1866703002

Cr-Commit-Position: refs/heads/master@{#386305}
fs
Separate metrics update and layout attribute resolving
This splits the walkInlineText() function from SVGTextMetricsBuilder.cpp
into one function for computing the Vector of SVGTextMetrics (called
via updateTextMetrics in LayoutSVGInlineText) and one function for
computing the mapping of layout attributes (updateLayoutAttributes in
SVGTextLayoutAttributesBuilder.cpp).
This in turn mean that the UpdateAttribute helper struct is split and
done away with, similarly TreeWalkTextState.

BUG=594058

Review URL: https://codereview.chromium.org/1861013003

Cr-Commit-Position: refs/heads/master@{#386301}
fs
Invalidate text metrics when the <text> subtree is mutated
When the content of a text node is modified, we would only invalidate
positioning values and not text metrics. This would lead to incorrect or
inconsistent text metrics/fonts being used, which would lead to repaint
bugs and similar issues.
Make sure all mutations to the <text> subtree trigger text metrics re-
computation.

Also take this opportunity to move the definition of the
willBeDestroyed() method for slightly better grouping.

BUG=299497, 594058

Review URL: https://codereview.chromium.org/1865923002

Cr-Commit-Position: refs/heads/master@{#386300}
fs
Revert of Reland: Switch components/password_manager code from IPC messages to Mojo. (patchset #4 id:60001 of https://codereview.chromium.org/1866643002/ )
Reason for revert:
Appears to have caused:

FAILED: /b/build/slave/GPU_Linux_Builder/build/src/build/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/chrome/browser/test_support_ui/password_manager_test_base.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DENABLE_MDNS=1 -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_UDEV -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_CLIPBOARD_AURAX11=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_GLIB=1 -DUSE_OPENSSL=1 -DUSE_NSS_CERTS=1 -DUSE_NSS_VERIFIER=1 -DUSE_X11=1 -DENABLE_WEBRTC=1 -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_TOPCHROME_MD=1 -DUSE_PROPRIETARY_CODECS -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=264915-1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DTOOLKIT_VIEWS=1 -DGL_GLEXT_PROTOTYPES -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=0 -DGTEST_HAS_RTTI=0 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_SUPPORT_GPU=1 -DUNIT_TEST -I../.. -Igen -I../../build/linux/debian_wheezy_amd64-sysroot/usr/include/glib-2.0 -I../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/protobuf/src -I../../third_party/protobuf -I../../third_party/khronos -I../../gpu -I../../testing/gtest/include -I../../build/linux/debian_wheezy_amd64-sysroot/usr/include/nss -I../../build/linux/debian_wheezy_amd64-sysroot/usr/include/nspr -I../../third_party/boringssl/src/include -I../../testing/gmock/include -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/gpu -I../../third_party/skia/src/gpu -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -fcolor-diagnostics -fdebug-prefix-map=/b/build/slave/GPU_Linux_Builder/build/src=. -pthread -m64 -march=x86-64 -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -O2 -fno-ident -fdata-sections -ffunction-sections -g0 --sysroot=../../build/linux/debian_wheezy_amd64-sysroot -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -Wheader-hygiene -Wstring-conversion -Wno-header-guard -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -fno-rtti -fno-exceptions -c ../../chrome/browser/password_manager/password_manager_test_base.cc -o obj/chrome/browser/test_support_ui/password_manager_test_base.o
In file included from ../../chrome/browser/password_manager/password_manager_test_base.cc:13:
In file included from ../../chrome/browser/password_manager/chrome_password_manager_client.h:15:
In file included from ../../components/password_manager/content/browser/credential_manager_impl.h:13:
In file included from gen/components/password_manager/content/public/interfaces/credential_manager.mojom.h:26:
gen/components/password_manager/content/public/interfaces/credential_manager.mojom-internal.h:14:10: fatal error: 'url/mojo/origin.mojom-internal.h' file not found
#include "url/mojo/origin.mojom-internal.h"

(https://build.chromium.org/p/chromium.gpu/builders/GPU%20Linux%20Builder/builds/58271/steps/compile/logs/stdio)

Original issue's description:
> Reland: Switch components/password_manager code from IPC messages to Mojo.
>
> Original CL was found breaking android gn build after landed.. #strange
> Fix BUILD.gn and reland.
>
> The original CL:
> https://crrev.com/d20fb918841354a75546fa38b5307aaba117598b
>
> Original CL description follows:
>
> Replace credential_manager_messages.h IPC to Mojo service.
>
> BUG=582391
>
> Committed: https://crrev.com/4a2f71f4c9e9e2c3ac0e4622c12e5dc0c5ebfe24
> Cr-Commit-Position: refs/heads/master@{#386290}

TBR=jochen@chromium.org,amistry@chromium.org,rockot@chromium.org,tsepez@chromium.org,vabr@chromium.org,leon.han@intel.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=582391

Review URL: https://codereview.chromium.org/1872133002

Cr-Commit-Position: refs/heads/master@{#386297}
fs
Add test for metrics invalidation on textnode removal
This tests that text metrics (read: collapsing info) are updated as
needed when a text node is removed.

BUG=299497, 594058

Review URL: https://codereview.chromium.org/1872513005

Cr-Commit-Position: refs/heads/master@{#386223}
mstensho
Correctly account for nested multicol top border / padding.
Top border and padding will be baked into the first LayoutColumnSet object of a
multicol container, but not until the column set is laid out. Since column sets
are laid out after flow threads, use a more reliable way to include top border
and padding.

BUG=552615

Review URL: https://codereview.chromium.org/1863413002

Cr-Commit-Position: refs/heads/master@{#386213}
mostynb
remove klundberg from build/android/OWNERS
Requested over in https://codereview.chromium.org/1875663002/

TBR=mikecase@chromium.org

Review URL: https://codereview.chromium.org/1872043002

Cr-Commit-Position: refs/heads/master@{#386206}
mostynb
support adding symlinks to zip files
Add symlinks as symlinks to zip files, not their target
in place of the symlink.

Review URL: https://codereview.chromium.org/1875663002

Cr-Commit-Position: refs/heads/master@{#386199}
sigbjornf
Add support for URL.searchParams getter.
Add the missing piece to our URLSearchParams implementation;
the readonly attribute for URL, URL.searchParams:

 https://url.spec.whatwg.org/#dom-url-searchparams

The currently spec'ed connection between URL and URLSearchParams is
a lot less general than previous designs, hence the object lifetime
complexities it ran into (see https://codereview.chromium.org/143313002/)
falls away.

Intent to Implement and Ship (for URLSearchParams and this URL attribute):

 https://groups.google.com/a/chromium.org/d/msg/blink-dev/grHZDbldP04/JdsoQ169AQAJ

R=mkwst
BUG=303152

Review URL: https://codereview.chromium.org/1860623002

Cr-Commit-Position: refs/heads/master@{#386189}
fs
Wait for 'load' in svg/wicd/test-rightsizing-b.xhtml
BUG=444095

Review URL: https://codereview.chromium.org/1874723002

Cr-Commit-Position: refs/heads/master@{#386089}
rune
Revert of Don't apply style elements or PIs with loading imports. (patchset #2 id:20001 of https://codereview.chromium.org/1867513002/ )
Reason for revert:
This change is incompatible with what Gecko and Blink used to do when inserting an @import rule with insertRule() into a style element sheet.

Inserting a style element with script, immediately followed by an @import insertRule() behaves differently than inserting the style element containing that @import rule in the text because the <style> element is processed before the insertRule. Both Gecko and Blink (without this CL) applies the main stylesheet while the @import inserted with insertRule is loading, while they don't when @import is part of the text node child.

The behavior for inserting @import is not specified, and zcorpan reported [1].

[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=29566

Original issue's description:
> Don't apply style elements or PIs with loading imports.
>
> updateLayoutTreeIgnorePendingStylesheets may resolve styles when sheets
> are loading. For link elements, the main stylesheet is not applied if
> any of its @imports are still loading. For style elements and
> xml-stylesheets, we did apply the contents of the main stylesheet while
> its @imports were loading. That means we applied half-baked stylesheets
> and we had an inconsistency between link and style. Instead regard
> style elements and processing instructions as loading when @imports are
> loading.
>
> BUG=600733
>
> Committed: https://crrev.com/456c101025b6c470dce2a6af3b0d70cb2950a980
> Cr-Commit-Position: refs/heads/master@{#385564}

TBR=esprehn@chromium.org,timloh@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=600733

Review URL: https://codereview.chromium.org/1867753006

Cr-Commit-Position: refs/heads/master@{#386081}
sigbjornf
Clean up CompositorPendingAnimations inclusion.
No need for Document.h to include this header; remove +
follow up on various IWYU violations that surfaces as a
result.

Also tidy up IntersectionObserver inclusion + remove its
non-Oilpan code.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1870963002

Cr-Commit-Position: refs/heads/master@{#386042}
hugoh
Add ssl_error's dependency to network_time in gyp
https://codereview.chromium.org/1772143002 updated
BUILD.gn but not the corresponding ssl_errors.gypi.

Without this fix gyp-builds get undefinded references
to NetworkTimeTracker::GetNetworkTime() when linking.

BUG=589700

Review URL: https://codereview.chromium.org/1865493002

Cr-Commit-Position: refs/heads/master@{#386025}
sigbjornf
Prerender need to be on the Oilpan heap.
The object implementing the PrerenderClient is LinkLoader, which is
an object that's Oilpan heap allocated. Consequently, it cannot be
kept Prerender as a bare pointer, but needs to be traced and accounted
for during garbage collections.

The simplest way to handle that is to move Prerender to the Oilpan
heap.

R=haraken,jochen
BUG=

Review URL: https://codereview.chromium.org/1862593005

Cr-Commit-Position: refs/heads/master@{#386007}
rune
Plugin element widget may be a RemoteFrameView.
Corrected ASSERT and re-enabled test.

Removed ENABLE(OILPAN) ifdef in the neighborhood since its removal is
in progress.

R=dcheng@chromium.org,lukasza@chromium.org
BUG=601581

Review URL: https://codereview.chromium.org/1872653002

Cr-Commit-Position: refs/heads/master@{#386005}
sigbjornf
Add setIndexedDBClientCreateFunction() explanatory comment.
Follow up changes in r385772 and r385733 with a comment to
try to explain why update atomicity matters here.

R=
BUG=598551, 599011
NOTRY=true

Review URL: https://codereview.chromium.org/1862223005

Cr-Commit-Position: refs/heads/master@{#386000}
mstensho
Only allow forced fragmentainer breaks at class A break points.
https://drafts.csswg.org/css-break/#possible-breaks
https://drafts.csswg.org/css-break/#forced-breaks

The essential change is that forced breaks are not allowed before a first child
or after a last child, only between siblings. Floats and auto-positioned
out-of-flow siblings after the last in-flow child still need to honor the
break-after value of said last in-flow child, though.

Updated the forced-break-before-complex-margin-collapsing.html test, since it
became invalid. Top margins after forced breaks should not be eaten by the
column boundary. It also made an incorrect assumption about inserting a forced
break in front of a first child block. That's no valid class A break point.

This change also made printing/css2.1/page-break-after-003.html pass, which
has a break-after:page block with no in-flow block following it - i.e. there'll
be no class A break point for it to have any effect. It should not create a
blank page at the end.

BUG=223068,539873

Review URL: https://codereview.chromium.org/1856373002

Cr-Commit-Position: refs/heads/master@{#385955}
mstensho
Make top-layer elements work also when the viewport is paginated.
When the viewport is paginated (by overflow:-webkit-paged-* specified on HTML
or BODY), top-layer elements are redirected to a flow thread, along with
everything else. So we have to go through the children of the flow thread, not
the children of the layout view, when looking for them.

BUG=594306

Review URL: https://codereview.chromium.org/1850153002

Cr-Commit-Position: refs/heads/master@{#385883}
mboc
Export the tablet mode checking function from base.
BUG=

Review URL: https://codereview.chromium.org/1838993002

Cr-Commit-Position: refs/heads/master@{#385832}
sigbjornf
Avoid IndexedDBClient::create() read race.
R=haraken
BUG=598551

Review URL: https://codereview.chromium.org/1869013002

Cr-Commit-Position: refs/heads/master@{#385772}
sigbjornf
Avoid setIndexedDBClientCreateFunction() write race.
R=haraken
BUG=599011

Review URL: https://codereview.chromium.org/1862403002

Cr-Commit-Position: refs/heads/master@{#385733}
fs
Rebaseline svg/wicd/test-rightsizing-b.xhtml
Get latest result from the bots.

TBR=davve@opera.com
BUG=444095

Review URL: https://codereview.chromium.org/1865263002

Cr-Commit-Position: refs/heads/master@{#385713}
sigbjornf
Make VTTParserClient the GC mixin it needs to be.
Unsafe for the VTTParser to keep a raw pointer to the GCed object
implementing this client interface.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1870603002

Cr-Commit-Position: refs/heads/master@{#385688}
tmoniuszko
Accept absolute Windows paths without leading slash in GN commands
Leading slash is removed before path is passed to GN when command is run
on MSYS shell. See http://www.mingw.org/wiki/Posix_path_conversion.

BUG=590686

Review URL: https://codereview.chromium.org/1742303002

Cr-Commit-Position: refs/heads/master@{#385686}
tsniatowski
Add android_libcpp_lib_dir gn arg
Port android_libcpp_libs_dir from gyp, where it was possible to override
this directory. Allows using a custom libc++ easily.

BUG=359249

Review URL: https://codereview.chromium.org/1865853002

Cr-Commit-Position: refs/heads/master@{#385679}
sigbjornf
Have the mock PlatformSpeechSynthesizer ignore pause/resume sometimes.
Should pause()/resume() be attempted without nothing being currently
spoken, just ignore.

R=
BUG=600664

Review URL: https://codereview.chromium.org/1861323003

Cr-Commit-Position: refs/heads/master@{#385670}
rune
Don't persist plugins across reattach for widget updates.
HTMLPluginElement::lazyReattachIfNeeded() is called for changes where we
expect the plugin to be re-initialized. For instance, if the type or
data attributes changes on <object>. In theory, a detach() as part of a
plugin-persisting lazy re-attach done previously may already have put
the plugin widget into the persisted plugin widget member. In that case
we will return early from detach() which is why we're resetting the
persisted widget in lazyReattachIfNeeded() instead of handling it in
detach().

R=esprehn@chromium.org
BUG=567329

Review URL: https://codereview.chromium.org/1866153002

Cr-Commit-Position: refs/heads/master@{#385590}
rune
Don't apply style elements or PIs with loading imports.
updateLayoutTreeIgnorePendingStylesheets may resolve styles when sheets
are loading. For link elements, the main stylesheet is not applied if
any of its @imports are still loading. For style elements and
xml-stylesheets, we did apply the contents of the main stylesheet while
its @imports were loading. That means we applied half-baked stylesheets
and we had an inconsistency between link and style. Instead regard
style elements and processing instructions as loading when @imports are
loading.

BUG=600733

Review URL: https://codereview.chromium.org/1867513002

Cr-Commit-Position: refs/heads/master@{#385564}
mostynb
Convert //sandbox to use std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1849323003

Cr-Commit-Position: refs/heads/master@{#385445}
mostynb
fix incorrect libstdc++ from GCC >= 5.1 check
Assume that libstdc++ from GCC >= 5.1 is being used only when compiling with GCC >= 5.1.

This unbreaks GCC 4.8.5 and 4.9.3 builds after https://codereview.chromium.org/1837563002/
landed.

Review URL: https://codereview.chromium.org/1863523005

Cr-Commit-Position: refs/heads/master@{#385416}
sigbjornf
Remove ENABLE(OILPAN) uses in wtf/
R=
BUG=585328

Review URL: https://codereview.chromium.org/1863753002

Cr-Commit-Position: refs/heads/master@{#385411}
mstensho
Initialize child framesets when they become part of the parent frameset grid.
The number of child frames and framesets in a parent frameset grid may be
increased by a script after initial layout. Framesets that initially were not
part of the grid were left uninitialized, i.e. their GridAxis objects are
empty, and the layout object size is 0x0. As soon as such a frameset becomes
part of the grid later on, it typically gets a size, which positionFrames()
will detect and lay it out. However, since zero-width columns and zero-height
rows are allowed, if the size of the child frameset remains at 0x0, we cannot
just base the need for layout (which initializes the frame sets) on them
getting a new size.

BUG=594834

Review URL: https://codereview.chromium.org/1848033004

Cr-Commit-Position: refs/heads/master@{#385404}
fs
Simplify layout attribute invalidation in LayoutSVGText
Move invalidation to a new method (invalidatePositioningValues), and
also make sure to clear LayoutSVGText::m_layoutAttributes to make it
more robust.

BUG=405966, 594058

Review URL: https://codereview.chromium.org/1856393002

Cr-Commit-Position: refs/heads/master@{#385274}
mstensho
Adding tall content may require insertion of more than one additional column row.
There's no guarantee that adding just one column row has created enough columns
to flow the content into. So add as many as we need.

Review URL: https://codereview.chromium.org/1864493002

Cr-Commit-Position: refs/heads/master@{#385226}
fs
Rebuild layout attributes on layout instead of on layout tree updates
What layout attributes are used (for a text node; LayoutSVGInlineText),
depends on how many "characters" precedes the node in question.
Layout attributes were updated on insertions and removals on the layout
tree, by find the node to update, and update the surrounding nodes.
It were however trying to depend on the order in which nodes were being
attached, which meant that a sequence of updates could lead to incorrect
layout attribute (indices) being computed. The process per node is also
essentially O(n) (albeit a fairly cheap such.)
Instead of updating on add/remove/update of nodes, just mark the position
data as invalid, and update on the next layout of the <text> root. This
also has the side-effect of simplifying the code quite significantly,
and should avoid repeatedly resolving the layout attribute indices.

Also take the opportunity to pass LayoutSVGText references and simplify
related code a bit.

BUG=405966, 594058

Review URL: https://codereview.chromium.org/1854123002

Cr-Commit-Position: refs/heads/master@{#385149}
sigbjornf
Update Source/platform/ to assume Oilpan only.
R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1860903002

Cr-Commit-Position: refs/heads/master@{#385145}
fs
Fold 'rotate' attribute semantics into the attribute list iterator
With a small increase in complexity in the updateCharacterData() method
in the AttributeListsIterator helper, the loop handling the 'rotate'
"tail" semantics can be folded into the loop updating all attributes.

Review URL: https://codereview.chromium.org/1849353002

Cr-Commit-Position: refs/heads/master@{#385128}
sigbjornf
Avoid unnecessary DocumentElementSetMap hash table updates.
Alter the representation of the singleton map used to track the
correspondence between Documents and their media elements.

Additions and removals become slightly cheaper as a result.

R=
BUG=

Review URL: https://codereview.chromium.org/1852423003

Cr-Commit-Position: refs/heads/master@{#385126}
fs
Iteration helper for SVGTextLayoutAttributesBuilder::fillCharacterDataMap
Add helper AttributeListsIterator that keeps the iteration state for
the x, y, dx, dy and rotate attribute lists.

Review URL: https://codereview.chromium.org/1854853002

Cr-Commit-Position: refs/heads/master@{#385124}
sigbjornf
Remove unused DEFINE_STATIC_REF_WILL_BE_PERSISTENT().
R=
BUG=585328

Review URL: https://codereview.chromium.org/1858823002

Cr-Commit-Position: refs/heads/master@{#385062}
rune
Removed TODO as non-matching host rules are skipped earlier.
The TODO comment was about non-matching selectors like "div:host" or
":host.class". Such selectors are ignored for RuleSet when returning
SelectorNeverMatches from collectFeaturesFromRuleData.

R=timloh@chromium.org,esprehn@chromium.org

Review URL: https://codereview.chromium.org/1855853004

Cr-Commit-Position: refs/heads/master@{#385025}
mostynb
convert //mash to std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1857623003

Cr-Commit-Position: refs/heads/master@{#384948}
mostynb
convert //chrome_elf to std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1858493002

Cr-Commit-Position: refs/heads/master@{#384925}
sigbjornf
Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects.
Extend DEFINE_STATIC_LOCAL() to automatically wrap up heap objects
being exposed as static singletons -- the wrapping happening by
way of a Persistent<>.

With that in place, simplify various uses of DEFINE_STATIC_LOCAL()
along with phasing out the use of DEFINE_STATIC_REF_WILL_BE_PERSISTENT()
entirely.

R=haraken
BUG=585328

Committed: https://crrev.com/18dc8ecff5ba68d28fc536f723ae3c57eafa1b4e
Cr-Commit-Position: refs/heads/master@{#384887}

Review URL: https://codereview.chromium.org/1850413002

Cr-Commit-Position: refs/heads/master@{#384904}
sigbjornf
Simplify LifecycleNotifier and Observer.
With Oilpan permanently enabled, let go of some dead code.

R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1858583002

Cr-Commit-Position: refs/heads/master@{#384897}
sigbjornf
Revert of Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (patchset #7 id:120001 of https://codereview.chromium.org/1850413002/ )
Reason for revert:
Don't understand what happened here, but compilation breakage seen https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac%20Builder/builds/155272

Original issue's description:
> Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects.
>
> Extend DEFINE_STATIC_LOCAL() to automatically wrap up heap objects
> being exposed as static singletons -- the wrapping happening by
> way of a Persistent<>.
>
> With that in place, simplify various uses of DEFINE_STATIC_LOCAL()
> along with phasing out the use of DEFINE_STATIC_REF_WILL_BE_PERSISTENT()
> entirely.
>
> R=haraken
> BUG=585328
> NOTRY=true
>
> Committed: https://crrev.com/18dc8ecff5ba68d28fc536f723ae3c57eafa1b4e
> Cr-Commit-Position: refs/heads/master@{#384887}

TBR=oilpan-reviews@chromium.org,haraken@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=585328

Review URL: https://codereview.chromium.org/1855203002

Cr-Commit-Position: refs/heads/master@{#384890}
sigbjornf
Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects.
Extend DEFINE_STATIC_LOCAL() to automatically wrap up heap objects
being exposed as static singletons -- the wrapping happening by
way of a Persistent<>.

With that in place, simplify various uses of DEFINE_STATIC_LOCAL()
along with phasing out the use of DEFINE_STATIC_REF_WILL_BE_PERSISTENT()
entirely.

R=haraken
BUG=585328
NOTRY=true

Review URL: https://codereview.chromium.org/1850413002

Cr-Commit-Position: refs/heads/master@{#384887}
mostynb
convert //headless to std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1854043002

Cr-Commit-Position: refs/heads/master@{#384880}
mostynb
convert //testing to std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1855823002

Cr-Commit-Position: refs/heads/master@{#384872}
rune
Fixed ::slotted performance in pure v1 shadow documents.
Instead of traversing all m_treeBoundaryCrossingScopes matching rules
from other scopes, just walk the assignedSlot() chain for resolvers.
This makes rule matching a lot cheaper since quite a lot of components
have tree boundary crossing rules in practice (polymer apps using v0
typically have hundreds of such scopes).

The assumption here is that the assignedSlot chain most of the time
will be quite short and/or cheap to walk.

Introducing a flag set in StyleEngine if there ever exists a v0 shadow
tree to fall back to traversing m_treeBoundaryCrossingScopes when
necessary.

For the slotted.html demo in crbug.com/599833, the full recalc with
~4000 elements goes from ~800ms to ~40ms with this change when each
shadow tree has a ::slotted rule. No substantial regression for the
case without ::slotted rules.

Added a test for /deep/ being used a descendant combinator in a
document without shadow trees, as I feared I might have broken that and
I couldn't find any existing tests for it.

For later, we may choose to never collect m_treeBoundaryCrossingScopes
for pure v1 documents, but that means we would have to recreate that
collection once we add a v0 shadow to the document.

R=kochi@chromium.org,hayato@chromium.org,dglazkov@chromium.org
BUG=599833

Review URL: https://codereview.chromium.org/1853713002

Cr-Commit-Position: refs/heads/master@{#384867}
sigbjornf
Remove now-unused kConstantInModule.
TBR=thakis,wfh
BUG=550065

Review URL: https://codereview.chromium.org/1857693002

Cr-Commit-Position: refs/heads/master@{#384866}
mostynb
remove gwilson from rlz/OWNERS
Review URL: https://codereview.chromium.org/1855833002

Cr-Commit-Position: refs/heads/master@{#384857}
mostynb
convert //apps to std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1851373002

Cr-Commit-Position: refs/heads/master@{#384853}
sigbjornf
Make WTF::IsGarbageCollectedType<> work for GC mixin instances.
The trick that IsGarbageCollectedType<T> uses of probing for the presence
of a "marker" type name within T to detect if T derives from a GC base
or is another kind of heap object, doesn't work for GC mixins.

For instance,

 class Mixin : public GarbageCollectedMixin { ... };
 class Use : public GarbageCollected<Use>, public Mixin {
     USING_GARBAGE_COLLECTED_MIXIN(Use);
     ...
 };

As both GarbageCollected<> and GarbageCollectedMixin<> provide the marker
type name, referring to the marker type name is ambiguous when attempted
over Use. Address the problem by overriding and defining the marker for
mixin instances also.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1851383002

Cr-Commit-Position: refs/heads/master@{#384851}
mostynb
convert //rlz to std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1856623002

Cr-Commit-Position: refs/heads/master@{#384837}
mostynb
Convert //url to use std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1851933002

Cr-Commit-Position: refs/heads/master@{#384831}
mostynb
Convert //gin to use std::unique_ptr
BUG=554298

Review URL: https://codereview.chromium.org/1848423002

Cr-Commit-Position: refs/heads/master@{#384830}
sigbjornf
Simplify ScriptStreamer lifetime handling.
Remove manual keep-alive ref counting for ScriptStreamer across a posted
task; unnecessary as the closure will keep a strong enough reference as-is.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1848443008

Cr-Commit-Position: refs/heads/master@{#384811}
sigbjornf
Hide PingLoader lifetime implementation detail from outside view.
The self-sustaining nature of ping loader objects while the request is
in-flight is an internal implementation detail. Reflect that by having
the class type derive from just GarbageCollectedFinalized> and instead
internally manually manage a SelfKeepAlive<> reference.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1847823007

Cr-Commit-Position: refs/heads/master@{#384810}
sigbjornf
Round out WillBe type removal.
A few leftovers.

R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1850183003

Cr-Commit-Position: refs/heads/master@{#384804}
sigbjornf
HeapSupplements are now just Supplements.
Replace occurrences of HeapSupplement with Supplement and retire the
former name (HeapSupplement.)

R=haraken
BUG=585328

Review URL: https://codereview.chromium.org/1846913009

Cr-Commit-Position: refs/heads/master@{#384803}
mstensho
All ancestor multicols must have enough rows before laying out some inner multicol.
We had code in place to insert new rows (and rows in enclosing fragmentation
contexts) when we ran out of space during layout, but we didn't make sure
initially that enough rows had been created, which would result in calculating
an incorrect column height and cause general confusion.

appendNewFragmentainerGroupIfNeeded() now needs to take a PageBoundaryRule
argument (since the new code in this CL deals with top offsets rather than
bottom offsets).

BUG=597058, 588364

Review URL: https://codereview.chromium.org/1834223008

Cr-Commit-Position: refs/heads/master@{#384800}
mstensho
Correct conversion from flowthread to visual coordinate space when there's border/padding.
If an inner multicol container has border or padding, just using the outer
block offset stored in the inner flow thread won't be good enough. We need to
find the actual first fragmentainer group in the first column set.

Or, put simply: let's do what the comment in the code actually says!

Review URL: https://codereview.chromium.org/1847343003

Cr-Commit-Position: refs/heads/master@{#384737}
ckulakowski
Make global variable gTimeDeltaForTesting lazily created.
It's a fix for compilation error: "declaration requires a global constructor [-Werror,-Wglobal-constructors]"

BUG=

Review URL: https://codereview.chromium.org/1851443003

Cr-Commit-Position: refs/heads/master@{#384724}
sigbjornf
Simplify Supplementables post Oilpan.
R=
BUG=585328

Review URL: https://codereview.chromium.org/1851743002

Cr-Commit-Position: refs/heads/master@{#384689}
fs
Use HashMap::add in SVGTextLayoutAttributesBuilder
Removes some redundancies and eliminates double-hashing.
Do the update of default values last. (Avoids assert in AddResult
destructor.)

Review URL: https://codereview.chromium.org/1847333003

Cr-Commit-Position: refs/heads/master@{#384599}
rune
Removed unused non-const accessors for stylesheet lists.
R=mstensho@opera.com

Review URL: https://codereview.chromium.org/1849203002

Cr-Commit-Position: refs/heads/master@{#384578}
fs
Move metrics list storage to LayoutSVGInlineText
It was previously stored in SVGTextLayoutAttributes (which is stored in
LayoutSVGInlineText). The connection between these two is very loose, so
letting the metrics be a part of the attributes structure doesn't feel
entirely logical. There's still a back-pointer in the attributes
structure, which means it's still reachable in the same way (albeit with
one additional indirection.)
Rename the various accessors to metricsList().

BUG=594058

Review URL: https://codereview.chromium.org/1844723003

Cr-Commit-Position: refs/heads/master@{#384450}
rune
No need to look up Document from Element.
Instead use the document() from StyleResolver.

R=kochi@chromium.org

Review URL: https://codereview.chromium.org/1851463002

Cr-Commit-Position: refs/heads/master@{#384325}
rune
Add trace event for updateActiveStyleSheets.
Added for inspecting performance changes for async stylesheet update
and show how much time stylesheet update will account for when moved to
the updateLayoutTree part of the lifecycle.

Will not be called often enough to cause a performance issue in itself.

R=mstensho@opera.com
BUG=567021

Review URL: https://codereview.chromium.org/1843063005

Cr-Commit-Position: refs/heads/master@{#384237}
fs
Pass LineLayoutSVGInlineText to SVGTextMetricsCalculator
Slightly more on the Layout API bandwagon.

BUG=594058

Review URL: https://codereview.chromium.org/1838363004

Cr-Commit-Position: refs/heads/master@{#384137}
fs
Move SVGTextPositioningElement::elementFromLayoutObject
...to SVGTextLayoutAttributesBuilder.cpp, since that is where it's used.
Turn the entry if into an ASSERT (because it's trivial to see that the
condition always holds in this context.)

BUG=594058

Review URL: https://codereview.chromium.org/1846633002

Cr-Commit-Position: refs/heads/master@{#384136}
mboc
Avoid applying alpha twice in RenderText.
BUG=575186

Review URL: https://codereview.chromium.org/1842693002

Cr-Commit-Position: refs/heads/master@{#384055}
rune
Introduce setNeedsActiveStyleUpdate for adding/removing stylesheets.
Remove the add/remove/modify methods which did not have different
implementations anyway. The plan is to let the async active stylesheet
update detect which StyleSheetContents have been added and which have
been removed and invalidate style and caches accordingly.

I've started to write up the plan here: http://bit.ly/25uxtnU

BUG=567021

Review URL: https://codereview.chromium.org/1843693002

Cr-Commit-Position: refs/heads/master@{#384008}
rune
No need for resolverChanged from xml parser.
StyleEngine::resolverChanged now updates the list of active stylesheets.
At some point resolverChanged caused a synchronous style recalc and
layout tree update. There are indications that XSL transforms also were
hooked into that code based on the comments. XSL transforms are
triggered on XSL PI source loaded or DOM content loaded event. For CSS
stylesheets resolverChanged should be called from the StyleEngine when
sheets finishes loading etc like we do for HTML documents.

Review URL: https://codereview.chromium.org/1767083002

Cr-Commit-Position: refs/heads/master@{#383933}
rune
Ensure fullscreen.css loaded for ancestor invalidation
Using invalidation sets caused regression crbug.com/596803 because we
only ensured the fullscreen.css had features available for style
resolving in the fullscreened element's document. This CL ensures the
features are up-to-date for all fullscreen related pseudoStateChanged.

I was not able to reproduce the problem in 596803, but 448721 also
regressed and I've confirmed this CL fixes that regression.

The added layout test does not fail without this fix because the
full screen implementation in content_shell is different and
setMediaType() for fullscreen on resize causes a full recalc of
everything in content_shell before we try to apply fullscreen style
changes. However, if mediaQueryAffectingValueChanged was smarter when
changing media type to fullscreen. That test would have failed.

BUG=596803

Review URL: https://codereview.chromium.org/1823143002

Cr-Commit-Position: refs/heads/master@{#383711}
fs
Regenerate Win7/Android baselines for a few SVG letter-spacing tests
Didn't appear successful on the first try.

TBR=dgrogan@chromium.org
BUG=583298

Review URL: https://codereview.chromium.org/1827103004

Cr-Commit-Position: refs/heads/master@{#383226}
fs
Always create a BidiRun in SVGTextMetricsBuilder
Create a BidiRun for the 'override' case too, to avoid a bunch of
special cases. Since we always have a BidiRun now, null-checks can be
removed, and code simplified a bit. (Hopefully even more in the future.)
Also make "8-bit" (latin1) strings take this code-path. (This was
handled by the SimpleShaper path previously.)

BUG=594058

Review URL: https://codereview.chromium.org/1826263002

Cr-Commit-Position: refs/heads/master@{#383224}
fs
Add spacingDisabled() check to ShapeResultSpacing
SVGTextLayoutEngine applies letter-spacing and word-spacing itself, so
without this we'd apply the spacing properties twice.
This is essentially a bandaid work-around, until we can figure out how
to handle this in a better way.

BUG=583298

Review URL: https://codereview.chromium.org/1827083002

Cr-Commit-Position: refs/heads/master@{#383078}
tmoniuszko
Convert GN group targets to Visual Studio projects
BUG=596895

Review URL: https://codereview.chromium.org/1819353002

Cr-Commit-Position: refs/heads/master@{#383042}
fs
More explicit SVGTextMetrics construction
This makes SVGTextMetrics dumber - essentially POD - leaving all
measuring etc. to whoever creates one (SVGTextMetricsBuilder/Calculator)
for a minor "cost" in complexity.
This makes SVGTextMetrics not depend on LineLayoutSVGInlineText.

Drop SVGTextMetrics::setWidth too since it's unused.

BUG=594058

Review URL: https://codereview.chromium.org/1825613005

Cr-Commit-Position: refs/heads/master@{#382944}
fs
Move SVGTextMetrics::constructTextRun to SVGTextMetricsBuilder
New resting place is the SVGTextMetricsCalculator helper class.
This avoids using this function to create runs based on the wrong BiDi
context.
Also wrap the static bits of SVGTextMetricsBuilder.cpp in an unnamed
namespace, removing a few 'static' keywords.

BUG=596721, 594058

Review URL: https://codereview.chromium.org/1829713002

Cr-Commit-Position: refs/heads/master@{#382938}
davve
Document how effective zoom relates to StyleImage sizing
BUG=561519

Review URL: https://codereview.chromium.org/1824003002

Cr-Commit-Position: refs/heads/master@{#382859}
tmoniuszko
Make some chrome feature flags customizable in GN build
These flags are customizable in GYP build.

BUG=

Review URL: https://codereview.chromium.org/1830543002

Cr-Commit-Position: refs/heads/master@{#382854}
davve
Straighten out zoom and border-image
The border-image-slice property determines how the image is sliced
into the nine piece pattern. Since border-image-slice are not lengths,
they are not automatically zoomed in computed style. Thus the zoom
factor hasn't been applied to the image size either. For border-image
the image size has no impact on the destination area anyway, so this
part is fine.

However, the default object size is in zoomed coordinates and unless
the default object size is unzoomed, there will be a mix of zoomed and
unzoomed coordinates when calculating the final image size for image
sizes that depend on the default object size, e.g. SVG with no
intrinsic size.

For this reason, unzoom the default object size before using it to
compute the image size.

Since the zoom passed to StyleImage::image() should represent the zoom
applied to the image size, it follows from this that the zoom should
be one.

BUG=596075, 561519

Review URL: https://codereview.chromium.org/1819083004

Cr-Commit-Position: refs/heads/master@{#382842}
fs
Use the line box's direction in computeGlyphOverflow
Use SVGInlineTextBox::constructTextRun in order to get the direction as
determined by the BiDi algorithm rather than the what is specified on
the element. (This should also get the right override value for similar
reasons.)

BUG=596721

Review URL: https://codereview.chromium.org/1823073002

Cr-Commit-Position: refs/heads/master@{#382655}
fs
Remove unused SVGTextMetrics constructor
This version of the SVGTextMetrics constructor is no longer used after
SVGTextMetrics::measureCharacterRange was removed by
https://codereview.chromium.org/1773403002.

Review URL: https://codereview.chromium.org/1821833003

Cr-Commit-Position: refs/heads/master@{#382573}
fs
Optimize the characterNumberAtPositionCallback text query
Refactor the calculateGlyphPositionWithoutTransform and
calculateGlyphBoundaries helpers to get logicalGlyphPositionToPhysical
and physicalGlyphExtents.
Use the new methods to implement characterNumberAtPositionCallback as an
iteration over the contributing glyphs, thereby avoiding the O(n^2) for
glyph bounds calculation.

Also fold calculateFragmentBoundaries into
characterNumberAtPositionCallback, because it is trivial, and most of it
is needed for the remaining part of the function too.

Review URL: https://codereview.chromium.org/1816073002

Cr-Commit-Position: refs/heads/master@{#382557}
fs
Make the findMetricsForCharacter SVGTextQuery-helper return an iterator
Convert the helper to return an iterator into the metrics vector. Then
use that new property in the calculateGlyphRange helper to avoid O(n^2)
runtime.

Also remove modifyStartEndPositionsRespectingLigatures, because all
users of it (indirectly through
mapStartEndPositionsIntoFragmentCoordinates) now uses the pre-computed
text metrics - which should account for the same thing automatically.
Also fix up the TODO in endPositionOfCharacterCallback by doing what it
says.

Review URL: https://codereview.chromium.org/1822673002

Cr-Commit-Position: refs/heads/master@{#382536}
tmoniuszko
Make rebase_path() aware of Windows drive letter capitalization
Make sure rebase_path() supports both capital and non-capital Windows path
drive letters. It's unable to find common path prefix otherwise.

BUG=596072

Review URL: https://codereview.chromium.org/1817533002

Cr-Commit-Position: refs/heads/master@{#382532}
rune
Use LocalStyleChange for text direction changes.
Changing the dir attribute or inserting text content into the document
may affect the CSS direction property through presentation style. The
code traversed and marked the parent elements affected by such changes
but use SubtreeStyleChange which recalculate more style than necessary.
Instead use LocalStyleChange as that will also cause inheritance to
happen appropriately.

R=kojii@chromium.org
BUG=596509

Review URL: https://codereview.chromium.org/1817143002

Cr-Commit-Position: refs/heads/master@{#382442}
rune
Use invalidation sets for fullscreen pseudos.
Schedule invalidation sets on elements changing state for
:-webkit-full-screen and:-webkit-full-screen-ancestor.

Lazily load the UA style for fullscreen, but before we enter fullscreen
the first time to have the invalidation sets available for style
invalidation

BUG=442239

Review URL: https://codereview.chromium.org/803133002

Cr-Commit-Position: refs/heads/master@{#382405}
rune
Clear baseComputedStyle when text-autosizing changes.
baseComputedStyle is an optimization for animations where the computed
style before animations are applied is cached and cloned to have
cheaper style recalcs for per-frame animation changes. An assumption is
that the computed style for the layout object only changes in
styleForElement or pseudoStyleForElement. That assumption is not true
for text autosizing as the computed style may be changed during layout.
Then, for the next animation frame, the text autosizing factor may be
different even though the style has not been marked for recalc, and the
sanity check for an unchanged baseComputedStyle will trigger an assert.

Make sure we clear the baseComputedStyle for an element when the text
autosizing factor changes.

R=pdr@chromium.org,drott@chromium.org
BUG=596018

Review URL: https://codereview.chromium.org/1816103002

Cr-Commit-Position: refs/heads/master@{#382350}
mstensho
Shift flowthread-to-visual coordinate space conversion one level up in the tree.
The conversion now takes place between the flow thread and its parent multicol
container, rather than between the flow thread and its children.

This is both conceptually more correct, and it also matches what
mapToVisibleRectInAncestorSpace() already does. Having all machineries do this
at the same place in the tree is what fixes the editing-specific bug 596070.

As for layer clipping bug 527709, it just so happens that we specify the flow
thread as ancestor in mapLocalToAncestor(), which is invoked via
localToAncestorPoint() from PaintLayerClipper::calculateClipRects().
PaintLayerClipper does its work *before* fragments have been collected and set
up for a given layer, so it doesn't want mapLocalToAncestor() or anyone to
change to the visual coordinate space.

BUG=527709,596070
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1819603003

Cr-Commit-Position: refs/heads/master@{#382339}
fs
Make calculateGlyphBoundaries helper return the computed bounds
Review URL: https://codereview.chromium.org/1821613002

Cr-Commit-Position: refs/heads/master@{#382275}
fs
Push ScriptWrappable inheritance down from SVGAnimatedPropertyBase
Rather than letting the base inherit and then override for actually
wrappable subclasses, put the inheritance in the subclasses.
This avoids having "dead" ScriptWrappables on subclasses that don't need
this functionality.
Since this removes the last user of the DEFINE_WRAPPERTYPEINFO_NOT_REACHED
macro, remove that too.

BUG=596011

Review URL: https://codereview.chromium.org/1807333003

Cr-Commit-Position: refs/heads/master@{#382265}
mstensho
Untangle multicol coordinate space conversion from offsetFromContainer().
The various offsetFromContainer() implementations used to convert from flow
thread coordinates to visual coordinates if the container was a flow thread.
That works when mapping a position relatively to some ancestor, but not when
mapping a position relatively to some descendant. Put differently: It works
fine when walking upwards in a tree, but not so fine when walking it downwards
(we need the opposite operation in that case; convert from visual to flow
thread coordinates). That was the reason for some mess in mapAncestorToLocal(),
since we had to cancel out the shenanigans carried out by
offsetFromContainer().

So, instead, perform this flowthread-to-visual coordinate space conversion
where we need it, and don't cause trouble for those who don't need it.

No behavior changes intended. This is also why we're keeping this coordinate
space conversion in CaretBase for now, even if it's wrong (see bug 596070).
Simply removing that *now* wouldn't fix the bug anyway, just alter it (probably
for the better, but who knows -- still buggy). A proper fix will land shortly.

BUG=568492
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1820483002

Cr-Commit-Position: refs/heads/master@{#382153}
rune
Moved resolverChanged for mq updates into StyleEngine.
The placement of resolverChanged() needs a bit of explanation. We
incorrectly only clear the rulesets of active stylesheets when media
query evaluation changes. That currently causes crbug.com/589083.
Updating the active stylesheets (resolverChanged) before clearing the
ruleset will at least make sure that rule set for @media rules inside
sheets with a media attribute changing evaluation will be cleared
correctly. Moving resolverChanged() would have made the effects of
589083 worse.

BUG=567021

Review URL: https://codereview.chromium.org/1783913003

Cr-Commit-Position: refs/heads/master@{#381921}
sigbjornf
Remove unnecessary WebGLRenderingContextBase unregistration.
The garbage collector takes care of clearing out weak references to
WebGLRenderingContextBase objects that the |forciblyEvictedContexts()|
and |activateContexts()| sets keep, before the objects are finalized.

Hence no need to additionally attempt to remove; just assert
non-membership.

R=haraken
BUG=
CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel;tryserver.chromium.mac:mac_optional_gpu_tests_rel

Review URL: https://codereview.chromium.org/1815513002

Cr-Commit-Position: refs/heads/master@{#381916}
rune
Dirty tree scopes are always a subset of active tree scopes.
No need to walk dirty tree scopes when clearing media dependent rule
sets after walking the active tree scopes.

Also clear m_dirtyTreeScopes in StyleEngine::detachFromDocument.
Currently, m_dirtyTreeScopes are synchronously updated and cleared
right after they are marked dirty, but that is supposed to change.

BUG=567021

Review URL: https://codereview.chromium.org/1786663003

Cr-Commit-Position: refs/heads/master@{#381909}
philipj
Measure the impact of a proposed media element load algorithm change
https://github.com/whatwg/html/issues/869#issuecomment-196189743

R=mlamouri@chromium.org,isherman@chromium.org

Review URL: https://codereview.chromium.org/1809023003

Cr-Commit-Position: refs/heads/master@{#381787}
philipj
Remove use counters for Element methods that have been settled in spec
https://dom.spec.whatwg.org/#interface-element

This also moves the non-spec'd webkitMatchesSelector,
insertAdjacentElement and insertAdjacentText.

The use counter for webkitMatchesSelector is left in place, because it
it's somewhat interesting to follow its decline. The usage ought to be
dominated by old versions of jQuery and other libraries, and so it says
something about how long it takes for those libraries to be dropped or
upgraded in the wild. jQuery and other libraries were updated around the
time that the unprefixed matches was shipped in Blink, and usage of
webkitMatchesSelector has roughly halved every year since. (Since it's
now implemented in all engines, it's still unlikely to ever be removed.)

Original commits:
https://crrev.com/d92494c5c13990d8ab8d8cd73b0a20b8b2dee1e9
https://crrev.com/a706ad3cd488d6827cfcc99cd67cc30625296928
https://crrev.com/709823c231eb406d6928938c745effb16d6b3b3c
https://crrev.com/45b5b0427c403ba30d0067921b2639a31f0190df
https://crrev.com/6bcc2fb1c405cca7971ef6f361d94f8e8c63e726

BUG=460722

Review URL: https://codereview.chromium.org/1804383002

Cr-Commit-Position: refs/heads/master@{#381701}
sigbjornf
(Only) poison unmarked heap objects prior to sweeping.
Drop the unnecessary restriction that eagerly finalized objects aren't
allowed to touch access other eagerly finalized, but live, objects during
finalization. They're allowed to access live objects in other heaps/arenas,
so the same-heap restriction makes little sense.

Simplify the HeapPage poisoning methods as a result.

R=haraken
BUG=594129

Review URL: https://codereview.chromium.org/1805343004

Cr-Commit-Position: refs/heads/master@{#381554}
davve
Move computeIntrinsicSizingInfo to LayoutReplaced
It's only used on replaced content anyway so having an empty LayoutBox
implementation is pointless.

Review URL: https://codereview.chromium.org/1785323002

Cr-Commit-Position: refs/heads/master@{#381445}
philipj
Welcome isSameNode back as a per-spec method
The spec change has been reverted:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27424#c21
https://dom.spec.whatwg.org/#interface-node

There's no need to measure usage any longer, as not further change is
likely to ever happen.

BUG=460722
R=yosin@chromium.org

Review URL: https://codereview.chromium.org/1807833002

Cr-Commit-Position: refs/heads/master@{#381420}
sigbjornf
Stop scheduling in-order script execution upon hitting failed script.
R=haraken
BUG=581425

Committed: https://crrev.com/10cb02165d6d68a66007a3522f23a89fcb8a69d5
Cr-Commit-Position: refs/heads/master@{#381217}

Review URL: https://codereview.chromium.org/1798253002

Cr-Commit-Position: refs/heads/master@{#381281}
sigbjornf
Stop scheduling in-order script execution upon hitting failed script.
R=haraken
BUG=581425

Review URL: https://codereview.chromium.org/1798253002

Cr-Commit-Position: refs/heads/master@{#381217}
tommyt
bluetooth: android: Confirm the notify session after the descriptor has been written.
This change also implements WriteRemoteDescriptor and
ReadRemoteDescriptor. Because of this, I've also added quite a few
descriptor unit tests. These tests are pretty much the same as the
read/write tests for characteristics.

BUG=584369

Review URL: https://codereview.chromium.org/1712593002

Cr-Commit-Position: refs/heads/master@{#381088}
sigbjornf
Remove unused WorkerThread::postDelayedTask().
Unused since Blink r195402 ( https://codereview.chromium.org/1130413003 )

R=kinuko
BUG=

Review URL: https://codereview.chromium.org/1791053002

Cr-Commit-Position: refs/heads/master@{#380943}
davve
Rework embeddedContentBox into embeddedReplacedContent
In preparation for removing computeIntrinsicSizingInfo from LayoutBox
and only have it on LayoutReplaced.

Review URL: https://codereview.chromium.org/1785123003

Cr-Commit-Position: refs/heads/master@{#380902}
sigbjornf
Sync SlowTests expectations following r380895.
TBR=yosin
BUG=356957
NOTRY=true

Review URL: https://codereview.chromium.org/1791293002

Cr-Commit-Position: refs/heads/master@{#380898}
sigbjornf
Space out issuing of spellcheck requests to speed up layout test.
Avoid issuing all spellcheck requests (by focusing elements) in one go
as this queues up a number of tasks and timers that it will require going
back to the event loop many times to process and handle. As the actual
test also relies on timers and setTimeout() this delays the completion
of the test considerably.

Restructure the test, interleaving the element focusing (=> spellcheck
request) with asynchronously checking the spellcheck result. Test completes
earlier as a result.

R=haraken
BUG=356957
TEST=editing/spelling/spellcheck-editable-on-focus.html

Review URL: https://codereview.chromium.org/1781273009

Cr-Commit-Position: refs/heads/master@{#380895}
mstensho
Only honor break-* values when appropriate.
Only honor column-specific break property values if inside a multicol
container, and only honor pagination-specific break property values if inside
some kind of pagination container (printing or paged overflow).

For breaking inside paged overflow containers, honor page values, not column
values. The paged overflow implementation sits on top of the multicol
implementation, which means that it's flowthread-based. But that's just an
implementation detail. Paged overflow containers don't establish columns -- it
establishes pages. Had to update one test, since it relied on
-webkit-column-break-* working inside a paged overflow container, which no
longer is the case. Some unit tests needed an update too.

R=leviw@chromium.org
BUG=223068

Review URL: https://codereview.chromium.org/1762983002

Cr-Commit-Position: refs/heads/master@{#380797}
davve
Propagate media session id into MediaPlayerAndroid
The media session id will be used to implicitly activate a user defined media session.

BUG=497735, 581728

Review URL: https://codereview.chromium.org/1640123004

Cr-Commit-Position: refs/heads/master@{#380632}
mstensho
Class A fragmentainer break points also exist between zero-height blocks.
We used to base class A break point [1] detection on whether we were at the
start of the container, location-wise (atBeforeSideOfBlock). That's not
sufficient. It's obviously okay to collapse margins through a zero-height
block, and basically pretend that it doesn't exist for the sake of margin
collapsing. But this isn't true for fragmentation. Class A break points [1]
exist between any two in-flow blocks, regardless of the height of said blocks.
Therefore we cannot propagate the pagination strut caused by a line inside a
block following an empty first-child block. We still need to keep the check for
whether we are at the start of the container, though, because if we aren't, it
means that we have a class C break point [1].

This CL introduces the BlockChildrenLayoutInfo class, which is used as a state
object during block children layout. This replaces MarginInfo and LayoutUnit
previousFloatLogicalBottom, which is what we used to pass back and forth. They
have now been wrapped into BlockChildrenLayoutInfo, along with a new piece of
information: whether we're laying out the first in-flow child or not. This
information is what we now use to detect if we're at a class A break point [1]
or not.

[1] https://drafts.csswg.org/css-break/#possible-breaks

R=leviw@chromium.org
BUG=223068

Review URL: https://codereview.chromium.org/1769483002

Cr-Commit-Position: refs/heads/master@{#380625}
mstensho
Remove special-code for removing anonymous blocks around pseudo elements.
We now have more generic code to take care of this, in
makeChildrenInlineIfPossible().

Review URL: https://codereview.chromium.org/1778483002

Cr-Commit-Position: refs/heads/master@{#380617}
sigbjornf
Simplify StackFrameDepth's handling of stack limits.
The handling of enabled/disabled and limits has become unnecessarily
complex. Especially so now that supported targets all have reasonable
estimates about safe thread stack sizes. Simplify asserts and limit checks
accordingly.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1779243002

Cr-Commit-Position: refs/heads/master@{#380566}
sigbjornf
Check if stylesheet resource was cached before marking it as such.
Should the memory cache already have an entry for a resource other
than the stylesheet resource we're trying to add, do not mark
the underlying StyleSheetContents as being "cached".

Given the possibility that the StyleSheetContents may not be
memory cached, retire the sanity-checking assert that a stylesheet
resource must have been evicted from that cache when finalized.

R=japhet
BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/1782473002

Cr-Commit-Position: refs/heads/master@{#380559}
sigbjornf
If under stack pressure, do not enable eager stack use.
The Oilpan marking pass safely utilizes the system stack of the
marking thread when tracing the object graph. Should GC be
invoked when stack use is already considerable, the estimated stack
threshold for when it is no longer known safe to continue
consuming system stack, may already have been exceeded. If so,
leave the stack threshold limit & check disabled.

This addresses an assertable condition only; the stack limit
check handles GCing under stack pressure as wanted.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1778353002

Cr-Commit-Position: refs/heads/master@{#380426}
mstensho
Remove special-code used by the old (removed) multicol implementation.
In regular block flow, anonymous blocks always have inline children, unless
it's the part of a continuation chain that contains blocks (which should never
be merged with siblings). Anonymous blocks with block-children also occur in
flexbox (flex items), and in the ruby implementation, but otherwise never in
regular block container layout.

Review URL: https://codereview.chromium.org/1778463002

Cr-Commit-Position: refs/heads/master@{#380381}
sigbjornf
Revert of IntersectionObserver: use an idle callback to send notifications. (patchset #6 id:100001 of https://codereview.chromium.org/1776493002/ )
Reason for revert:
Tests added are leaking, https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Leak/builds/18011

Original issue's description:
> IntersectionObserver: use an idle callback to send notifications.
>
> With this change, the tests can no longer use setTimeout(0) to wait
> for notifications to be delivered.  Instead, use takeRecords() to
> proactively grab notifications right after they are generated
> (typically in a RAF right after a layout change).
>
> BUG=540528
> R=ojan@chromium.org,haraken@chromium.org
>
> Committed: https://crrev.com/2c168f38b5c0e4e50374be4e54c44901c60738a9
> Cr-Commit-Position: refs/heads/master@{#380278}

TBR=ojan@chromium.org,haraken@chromium.org,skyostil@chromium.org,szager@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=540528

Review URL: https://codereview.chromium.org/1780163002

Cr-Commit-Position: refs/heads/master@{#380375}
philipj
Drop remaining [LegacyInterfaceTypeChecking] for Selection
With [LegacyInterfaceTypeChecking], any invalid type is treated as null,
and the risk of this change is therefore bounded by the
SelectionCollapseNull (also hit by setPosition) and
SelectionSetBaseAndExtentNull use counters:
https://www.chromestatus.com/metrics/feature/timeline/popularity/1083
https://www.chromestatus.com/metrics/feature/timeline/popularity/1084

Unfortunately chromestatus.com is not updating, but rbyers@ has checked
the stable channel data and reports usage as ~0 for both. The majority
of this tiny usage still ought to be actual null input, in cases like
collapse(something.firstChild).

The behavior of other engines was tested with this test:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3970

Edge already throws for non-Node-or-null argumens to collapse and
setBaseAndExtent, but doesn't support setPosition.

Gecko already throws for collapse, but doesn't support setPosition or
setBaseAndExtent.

Overall, this ought to be very low risk.

BUG=561338
R=yoichio@chromium.org,rbyers@chromium.org

Review URL: https://codereview.chromium.org/1778683005

Cr-Commit-Position: refs/heads/master@{#380339}
sigbjornf
Have DataObject create less copies of mime type lists.
R=dcheng
BUG=

Review URL: https://codereview.chromium.org/1776133003

Cr-Commit-Position: refs/heads/master@{#380244}
davve
Remove Image::computeIntrinsicDimensions()
There were only one user of Image::computeIntrinsicDimensions() left,
SVGImagePainter. It was used to calculate the container size in such a
way to force non-uniform scaling in case of
preserveAspectRatio=none. Use SVGImage::concreteObjectSize to get the
viewport size for SVG images.

BUG=581357

Review URL: https://codereview.chromium.org/1720853002

Cr-Commit-Position: refs/heads/master@{#380204}
fs
Simplify CullRect computation in LineBoxList::hitTest; fixing off-by-one
In the old formulation, we were essentially trying to "restore" the
margins from the HitTestLocation bounding-box and point, to compute a
"slice" to cull with. The "width" and "height" expressions for the slice
however trivially simplify to just the corresponding dimension of the
HitTestLocation bounding-box. For the "x" and "y" expressions however
the left/top margin is computed using the rounded point - which for
certain values of x/y will end up shifting the cullrect left/up by one
additional "unit" (pixel).
When the font size is small, one "unit" will be a lot, meaning that lines
can be missed entirely.

Change the computation of the cull rect to just use the bounding-box
from directly rather than restoring it from the (re)computed margin.
This gets rid of the last user of the HitTestLocation::*Padding()
methods, so remove those.

BUG=466617

Review URL: https://codereview.chromium.org/1780673002

Cr-Commit-Position: refs/heads/master@{#380194}
fs
Avoiding losing too much precision when hit-testing SVG <text>
Using flooredIntPoint() will lose all fractional precision - which is
too much considering that the location is actually at least a
LayoutPoint.
Use the HitTestLocation(const FloatPoint&) constructor instead - which does flooredLayoutPoint() behind scenes but also retains the FloatPoint.
Do the same for LayoutSVGForeignObject, since it has similar requirements.

BUG=466617

Review URL: https://codereview.chromium.org/1775363002

Cr-Commit-Position: refs/heads/master@{#380144}
sigbjornf
No need for ListHashSet<> in FrameSerializer.
Insertion ordering isn't made use of.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1778713004

Cr-Commit-Position: refs/heads/master@{#380112}
sigbjornf
Revert of MediaStream audio object graph untangling and clean-ups. (patchset #10 id:200001 of https://codereview.chromium.org/1721273002/ )
Reason for revert:
Broke a number of mediastream/ tests, e.g., https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Trusty/builds/9786

Original issue's description:
> MediaStream audio object graph untangling and clean-ups.
>
> This change consists of a number of "clean-up" changes that are being
> done to make the soon-upcoming refactoring of these classes go much more
> smoothly.  These are:
>
> 1. Public content MediaStreamApi functions cleaned up.  Removed
> "duplicated" functions that don't really do the same thing.  Removed
> hard-coded audio parameters from AddAudioTrackToMediaStream().
>
> 2. Eliminated ref-counting of WebRtcAudioCapturer and
> WebAudioCaptureSource.  Removed unnecessary references to these from
> WebRtcLocalAudioTrack.  Not only did this improve encapsulation of some
> code, but it also allowed for the removal of several dozen lines of
> "dead weight" testing set-upcode throughout the directory.
>
> 3. Renamed MediaStreamAudioTrack::GetTrack() method to From(), to be
> consistent with how this pattern is used in other parts of libcontent,
> and added a MediaStreamAudioSource::From().
>
> 4. Moved audio level calculations out of WebRtcLocalAudioTrack and into
> WebRtcAudioCapturer.  This way, when multiple tracks are present, the
> calculation is only being done once on the same audio.
>
> 5. Eliminated call to WebRtcCapturer::Stop() from
> WebRtcAudioDeviceImpl::Terminate(), which are each supposed to run on
> different threads.  From testing, DCHECKs should have been firing, but
> weren't, so the Terminate() method seems to be dead code.
>
> 6. Miscellaneous other "compaction" and comment updates.
>
> BUG=577881, 577874
> TBR=peter@chromium.org
>
> Committed: https://crrev.com/26bfd80549511a7e05f23c9941c41ced104ddf28
> Cr-Commit-Position: refs/heads/master@{#380065}

TBR=jochen@chromium.org,finnur@chromium.org,mcasas@chromium.org,olka@chromium.org,peter@chromium.org,tommi@chromium.org,miu@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=577881, 577874

Review URL: https://codereview.chromium.org/1780653002

Cr-Commit-Position: refs/heads/master@{#380103}
sigbjornf
Avoid WeakProcessingHashTableHelper<> type redefinitions.
R=haraken
BUG=

Review URL: https://codereview.chromium.org/1770103003

Cr-Commit-Position: refs/heads/master@{#379820}
davve
Support canvas size as default object size
By adding a defaultObjectSize parameter to

 * CanvasImageSource::elementSize,
 * CanvasImageSource::defaultDestinationSize
 * CanvasImageSource::getSourceImageForCanvas

we can support the default sizing algorithm in HTMLImageElement for
images that lack an intrinsic size. This affects both drawImage() and
createPattern().

At time of writing there doesn't exist clear spec text for how
createPattern should behave. In
https://github.com/whatwg/html/issues/735 the behavior in this CL has
been suggested as a reasonble starting point.

BUG=581357, 475009

Review URL: https://codereview.chromium.org/1767633002

Cr-Commit-Position: refs/heads/master@{#379818}
sigbjornf
Remove Resource::assertIsAlive().
Temporary release assert to diagnose a crash that got stuck.

R=dcheng
BUG=352043

Review URL: https://codereview.chromium.org/1770013004

Cr-Commit-Position: refs/heads/master@{#379810}
davve
Merge image sizing algorithms
Let users of StyleImage use StyleImage::imageSize() to get the image
size instead of fetching intrinsic information and calculating the
size outside StyleImage. This let's us remove the sizing algorithm in
LayoutBoxModelObject::calculateImageIntrinsicDimensions.

By passing along the default object size to StyleImage::imageSize, we
can remove the sizing algorithm in LayoutBoxModelObject and reuse the
one in SVGImage instead for the one image type that needs the
complicated sizing algorithm. Simpler algorithms can remain simple,
e.g. for generated images with no fixed size, the default object size
is returned unmodified.

SVGImage::concreteObjectSize almost had the necessary bits to
support full sizing of SVG images within a style context, i.e. through
StyleImage. The only missing bit was the the contain constraint on the
default object size added by this patch.

Some zoom juggling needed since the provided default object size is
sometimes zoomed and SVGImage has no notion of zoom. Thus the zoom is
removed before calling SVGImage::concreteObjectSize() and reapplied on
the result afterwards.

Background images and other decorative images should never respect the
exif rotation[1], so StyleImage::imageSize now requests the image size
from ImageResource without exif rotation applied. Presumably
StyleImage::imageSize() was broken but unused in this regard before.

In contrast to LBMO::calculateImageIntrinsicDimensions(),
StyleImage::imageSize returns the size for layout, i.e. the size
compensated for the image scale factor. This fixes two hidpi bugs, one
for list item marker images and one for shape-outside.

BUG=581357, 591935, 591939, 592888, 592886

Review URL: https://codereview.chromium.org/1756763004

Cr-Commit-Position: refs/heads/master@{#379801}
sigbjornf
Remove dangling LeakExpectations pointers.
TBR=kouhei,yutak@chromium.org
BUG=364411,364417,506754
NOTRY=true

Review URL: https://codereview.chromium.org/1771943003

Cr-Commit-Position: refs/heads/master@{#379793}
sigbjornf
Fix non-Oilpan following r379558.
R=
BUG=580169

Review URL: https://codereview.chromium.org/1770323002

Cr-Commit-Position: refs/heads/master@{#379786}
rune
deviceScaleFactorChanged() handles style recalc.
No need to do an additional frame tree walk for marking style dirty
right before.

Review URL: https://codereview.chromium.org/1773523003

Cr-Commit-Position: refs/heads/master@{#379764}
rune
No need to re-collect stylesheets for setting type StyleChange.
Style recalc for all frames necessary, though.

Review URL: https://codereview.chromium.org/1772513003

Cr-Commit-Position: refs/heads/master@{#379763}
rune
Move preferred stylesheet logic into StyleEngine.
To understand the code better:

We don't support selecting alternate stylesheets in Blink, although the
API for Document.selectedStylesheetSet is present. The way it works, is
that the effective selected stylesheet set is either empty or the
preferred set. Setting selectedStylesheetSet has no effect.

This CL should not impose any functional changes, but a resolverChanged
with no effect has been removed.

The next step for async active stylesheet update is to move the setting
of the preferred set name to where the the dom mutations happen as the
order of mutations is what defines which stylesheet title has
precedence.

BUG=567021

Review URL: https://codereview.chromium.org/1769903002

Cr-Commit-Position: refs/heads/master@{#379762}
rune
Remove unnecessary setNeedsRecalcStyleInAllFrames for fonts.
Instead of walking the frame tree twice, nuking the style world the
second time, do normal font cache invalidation which lets StyleEngine
handle the change in StyleEngine::fontsNeedUpdate.

TEST=fast/text/update-sans-serif-and-recalc-style.html

Review URL: https://codereview.chromium.org/1771823002

Cr-Commit-Position: refs/heads/master@{#379761}
rune
Added tests for preferred sheet insertion order.
Which stylesheet wins setting the preferred stylesheet set based on the
title attribute depends on the insertion order, and not the tree order,
since it's done as part of adding a stylesheet[1], as part of creating
a stylesheet[2], which is done on closing a style element, on inserting
or removing the style element [3].

Added two tests to make sure this is still true after active stylesheet
update has been made async.

[1] https://drafts.csswg.org/cssom/#add-a-css-style-sheet
[2] https://drafts.csswg.org/cssom/#create-a-css-style-sheet
[3] https://html.spec.whatwg.org/#update-a-style-block

BUG=567021

Review URL: https://codereview.chromium.org/1769843002

Cr-Commit-Position: refs/heads/master@{#379760}
sigbjornf
Remove WebFormElement::wasUserSubmitted.
As autofill is no longer using this (as of r339061), drop this
this public API.

R=
BUG=

Review URL: https://codereview.chromium.org/1768953002

Cr-Commit-Position: refs/heads/master@{#379683}
fs
Add more SVG-related mapLocalToAncestor/mapAncestorToLocal tests
Written while looking at crbug.com/592316. Tests viewBoxes with a
non-zero x/y component.

BUG=592316, 568614

Review URL: https://codereview.chromium.org/1771833002

Cr-Commit-Position: refs/heads/master@{#379600}
auygun
Set debug color for borders of compressed tiles.
BUG=434699
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1774533002

Cr-Commit-Position: refs/heads/master@{#379582}
mostynb
export blink::Platform symbols in shared_library builds
This unbreaks GCC component=shared_library builds, which fail to link
libblink_platform.so due to missing vtable, since CL 1660383002 landed.

BUG=548254

Review URL: https://codereview.chromium.org/1770693002

Cr-Commit-Position: refs/heads/master@{#379577}
davve
Shortcut ImageResource::canRender()
Move the little work ImageResource::canRender() does out of fetch/ and
into the respective call sites. A small step towards getting rid of
ImageResource::imageSize() and limiting ImageResource to fetch related
functionality.

It's assumed that ImageResource::image() never returns the nullptr and
that !errorOccurred() implies the an image or the nullImage if no
image is available.

BUG=581357

Review URL: https://codereview.chromium.org/1773503002

Cr-Commit-Position: refs/heads/master@{#379549}
fs
Handle '<something>' to 'none' changes of 'transform' for SVG
Only the value of the new style was observed and triggered an update.
Check the StyleDifference flag for simplicity.

BUG=592206

Review URL: https://codereview.chromium.org/1771773002

Cr-Commit-Position: refs/heads/master@{#379546}
fs
Don't expand <symbol> elements in <use> that are not targets
When a <use> was referencing a subtree which contained a <symbol>
element, the <symbol> would get replaced by the "replace <symbol>" part
of the <use> expansion. This would result in content being rendered that
should not (since only <symbol>s that are directly referenced by <use>
should render.)
Instead of blindly expanding <symbol> elements, replace them directly
when producing the instance clone.

Replace the old faulty test svg/custom/use-on-g-containing-symbol.svg
with a new test.

Test from: https://bugs.webkit.org/show_bug.cgi?id=154576

BUG=589682

Review URL: https://codereview.chromium.org/1736283003

Cr-Commit-Position: refs/heads/master@{#379532}
rune
Re-collect rule features for watched selectors.
Instead of nuking the StyleResolver and re-collecting all stylesheets,
clear the current rule features on StyleResolver and mark them for
re-collection. We need to re-collect because the rule features on
StyleResolver are a union of the rule features from stylesheets and the
watched selectors from the declarativeContent css api for extensions.

A bonus is that this change avoids a synchronous active stylesheets
update.

R=dstockwell@chromium.org
BUG=567021

Review URL: https://codereview.chromium.org/1757503002

Cr-Commit-Position: refs/heads/master@{#379529}
rune
Avoid nuking everything when injecting stylesheet.
Instead do an analyzed update of the Document scope.

Review URL: https://codereview.chromium.org/1762443004

Cr-Commit-Position: refs/heads/master@{#379528}
philipj
Measure the many aspects of HTMLAllCollection
Multiple spec changes to HTMLAllCollection are under discussion:
https://github.com/whatwg/html/issues/775
https://github.com/whatwg/html/pull/780

To help inform the discussion and estimate risk, measure some of the
aspects that are currently not per spec, as well as a few extra bits for
comparison purposes.

BUG=591605

Review URL: https://codereview.chromium.org/1756963002

Cr-Commit-Position: refs/heads/master@{#379484}
sigbjornf
Remove now-unused Visitor::m_isGlobalMarkingVisitor field.
R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1759183005

Cr-Commit-Position: refs/heads/master@{#379469}
fs
Correct initial width/height for <use>d <symbol>s
The initial values for width/height on the <svg> generated for the
<symbol> should be "100%".
Since the <symbol> element had been replaced by a <svg> element by the
time the attributes were transferred the wrong set of rules were used.

Adjust svg/custom/use-attribute-invalidations.html to be correct.
svg/custom/relative-sized-shadow-tree-content-with-symbol.xhtml now
renders correctly.

BUG=592063

Review URL: https://codereview.chromium.org/1757993007

Cr-Commit-Position: refs/heads/master@{#379350}
sigbjornf
Simplify mock web speech recognizer's "onend" handling.
..and fix a bug introduced by r378252 in the process, it assuming
a different interpretation of speech recognizer handle equality than
what's (reasonably) provided.

i.e., handle the completion of a speech recognition via one
task rather than two.

R=tommi,jochen
BUG=591298

Review URL: https://codereview.chromium.org/1750213004

Cr-Commit-Position: refs/heads/master@{#379299}
fs
Add SVGUseElement::createInstanceTree helper
Add a new method used to create a new instance subtree from a <use>-
targetted element. Re-use where possible.

Also make isDisallowedElement(...) take a Element& (it's no longer
called on Nodes) and remove a redundant call to
removeDisallowedElementsFromSubtree in <symbol> expansion (no new clones
are produced here expecpt the <svg> on replacing the <symbol>.)

BUG=589682

Review URL: https://codereview.chromium.org/1763033002

Cr-Commit-Position: refs/heads/master@{#379298}
fs
Remove SVGUseElement::buildShadowTree
SVGUseElement::buildShadowTree() steps out for a moment to regain
strength. In its absence, open-code the sequence using other helper
functions.

BUG=589682

Review URL: https://codereview.chromium.org/1769493002

Cr-Commit-Position: refs/heads/master@{#379290}
fs
Factor addReferenceTo()-calls out of SVGUseElement::buildShadowTree
This factors the registering of references to first degree nested <use>
elements out of the buildShadowTree, getting rid of the |foundUse|
parameter. This brings us one step closer to more streamlined shadow-
tree construction. It also avoids calling isStructurallyExternal() more
than once.

Also cleanup the instanceTreeIsLoading() method by letting it traverse
all the SVGUseElement descendants of the shadow root using the
Traversal<> helpers.

BUG=589682

Review URL: https://codereview.chromium.org/1759423003

Cr-Commit-Position: refs/heads/master@{#379289}
sigbjornf
Retire expectation for fast/dom/webtiming.html
No longer coming through as flaky.

TBR=skyostil
BUG=520172
NOTRY=true

Review URL: https://codereview.chromium.org/1763883004

Cr-Commit-Position: refs/heads/master@{#379272}
sigbjornf
Avoid PageMemoryRegion::m_numPages data race.
R=haraken
BUG=591217

Review URL: https://codereview.chromium.org/1762093002

Cr-Commit-Position: refs/heads/master@{#379228}
fs
Eliminate SVGUseElement::referencedScope()
During "shadow tree fixup" (SVGUseElement::expand*) we can use the
document of the original (corresponding) element rather than
referencedScope(), because the Document of those elements will be the
external or the "local" respectively depending on source for the initial
clone operation.
This leaves a few users in buildPendingResource() which can be
eliminated by folding the method into it.
Hopefully this will also allow future cleanups to
isExternalURIReference, since now it's not called unnecessarily for each
nested <use>. (Possibly minor perf effect from eliminating the calls to
referencedScope().)

BUG=589682

Review URL: https://codereview.chromium.org/1757323002

Cr-Commit-Position: refs/heads/master@{#379074}
fs
Replace cloneNodeAndAssociate with Element::cloneElementWithChildren
Use the Element::cloneElementWithChildren to do a "straight" clone, and
then post-process it to associate the cloned nodes with their
corresponding elements.
Move the call to removeDisallowedElementsFromSubtree() into the cloning
sequence since it will have nothing to do if there's no target. The
root has already been verified to be "allowed", so the different
starting element makes no difference on the result.

BUG=589682

Review URL: https://codereview.chromium.org/1759553005

Cr-Commit-Position: refs/heads/master@{#379046}
fs
Use references some more in SVGUseElement
Mostly changes to pass SVGElement& rather than SVGElement* - and some
cleanup/removal of dead null-checks etc. as a consequence.

BUG=589682

Review URL: https://codereview.chromium.org/1762633002

Cr-Commit-Position: refs/heads/master@{#379031}
rune
Don't call updateLayoutTree twice.
In updateLayoutTreeIgnorePendingStylesheets we would call
updateLayoutTree twice when having nodes with placeholder style.
Removed the first call.

Review URL: https://codereview.chromium.org/1764653002

Cr-Commit-Position: refs/heads/master@{#379007}
sigbjornf
Fix non-Oilpan following r378744.
R=haraken,fs@opera.com
BUG=535429

Review URL: https://codereview.chromium.org/1753283004

Cr-Commit-Position: refs/heads/master@{#378996}
fs
Remove SVGUseElement helper subtreeContainsDisallowedElement
The related helper removeDisallowedElementsFromSubtree() already walks
the same subtree and checks with the same predicate[1], so letting the
removing function do all the work should not be a problem.

Also change isDisallowedElement to take a const Node&, and tighten the
type of the subtree root passed to removeDisallowedElementsFromSubtree
(it's always either a SVGSVGElement or a SVGGElement.)
Move the lengthy - and somewhat outdated - comment above
removeDisallowedElementsFromSubtree to just above its definition.
(We aim to align the current behavior to it though, so keeping it
around unchanged.)

[1] subtreeContainsDisallowedElement() was walking the Nodes of the
    tree, while removeDisallowedElementsFromSubtree() walks the
    Elements. Thus they did not look at the exact same set of nodes.
    Since the removal took place on the smaller set though there should
    be no change in behavior.
    Previously we could end up walking the entire subtree looking for
    something to remove (in removeDisallowedElementsFromSubtree)
    eventhough we wouldn't find it (like for example a COMMENT node.)

BUG=589682

Review URL: https://codereview.chromium.org/1755153002

Cr-Commit-Position: refs/heads/master@{#378993}
fs
Clean up reparenting in SVGUseElement::expand*
Add a helper moveChildrenToReplacementElement() and use that instead of
an open-coded loop.
Split transferUseAttributesToReplacedElement() into two, getting rid of
one by open-coding the call to cloneDataFromElement(), and make the other
one static (while renaming it.)

BUG=589682

Review URL: https://codereview.chromium.org/1760553002

Cr-Commit-Position: refs/heads/master@{#378992}
davve
Pass media session id over IPC
Add media_session_id to the MediaPlayerHostMsg struct in preparation
for letting the browser process create media players with user created
media sessions.

BUG=497735, 581728

Review URL: https://codereview.chromium.org/1641993003

Cr-Commit-Position: refs/heads/master@{#378983}
rune
One instead of three resolverChanged replacing source in inspector.
resolverChanged() was called three times when replacing the stylesheet
text from the inspector. Two mutation scopes and an explicit call at
the end.

Kept one of the mutation scopes. Two shouldn't be necessary, and I have
confirmed that the crash tests for which this was justified earlier
don't crash when removing one of the scopes.

Moved the stylesheet modifications into CSSStyleSheet::setText().

Also moved clearing of the CSSOM wrappers before the mutation scope
declaration as the mutation scope constructor would unnecessarily
re-attach wrappers which would then be cleared right after.

R=esprehn@chromium.org,pfeldman@chromium.org
BUG=591599

Review URL: https://codereview.chromium.org/1765463002

Cr-Commit-Position: refs/heads/master@{#378978}
rune
Removed unnecessary resolverChanged call.
Changing disabled state of a stylesheet link caused active stylesheet
update to happen twice. Once from setDisabled() on the stylesheet and
once directly from LinkStyle::setDisabledState(). Removed the one
called directly from LinkStyle::setDisabledState.

R=esprehn@chromium.org
BUG=591559

Review URL: https://codereview.chromium.org/1761693002

Cr-Commit-Position: refs/heads/master@{#378922}
sigbjornf
Revert of Use a bitmap to record PageMemoryRegion usage. (patchset #1 id:1 of https://codereview.chromium.org/1748363005/ )
Reason for revert:
Using a bitmap is problematic as pages within a region may belong to different threads (see https://crbug.com/591217 ).

Revert back to previous and use a separate bool per thread to avoid overlap.

Original issue's description:
> Use a bitmap to record PageMemoryRegion usage.
>
> R=haraken
> BUG=420515
>
> Committed: https://crrev.com/648b0ff04620c688b1d8926b06220f45da3e4598
> Cr-Commit-Position: refs/heads/master@{#378449}

TBR=oilpan-reviews@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=420515

Review URL: https://codereview.chromium.org/1749103005

Cr-Commit-Position: refs/heads/master@{#378756}
philipj
Make DeviceOrientationEvent.prototype.absolute non-nullable
This is to match the spec and Gecko:
http://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientation
https://hg.mozilla.org/mozilla-central/file/85e218929a7a/dom/webidl/DeviceOrientationEvent.webidl

BUG=460722

Review URL: https://codereview.chromium.org/1737443002

Cr-Commit-Position: refs/heads/master@{#378747}
fs
Simplify SVGUseElement::expand* methods
 * Use Traversal<Type> helpers.
 * Start at the ShadowRoot.

BUG=589682

Review URL: https://codereview.chromium.org/1753843002

Cr-Commit-Position: refs/heads/master@{#378722}
rune
Remove unnecessary feature flag update.
The feature flags in StyleEngine were always reset from
StyleResolver::finishAppendAuthorStyleSheets right before we called
combineCSSFeatureFlags with the exact same feature set.

R=dstockwell@chromium.org
BUG=401359,567021

Review URL: https://codereview.chromium.org/1743183003

Cr-Commit-Position: refs/heads/master@{#378719}
fs
Implement mapAncestorToLocal for LayoutSVG{ModelObject,Block}
This CL adds an implementation of mapAncestorToLocal for SVG
LayoutObject types via a helper in SVGLayoutSupport.
This should help cases which use any of the LayoutObject::ancestorTo*
methods (or similar/wrappers.) Examples of users are various form
controls and scrollbars.

BUG=568614

Review URL: https://codereview.chromium.org/1747223002

Cr-Commit-Position: refs/heads/master@{#378716}
rune
Remove unused createdByParser flags and arguments.
Review URL: https://codereview.chromium.org/1754863002

Cr-Commit-Position: refs/heads/master@{#378711}
philipj
Remove the always-enabled Media from RuntimeEnabledFeatures
This has been enabled everywhere since
https://codereview.chromium.org/590083002

Review URL: https://codereview.chromium.org/1749683002

Cr-Commit-Position: refs/heads/master@{#378686}
philipj
Remove Selection TODO that was fixed by a spec change
BUG=460722
R=yoichio@chromium.org

Review URL: https://codereview.chromium.org/1755503002

Cr-Commit-Position: refs/heads/master@{#378667}
fs
Clone non-markup event listeners for <use> in a separate pass
This brings us closer to be able to use cloneNode(true) for the initial
clone.

BUG=589682

Review URL: https://codereview.chromium.org/1753823002

Cr-Commit-Position: refs/heads/master@{#378604}
fs
Remove redundant check in SVGUseElement::buildShadowTree
We already perform this check on |target| in all callers (the method
itself and buildShadowAndInstanceTree), so this condition will never be
true at this point. Remove it (replace with assert.) Since this gets rid
of the only way for buildShadowTree to return false, change the return-
type to 'void' and simplify accordingly.

BUG=589682

Review URL: https://codereview.chromium.org/1754693002

Cr-Commit-Position: refs/heads/master@{#378504}
sigbjornf
Add missing DevToolsEmulator field initialization.
Introduced in r371567.

R=
BUG=581115

Review URL: https://codereview.chromium.org/1747203002

Cr-Commit-Position: refs/heads/master@{#378491}
sigbjornf
Keep XHR progress throttle interval an implementation detail.
R=
BUG=

Review URL: https://codereview.chromium.org/1750323002

Cr-Commit-Position: refs/heads/master@{#378487}
sigbjornf
Retire WebLocalFrameScope.
Retire this test-supporting scope object; no longer needed to ensure timely
release and closing of WebLocalFrames in CreateLocalChildWithPreviousSibling

R=dcheng
BUG=

Review URL: https://codereview.chromium.org/1750613002

Cr-Commit-Position: refs/heads/master@{#378454}
sigbjornf
Use a bitmap to record PageMemoryRegion usage.
R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1748363005

Cr-Commit-Position: refs/heads/master@{#378449}
sigbjornf
Remove unused HashSet<>::isValidValue().
R=
BUG=

Review URL: https://codereview.chromium.org/1750983002

Cr-Commit-Position: refs/heads/master@{#378435}
sigbjornf
Sync leak expectations following r378252.
TBR=dmazzoni
BUG=506529
NOTRY=true

Review URL: https://codereview.chromium.org/1751923002

Cr-Commit-Position: refs/heads/master@{#378431}
sigbjornf
Node.h #include parsimony.
Node.h is slurped in throughout Blink, hence it makes sense to have it
not include unnecessary headers.

R=tkent
BUG=

Review URL: https://codereview.chromium.org/1746673002

Cr-Commit-Position: refs/heads/master@{#378427}
tmoniuszko
Update GN docs about Visual Studio generators
BUG=

Review URL: https://codereview.chromium.org/1750523002

Cr-Commit-Position: refs/heads/master@{#378419}
philipj
Renew deprecation messages for Web Audio doppler effects
Intent to Deprecate:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/-1SI1GoHYO8/6XUjRs-fdv4J

BUG=439644

Review URL: https://codereview.chromium.org/1745103002

Cr-Commit-Position: refs/heads/master@{#378409}
rune
Allow simple selectors after ::content for compat.
Allow simple selectors which are not pseudo elements after ::content in
compound selectors. Polymer 0.5 content sometimes use ::content[attr]
instead of [attr]::content. This was made invalid with r369760.

R=timloh@chromium.org
BUG=589252

Review URL: https://codereview.chromium.org/1749713002

Cr-Commit-Position: refs/heads/master@{#378331}
sigbjornf
Make HTMLSelectElementTest.DefaultToolTip work non-Oilpan
R=tkent
BUG=

Review URL: https://codereview.chromium.org/1742353002

Cr-Commit-Position: refs/heads/master@{#378324}
sigbjornf
Reduce weak callback stack reservation for non-main threads.
Tune the initial reservation for Oilpan threads other than the main
thread; very few uses of weak references and collections happen off
the main thread. Adjust the initial allocation accordingly.

R=
BUG=

Review URL: https://codereview.chromium.org/1750553002

Cr-Commit-Position: refs/heads/master@{#378318}
sigbjornf
Have mock speech recognizer reset and release its recognizer upon ending.
Take care of leaks attributed to this mock object - it unnecessarily
retaining a WebSpeechRecognitionHandle beyond completion of the final
'ended' notification to it.

R=dmazzoni
BUG=506529

Review URL: https://codereview.chromium.org/1737953003

Cr-Commit-Position: refs/heads/master@{#378252}
sigbjornf
Fix PointerEventFactoryTest unit tests non-Oilpan following r377576.
TBR=oilpan-reviews
BUG=583331

Review URL: https://codereview.chromium.org/1749773002

Cr-Commit-Position: refs/heads/master@{#378242}
philipj
Move Deprecation helpers into an anonymous namespace
willBeRemoved is used in the first Deprecation::deprecationMessage so
unfortunately these can't be kept right next to second
Deprecation::deprecationMessage where they are used most.

Review URL: https://codereview.chromium.org/1750503002

Cr-Commit-Position: refs/heads/master@{#378206}
philipj
Remove unused UseCounter features
Review URL: https://codereview.chromium.org/1740153002

Cr-Commit-Position: refs/heads/master@{#378185}
sigbjornf
Remove unused NodeIntersectionObserverData predicates.
R=haraken
BUG=none

Review URL: https://codereview.chromium.org/1740973003

Cr-Commit-Position: refs/heads/master@{#378140}
sigbjornf
Reduce ephemeron stack size reservation.
The ephemeron stack is used by the Oilpan GC to handle key-value pairs
over weak references as wanted (i.e., the value is strongly referenced
until the key becomes unreachable). The marking process will push
hash tables containing such onto a stack processing for later processing.

Blink only has a handful of hash tables requiring ephemeron processing,
hence tune down the initial size of the stack accordingly.

As a data point, browsing around on various popular sites resulted in
ephemeron stacks no deeper than in the mid-20s.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1741833002

Cr-Commit-Position: refs/heads/master@{#378131}
perja
bluetooth: android: register for adapter on/off events.
Register for BluetoothAdapter.ACTION_STATE_CHANGED and reflect the
state changes in the device chooser dialog.

BUG=543060

Review URL: https://codereview.chromium.org/1711393002

Cr-Commit-Position: refs/heads/master@{#377982}
fs
After expanding <symbol> in <use>, expand its siblings
If the siblings are not expanded at this point, the loop of the children
of the ancestor will lose the siblings because it's still referencing
the old <symbol> element.
This little loop fell out in https://codereview.chromium.org/272523002.

BUG=589682

Review URL: https://codereview.chromium.org/1734983004

Cr-Commit-Position: refs/heads/master@{#377922}
sigbjornf
Remove unused Document auxiliary methods.
R=
BUG=

Review URL: https://codereview.chromium.org/1734373002

Cr-Commit-Position: refs/heads/master@{#377879}
fs
Fix synchronization of SVGAnimatedAngle (<marker orient>)
Since SVGAnimatedAngle also wraps the SVGAnimatedEnumeration for the
enumeration representation of the 'orient' attribute, and both of them
synchronize to said attribute, we need to override the synchronization
methods to take the synchronization status of them both into account
(as opposed to previously where only the SVGAnimatedAngle itself was
considered.) Rewrite the existing synchronizeAttribute() implementation
to just delegate rather than do the actual work itself.

Also change reference from SVGMarkerElement to just SVGElement and
include the specific header - SVGAngle.h rather than SVGAngleTearOff.h.

BUG=589808

Review URL: https://codereview.chromium.org/1739533004

Cr-Commit-Position: refs/heads/master@{#377875}
tmoniuszko
Limit the set of Visual Studio projects generated by GN
BUG=589099

Review URL: https://codereview.chromium.org/1718093006

Cr-Commit-Position: refs/heads/master@{#377871}
philipj
Adjust deprecation messages to match Estimated Stable Dates
These dates are from https://www.chromium.org/developers/calendar and
match the branch date + 6 weeks rule.

It would be unfortunate if developers think they have more time to adapt
than they actually do.

BUG=590143

Review URL: https://codereview.chromium.org/1736533004

Cr-Commit-Position: refs/heads/master@{#377870}
sigbjornf
Parameterize CallbackStack over initial block size.
CallbackStack keeps a chain of blocks, extending it as needed. So as to
allow stacks with varying block sizes, have its constructor take the
block size to use as argument.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1737913002

Cr-Commit-Position: refs/heads/master@{#377865}
sigbjornf
Ignore setting of navigation starting points for detached documents.
Address non-Oilpan leaks.

R=tkent
BUG=454172

Review URL: https://codereview.chromium.org/1739713003

Cr-Commit-Position: refs/heads/master@{#377679}
fs
Don't use SVG resource documents with an unrecognized MIME-type
Before parsing/creating the actual document of a DocumentResource, make
sure that the resource in question was actually served as a reasonable
MIME-type - one of:

  image/svg+xml,
  text/xml,
  application/xml or
  application/xhtml+xml

Use the original Content-Type from the HTTP header when possible and
treat empty as invalid (matches Gecko).
This could help mitigate some issues with content sanitation. It seems
to match what Gecko is doing so is hopefully not too web-incompatible.

Move the commonly recurring *Resource::mimeType() helper from subclasses
to the baseclass (Resource) and rename it httpContentType() since that
should be a better match for what it is.

BUG=527514

Review URL: https://codereview.chromium.org/1706243002

Cr-Commit-Position: refs/heads/master@{#377560}
fs
Don't apply the SandboxPlugins flag until we know a plugin will be used
Move the check of the SandboxPlugins flag out of the pluginIsLoadable
function and to just before the actual load/instantiation of the plugin
is initiated. This means the URL and MIME-type is still subject to
SecurityOrigin, (some) CSP and Mixed-Content checks, but the flag will
not block resources if they will not use a plugin.

Split pluginIsLoadable into one part that checks if the URL/MIME-type is
allowed, and one part that checks if the plugin itself can be
loaded/instantiated. The former is allowedToLoadObject while the latter
is allowedToLoadPlugin. Only call the latter if we determine that a
plugin will be used to view the content (URL or not). Sink the
allowedToLoadPlugin check into loadPlugin, which in turn means it will
apply to the code-path through createPluginWithoutLayoutObject() as well,
while adding a call to allowedToLoadObject there as well.

Also make sure that shouldUsePlugin() sets the |useFallback| out-
variable before all returns. (Could previously be used uninitialized.
Found by code inspection.)

BUG=578916

Review URL: https://codereview.chromium.org/1645313002

Cr-Commit-Position: refs/heads/master@{#377559}
philipj
Remove dead code related to Web Audio doppler effects
Doppler already has no effect on AudioBufferSourceNodes, as the only
call to setPannerNode was removed in time for M41:
https://codereview.chromium.org/783273002/

PannerHandler::dopplerRate becomes unreachable next, and pulling at the
thread of unreachable things ends up removing quite a lot.

PannerNode's setVelocity is revealed to have no effect at all, although
it remains in the spec. A spec issue was filed:
https://github.com/WebAudio/web-audio-api/issues/730

BUG=439644
R=rtoy@chromium.org

Review URL: https://codereview.chromium.org/1734483002

Cr-Commit-Position: refs/heads/master@{#377507}
sigbjornf
Have EventSender mouseups unwind better on cancellation during dragover.
Follow up on changes brought by r376733 and check if handling of dragover
cancelled our ongoing drag. Leave early, if so.

R=dcheng,rbyers
BUG=589426

Review URL: https://codereview.chromium.org/1728353002

Cr-Commit-Position: refs/heads/master@{#377392}
mostynb
only include xdg_util_unittest.cc on desktop linux
Review URL: https://codereview.chromium.org/1726613003

Cr-Commit-Position: refs/heads/master@{#377373}
philipj
Remove SVGElement.offsetParent/offsetTop/offsetLeft/offsetWidth/offsetHeight
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/jjwLLSG_hGY/Ovi-nvEeDwAJ

BUG=463116

Review URL: https://codereview.chromium.org/1726743002

Cr-Commit-Position: refs/heads/master@{#377283}
philipj
Update SVG tests ahead of offset* removal
This converts some SVG tests to use getBoundingClientRect() instead of
the deprecated offset* attributes, so that the removal CL is minimized
and thus easier to revert in case of trouble.

smil-scheduled-in-inactive-document-crash.html didn't actually run the
problematic code because of a early finishJSTest(), which was moved.

BUG=463116
R=fs@opera.com

Review URL: https://codereview.chromium.org/1729073002

Cr-Commit-Position: refs/heads/master@{#377261}
mstensho
Ability to return the height of fragmentainer groups that don't yet exist.
When the flow thread offset is out of range (i.e. it comes after the logical
bottom of the last fragmentainer group created so far) when asking for a column
height, estimate how tall the next fragmentainer group will be, instead of
returning the height of the last fragmentainer group.

It was dodgy of LayoutBlockFlow::adjustLinePositionForPagination() to call
paginatedContentWasLaidOut() before the final position of the line had been
determined, but we did so in order to create the necessary fragmentainer
groups, so that we could get the right column height. However, since we may
decide to drop the strut calculated if a line is taller than the column, we'd
better not pretend that we applied the strut. Otherwise we may create more
fragmentainer groups than necessary, causing mild confusion and assertion
failures in the multicol machinery.

To fix this, we need LayoutBlock::pageLogicalHeightForOffset() to be able to
return the height of columns in a fragmentainer group that has't yet been
created (and perhaps never will). The rationale behind this solution is that it
seems better to deal with this inside the multicol implementation, than to add
more complexity in adjustLinePositionForPagination(). Leaving LayoutBlockFlow
blissfully unaware of multiple fragmentainer groups seems like a good thing.

BUG=552615

Review URL: https://codereview.chromium.org/1710843003

Cr-Commit-Position: refs/heads/master@{#377256}
landell
Include errno.h
BUG=

Review URL: https://codereview.chromium.org/1729433002

Cr-Commit-Position: refs/heads/master@{#377254}
sigbjornf
Retire stale leak expectations.
Both these tests are no longer reported as leaking, sync expectations
accordingly.

R=haraken
BUG=582376
NOTRY=true

Review URL: https://codereview.chromium.org/1734493002

Cr-Commit-Position: refs/heads/master@{#377237}
mostynb
simplify glib condition for including message_pump_glib_unittest.cc
We should use the use_glib variable instead of alternative
conditions throughout the build configuration.

Review URL: https://codereview.chromium.org/1719343004

Cr-Commit-Position: refs/heads/master@{#377053}
sigbjornf
Re-order unregistration and detachment of failed ScriptLoader.
For a ScriptLoader that fails to load its script resource, unregister
with the associated ScriptRunner before dispatching 'error'. This avoids
potential trouble should the onerror handler trigger nested access to
the ScriptRunner's (sync) script queue, if it ends up loading script
resources of its own.

R=haraken
BUG=570012

Review URL: https://codereview.chromium.org/1718083005

Cr-Commit-Position: refs/heads/master@{#376986}
davve
Prepare SVGImage for the default sizing algorithm
This patch aligns sizing in SVGImage with sizing done in
LayoutBoxModelObject::calculateImageIntrinsicDimensions()

Split SVGImage::containerSize() into two parts. On part that
calculates the concrete size.

The other part return containerSize(), with concrete object size as
fall-back for direct SVGImage::draw() users (webgl being the only one
known).

The long term plan is to only keep this sizing implementation and
remove the one in LayoutBoxModelObject. As long as SVG is the only
user of the complex version of the algorithm it makes sense to keep it
as SVG-only code.

BUG=581357

Review URL: https://codereview.chromium.org/1695243004

Cr-Commit-Position: refs/heads/master@{#376965}
davve
Clean up computeIntrinsicDimensions
No need to carry around Length for intrinsic width or height
anymore. A FloatSize does fine when all lengths are fixed.

BUG=581357, 585467

Review URL: https://codereview.chromium.org/1685353004

Cr-Commit-Position: refs/heads/master@{#376956}
sigbjornf
Sync leak expectations following r376816.
TBR=yosin,tkent
BUG=587424
NOTRY=true

Review URL: https://codereview.chromium.org/1727503002

Cr-Commit-Position: refs/heads/master@{#376939}
philipj
Add TODOs to convert from video-test.js to testharness.js
BUG=588956
R=mlamouri@chromium.org

Review URL: https://codereview.chromium.org/1715303002

Cr-Commit-Position: refs/heads/master@{#376938}
mstensho
Spec-compliant shorthand parsing of foo-break-(after,before,inside).
The CL that introduced the generic break-after, break-before and break-inside
properties deliberately violated the spec when it came to parsing the
page-break-(after,before,inside) shorthand properties. This was in order to
reduce the risk of a big revert, and instead remain as compatible as we could
with how we used to handle it prior to the introduction of the new generic
properties, i.e. when we parsed and stored separate properties for
page-break-foo and -webkit-column-break-foo, rather than treating them as
shorthands for break-foo.

BUG=223068

Review URL: https://codereview.chromium.org/1720063002

Cr-Commit-Position: refs/heads/master@{#376896}
rune
Removed Document::addedStyleSheet.
Replace it with resolverChanged(). It was only a call from StyleEngine
into Document and back into StyleEngine. Removed a couple of comments
referring to the removed method which were confusing/out-of-date.

Moved call to resolverChanged() immediately following
modifiedStyleSheetCandidateNode() into the latter method.

Made StyleEngine::markDocumentDirty() private.

No functional changes.

BUG=567021

Review URL: https://codereview.chromium.org/1721673002

Cr-Commit-Position: refs/heads/master@{#376894}
rune
Trigger options width update when option text changes.
Previously this was triggered by doing a full host subtree recalc on
shadow redistribution, but that recalc was removed as an optimization.

R=tkent@chromium.org
BUG=588585

Review URL: https://codereview.chromium.org/1719873002

Cr-Commit-Position: refs/heads/master@{#376880}
julienp
SingleSplitView did not take the view border into account when handling the splitter position. This fixes that.
Review URL: https://codereview.chromium.org/1702473002

Cr-Commit-Position: refs/heads/master@{#376876}
sigbjornf
Stop async spellchecker before running the leak detector.
Should a test finish up before all the spellcheck requests that
it (inadvertently?) generates have been asynchronously processed
and completed, it risks beomg reported as leaking.

These requests have no bearing on the correctness of the test
(if they did, the test would have to arrange to wait on their
outcomes), and can safely be cancelled before leak detection goes
ahead. Along with stopping the async spellchecker, this avoids
unnecessary flakiness from tests that involve spellchecking.

R=
BUG=587424

Review URL: https://codereview.chromium.org/1715203002

Cr-Commit-Position: refs/heads/master@{#376816}
mstensho
Run update_use_counter_css.py for r376249, r376148 and r376051.
R=holte@chromium.org

Review URL: https://codereview.chromium.org/1720823002

Cr-Commit-Position: refs/heads/master@{#376787}
rune
Ignore title attribute for style elements in shadow trees.
Title attributes on style elements in shadow trees should not set the
preferred stylesheet name for the whole document. Also, title on style
elements in shadow trees should not respond to the preferred stylesheet
set in the top document.

BUG=588718

Review URL: https://codereview.chromium.org/1717303002

Cr-Commit-Position: refs/heads/master@{#376776}
sigbjornf
Gracefully handle nested eventSender.beginDragWithFiles() attempts.
Programmatic drag operations in test code may attempt to initiate nested
file drag operations, something eventSender nor anyone else is prepared
for. Throw an error and cancel the current drag operation to discourage
(fuzzer?) code from attempting this.

R=dcheng,mkwst
BUG=479216

Review URL: https://codereview.chromium.org/1718463002

Cr-Commit-Position: refs/heads/master@{#376733}
philipj
Fix grammar (does->do) in border-image-sans-border-style deprecation
BUG=559258
R=cavalcantii@chromium.org

Review URL: https://codereview.chromium.org/1722543002

Cr-Commit-Position: refs/heads/master@{#376724}
auygun
Reland Allow one-copy and zero-copy task tile worker pools to use compressed textures.
BUG=434699
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1713503002

Cr-Commit-Position: refs/heads/master@{#376711}
davve
Carry WebMediaSession in WebMediaPlayerParams
While general, this is Android focused in the short-term. It prepares
WebMediaPlayerAndroid for propagating its media session id, if any,
over IPC to the browser process where the media session integration
with the platform happens.

BUG=497735, 581728

Review URL: https://codereview.chromium.org/1648653002

Cr-Commit-Position: refs/heads/master@{#376707}
rune
Don't expose HTMLSlotElement if Shadow DOM V1 is not enabled.
Invoking toString on the element serialized to [object HTMLSlotElement]
which is not correct until we ship.

R=hayato@chromium.org,kochi@chromium.org
BUG=531990

Review URL: https://codereview.chromium.org/1717823002

Cr-Commit-Position: refs/heads/master@{#376701}
rune
Don't try to find a slot in a v0 shadow tree.
ElementShadow::assignedSlotFor asserts that it's only called for V1
ElementShadows and doesn't null check m_slotAssignment. Guard with an
if-check for V1 when assignedSlotFor from Node::assignedSlot like we
already do from Node::assignedSlotForBinding.

R=hayato@chromium.org,kochi@chromium.org
BUG=588209

Review URL: https://codereview.chromium.org/1717053002

Cr-Commit-Position: refs/heads/master@{#376699}
rune
Use invalidation sets to invalidate slotted elements.
Mark invalidation sets as invalidating slotted elements when the
invalidation set features come from a ::slotted pseudo element.

When we encounter a <slot> element during style invalidation, match the
invalidation sets marked as invalidating slotted elements against the
distributed nodes list for the <slot>.

R=hayato@chromium.org,kochi@chromium.org,ericwilligers@chromium.org
BUG=587746

Review URL: https://codereview.chromium.org/1717703002

Cr-Commit-Position: refs/heads/master@{#376698}
sigbjornf
Switch BlinkGCPluginConsumer to use ranged for-loops.
Modernize and consistently use ranged for-loops where possible.

R=haraken,thakis
BUG=

Review URL: https://codereview.chromium.org/1717433003

Cr-Commit-Position: refs/heads/master@{#376656}
rune
Trigger repaint on first paint only on pending stylesheet decrement.
Also, since Document::styleResolverChanged() is now just a call to
StyleEngine::resolverChanged(), remove it.

This is in preparation for splitting (style)resolverChanged() into more
descriptive methods on StyleEngine for what is necessary to nuke and
rebuild in the various cases. That, in turn, is in preparation for the
componentized style resolver and asynchronous update of active
stylesheets.

BUG=401359,567021

Review URL: https://codereview.chromium.org/1716803002

Cr-Commit-Position: refs/heads/master@{#376594}
fs
Rename -webkit-text to -internal-quirk-inherit, limiting it to UA style
Stop accepting the -webkit-text value for color properties in quirks mode.
Rename it to -internal-quirk-inherit to better match the naming in the
quirks mode spec [1].
Usage of this property value is low [2].

[1] https://quirks.spec.whatwg.org/#the-tables-inherit-color-from-body-quirk
[2] https://www.chromestatus.com/metrics/feature/timeline/popularity/942

BUG=586485

Review URL: https://codereview.chromium.org/1713513002

Cr-Commit-Position: refs/heads/master@{#376506}
asaka
Use std::isnan instead of isnan in global ns
BUG=

Review URL: https://codereview.chromium.org/1705173003

Cr-Commit-Position: refs/heads/master@{#376477}
fs
Add test from issue 50819
BUG=50819

Review URL: https://codereview.chromium.org/1716663004

Cr-Commit-Position: refs/heads/master@{#376463}
rune
Reland: Propagate inherited properties into slotted elements on recalc.
When we reach a <slot> element during recalc, we need to trigger recalc
of elements distributed to that slot for inheritance. This is similar
to what is done for InsertionPoint. I have however not found a case
where we need a bigger cannon than LocalStyleChange on the distributed
elements.

Made a few override methods final, expecting no inheritance of
HTMLSlotElement.

R=kochi@chromium.org,hayato@chromium.org
BUG=587797

Committed: https://crrev.com/e6491c6e66c3393363402f04f625959e29ba236c
Cr-Commit-Position: refs/heads/master@{#376406}

Review URL: https://codereview.chromium.org/1708213002

Cr-Commit-Position: refs/heads/master@{#376461}
sigbjornf
Fix non-Oilpan ref pointer usage over DOMTokenLists.
R=
BUG=584612
NOTRY=true

Review URL: https://codereview.chromium.org/1715653002

Cr-Commit-Position: refs/heads/master@{#376434}
tmoniuszko
[GN] Don't rewrite files with the same contents
Reland of https://codereview.chromium.org/1656253003 with fix.

Reason for revert:
Need to revert this patch according https://sites.google.com/a/chromium.org/dev/developers/tree-sheriffs/sheriffing-bug-queues. This patch added a flaky test FilesystemUtils.WriteFileIfChanged.

-----

It's a test flake:
1) Try to find the patch that caused the flake. It should be recent (e.g. last day or two) in all likelihood.
2) If successful with finding that patch, revert the patch. This is especially true if the flake is from a new test introduced in that patch.
3) Close the bug.

-----

The test has failed in the following builds:

http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/176911
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/176911
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/176735
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/176715
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/176715
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/176561
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/176462
http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/176375

-----

Example failure:

[ RUN      ] FilesystemUtils.WriteFileIfChanged
../../tools/gn/filesystem_utils_unittest.cc:610: Failure
Expected: (last_modified) != (file_info.last_modified), actual: 2016-02-04 18:06:36.920 UTC vs 2016-02-04 18:06:36.920 UTC
[  FAILED  ] FilesystemUtils.WriteFileIfChanged (3 ms)
[315/315] FilesystemUtils.WriteFileIfChanged (3 ms)
Retrying 1 test (retry #2)
[ RUN      ] FilesystemUtils.WriteFileIfChanged
../../tools/gn/filesystem_utils_unittest.cc:610: Failure
Expected: (last_modified) != (file_info.last_modified), actual: 2016-02-04 18:06:36.936 UTC vs 2016-02-04 18:06:36.936 UTC
[  FAILED  ] FilesystemUtils.WriteFileIfChanged (2 ms)
[316/316] FilesystemUtils.WriteFileIfChanged (2 ms)
Retrying 1 test (retry #3)
[ RUN      ] FilesystemUtils.WriteFileIfChanged
../../tools/gn/filesystem_utils_unittest.cc:610: Failure
Expected: (last_modified) != (file_info.last_modified), actual: 2016-02-04 18:06:36.952 UTC vs 2016-02-04 18:06:36.952 UTC
[  FAILED  ] FilesystemUtils.WriteFileIfChanged (2 ms)
[317/317] FilesystemUtils.WriteFileIfChanged (2 ms)
1 test failed:
    FilesystemUtils.WriteFileIfChanged (../../tools/gn/filesystem_utils_unittest.cc:579)

-----

More details in http://crbug.com/584548.

Original issue's description:
> [GN] Don't rewrite files with the same contents
>
> BUG=
>
> Committed: https://crrev.com/f8ea5cceefcedd4a01935d5ac4d2ba71e23ac13e
> Cr-Commit-Position: refs/heads/master@{#373544}

BUG=584548

Review URL: https://codereview.chromium.org/1704383002

Cr-Commit-Position: refs/heads/master@{#376430}
fs
Remove support of the -webkit-text value from {-webkit-,}background-clip
Usage is essentially/rounding to zero [1].

[1] https://www.chromestatus.com/metrics/feature/timeline/popularity/941

BUG=586485

Review URL: https://codereview.chromium.org/1708173002

Cr-Commit-Position: refs/heads/master@{#376421}
philipj
Remove support for TreatReturnedNullStringAs=Null|Undefined
document.defaultCharset was the last user and is now removed:
https://codereview.chromium.org/1707473002

BUG=497982

Review URL: https://codereview.chromium.org/1711783003

Cr-Commit-Position: refs/heads/master@{#376419}
rune
Propagate inherited properties into slotted elements on recalc.
When we reach a <slot> element during recalc, we need to trigger recalc
of elements distributed to that slot for inheritance. This is similar
to what is done for InsertionPoint. I have however not found a case
where we need a bigger cannon than LocalStyleChange on the distributed
elements.

Made a few override methods final, expecting no inheritance of
HTMLSlotElement.

R=kochi@chromium.org,hayato@chromium.org
BUG=587797

Review URL: https://codereview.chromium.org/1708213002

Cr-Commit-Position: refs/heads/master@{#376406}
mstensho
Unprefix multicol properties.
The prefixed versions will be retained as aliases for the unprefixed ones.
Might take some decades before the world wide web has stopped using them,
so we probably cannot deprecate (and remove) them any time soon.

Most tests are still prefixed. Will clean that up in due course. For now, just
unprefix one random unit test and one random LayoutTest.

BUG=492297

Review URL: https://codereview.chromium.org/1710003002

Cr-Commit-Position: refs/heads/master@{#376249}
philipj
Remove document.defaultCharset
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/pWSb_tq13Kg/Dmk59Fb9AQAJ

The removed Android test depended on defaultCharset. There is already
another test that verifies that the setting affects the default
encoding: LayoutTests/http/tests/download/default-encoding.html

BUG=567738

Review URL: https://codereview.chromium.org/1707473002

Cr-Commit-Position: refs/heads/master@{#376170}
mstensho
Enable CSS column-fill by default (in stable).
There are already plenty of tests for this in LayoutTests/fast/multicol/

BUG=492297

Review URL: https://codereview.chromium.org/1704883002

Cr-Commit-Position: refs/heads/master@{#376167}
mstensho
Add CSS parser support for break-after, break-before and break-inside.
Note that this only adds support for these properties on specified and computed
style level, and does not extend the functionality in the layout engine. In
particular, we don't support break-(after|before):(avoid|left|right) any better
than before (i.e. we just recognize the values and do nothing about them in the
engine).

The (page|-webkit-column)-break-(after|before|inside) properties are treated as
shorthands for their break-(after|before|inside) counterparts, in accordance
with the spec.

This CL intends to make as few behavioral changes on computed style level as
humanly possible, apart from actually allowing the new properties. In order to
achieve that, we go against the spec when it comes to mapping between the three
modern break-(after|before|inside) properties and the old-fashioned ones. More
specifically, we map "right" and "left" values to "always", and we even support
those values on -webkit-column-break-(after|before), which is just bogus, but
this is how it's always been. We also violate the spec when it comes to mapping
"avoid" values. While the spec says that e.g. page-break-inside:avoid should
simply map to break-inside:avoid, we map it to avoid-page, so that the computed
value of -webkit-column-break-inside isn't affected by such a declaration.

There WILL be some minor behavioral changes, no matter how hard we try, though:
Since there's now just one property for each of before, after and inside
(instead of two - one for page and one for column), declaration sequences like
"page-break-inside:avoid; -webkit-column-break-inside:auto;" will not behave
like before. This will now become "break-inside:auto" (from the
-webkit-column-break-inside declaration), effectively allowing page breaks
inside.

The new test behaves exactly as it would have without the code changes in this
CL, apart from recognizing break-after, break-before and break-inside.

BUG=223068,492297

Review URL: https://codereview.chromium.org/1681273003

Cr-Commit-Position: refs/heads/master@{#376148}
mstensho
Merge most of LayoutBox::mapLocalToAncestor() into LayoutObject.
Just kept the part that updates the IsFixed MapCoordinatesMode, since it wasn't
intertwined with the rest and is unique to LayoutBox-derived classes.

BUG=568492
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1700743002

Cr-Commit-Position: refs/heads/master@{#376126}
sigbjornf
Fix non-Oilpan PassRefPtr<> usage following r375261.
Add required RefPtr<> local bindings of incoming PassRefPtr<>s.

R=haraken
BUG=583376

Review URL: https://codereview.chromium.org/1703113003

Cr-Commit-Position: refs/heads/master@{#376122}
rune
Don't add rule feature data for rules which may never match.
:host and :host-context must always be in the rightmost compound with
no other simple selectors except a succeding pseudo element in order to
match as the host element is feature-less in that context. It's however
not an invalid selector according to the CSS Scoping spec, so we
shouldn't drop it at parse time.

We could potentially skip adding other selectors to rulesets as well
including selectors like:

:hover:not(:hover), div:not(div), ::content and ::slotted not in
shadow trees, etc.

R=kochi@chromium.org,ericwilligers@chromium.org
BUG=489481

Review URL: https://codereview.chromium.org/1703893002

Cr-Commit-Position: refs/heads/master@{#376116}
rune
Don't add to uncommonAttributeRules for non-sharable cases.
Like for siblingRules in [1], we don't need to add rules to
uncommonAttributeRules if the attribute selectors are left of ::content,
::slotted, :host, or :host-context as two elements only may share style
if they match the same elements left of the two former, and anything
left of the two latter may never match.

[1] https://codereview.chromium.org/1695393002/

R=kochi@chromium.org

Review URL: https://codereview.chromium.org/1706793002

Cr-Commit-Position: refs/heads/master@{#376106}
rune
Fixed comment about :host in SelectorChecker.
- Only non-functional :host has no selector list.
- Removed misplaced specificity comment.

R=kochi@chromium.org

Review URL: https://codereview.chromium.org/1707643002

Cr-Commit-Position: refs/heads/master@{#376076}
mstensho
Introduce maxColumnLogicalHeight() and clean up a little.
Looks like MultiColumnFragmentainerGroup::calculateMaxColumnHeight() isn't
going to be the only place where we need this functionality.

No functional changes intended.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1696713003

Cr-Commit-Position: refs/heads/master@{#376075}
sigbjornf
Eagerly unregister PostMessageTimer as a context observer.
The effective lifetime of a PostMessageTimer is over once its callback
fires; unregister as an observer at that point to avoid unnecessary work
during the following GC.

R=haraken
BUG=587012

Review URL: https://codereview.chromium.org/1703883002

Cr-Commit-Position: refs/heads/master@{#375885}
fs
Simplify SVGAnimatedHref
Let SVGAnimatedHref hold the actual value for 'href' and just wrap the
object for 'xlink:href'. This means we can get rid of most of the
overrides.

BUG=584142

Review URL: https://codereview.chromium.org/1697593002

Cr-Commit-Position: refs/heads/master@{#375861}
philipj
Remove internal use of Document::defaultCharset
This is in preparation for removing document.defaultCharset itself.

The third argument for FormDataBuilder::encodingFromAcceptCharset was
added in https://codereview.chromium.org/25417007 to handle a situation
where a form was inserted into an ImageDocument, which did not have an
encoding.

In https://codereview.chromium.org/1180793002 the charset attribute and
its aliases was made to never return null by initializing
DocumentEncodingData to UTF-8, and so the fallback to defaultCharset in
encodingFromAcceptCharset is now unreachable.

While in the area, clean up encodingFromAcceptCharset slightly to take
an explicit fallback encoding that must be valid, and use a range-based
for loop for readability.

TEST=LayoutTests/fast/images/image-page-injected-script-crash.html
BUG=567738

Review URL: https://codereview.chromium.org/1698883005

Cr-Commit-Position: refs/heads/master@{#375835}
fs
Don't report errors when SVG attributes are removed
In some cases, SVGAnimated*, and the parser for the underlying object,
will return an error when encountering a null String object (which it
will be passed when the attribute it reflects is removed.) This can be
misleading, so suppress error reporting in these cases.

Also let SVGAnimatedViewBoxRect::setBaseValueAsString delegate to its
superclass rather than open-coding the same thing. This could prove
beneficial if adding additional logic for handling attribute removals.

BUG=523685

Review URL: https://codereview.chromium.org/1702643002

Cr-Commit-Position: refs/heads/master@{#375833}
sigbjornf
If pthread stack size can't be determined, make a conservative guess.
Default the underestimated stack size for pthreads-based (non OSX) to
512k.

R=haraken
BUG=581913

Review URL: https://codereview.chromium.org/1697263006

Cr-Commit-Position: refs/heads/master@{#375814}
davve
Deprecate SVGZoomEvent and SVGZoomEvents
Deprecate the SVGZoomEvent interface and the corresponding onzoom
attribute. Show deprecation message to the user when creating the
event or when setting up an event handler using onzoom="..." on
<svg:svg>.

Intent to deprecate:

https://groups.google.com/a/chromium.org/d/msg/blink-dev/5PEUh2qHa7c/IUGlM4a9CQAJ

BUG=367890

Review URL: https://codereview.chromium.org/1691883003

Cr-Commit-Position: refs/heads/master@{#375771}
philipj
Remove KeyboardEvent.prototype.keyLocation (alias of location)
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/lqknEaUYCJM/UbNahDDMAwAJ

BUG=568261

Review URL: https://codereview.chromium.org/1700233002

Cr-Commit-Position: refs/heads/master@{#375759}
fs
Consider focusability even when tabs-to-links is enabled for <svg:a>
SVGAElement::isKeyboardFocusable could end up returning 'true' even when
the element wasn't focusable (because it had "display: none" and hence
no LayoutObject) because the value of the 'tabsToLinks' setting would be
returned without further checks. Because it wasn't focusable
setFocusedElement would not do anything, and focus would remain where it
was previously.
Make sure the focusable check is considered in this case. This makes the
SVGAElement version of this code look the same as the HTMLAnchorElement
version.

BUG=586200

Review URL: https://codereview.chromium.org/1700833003

Cr-Commit-Position: refs/heads/master@{#375713}
fs
Add David Vest to core/OWNERS
Review URL: https://codereview.chromium.org/1695383003

Cr-Commit-Position: refs/heads/master@{#375609}
mstensho
Combine 4 bools into GeometryInfoFlags.
This should be more readable and less error-prone than passing 4 bool
parameters to LayoutGeometryMap::push().

"false, false, false, false" -> "0"

Review URL: https://codereview.chromium.org/1698143002

Cr-Commit-Position: refs/heads/master@{#375600}
davve
Mark StyleGeneratedImage::m_fixedSize as const
Make it obvious that a generated image doesn't go from fixed size to
non-fixed size or vice versa during its life time.

BUG=581357

Review URL: https://codereview.chromium.org/1700023003

Cr-Commit-Position: refs/heads/master@{#375571}
mostynb
avoid 'may be used uninitialized' warnings in work_queue.cc
GCC gives 'may be used uninitialized' warnings for enqueue_order
and other_enqueue_order, so let's ensure that they're initialized.

Review URL: https://codereview.chromium.org/1700853002

Cr-Commit-Position: refs/heads/master@{#375558}
fs
Fix arguments order to EXPECT_EQ in HTMLParserIdiomsTest
BUG=586135

Review URL: https://codereview.chromium.org/1701903002

Cr-Commit-Position: refs/heads/master@{#375541}
rune
Don't add to siblingRules for features left of ::slotted.
Like for ::content distributed elements in shadow dom v0, slotted
elements do not share style if they are assigned/distributed to
different slots. Hence, we don't need to add rules to siblingRules when
the combinators or simple selectors are left of the ::slotted pseudo.

We need to add "::slotted(:nth-child(odd)" to siblingRules, but not
".a + ::slotted(.b)" nor ":nth-of-type(3)::slotted(*)".

Similarly, nothing left of :host or :host-context will ever match, so
we can treat those the same way. Selectors like "div + :host" or
":only-child:host-context(.a)" will never match. There is nothing in
the CSS Scoping spec which says they're invalid, hence they're not
dropped.

There was a bug in https://codereview.chromium.org/1683923003/ which
made us detect adjacent combinators before we had noticed the ::content
following it. The detection of sibling dependent pseudo classes like
:emtpy, :nth-child, etc and adjacent combinators have therefore been
split in this CL so that we handle the simple selectors in a compound
before we handle the combinator. Corresponding unit tests have been
added.

R=kochi@chromium.org,hayato@chromium.org

Review URL: https://codereview.chromium.org/1695393002

Cr-Commit-Position: refs/heads/master@{#375531}
mostynb
add a mechanism to define clang tarball mirrors
This patch adds a CDS_CLANG_BUCKET_OVERRIDE environment variable
which can be used to override the default google storage api
URL from which clang tarballs are downloaded.

The goal here is to minimize load on the google storage mirrors,
which can become blocked for external contributors, since it is
apparently quite difficult to figure out why and how to get
un-blocked.

BUG=586146

Review URL: https://codereview.chromium.org/1693363002

Cr-Commit-Position: refs/heads/master@{#375472}
rune
Check IsFixed specifically instead of presence of other flags.
LayoutSVGRoot::mapLocalToAncestor has an assert to check that there is
no fixed content in the SVG layout tree. However, it did incorrectly
rely on MapCoordinatesFlags being non-0. Changed the assert to check
for the Fixed flag explicitly instead.

R=mstensho@opera.com
BUG=586478

Review URL: https://codereview.chromium.org/1697543002

Cr-Commit-Position: refs/heads/master@{#375458}
sigbjornf
Tidy heap snapshotting implementation.
Adjust the division of labor between BaseHeap::takeSnapshot() and
the heap page implementations of takeSnapshot() --

 - have BaseHeap::takeSnapshot() handle creation of page dump objects
   (and their naming scheme.)
 - tally the heap free count+size in a separate object; only added to
   by "normal" heap pages.

R=
BUG=

Review URL: https://codereview.chromium.org/1700723002

Cr-Commit-Position: refs/heads/master@{#375455}
rune
Don't add siblingRules with combinator left of ::content.
RuleFeatureSet::siblingRules are collected because we need to skip
style sharing between elements which do not match the same set of
sibling selectors. Style sharing only happens if two elements' parent
chain of computed styles are common. That means that descendants of
their common ancestor also need to share style.

Due to this check in SharedStyleFinder::canShareStyleWithElement:

  if (!sharingCandidateDistributedToSameInsertionPoint(candidate))
    return false;

Elements with distributed nodes in their ancestor chain need to be
distributed to the same insertion points in order to share style. That
is, two elements which may share style match the same insertion points
for all selectors containing the ::content pseudo. Which also means
that any sibling selectors left of any ::content pseudo will match the
same sibling combinations for all elements which may share style.

Hence, we don't need to reject style sharing based on selectors like:

  .a + .b ::content .c

because the sharing would already be rejected because of insertion
point mismatch in the ancestor chain.

This CL skips adding rules to RuleFeatureSet::siblingRules if we have
seen a ::content combinator before we see any sibling selectors.

We currently rejecting style sharing for slots checking
isChildOfV1ShadowHost() in Element::supportsStyleSharing(), so we could
have skipped adding any of the ::slotted rules to siblingRules. I'm not
doing that here as that might change since ::slotted is work in
progress.

If continue to skip style sharing past different slots, this means we
will only need to consider siblingRules from the same TreeScope when
for Shadow DOM V1, which means we don't need a global set of
siblingRules.

R=kochi@chromium.org,hayato@chromium.org,esprehn@chromium.org
BUG=401359

Review URL: https://codereview.chromium.org/1683923003

Cr-Commit-Position: refs/heads/master@{#375454}
fs
Check length of String before checking if it's 8/16 bit
String::is8Bit() can't be called on 'null' Strings, so check if the
length is zero first.

BUG=586135

Review URL: https://codereview.chromium.org/1694773002

Cr-Commit-Position: refs/heads/master@{#375451}
rune
Added redistribution recalc test.
Adding a style recalc test for [1]. Elements redistributed to the same
position in the same insertion point should not need a style recalc.

[1] https://codereview.chromium.org/1677463002/

R=kochi@chromium.org
BUG=584177

Review URL: https://codereview.chromium.org/1688483003

Cr-Commit-Position: refs/heads/master@{#375430}
sbergner
Make AW state_serializer handle restoring also legacy format
This ensures that even if an app attempts to restore a state saved
before upgrading WebView (using the new state version) the old version
will still be successfully restored.

BUG=584693

Review URL: https://codereview.chromium.org/1687853002

Cr-Commit-Position: refs/heads/master@{#375418}
davve
Align IntrinsicSizingInfo with computeIntrinsicDimensions
Store aspect ratio as a ratio between two floats rather than a double,
in the same way as is done in Image::computeIntrinsicDimensions().

BUG=581357

Review URL: https://codereview.chromium.org/1690253002

Cr-Commit-Position: refs/heads/master@{#375364}
sigbjornf
Fix non-Oilpan build following r375261.
TBR=oilpan-reviews
BUG=583376
NOTRY=true

Review URL: https://codereview.chromium.org/1698683003

Cr-Commit-Position: refs/heads/master@{#375354}
sigbjornf
Avoid data race on Database::m_opened.
Upon closing, the database thread will transition m_opened
to |false|. Do that atomically so as to avoid a race when
other threads check opened() status.

R=michaeln
BUG=580994

Review URL: https://codereview.chromium.org/1694893002

Cr-Commit-Position: refs/heads/master@{#375353}
mstensho
Merge LayoutInline::mapLocalToAncestor() into LayoutObject.
Avoids code duplication and maybe also makes the LayoutObject implementation
more correct. It was typically only LayoutText objects that used the
LayoutObject implementation of mapLocalToAncestor() prior to this change.

Some extra care was needed when calling style() members, since text nodes just
copy their parent's computed style instead of just inheriting the inheritable
ones. Apart from that, it's basically just about replacing the LayoutObject
implementation with that of LayoutInline.

BUG=568492
R=leviw@chromium.org,ojan@chromium.org

Review URL: https://codereview.chromium.org/1516003003

Cr-Commit-Position: refs/heads/master@{#375269}
fs
Add support for 'href' (w/o XLink NS) for various SVG elements
This CL adds a new wrapper type SVGAnimatedHref that wraps 'href' (the
new, null/default NS version) and '(xlink:)href' (the XLink NS version).
This wrapper type is used by SVGURIReference and thus most uses of
'href' is covered by this part. SVGAnimatedHref is intended as a wrapper
for accessing the underlying value of either 'href' or 'xlink:href'. Any
updates due to setAttribute or will go directly to the underlying values
which means that synchronization etc. does not apply to the wrapper.
This is one of the "pro"s of this approach - it does not require any
modification to synching between the SVGString object and the attribute
in certain cases (like when the "active" attribute is removed). A "con"
would be that there's a lot of dead space in the object since the
wrapper itself still needs to implement the SVGAnimatedString interface
even if just forwards to the actual SVGString.
The UseCounter for href.baseVal/animVal are moved to the new wrapper.

For cases where SVGURIReference is not used, new code-paths are added to
select the right attribute.

Animation code is updated to target the 'href' in the null/default NS.

BUG=584142

Review URL: https://codereview.chromium.org/1681553002

Cr-Commit-Position: refs/heads/master@{#375192}
rune
Avoid overwrite of existing PaintLayerReflectionInfo.
The check for an existing reflectionInfo on PaintLayer before
allocating a new one fell out of [1]. This fixes the crash in the
original report in crbug.com/585699.

[1] https://codereview.chromium.org/1636563003

R=chrishtr@chromium.org
BUG=585699

Review URL: https://codereview.chromium.org/1688053003

Cr-Commit-Position: refs/heads/master@{#375169}
sigbjornf
Fix non-Oilpan build following r375129.
R=haraken
BUG=543198

Review URL: https://codereview.chromium.org/1696653002

Cr-Commit-Position: refs/heads/master@{#375160}
davve
Count document.createEvent() usage
Count all document.createEvent() calls outside what's listed in:

https://dom.spec.whatwg.org/#dom-document-createevent

BUG=569690

Review URL: https://codereview.chromium.org/1673243002

Cr-Commit-Position: refs/heads/master@{#375149}
sigbjornf
Tidy GrammarMarkerIndex spelling.
R=
BUG=

Review URL: https://codereview.chromium.org/1686263007

Cr-Commit-Position: refs/heads/master@{#375148}
mstensho
Unit tests for LayoutObject::mapLocalToAncestor() (and overrides).
BUG=568492

Review URL: https://codereview.chromium.org/1681403004

Cr-Commit-Position: refs/heads/master@{#375145}
rune
markDocumentDirty() before styleResolverChanged().
markDocumentDirty() was called after the active stylesheet list was
updated which left the tree-scope dirty after everything else was clean.

Switched the order of the statements.

R=hayato@chromium.org

Review URL: https://codereview.chromium.org/1684193003

Cr-Commit-Position: refs/heads/master@{#375139}
rune
Invalidate :-webkit-any-link for visited state changes.
We did style invalidation for :visited and :link, but UA style uses
color: -webkit-link with :-webkit-any-link and let -webkit-link be
translated into two different colors in the implementation instead of
using :visited and :link in the stylesheet.

Adding style invalidation of :-webkit-link as well. We already did that
for attribute changes on <a> and <svg:a>.

R=tkent@chromium.org
BUG=586190

Review URL: https://codereview.chromium.org/1689873004

Cr-Commit-Position: refs/heads/master@{#375138}
sigbjornf
Have ASan ignore ObjectAliveTrait<>::isHeapObjectAlive() applied to mixins
When Heap::willObjectBeLazilySwept<T>() is used on a lazy-sweepable
object where T is a mixin, the mixin's isHeapObjectAlive() virtual will
have to be used to adjust the object pointer to the head of the object.

It is unlikely that a compiler will devirtualize that call hence
mark the isHeapObjectAlive() as ASan ignorable.

R=
BUG=

Review URL: https://codereview.chromium.org/1695493002

Cr-Commit-Position: refs/heads/master@{#375137}
mstensho
Cannot do simplified layout on an object that contains a column-spanner.
Introducing LayoutFlowThread::canSkipLayout(). The implementation of this
method needed two pieces of simple functionality that already existed in other
methods. Refactored them into separate functions, instead of duplicating the
code.

BUG=512757

Review URL: https://codereview.chromium.org/1691053002

Cr-Commit-Position: refs/heads/master@{#375071}
mstensho
Remaining page height should never be 0 when told to AssociateWithLatterPage.
However, the laws of nature behave differently as LayoutUnit approaches
infinity. Just use the fragmentainer height instead of zero, but assert that
we're actually dealing with saturated arithmetic.

BUG=524882

Review URL: https://codereview.chromium.org/1691003003

Cr-Commit-Position: refs/heads/master@{#375059}
davve
Pass executionContext to document.createEvent()
In the long run, createEvent() should only work for whitelisted event
interfaces. An execution context is needed for taking the first steps
by adding use counters and doing deprecations.

BUG=569690

Review URL: https://codereview.chromium.org/1677033002

Cr-Commit-Position: refs/heads/master@{#374913}
sigbjornf
Add missing opener frame null check.
Opening a new window requires access to the calling window's frame, and
isn't supported otherwise. Add missing null check.

R=
BUG=541010

Review URL: https://codereview.chromium.org/1682173004

Cr-Commit-Position: refs/heads/master@{#374912}
davve
Expand IntrinsicSizingInfo for SVG
Add fields to IntrinsicSizingInfo specifying whether the intrinsic
width and height are specified or not. For SVGs there is a distinction
between missing width/height and setting width/height to 0. There is
code in LayoutReplaced that has specific hooks into the SVG code to
make this distinction. By having separate fields in
IntrinsicSizingInfo this entanglement can be broken.

BUG=585467

Review URL: https://codereview.chromium.org/1679743006

Cr-Commit-Position: refs/heads/master@{#374909}
philipj
Use effectivePreloadType() where possible
preloadType() is still used in two places where it ideally should not,
HTMLMediaElement::setPlayerPreload and HTMLMediaElement::seek, but
changing those would probably be observable and need tests.

Drive-by: Drop two unused HTMLMediaElement state bits

R=fs@opera.com

Review URL: https://codereview.chromium.org/1687793002

Cr-Commit-Position: refs/heads/master@{#374897}
sigbjornf
Oilpan: ImageObserver needs to be a GC mixin.
R=haraken
BUG=

Review URL: https://codereview.chromium.org/1610883002

Cr-Commit-Position: refs/heads/master@{#374896}
fs
Factor out the <textPath> positioning mapping code into a helper class
Since <textPath> will be getting a bunch of smaller new features - all
which essentially revolving around how the actual position is computed,
or how the actual path is setup, wrap the code that performs the
mapping from a location to a point on the path in a helper. The helper
is called PathPositionMapper, and for now resides with
LayoutSVGTextPath since that's the object that sets up the path data.

BUG=366559

Review URL: https://codereview.chromium.org/1683903004

Cr-Commit-Position: refs/heads/master@{#374893}
sigbjornf
Fix adopt-iframe-src-attr-after-remove.html flaky failure, attempt 2.
Test still flaky following r374872; make the ordering between timer
operations explicit -- requiring the onload's GC to have completed
before running the main part of this test.

(Semi-blind attempt, unable to reproduce locally.)

R=haraken
BUG=584209

Review URL: https://codereview.chromium.org/1689903002

Cr-Commit-Position: refs/heads/master@{#374889}
sigbjornf
Fix adopt-iframe-sec-attr-after-remove.html failure.
Delay GC until back at the event loop.

R=haraken
BUG=584209

Review URL: https://codereview.chromium.org/1692483002

Cr-Commit-Position: refs/heads/master@{#374872}
sigbjornf
Fix non-Oilpan build following r371046.
TBR=oilpan-reviews
BUG=552289

Review URL: https://codereview.chromium.org/1689773002

Cr-Commit-Position: refs/heads/master@{#374772}
sigbjornf
Fix non-Oilpan build following r374308.
TBR=oilpan-reviews
BUG=503491

Review URL: https://codereview.chromium.org/1688893002

Cr-Commit-Position: refs/heads/master@{#374724}
philipj
Rename XMLHttpRequestProgressEventThrottle to ProgressEventThrottle
XMLHttpRequestProgressEvent is no more.

BUG=357112
R=chrishtr@chromium.org

Review URL: https://codereview.chromium.org/1690503002

Cr-Commit-Position: refs/heads/master@{#374683}
mostynb
gn: make device/battery build on embedded linux
The logic for when to include the linux dbus implementation
falls into three cases: chromeos, non-chromeos linux with
dbus, and non-chromeos linux without dbus.

By using just the is_chromeos, is_linux and use_dbus
variables, this code will also build successfully on
embedded linux targets.

Review URL: https://codereview.chromium.org/1674233002

Cr-Commit-Position: refs/heads/master@{#374654}
davve
Introduce IntrinsicSizingInfo
Prepare for passing more information along, specifically whether
intrinsic sizes are specified, when computing intrinsic sizing
information. Do this by introducing a struct carrying the relevant
information. No functional change expected.

Factor out a part of computeAspectRatioInformationForLayoutBox (now
named computeIntrinsicSizingInfoForLayoutBox) and put in a separate
function constrainIntrinsicSizeToMinMax. In the process remove a FIXME
about moving code back to some undefined previous state that's
confusing now that the code has moved around even more.

BUG=585467

Review URL: https://codereview.chromium.org/1687503002

Cr-Commit-Position: refs/heads/master@{#374635}
rune
Remove unnecessary recalc of host subtree on distribute.
Nodes which need style recalculations after being distributed to new
insertion points, new positions within insertion points, or simply not
distributed anymore, are being reattached in
InsertionPoint::setDistributionNodes().

R=hayato@chromium.org,kochi@chromium.org,esprehn@chromium.org
TEST=fast/dom/shadow,fast/css
BUG=584177

Review URL: https://codereview.chromium.org/1677463002

Cr-Commit-Position: refs/heads/master@{#374629}
sigbjornf
Add registerNodeListWithIdNameCache() assert.
Follow up r374385 and catch out unsupported multiple registrations.

R=haraken
BUG=585054

Review URL: https://codereview.chromium.org/1683783002

Cr-Commit-Position: refs/heads/master@{#374614}
sigbjornf
Retire temporary cssTextCache() release assert.
R=
BUG=584692

Review URL: https://codereview.chromium.org/1682763003

Cr-Commit-Position: refs/heads/master@{#374611}
fs
Remove unused LayoutSVGTextPath::m_layoutPath
This member was probably intended for caching the path at some point in
time, but it isn't used at all at the moment. Remove it for now - maybe
something like it will make a comeback in the future.

Review URL: https://codereview.chromium.org/1686593002

Cr-Commit-Position: refs/heads/master@{#374490}
fs
Remove references to SVGPathElement from SVGAnimatedPath
There's no longer a need for being this specific. Just use SVGElement.

Review URL: https://codereview.chromium.org/1674353005

Cr-Commit-Position: refs/heads/master@{#374447}
fs
Move pathLength scale-factor computation to SVGPathElement
There'll eventually be more users of it. Maybe by means of the bug
referenced below.

BUG=366559

Review URL: https://codereview.chromium.org/1680183002

Cr-Commit-Position: refs/heads/master@{#374446}
philipj
Remove XMLHttpRequestProgressEvent (position and totalSize)
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/bpbq0Rcpauk/cnpJtHddAgAJ

BUG=357112

Review URL: https://codereview.chromium.org/1681923002

Cr-Commit-Position: refs/heads/master@{#374434}
davve
Make object-sizing-zero-intrinsic-width-height a javascript test
A javascript test can detect failures at a more fine-grained level and
is potentially less performance intensive.

BUG=585467

Review URL: https://codereview.chromium.org/1681013004

Cr-Commit-Position: refs/heads/master@{#374408}
sigbjornf
Do not re-register cached id-name HTMLCollection at same invalidation type.
An HTMLCollection creates an id-name cache for namedItem()/item() lookups.
To handle document tree invalidations following id-name mutations, the
HTMLCollection must then register with the document has having such a
cached collection.

This is done "by proxy", registering the HTMLCollection as being
dependent on id-name invalidation. This registration for the cache being
quite possibly in addition to the collection invalidation type that the
HTMLCollection is already registered at. The HTMLCollection implementation
then naturally taking care to unregister if the cache is invalidated and
cleared.

With Oilpan, the document keeps a weak set of references to these
live collections. So in the event that the HTMLCollection is already
an id-name collection and it registers its id-name cache (by proxy)
with the document, it will re-register the same collection object.
Upon invalidation of the id-name cache the unregistration will then
remove the HTMLCollection entirely as being dependent on id-name
related invalidation notifications. That lack of invalidations can
in certain circumstances lead to failure (see test.)

Address the problem by having id-name HTMLCollections not bother
with (un)registering the id-name cache as (another) live collection.
It adds no value, the collection object is already registered.

(This worked out non-Oilpan as the document there keeps bin counts
per collection invalidation type, allowing "duplicates" from the
same object.)

R=haraken
BUG=585054

Review URL: https://codereview.chromium.org/1674273004

Cr-Commit-Position: refs/heads/master@{#374385}
rune
Only cache nth-indices when child count > 32.
When matching :nth-* selectors, we sparsely cache the child index count
into a hashmap for the parent element. Doing this regardlessly gave us
a performance penalty for small number of children as where noticed in
a performance degradation for [1].

The new approach is to not cache any indices until we match an :nth-*
selector for which we walk more than 32 siblings. The number 32 were
proposed in the bug report, and it turns out to be quite suitable given
the experiments which were done comparing the implementation not using
a cache at all, and the implementation where we cached regardlessly.

We trigger caching for nth-of-type indices based on the sibling count
as well, but not the sibling-of-type count as that would cause terrible
performance if the elements of the same type were sparse compared to
other siblings.

Gives a > 40% performance improvement for [1].

[1] blink_perf.css:PseudoClassSelectors.

BUG=483338
TEST=blink_perf.css:PseudoClassSelectors

Review URL: https://codereview.chromium.org/1655993005

Cr-Commit-Position: refs/heads/master@{#374356}
mostynb
update obsolete code.google.com documentation links
This is a documentation-only change.

Disabling presubmit checks, due to "noparent" settings for the following files:
components/policy/resources/policy_templates.json
content/common/font_config_ipc_linux.h

BUG=567488
NOPRESUBMIT=true
TBR=atwilson,dcheng

Review URL: https://codereview.chromium.org/1592403002

Cr-Commit-Position: refs/heads/master@{#374213}
perja
bluetooth: android: Fix a couple of crashes when adapter is turned on/off.
These changes fixes the crashes found when toggling the adapter on/off
when device chooser dialog is used in web-bluetooth.

BUG=570610

Review URL: https://codereview.chromium.org/1610053005

Cr-Commit-Position: refs/heads/master@{#374145}
fs
Add override qualifier to SVGStaticStringList::setBaseValueAsString
Overrides method from SVGAnimatedPropertyBase.

Review URL: https://codereview.chromium.org/1673203002

Cr-Commit-Position: refs/heads/master@{#374127}
sigbjornf
Conditionally define PersistentNode destructor.
R=
BUG=

Review URL: https://codereview.chromium.org/1674113002

Cr-Commit-Position: refs/heads/master@{#374093}
sigbjornf
Improve MediaStreamTrack's hasPendingActivity predicate.
Make the predicate more precise; MediaStreamTrack objects only need
to have their lifetimes prolonged in certain non-ended states. See
comment for details.

R=haraken
BUG=583264

Review URL: https://codereview.chromium.org/1680563002

Cr-Commit-Position: refs/heads/master@{#374090}
sigbjornf
Tidy up inclusion of WebScheduler.h
Hygiene; insist on IWYU for WebScheduler.h also.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1680503002

Cr-Commit-Position: refs/heads/master@{#374055}
sigbjornf
Fix non-Oilpan build following r373473.
TBR=oilpan-reviews,rune@opera.com
BUG=

Review URL: https://codereview.chromium.org/1671263003

Cr-Commit-Position: refs/heads/master@{#374040}
sigbjornf
Revert of Don't set the origin twice when navigating for javascript: URLs (patchset #2 id:20001 of https://codereview.chromium.org/1670173002/ )
Reason for revert:
Number of MSan failures reported, https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20MSAN/builds/8451

Original issue's description:
> Don't set the origin twice when navigating for javascript: URLs
>
> As javascript: navigations will end up with a document that has the
> original document's URL, we shouldn't run the algorithm to determine
> origin on the original URL, especially since we'll override the origin
> later anyways.
>
> BUG=583445
> R=japhet@chromium.org,dcheng@chromium.org,mkwst@chromium.org
>
> Committed: https://crrev.com/75b27bda96f0fe77d40b502642d6669531981a49
> Cr-Commit-Position: refs/heads/master@{#373917}

TBR=dcheng@chromium.org,japhet@chromium.org,mkwst@chromium.org,jochen@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=583445

Review URL: https://codereview.chromium.org/1676793003

Cr-Commit-Position: refs/heads/master@{#374021}
fs
Remove the SVG parsing "generic error" reporting special case
With most error-reporting sites switched to using non-generic errors, the
workaround for the generic error message can be removed - giving all messages
a similar structure ("<context>: <message>").

BUG=231612

Review URL: https://codereview.chromium.org/1668183002

Cr-Commit-Position: refs/heads/master@{#373941}
fs
Error reporting for number-or-percentage
Move parseNumberOrPercentage from SVGParserUtilities to SVGNumber (since
it's the only user) and simplify it.

BUG=231612

Review URL: https://codereview.chromium.org/1667353003

Cr-Commit-Position: refs/heads/master@{#373899}
fs
Error reporting for SVGAngle
Refactor the local helepr stringToAngleType(...) to only advance past
complete matches (of units).

BUG=231612

Review URL: https://codereview.chromium.org/1669333002

Cr-Commit-Position: refs/heads/master@{#373888}
fs
Cleanup includes of XLinkNames.h
Remove includes which are not used, and use the imageSourceURL() method
in one place to abstract away future uses of 'href'.

BUG=584142

Review URL: https://codereview.chromium.org/1666363007

Cr-Commit-Position: refs/heads/master@{#373866}
sigbjornf
Do not let go of MediaStreamTracks too early.
Add missing hasPendingActivity() predicate.

R=haraken
BUG=583264

Review URL: https://codereview.chromium.org/1671033002

Cr-Commit-Position: refs/heads/master@{#373864}
sigbjornf
Avoid data race on CrossThreadPersistents during thread detachment.
As part of detaching a thread from Oilpan and emptying its heap, the
CrossThreadPersistent<>s pointing into that heap are cleared. Doing
so entails traversing the collection of such persistents and checking
their heap membership -- that traversal might race with other threads
who are not at any safepoint.

To avoid the race, insist that updates to CrossThreadPersistent<>s are
atomic along with the corresponding read when doing the above
traversal.

R=haraken
BUG=584250

Review URL: https://codereview.chromium.org/1670813004

Cr-Commit-Position: refs/heads/master@{#373814}
rune
Fixed for-loop increments in InsertionPoint::setDistributedNodes.
When we reached the end of the old/new distributed nodes in the inner
for-loop, we would do an extra increment of the index of the new/old
distributed nodes which would then lead to skipping reattach for one of
the elements.

Also removed the special treatment of reattaching fallback elements as
they would be part of the new/old vector and shouldn't need special
treatment.

The added test is currently not failing as it's hidden by a
SubtreeStyleChange on the host element which I'll try to remove in a
separate CL.

R=hayato@chromium.org,kochi@chromium.org,esprehn@chromium.org
BUG=584617

Review URL: https://codereview.chromium.org/1671873002

Cr-Commit-Position: refs/heads/master@{#373805}
sigbjornf
Split out fallback stack limit determination.
In case we're unable to get an estimate of the stack size for a platform
thread, a small stack size is assumed and its effective upper bound is
then probed and computed.

Do that in a separate method to avoid compiler-injected stack exhaustion checks
(MSVC's _chkstk()) from being always run for StackFrameDepth::enableStackLimit().
This also facilitates running GCs when up against stack pressure on Windows
platforms.

R=haraken
BUG=582819

Review URL: https://codereview.chromium.org/1673543002

Cr-Commit-Position: refs/heads/master@{#373787}
bratell
Set DOM Storage buffer size so that not everything ends up in RAM
When a database is opened the log file is read and if the write
buffer is large then it stays in memory, and this happens
every time the browser starts. By reducing the write buffer
the log file will be written into the database the first time
and then very little RAM will be used for that data.

BUG=583629

Review URL: https://codereview.chromium.org/1668463003

Cr-Commit-Position: refs/heads/master@{#373780}
landell
Use std::isnan instead of isnan in global ns
BUG=

Review URL: https://codereview.chromium.org/1665763002

Cr-Commit-Position: refs/heads/master@{#373548}
tmoniuszko
[GN] Don't rewrite files with the same contents
BUG=

Review URL: https://codereview.chromium.org/1656253003

Cr-Commit-Position: refs/heads/master@{#373544}
sigbjornf
Annotate TimerBase::CancellableTimerTask destructor as ASan ignorable.
Just like its run() method, the destructor may touch its Timer owner when
it is in a to-be-swept state; allow it.

R=haraken
BUG=581448

Review URL: https://codereview.chromium.org/1666133002

Cr-Commit-Position: refs/heads/master@{#373534}
mstensho
Remove unreachable code from TransformState::move().
Review URL: https://codereview.chromium.org/1661153002

Cr-Commit-Position: refs/heads/master@{#373530}
davve
Inline SVGImage::setContainerSize() and remove extra resize call
DrawInternal() is responsible for resizing the frame to the new
container size. Setting the frame size to the old container size
temporarily ought to be a redundant operation.

BUG=581357

Review URL: https://codereview.chromium.org/1667053002

Cr-Commit-Position: refs/heads/master@{#373517}
sigbjornf
If marking system stack is unknown, be more forgiving about stack depths.
In case we're unable to determine the stack size available for the GC
marking pass, a very conservative fallback size is used -- that size
being used to decide if the marking pass should switch to using lazy
marking instead.

If the fallback size is in effect, have the debug assert intended to catch
out unintentionally deep trace chains be more forgiving.

R=
BUG=581913

Review URL: https://codereview.chromium.org/1663823002

Cr-Commit-Position: refs/heads/master@{#373514}
sigbjornf
Reorder ScriptLoader fields to help diagnose object inconsistency.
crbug.com/570012 is showing signs of a ScriptLoader field update not
persisting on some platforms; reorder the fields to speculatively try
to perturb status.

R=
BUG=570012

Review URL: https://codereview.chromium.org/1666093002

Cr-Commit-Position: refs/heads/master@{#373505}
tmoniuszko
Support different project toolchains
Solution may contain projects configured to use non-default toolchains.
For instance solution with "Debug|Win32" configuration may contain some
projects with "Debug|x64" configuration.

BUG=305761

Review URL: https://codereview.chromium.org/1667773002

Cr-Commit-Position: refs/heads/master@{#373503}
fs
Don't propagate bbox for empty <text> to ancestors
If we have a <text> element which is "empty" (essentially has no text
content after collapsing spaces), then its bounding box would be empty,
but would still be propagated to the bounding boxes of the ancestors -
which could span them out to be bigger than expected. Similarly they
could be subject to their userspace transform with a similar effect.

Skip propagation of empty <text> element - where "empty" is defined as
"has no line boxes".

BUG=450229

Review URL: https://codereview.chromium.org/1661983002

Cr-Commit-Position: refs/heads/master@{#373501}
davve
Atomic scaling in ImageResource::imageSize()
Since https://codereview.chromium.org/1634133003/ there is only
hasRelativeSize(), no hasRelative{Width,Height}(). The code affected
by this patch was written under the latter assumption. With only
hasRelativeSize() the code can be simplified a bit to either scale or
return early.

Also remove useless ASSERT. |multiplier| is always non-equal to one in
that code branch so the assert doesn't check anything meaningful.

BUG=581357

Review URL: https://codereview.chromium.org/1661013002

Cr-Commit-Position: refs/heads/master@{#373496}
sigbjornf
Allow cssTextCache to be used on the main thread only.
https://codereview.chromium.org/864143006 tentatively made this
singleton cross-thread usable. (Repeated) testing doesn't indicate
that it is used outside the main thread, hence switch back to using
DEFINE_STATIC_LOCAL().

R=haraken,timloh
BUG=549732

Review URL: https://codereview.chromium.org/1667813002

Cr-Commit-Position: refs/heads/master@{#373493}
fs
Additional errors for SVG transform list parsing
This adds specific error messages for missing/incorrect transform
functions and missing '(' at the start of a transform function argument
list.

BUG=231612

Review URL: https://codereview.chromium.org/1663753003

Cr-Commit-Position: refs/heads/master@{#373491}
tmoniuszko
Make sure VS projects order is always the same in solution
Solution file is being rewritten and reloaded by Visual Studio if projects
order changes during 'gn gen' command.

BUG=305761

Review URL: https://codereview.chromium.org/1667553003

Cr-Commit-Position: refs/heads/master@{#373486}
rune
Incorrect setHasMediaQueries() when @media rule is dropped.
Trying to insert an @media rule into a stylesheet were incorrectly
marking the stylesheet as containing media queries before the media
rule was dropped because it was inserted before an @namespace rule.

That caused unnecessary rebuilding of rule sets for the stylesheet with
the dropped rule when a media query evaluation changed in some other
stylesheet.

R=timloh@chromium.org

Review URL: https://codereview.chromium.org/1669493006

Cr-Commit-Position: refs/heads/master@{#373473}
fs
Rename local limit variable in SVG transform argument parsing
Rename maxPossibleParams to requiredWithOptional to more precisely
describe what it is.

BUG=231612

Review URL: https://codereview.chromium.org/1655153002

Cr-Commit-Position: refs/heads/master@{#373217}
mstensho
Introduce RenderingTest::getLayoutObjectByElementId().
Because it's boring to type document().getElementById("foo")->layoutObject().

Review URL: https://codereview.chromium.org/1662483002

Cr-Commit-Position: refs/heads/master@{#373150}
fs
Support 'pathLength' for stroking operations on <path>
This implements support for the 'pathLength' attribute on <path>.

BUG=536217

Review URL: https://codereview.chromium.org/1376523002

Cr-Commit-Position: refs/heads/master@{#373110}
fs
Error reporting for SVG transform lists
Report too short/long argument lists to transform functions as well as
trailing garbage (separators). Could still be improved wrt invalid
transform functions and missing opening parenthesis.

BUG=231612

Review URL: https://codereview.chromium.org/1659513002

Cr-Commit-Position: refs/heads/master@{#373100}
tommyt
Call BluetoothGatt#close() after disconnecting
This fixes the problem where connections are never properly removed,
causing the BluetoothAdapter to eventually not be able to connect at
all.

BUG=576819

Review URL: https://codereview.chromium.org/1618273002

Cr-Commit-Position: refs/heads/master@{#372986}
tmoniuszko
Use ElapsedTimer to measure VS files generation time in GN
BUG=305761

Review URL: https://codereview.chromium.org/1651113002

Cr-Commit-Position: refs/heads/master@{#372912}
sigbjornf
Support reviving a disposed plugin container.
When a plugin element updates its 'persisted' renderless widget (a plugin
container most likely), we notify the previous one kept as having been
detached and disposed of. The plugin container must then promptly clear
the reference to its external WebPlugin (and others), for safety.

It is however possible for the embedder to still keep references to that
plugin container and afterwards revive it by assigning it a replacement
plugin. Support such revivification.

R=haraken
BUG=582811

Review URL: https://codereview.chromium.org/1652093002

Cr-Commit-Position: refs/heads/master@{#372907}
mstensho
LayoutBox cannot be non-atomic inline.
Don't account for such a situation. Instead, just assert that
it doesn't happen.

Review URL: https://codereview.chromium.org/1658643002

Cr-Commit-Position: refs/heads/master@{#372823}
davve
Document lifecycle violation workaround
Add comments describing how scheduleSVGFilterLayerUpdateHack's
lifecycle violation is handled and remove stale comments about
<iframe> compositioning long fixed.

NOTRY=true

Review URL: https://codereview.chromium.org/1544973002

Cr-Commit-Position: refs/heads/master@{#372715}
bratell
Handle NaN in the Audio delay curves.
Since switching from std::min to clampTo NaN has caused ASSERTs.
This restores the old behaviour of no ASSERT and a delay interpreted
as maxDelayTime.

BUG=582699
R=rtoy@chromium.org

Review URL: https://codereview.chromium.org/1657763002

Cr-Commit-Position: refs/heads/master@{#372710}
sigbjornf
Make copyToVector() robust against conservative GCs.
When resizing copyToVector()'s incoming vector to match the size of
the collection being copied from, do this in a manner that locks out
GCs across that vector backing store allocation.

If not, there's a risk that the collection's size might shrink across
that GC, and leave the vector as having an overestimated size.
copyToVector() will in that case unexpectedly encounter empty
elements in the tail, and fail.

This can only happen for Oilpan heap collections having weak references..
and that collection is not directly stack-reachable when a conservative
GC triggers. Rare, but copyToVector()'s obligation to make that safe
rather than its callers.

R=haraken
BUG=581698

Review URL: https://codereview.chromium.org/1652953002

Cr-Commit-Position: refs/heads/master@{#372693}
fs
Refactor parsing in SVGTransformList
In preparation for extended error reporting.

Split SVGTransform creation out of parseTransformOfType, and then fold
the remains into parseTransformParamList - naming the result
parseTransformArgumentsForType. Use a Vector with suitable
initial-capacity rather than a float[]. Change the handling trailing
commas so that it is not triggered when the maximum number of arguments
are reached. (This will allow for better errors to be reported in some
cases.)
Change parseAndSkipTransformType to return the parsed type via the
return value rather than an out parameter.
Reduce the number of calls to skipOptionalSVGSpaces in parseInternal
and parseTransformArgumentsForType, and make better use of the return
value from it.

Also make SVGTransformList::consolidate() and add() use initialize(...)
rather than open-coding it.

BUG=231612

Review URL: https://codereview.chromium.org/1643243002

Cr-Commit-Position: refs/heads/master@{#372656}
fs
Use StylePath instead of (Path)StyleMotionPath
Replace uses of PathStyleMotionPath with StylePath and remove the former
as well as the StyleMotionPath base-class. The methods length() and
isClosed() are transferred to StylePath.
Pass const CSSValue& to StyleBuilderConverter::convertPath (fixup to
https://codereview.chromium.org/1545713003) necessitating mutability.
Convert motion-path style building to use a converter.

BUG=535429

Review URL: https://codereview.chromium.org/1649003002

Cr-Commit-Position: refs/heads/master@{#372643}
sigbjornf
Fix safepoint entering when waiting for a debugger task.
When attempting to run worker debugger tasks, a timed wait is made on
the underlying task queue. While doing so, we are at a safepoint wrt
Blink GCs for the worker, and enter a safepoint scope.

The worker thread's stack will not be empty and clear of potential heap
references at that point; enter the safepoint with an appropriate
stack state.

R=
BUG=582710

Review URL: https://codereview.chromium.org/1656533002

Cr-Commit-Position: refs/heads/master@{#372570}
mostynb
support symlinks in zip files in build_utils.ExtractAll
Without this, extracting zip files which contain symlinks does not
work- instead of creating symlinks, regular files are written with
the symlink target.

Review URL: https://codereview.chromium.org/1641703002

Cr-Commit-Position: refs/heads/master@{#372557}
mstensho
Refuse to paginate if page height is 0.
When printing a document with an IFRAME, we first call
Document::setPrinting(true) on the root document and lay it out, then call
setPrinting(true) on the IFRAME document and lay it out. When we're done
printing, we first call setPrinting(false) on the root document and lay it out.
If this layout pass causes the IFRAME to be resized, we'll lay out the document
inside the IFRAME as well. When reaching LayoutView::layout() for the IFRAME
now, shouldUsePrintingLayout() will return true [1], and we'll establish a
ViewFragmentationContext for the child frame. This is harmful, since page
logical height is 0, and we'd end up dividing by zero when attempting to figure
out how much space we have left on a page for a given offset inside a multicol
container.

[1] shouldUsePrintingLayout() normally returns true for root frames only, with
one exception: if the child document is printing(), while the parent isn't. The
intention with this exception is to be able to print only an IFRAME
(iframeElement.contentWindow.print()), but in this case it had a nasty
side-effect.

BUG=578726
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1603613002

Cr-Commit-Position: refs/heads/master@{#372454}
fs
Error reporting for SVGInteger and SVGIntegerOptionalInteger
Also includes a minor cleanup of SVGInteger::setValueAsString.

BUG=231612

Review URL: https://codereview.chromium.org/1644293003

Cr-Commit-Position: refs/heads/master@{#372401}
sigbjornf
Keep (Heap)TerminatedArray in a consistent state while building.
When building a (Heap)TerminatedArray<T>, be careful to always have a
'last marker' set while doing so. Otherwise, should a conservative GC
strike while building, there's no last marker to terminate the tracing
of the HeapTerminatedArray<> elements.

R=haraken
BUG=581698

Review URL: https://codereview.chromium.org/1650123002

Cr-Commit-Position: refs/heads/master@{#372367}
bratell
[BinarySize] Filter duplicate lines in nm output.
nm just outputs the symbols it finds in the debug sections of the binary
and sometimes the same symbol appears more than once, with the exact
same data.

The binary_size tool would think that it was two different symbols that
shared the same address so it would get the numbers right, but the
output would be confusing since the memory would be split in two
halves.

BUG=

Review URL: https://codereview.chromium.org/1645843004

Cr-Commit-Position: refs/heads/master@{#372359}
tmoniuszko
Visual Studio generators for GN
BUG=305761

Review URL: https://codereview.chromium.org/1570113002

Cr-Commit-Position: refs/heads/master@{#372354}
rune
No pseudo elements in SelectorChecker::Mode QueryingRules.
QueryingRules mode is used by the Selectors APIs and when selecting
distributed nodes from the select attribute of the <content> element in
Shadow DOM V0.

CSSSelector::isCompound called from HTMLContentElement::validateSelect
makes sure we don't pass selectors with pseudo element selectors to the
rule collector.

Here we introduce a check which skips adding a selector to the selector
list in SelectorDataList if it will match a pseudo element. Such
selectors are still valid, and won't throw, but will result in an empty
result. If no selectors are added to SelectorDataList, we just skip the
DOM traversal.

This means we can replace the QueryingRules check in checkPseudoElement
with an assert.

BUG=489481

Review URL: https://codereview.chromium.org/1602833002

Cr-Commit-Position: refs/heads/master@{#372342}
rune
Add use counter for indirect adjacent selectors.
R=ojan@chromium.org
BUG=378058

Review URL: https://codereview.chromium.org/1641583002

Cr-Commit-Position: refs/heads/master@{#372341}
fs
Refactor away SVGPathSource
This CL moves the SVGPathParser::initialCommandIsMoveTo functionality into
the path data sources that needs this check - eliminating the need for the
SVGPathSource method peekSegmentType.
This leaves SVGPathParser::parsePath as a fairly trivial loop doing
parseSegment + emitSegment. Converting this function to a templated one,
The remaining two methods of the SVGPathSource interface no longer need to
be (called) virtual(ly) - allowing us too remove the interface entirely,
and simplify and inline code (hasMoreData) accordingly.
The net effect on (binary) code size is a roughtly 1.5k reduction.
Also rename and refactor some of the helpers in SVGPathStringSource.cpp
to try to better illustrate what they are used for.

BUG=467592

Review URL: https://codereview.chromium.org/1646543004

Cr-Commit-Position: refs/heads/master@{#372329}
sigbjornf
Support weak WebPrivatePtr<>s.
Parameterize WebPrivatePtr<> over the strength of the reference it maintains:

 WebPtrivatePtr<T, crossThreadDestruction, strongOrWeak>

where

 crossThreadDestruction = WebPrivatePtrDestruction{SameThread, CrossThread}
 strongOrWeak = WebPrivatePtrStrength::{Normal, Weak}

If Normal, the reference is the normal strong kind, which means either
a RefPtr<> or a strong off-heap (CrossThread)Persistent<T> Oilpan reference.

If Weak, the Oilpan reference will be (CrossThread)WeakPersistent<T>, meaning
that the WebPrivatePtr<> will not keep the object alive on its own. Any
dereference of the WebPrivatePtr<> will consequently have to check if the
reference has been cleared before using.

The abstraction doesn't currently support weak non-Oilpan references.

R=
BUG=

Review URL: https://codereview.chromium.org/1618043003

Cr-Commit-Position: refs/heads/master@{#372324}
fs
Don't give 'order' semantic errors special treatment
Just set the parse status to the (new) error code for "zero value" or
"negative value" and let it propagate.
This makes SVGDocumentExtensions::reportWarning dead, so remove it.

BUG=231612

Review URL: https://codereview.chromium.org/1645043002

Cr-Commit-Position: refs/heads/master@{#372176}
sigbjornf
Speculatively handle weak member clearing while creating iteration vector.
CSSFontSelector keeps a set of weakly referenced clients; when notifying
those the set is copied into a temporary heap vector before iterating.

Allocating that vector might potentially cause a GC, which in turn
could cause some of the weak references to be cleared. With the outcome
that the temporary vector will contain empty tail elements.

Speculatively check&handle that eventuality when iterating.

R=haraken
BUG=568173

Review URL: https://codereview.chromium.org/1642913002

Cr-Commit-Position: refs/heads/master@{#372112}
sigbjornf
Fix non-Oilpan build following r372015.
TBR=oilpan-reviews,tkent
BUG=477839
NOTRY=true

Review URL: https://codereview.chromium.org/1640233005

Cr-Commit-Position: refs/heads/master@{#372091}
sigbjornf
RenderViewTest: really drain the event loop before shutting down Blink.
And with that in place, undo the partial fix by r371169.

R=haraken,jochen
BUG=581948
NOTRY=true

Review URL: https://codereview.chromium.org/1645923002

Cr-Commit-Position: refs/heads/master@{#372088}
sigbjornf
Let notifyScriptLoadError() handle already detached ScriptLoaders.
If a ScriptRunner has been disposed of already, allow ScriptLoaders
to notify of their failure without asserting.

R=haraken
BUG=570012

Review URL: https://codereview.chromium.org/1642863002

Cr-Commit-Position: refs/heads/master@{#372075}
sigbjornf
Revert of Let notifyScriptLoadError() handle already detached ScriptLoaders. (patchset #3 id:40001 of https://codereview.chromium.org/1644483002/ )
Reason for revert:
The change here assumes PendingScripts are separately allocated objects, an M50 change. This makes for more difficult backporting. Unnecessarily so.

Hence reverting and will reland a variation ( https://codereview.chromium.org/1642863002/ ) that works for older branches.

Original issue's description:
> Let notifyScriptLoadError() handle already detached ScriptLoaders.
>
> If a ScriptRunner has been disposed of already, allow ScriptLoaders
> to notify of their failure without asserting.
>
> R=haraken
> BUG=570012
>
> Committed: https://crrev.com/e7bf58190483dffac8e78506884170720165b198
> Cr-Commit-Position: refs/heads/master@{#371772}

TBR=haraken@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=570012

Review URL: https://codereview.chromium.org/1640263004

Cr-Commit-Position: refs/heads/master@{#372058}
rune
Moved element style recalc count and stats to StyleEngine.
There are two element style recalc counters, one in Document, and one
in StyleResolver. The one in StyleResolver includes pseudo elements in
that count. We are unifying thesie counts keeping pseudo elements
included which means that the element recalc count will be higher for
tracing and the inspector, but unchanged for
internals.updateStyleAndReturnAffectedElementCount().

Also the StyleResolverStats is moved from StyleResolver to StyleEngine.
This means the stats will survive a clearResolver().

This change is motivated around item 6 and 9 in the design document for
crbug.com/401359.

R=dstockwell@chromium.org
BUG=401359

Review URL: https://codereview.chromium.org/1644543002

Cr-Commit-Position: refs/heads/master@{#372045}
rune
::before/::after are not features for invalidation.
We store a flag for finding ::before or ::after in
InvalidationSetFeatures, yet they are not added as features to
invalidation sets. That means we need to handle *::before as a universal
selector and cause subtree invalidations.

R=ericwilligers@chromium.org
BUG=581675

Review URL: https://codereview.chromium.org/1639133003

Cr-Commit-Position: refs/heads/master@{#372035}
fs
Implement specced parsing algorithm for <area coords>
This implements the parsing algorithm for "list of floating point
numbers" and uses it to parse the 'coords' attribute on <area>.
The fractional part of numbers are no longer discarded.
The old parsing code in platform/Length.cpp is no longer used and is
removed.

BUG=578114

Review URL: https://codereview.chromium.org/1636333003

Cr-Commit-Position: refs/heads/master@{#371940}
fs
Use SET_NESTED_VAR instead of SET_VAR where possible in ComputedStyle
In some cases this could save a copy of the outer object
(rareNonInheritedData in all cases.)
This also saves almost 3.5k of binary footprint.

BUG=581413

Review URL: https://codereview.chromium.org/1638213004

Cr-Commit-Position: refs/heads/master@{#371860}
fs
Lazily create the Path in StylePath
Instead of creating the Path object up front - when the StylePath is
created - create it on first access/use (usually on paint/layout.)

Review URL: https://codereview.chromium.org/1640313002

Cr-Commit-Position: refs/heads/master@{#371850}
fs
Extended error reporting for SVG path parsing
Adds reporting of errors for the errors detected:

 * Missing starting moveto
 * Missing command verb
 * Unexpected input type (number, arc flag)

The parsing helper parseArcFlag() is adjusted to not consume any
character on error.

BUG=231612

Review URL: https://codereview.chromium.org/1642463004

Cr-Commit-Position: refs/heads/master@{#371849}
fs
Fix typo(s) in css3/filters/effect-reference-composite*.html
y=20" -> y="20"

Review URL: https://codereview.chromium.org/1633093002

Cr-Commit-Position: refs/heads/master@{#371819}
mstensho
Display -webkit-filter objects in any column (instead of only in the first one).
Most of our painting-related operations take place after fragmentation, i.e.
via PaintLayerPainter::paintFragmentWithPhase(). All such operations can just
sit back and relax and not worry about fragmentation, since translation and
clipping for a given fragmentainer (column) has already taken place.

This is not the case for filters, though. They are set up before fragmentation.
Therefore, we need to make the bounding box of the layer visual (convert out of
the flow thread coordinate space) on our own. We now do this specifically for
filters, or we'd upset other parts of the code, such as clip path.

BUG=530074
R=wangxianzhu@chromium.org

Review URL: https://codereview.chromium.org/1645583002

Cr-Commit-Position: refs/heads/master@{#371808}
tmoniuszko
Move trace_event.h include from v8_platform.h to .cc file
trace_event.h is redundant in header file. It also causes compilation
issues when Blink precompiled headers are used on Windows (Bug 495697).

BUG=

Review URL: https://codereview.chromium.org/1585693002

Cr-Commit-Position: refs/heads/master@{#371801}
tmoniuszko
Fix //chrome/app/test_support dependency on //chrome/browser/policy:path_parser
BUG=

Review URL: https://codereview.chromium.org/1646483002

Cr-Commit-Position: refs/heads/master@{#371790}
bratell
Report PeriodicWave memory usage to v8 so GC can be properly scheduled
A PeriodicWave object can use half a MB and v8 needs to know about that
or it will not schedule garbage collects when memory usage increases.

BUG=578351

Review URL: https://codereview.chromium.org/1632753002

Cr-Commit-Position: refs/heads/master@{#371777}
mstensho
Remove support for -webkit-column-span:1
This was an "alias" for -webkit-column-span:none. '1' is not a valid value,
according to the spec. The only valid values are 'none' and 'all'. In an older
version of the spec, '1' and 'all' were the valid values. In the latest version
(2011), '1' was changed to 'none'.

It's highly unlikely that removing this should cause compatibility problems.
The initial value is 'none' (which is what '1' was mapped to), so in order to
cause trouble, one would need a declaration -webkit-column-span:all to be
overridden by a -webkit-column-span:1. I went through httparchive to verify.
No sites were found to do this.

R=timloh@chromium.org

Review URL: https://codereview.chromium.org/1635993002

Cr-Commit-Position: refs/heads/master@{#371773}
sigbjornf
Let notifyScriptLoader() handle already detached ScriptLoaders.
If a ScriptRunner has been disposed of already, allow ScriptLoaders
to notify of their failure without asserting.

R=haraken
BUG=570012

Review URL: https://codereview.chromium.org/1644483002

Cr-Commit-Position: refs/heads/master@{#371772}
fs
Avoid unnecessary CoW for outer DataRef when applying transform-origin
Even if the transform-origin is the same as the current value,
rareNonInheritedData will still be copied.
Add a new macro SET_NESTED_VAR, similar to the existing SET_VAR, but
allowing an intermediate |base| field to be specified, avoiding the
access in the dereference of that field from the group.

BUG=571183

Review URL: https://codereview.chromium.org/1636503005

Cr-Commit-Position: refs/heads/master@{#371766}
davve
Condense Image::hasRelative{Width,Height}() into one
Image::hasRelative{Width,Height} always return the same result so
there is no need for two functions. Since
https://codereview.chromium.org/26390004 there is no reason to have
these separate since the SVGImage implementations are gone.

BUG=581357

Review URL: https://codereview.chromium.org/1634133003

Cr-Commit-Position: refs/heads/master@{#371764}
davve
Consistency in LayoutReplaced::computeReplacedLogicalWidth()
All other return values pass through
computeReplacedLogicalWidthRespectingMinMaxWidth, let this one do so
too.

Review URL: https://codereview.chromium.org/1637473002

Cr-Commit-Position: refs/heads/master@{#371761}
rune
Marked parsing as failed for invalid compound.
If we return nullptr trying to consume a compound, and all tokens have
been consumed, we don't recognize that as a parse failure if a valid
selector precedes the compound. Set m_failedParsing to true to notice
we have an invalid selector.

R=timloh@chromium.org
BUG=581257

Review URL: https://codereview.chromium.org/1634273003

Cr-Commit-Position: refs/heads/master@{#371760}
fs
Negative or zero radius for <area shape=circle> gives an empty shape
Step 7 in

https://html.spec.whatwg.org/multipage/embedded-content.html#processing-model

BUG=578125

Review URL: https://codereview.chromium.org/1631303002

Cr-Commit-Position: refs/heads/master@{#371742}
fs
The missing value default for <area shape> is 'rect'
There is no invalid value default, so the missing value default will
apply in that case too.
The 'Unknown' HTMLAreaElement::Shape enumeration value is no longer
needed, so remove it.

Also add support for the non-conforming <area shape> values:

 * 'circ'     (alias for 'circle')
 * 'polygon'  (alias for 'poly')
 * 'rectangle (alias for 'rect')

Because 'rect' (and hence 'rectangle') is the same as the missing
value default we don't need any explicit checks for these values.

https://html.spec.whatwg.org/multipage/embedded-content.html#attr-area-shape

BUG=578125

Review URL: https://codereview.chromium.org/1632133007

Cr-Commit-Position: refs/heads/master@{#371731}
philipj
Remove superfluous semicolons around IPC message macros
These macros are defined such that trailing semicolons (or inner
semicolons) have no effect, and they are overwhealmingly used without
semicolons, as per the documentation in ipc_message_macros.h.

Review URL: https://codereview.chromium.org/1639713002

Cr-Commit-Position: refs/heads/master@{#371706}
mstensho
Adjust column rows' height better for their offset in the multicol container.
We were missing the case where the first object in a multicol container was a
spanner (the call to previousSiblingMultiColumnSet() should have been
previousSiblingMultiColumnBox(), to catch spanner placeholders in addition to
column sets).

But instead of having a special code path depending on whether we're dealing
with the first box or not (to avoid subtracting the multicol container's top
border and padding from an uncalculated logical top of a column set), always
subtract the margin top edge of the first column box instead.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1631633002

Cr-Commit-Position: refs/heads/master@{#371661}
sigbjornf
Promptly let go of WebURLLoader objects.
The objects keeping their own WebURLLoaders (and thus being
WebURLLoaderClients) must promptly let go of their ownership upon
becoming garbage. Not doing so risks the embedder calling the client
while it is in a sweepable state.

R=
BUG=568173

Review URL: https://codereview.chromium.org/1635113002

Cr-Commit-Position: refs/heads/master@{#371639}
davve
Avoid calling imageForCurrentFrame needlessly on SVGImageForContainer
Propagate SVGImage::isTextureBacked() through SVGImageForContainer to
make https://codereview.chromium.org/1438663002 effective in more
cases.

BUG=552406

Review URL: https://codereview.chromium.org/1635123002

Cr-Commit-Position: refs/heads/master@{#371535}
davve
Media Session: prepare for implicit activation of user created session
Provide an optional WebMediaSession to embedder when creating a
WebMediaPlayer. A null WebMediaSession means the player should belong
to the default media session.

BUG=497735

Review URL: https://codereview.chromium.org/1585163002

Cr-Commit-Position: refs/heads/master@{#371530}
fs
Use ASCII case-insensitive matching for ident-likes in the CSS parser
This CL replaces CSSParserToken::valueEqualsIgnoringCase and
CSSParserString::equalIgnoringCase with valueEqualsIgnoringASCIICase
and equalIgnoringASCIICase respectively - calling the similarly named
function in WTF.
Some cases where CSSParserToken::value() was coerced to a String is
changed to avoid the coercion - using the CSSParserToken method
directly.
Similarly some cases that use the CSSParserString overload for
equalIgnoringCase is changed to use the method on CSSParserToken.
The dead equalIgnoringCase(const CSSParserString&, ...) function in
LegacyCSSPropertyParser.cpp is removed.

BUG=581001

Review URL: https://codereview.chromium.org/1636453002

Cr-Commit-Position: refs/heads/master@{#371500}
davve
Drop contradictory condition in min-width clamping
isMaxSizeNone() is nonsensical for min-width. Zero (but represented as
Auto) is initial Length value for min-width, not MaxSizeNone. This
stands out after the rename from isUndefined() to isMaxSizeNone(). But
in this case it seems |style()->logicalMinWidth().isMaxSizeNone()| was
a just long alias for |false| so remove it.

Review URL: https://codereview.chromium.org/1633683002

Cr-Commit-Position: refs/heads/master@{#371494}
fs
Match <area shape> ASCII case-insensitively
The 'shape' attribute on HTMLAreaElement is an "enumerated attribute"
[1], which means that it should be matched ASCII case-insensitively[2].

To get a proper overload of equalIgnoringASCIICase(...) that matches the
required use (AtomicString against string literal/const char*),
restructure the definition of equalIgnoringASCIICase() to do away with
the templated version in favor of a generic StringImpl* version, and
specific wrappers around that one for AtomicString/String.
Also add a specialization for comparing against char/LChar.

No effect on the specified test because:
a) Invalid/missing value default is not per spec, so the unexpected shape
is picked anyway.
But more importantly:
b) the way case-folding is implemented/specified, no non-ASCII character
is case-folded to something in the ASCII-range.

[1] https://html.spec.whatwg.org/multipage/embedded-content.html#attr-area-shape
[2] https://html.spec.whatwg.org/multipage/infrastructure.html#enumerated-attribute

TEST=fast/html/area-shape.html
BUG=578125

Review URL: https://codereview.chromium.org/1624383002

Cr-Commit-Position: refs/heads/master@{#371478}
sigbjornf
Precisely account for required buttons in a radio group.
As part of processing the name attribute for a radio button, it is
added to the current radio button group. For buttons that are
additionally "required", that leads to double accounting for the
group's count of such required buttons, as the radio button group
doesn't keep track what has been registered as "required" already
or not.

Address by having the button group track the registered "required"
state of its members/buttons.

R=keishi,tkent
BUG=

Review URL: https://codereview.chromium.org/1632493002

Cr-Commit-Position: refs/heads/master@{#371476}
fs
Use even-odd fill rule for <area shape=poly>
See step 8, "Polygon state" in

https://html.spec.whatwg.org/multipage/embedded-content.html#processing-model

BUG=578125

Review URL: https://codereview.chromium.org/1630763002

Cr-Commit-Position: refs/heads/master@{#371371}
rune
Serialize namespaced type/* selectors according to CSSOM spec.
See https://drafts.csswg.org/cssom/#serializing-selectors.

The serialize-namespaced-type-selectors.html test is a stripped version
of this pull request: https://github.com/w3c/csswg-test/pull/1020
Gecko (Firefox 43) passes all those tests.

As part of this we are fixing problems with universal selectors being
incorrectly marked as explicit (for serialization) in certain cases.

When we have pseudo elements which require an implicit shadow combinator
to match across shadow boundaries, we need to add an implicit universal
selector to make the combinator combine the pseudo with some parent when
the original selector doesn't have any other simple selectors.

video::cue(i) can add the combinator between video and ::cue(i), while
::cue(i) requires a universal selector in the internal representation
to have ::cue(i) -> /implicit-shadow-crossing/ -> *.

For ::cue(i), the universal selector were marked correctly as implicit
to avoid it being serialized as *::cue(i). However, with an explicit
universal selector in the source *::cue(i), the universal selector were
marked as explicit due to an incorrect isNull() check. Explicit
universal selectors were already dropped from the serialization of
selectors like *::before.

BUG=579043

Review URL: https://codereview.chromium.org/1607873002

Cr-Commit-Position: refs/heads/master@{#371363}
sigbjornf
Have WebGeolocationController always wrap up its private controller object
Until Oilpan is firmly enabled, always use GeolocationControllerPrivate
to wrap up the non-owned GeolocationController* object. The previous
implementation was performing an untidy downcast with undefined behavior;
no need for such shortcuts here.

R=
BUG=581112

Review URL: https://codereview.chromium.org/1638573002

Cr-Commit-Position: refs/heads/master@{#371341}
fs
Error reporting for SVGLength and SVGLengthList
LoFi error reporting for SVGLength (LoFi because it uses the CSS
parser, and hence can't provide locus information.)
Minor cleanup in SVGLengthList, hoisting the call to clear().
Adding SVGParsingError::offsetWith to support the nested parsing going
on in SVGLengthList.

BUG=231612

Review URL: https://codereview.chromium.org/1636503003

Cr-Commit-Position: refs/heads/master@{#371288}
rune
Fix selector namespace prefix resolution.
When parsed without a stylesheet context, there are no prefix to
namespace URI mapping, so a ns name prefixed selector should be
invalid. Instead, we mapped "ns|e" to "*|e".

Here, we instead make "ns|e" invalid in contexts where there is no
stylesheet. However, "|e" and "*|e" should still be valid, so that part
of the prefix resolution is moved from the stylesheet to the selector
parser.

This meant that prefix resolution was incorrect for the select
attribute of the content element.

Also, prefixes in Selectors API were handled outside of the selector
parsing instead. Now we handle it inside the selector parsing instead
which means that we throw a SyntaxError instead of a NamespaceError for
unresolved namespace prefixes in the Selectors API. This is in line
with the specifications[1][2] and Gecko.

Another issue, was that setting selectorText of StyleRule did not pass
a stylesheet to the selector parser, so namespace resolution did not
work for setting selectorText.

[1] https://www.w3.org/TR/selectors-api2/#resolving-namespaces
[2] https://dom.spec.whatwg.org/#scope-match-a-selectors-string

R=timloh@chromium.org
BUG=580023,580445

Review URL: https://codereview.chromium.org/1616423003

Cr-Commit-Position: refs/heads/master@{#371275}
sigbjornf
Fix g++ builds by avoiding early HeapSupplement<Document> instantiation.
Building ToT with g++ (component build) currently breaks when using
the Oilpan type HeapSupplement<Document>:

 ...
 error: type attributes ignored after type is already defined [-Werror=attributes]
 ...
 .../dom/Document.h:179:51: note: in expansion of macro ‘WillBeHeapSupplement’
 extern template class CORE_EXTERN_TEMPLATE_EXPORT WillBeHeapSupplement<Document>;

It appears that g++ cannot be kept happy if it implicitly instantiates
a template at a type and then later sees an extern decl like the above
with some extra attributes attached.

Hence, bring the required types into scope for FontFaceSet's declaration
to avoid that unfortunate situation.

R=haraken,thakis
BUG=

Review URL: https://codereview.chromium.org/1634683002

Cr-Commit-Position: refs/heads/master@{#371270}
fs
Add tests for HTMLAreaElement coords/shape and processing model
This makes local copies of:

 html/semantics/embedded-content/the-area-element/area-coords.html
 html/semantics/embedded-content/the-area-element/area-processing.html
 html/semantics/embedded-content/the-area-element/area-shape.html
 html/semantics/embedded-content/the-area-element/support/hit-test.js

in fast/html/ and adjust them so that they can run correctly in the
test runner. The adjustment amounts to referencing a different image
than the original, and doing so using a relative path, and putting
hit-test.js in the local resources/ directory in fast/html.

BUG=578125,578114,498120

Review URL: https://codereview.chromium.org/1618373002

Cr-Commit-Position: refs/heads/master@{#371246}
fs
Match 'i' attribute selector modifier case-insensitively
The 'i' should be treated as an identifier, so matching should be ASCII
case-insensitive.

BUG=580446

Review URL: https://codereview.chromium.org/1626563002

Cr-Commit-Position: refs/heads/master@{#371228}
rune
Missing m_failedParsing=true for unresolved namespace.
When we already have an accepted compound and we return nullptr for a
second fully consumed compound, we were relying on non-consumed tokens
like trailing spaces to detect that the selector was invalid. Setting
m_failedParsing=true fixed it.

R=timloh@chromium.org
BUG=580496

Review URL: https://codereview.chromium.org/1625433002

Cr-Commit-Position: refs/heads/master@{#371202}
fs
Remove use of minimumValueForLength in HTMLAreaElement::getRegion
While the 'coords' attribute on HTMLAreaElement is stored as a
Vector<Length>, the Lengths will all be of the type 'Fixed'. This means
that the only effect of minimumValueForLength() will be to round-trip
through LayoutUnit - resulting in a clamp to the allowed range of
LayoutUnit. Replace the uses of minimumValueForLength() with a new
function (clampCoordinate) that only does this clamping.

No functional changes.

BUG=578114

Review URL: https://codereview.chromium.org/1619793002

Cr-Commit-Position: refs/heads/master@{#371184}
rune
Add regression test for crbug.com/408957
Issue 408957 was fixed when fixing 557440. This CL is just adding a
test for it.

R=ericwilligers@chromium.org
BUG=408957

Review URL: https://codereview.chromium.org/1607893002

Cr-Commit-Position: refs/heads/master@{#371180}
sigbjornf
Insist on a Blink GC on RenderViewImpl unit test teardowns.
Without it, flaky LSan reports are a risk, depending on GC timing and
on tests allowing posted GC tasks to be processed before many of them
abruptly clear posted messages as part of their operation.

R=haraken
TBR=jochen
BUG=

Review URL: https://codereview.chromium.org/1621823004

Cr-Commit-Position: refs/heads/master@{#371169}
philipj
Fix typo in link to ccache for Mac
R=andybons@chromium.org

Review URL: https://codereview.chromium.org/1624903002

Cr-Commit-Position: refs/heads/master@{#371150}
sigbjornf
Also transfer pending in-order scripts upon element moving to new document
Extend the ScriptLoader script runner reassociation that happens when a
script element moves to a new document to also include pending in-order
scripts.

Having this be restricted to async scripts unnecessarily confuses the
ScriptLoader when it notifies the ScriptRunner.

R=haraken
BUG=570012

Review URL: https://codereview.chromium.org/1620983002

Cr-Commit-Position: refs/heads/master@{#371145}
landell
Include stdlib.h for bsearch
BUG=

Review URL: https://codereview.chromium.org/1618193002

Cr-Commit-Position: refs/heads/master@{#371057}
rune
Removed selector matching check for invalid pseudo elements.
The check removed checked that only custom pseudo elements and
::selection allow other simple selectors to follow. This is now handled
entirely at parse time.

R=esprehn@chromium.org,timloh@chromium.org
BUG=489481

Review URL: https://codereview.chromium.org/1605523002

Cr-Commit-Position: refs/heads/master@{#371054}
fs
Extended error reporting for SVGNumber/Point/Rect and related types
Add extended error reporting for "number-based" types - SVGNumber,
SVGNumberList, SVGNumberOptionalNumber, SVGPoint, SVGPointList and
SVGRect.

Also clean up some of the parsing functions and eliminate some
unnecessary clear() calls in the list types.

BUG=231612

Review URL: https://codereview.chromium.org/1620203002

Cr-Commit-Position: refs/heads/master@{#371022}
sigbjornf
Keep PlatformSpeechSynthesisVoice off the Oilpan heap.
Keeping this object on the heap makes some sense in terms of regularity:
all the other Blink objects that refer to it are on the heap. However,
it is problematic to do so for this value object considering how
the embedder might use its WebSpeechSynthesisVoice wrapper object.

That is, creating or allocating a WebSpeechSynthesisVoice on the stack
by the embedder will bring about a heap allocation, which in turn can
trigger a GC when the embedder isn't prepared for that -- see
associated bug for stack trace and details.

This is normally a detail the embedder doesn't need to worry about,
but as TtsDispatcher keeps an (unsavory) weak reference to its speech
synthesizer client we're forced to consider GC safety and take
that into account.

Embedder code that keep these bare, but intended weak, references
to Oilpan heap objects should be reworked into something safer,
but to address this local problem, PlatformSpeechSynthesisVoice is
moved off the heap where it can reside just as well. By doing so,
WebSpeechSynthesisVoice allocations won't allocate on the Oilpan
heap, avoid said GC unsafety.

R=dmazzoni,jochen
BUG=539511

Review URL: https://codereview.chromium.org/1617383003

Cr-Commit-Position: refs/heads/master@{#370960}
sigbjornf
Fix spellchecker updating of marker ranges spanning multiple elements.
The optimization made in Blink r187820 (https://crrev.com/828293002)
completely failed to take into account the case where the start and
end position spanned multiple nodes.

With EphemeralRange since then introduced, fix by switching to it.
For the original test optimized for (blink_perf.dom:textarea-edit),
local testing with chrome-release shows no degradation in performance
either.

R=yosin
BUG=579151

Review URL: https://codereview.chromium.org/1615963004

Cr-Commit-Position: refs/heads/master@{#370929}
davve
Move specialized computePositionedLogicalWidth to LayoutReplaced.
Since the isAtomicInlineLevel() rename (it used to be called
isReplaced()) it looks extra strange to have a *Replaced method up in
LayoutBox. While LayoutReplaced does not contain everything about
replaced elements, it may contain this.

Review URL: https://codereview.chromium.org/1603603002

Cr-Commit-Position: refs/heads/master@{#370922}
mstensho
Pass values in the right flow thread's coordinate space.
We were talking to our enclosing flow thread, but using coordinates in our own
flow thread coordinate space. This caused both miserable rendering and
assertion failures, since we'd fail to realize that there'd be rows further
ahead with enough space for the content we were trying to fit.

BUG=552615
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1619703003

Cr-Commit-Position: refs/heads/master@{#370891}
sigbjornf
Oilpan: LinkLoaderClient must be a GC mixin.
LinkLoader notifies its 'client' of load completion and other lifecycle
transitions. The assumption is that the client's lifetime is >= that
of the loader object, hence a bare pointer is all required.

This assumption doesn't hold when both LinkLoader and the client is on
the Oilpan heap, nor when LinkLoader is on the heap and the client is
stack allocated (cf. mock client object in LinkLoader unit tests).

Address the unsoundness by making LinkLoaderClient a GC mixin.

TBR=haraken@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1616713003

Cr-Commit-Position: refs/heads/master@{#370654}
tommyt
Tidy up service discovery state for bluez on disconnect
This should fix cases where you connect, disconnect and then reconnect
to a BLE device. I've extended the ServicesDiscovered unit test to test
this.

BUG=577641

Review URL: https://codereview.chromium.org/1606523002

Cr-Commit-Position: refs/heads/master@{#370628}
philipj
Remove always-false null checks for getElementsByTagName(NS)
getElementsByTagNameNS is called from WebNode::getElementsByHTMLTagName,
which in turn is only called with the static kLabel ("label").
getElementsByTagName is also called internally in
getElementsByTagNameNS. Other than this, both are called from bindings.
In no case is it possible for localName to be a null AtomicString, so
these checks are not needed.

Review URL: https://codereview.chromium.org/1606533002

Cr-Commit-Position: refs/heads/master@{#370616}
fs
Extended error reporting for SVG attribute parsing
This CL extends the SVG attribute parsing error reporting functionality
to allow more precise (and hopefully helpful) reporting.
The main improvements consist of:

 1) More (precise) status codes
    Avoids generic error messages.

 2) Locus support
    Allows reducing the amount of context, which should make it easier
    to pinpoint the actual error. (Preferably the offending character
    should be highlighted somehow in the error message, but that is
    left as future work.)

To achieve this, the SVGParsingError enumeration is turned into a
thin wrapper class around a status code and a locus. The status codes
move to a new enumeration 'SVGStatus'.

Formatting of error messages are moved out of
SVGElement::reportAttributeParsingError and into SVGParsingError.cpp
(new file).

This CL start adding extended reporting to a few of the value classes:
SVGBoolean, SVGEnumeration and SVGPreserverAspectRatio; to illustrate
the mechanism. Further value classes will be annotated in later CLs.
For that reason the "generic" errors are kept in their current form - to
be removed as more value class parsers get converted.

BUG=231612

Review URL: https://codereview.chromium.org/1588993005

Cr-Commit-Position: refs/heads/master@{#370479}
davve
Remove stale FIXME comment about now fixed bug
NOTRY=true
BUG=364807

Review URL: https://codereview.chromium.org/1605383002

Cr-Commit-Position: refs/heads/master@{#370396}
davve
Simplify LayoutSVGRoot::computeReplacedLogical{Width,Height}
Remove redundant if statements and slightly confusing
comments. SVGImage unconditionally sets the container size in
SVGImage::drawForContainer() so when SVGImageForContainer is used, the
container size will be set.

BUG=468897

Review URL: https://codereview.chromium.org/1610603002

Cr-Commit-Position: refs/heads/master@{#370393}
sigbjornf
Add missing variable initialization in StyleCalcLength::toCSSValue().
TBR=oilpan-reviews
BUG=545318
NOTRY=true

Review URL: https://codereview.chromium.org/1604133003

Cr-Commit-Position: refs/heads/master@{#370390}
davve
Set intrinsic size for inline SVG earlier
LayoutReplaced has a m_intrinsicSize that's updated when computing
logical widths and heights (and only if needed; specified style makes
it not being set at all).

But m_intrinsicSize can be used earlier that that, when computing
preferred widths for the container, see
LayoutReplaced::computeIntrinsicLogicalWidths called from
LayoutReplaced::computePreferredLogicalWidths().

This patch computes the intrinsic size in the constructor to avoid
returning the stale default size.

BUG=468897

Review URL: https://codereview.chromium.org/1604993003

Cr-Commit-Position: refs/heads/master@{#370388}
davve
Simplify SVGSVGElement::collectStyleForPresentationAttribute
There is no need to have the flags separated since they are always
used in conjunction.

BUG=468897

Review URL: https://codereview.chromium.org/1601093007

Cr-Commit-Position: refs/heads/master@{#370386}
rune
Pseudo element ids != NOPSEUDO only in rightmost compound.
After landing [1], selectors with pseudo elements will only be valid if
the pseudo element is in the rightmost compound. Invalid selectors will
be dropped at parse time. Hence, there's no need to check this
condition during matching. Also, pseudo element selectors for which
CSSSelector::pseudoId() returns NOPSEUDO, are handled in the switch
above the modified code.

[1] https://codereview.chromium.org/1600793002/

R=esprehn@chromium.org,timloh@chromium.org
TEST=CSSSelectorParserTest::InvalidPseudoElementInNonRightmostCompound
BUG=489481

Review URL: https://codereview.chromium.org/1605473002

Cr-Commit-Position: refs/heads/master@{#370356}
mstensho
Need to examine the *bottom* of fragmented content.
Content may cross fragmentainer boundaries, and when evaluating the need for
appending additional fragmentainer groups, we need to look at the bottom of the
content, not the top.

This CL is a prerequisite to fixing bug 552615, but note that it doesn't fix
anything there on its own.

BUG=552615
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1573133002

Cr-Commit-Position: refs/heads/master@{#370323}
mstensho
Soften assertion slightly, to survive saturated arithmetic situations.
We do want to be at the exact top of a column here, but if the flow thread top
offset for the next column is larger than what a LayoutUnit can hold, we get a
bogus value passed here. Survive the assertion and carry on.

BUG=574309
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1558133002

Cr-Commit-Position: refs/heads/master@{#370297}
mostynb
fix 'set but not used' GCC warning
Followup to https://codereview.chromium.org/1586353004 which introduced
a warning when building with GCC.

BUG=557130

Review URL: https://codereview.chromium.org/1606053002

Cr-Commit-Position: refs/heads/master@{#370203}
fs
Remove tracking of 'closed subpath' state from SVGPathBuilder
For any implicit moveto (like: "M0,0z L..." it would not do the right
thing (clear m_closed), which could result in unwanted calls to
Path::closeSubpath if a(n explicit) moveto followed. This in turn would
result in rendering errors (the "close" line being stroked that should
not.)
SkPath seems to do a much better job of this already - and Path is just
a thin wrapper around SkPath in these cases - so just drop the
SVGPathBuilder::m_closed flag and leave the work to SkPath.

BUG=578254

Review URL: https://codereview.chromium.org/1605943002

Cr-Commit-Position: refs/heads/master@{#370168}
rune
Remove checkForChildrenAdjacentRuleChanges.
All uses of SubtreeStyleChange now means strict subtree. All sibling
forest invalidations are done using invalidation sets except on node
insertions and removals.

checkForSiblingStyleChanges now has to invalidate siblings itself on
insertion/removal. Before this change we did a SubtreeStyleChange on a
single element and let checkForChildrenAdjacentRuleChanges mark the
sibling forest for recalc. The reason why we cannot use invalidation sets
when adding/removing nodes, is that we don't change the relevant features
(classes, ids, etc) when we need to figure out. For instance:

<style>
:not(.a) + div { color green }
</style>
<div class="a"></div>
<div>Should be green after insertion</div>

If you insert an element between the two divs, the latter will start
matching the style rule, but we cannot do that with invalidation sets.

Adjustments have been done to the style invalidator to allow scheduling
sibling invalidation sets on SubtreeStyleChange elements, since siblings
will have style recalcs triggered through the invalidation machinery, not
checkForChildrenAdjacentRuleChanges.

BUG=557440

Review URL: https://codereview.chromium.org/1509853002

Cr-Commit-Position: refs/heads/master@{#370097}
rune
Pseudo elements may only appear in rightmost compound.
Pseudo elements are appended to an originating element as defined in
Selectors Level 4 and may only be followed by user action pseudo
classes. That means it also must appear in the rightmost compound. We
drop selectors as invalid when trying to add a compound when we have
already seen a pseudo element in a previous compound.

There are expections to this for Blink, where we implement ::content
and ::shadow to pierce through insertion points and shadow boundaries
as pseudo elements. Another exception is for custom pseudo elements in
UA stylesheets, as we rely on exposing inner shadow structure to style
media controls and VTT track regions (crbug.com/578131).

R=timloh@chromium.org
BUG=489481

Review URL: https://codereview.chromium.org/1600793002

Cr-Commit-Position: refs/heads/master@{#370088}
sigbjornf
Migrate Handle.h WTF decls closer to their corresponding definitions.
Move some declarations in the WTF namespace out of the larger Handle.h,
and near/next to where the corresponding types are declared.

No change in functionality.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1598103003

Cr-Commit-Position: refs/heads/master@{#369986}
sigbjornf
Revert of Use registerWeakMembers to clean up IntersectionObserver. (patchset #1 id:1 of https://codereview.chromium.org/1591763003/ )
Reason for revert:
Broke on some tests w/ Oilpan enabled,

 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Oilpan%20Leak/builds/16410

backing it out.

(see also https://codereview.chromium.org/1596333002/ )

Original issue's description:
> Use registerWeakMembers to clean up IntersectionObserver.
>
> Pre-oilpan, when the root disappears, it observers are cleaned up
> in NodeIntersectionObserverData::dispose().
>
> Post-oilpan, the cleanup will be done with registerWeakMembers.
>
> BUG=540528
> R=haraken@chromium.org,dcheng@chromium.org
>
> Committed: https://crrev.com/546573354e47ddd01f491c382701fa51500f85eb
> Cr-Commit-Position: refs/heads/master@{#369948}

TBR=dcheng@chromium.org,haraken@chromium.org,szager@chromium.org
BUG=540528
NOTRY=true

Review URL: https://codereview.chromium.org/1600243002

Cr-Commit-Position: refs/heads/master@{#369970}
sigbjornf
Revert of Oilpan: Fix weak processing for IntersectionObserver::m_root (patchset #3 id:40001 of https://codereview.chromium.org/1594813002/ )
Reason for revert:
This and the parent change introduced some failures,

 https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Oilpan%20Leak/builds/16410

backing out for now.

Original issue's description:
> Oilpan: Fix weak processing for IntersectionObserver::m_root
>
> This is a follow-up fix for https://codereview.chromium.org/1591763003/.
> IntersectionObserver::m_root must be cleared in the weak callback when the m_root is dead.
>
> BUG=
>
> Committed: https://crrev.com/2760f06a3c43c8919f4ecae43f460ada20d0990b
> Cr-Commit-Position: refs/heads/master@{#369956}

TBR=szager@chromium.org,haraken@chromium.org
BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/1596333002

Cr-Commit-Position: refs/heads/master@{#369969}
sigbjornf
libxml2: linearly optimize XPath expressions.
Some XPath expression nodes keep a back pointer to the last/previous
expression node for optimization purposes. Such pointers will result
in repeated work when walking over the expression
tree/graph, peephole optimizing it. Unacceptable amounts of repeated
work as the expression tree becomes deeper.

Avoid by marking the expression nodes during the optimization pass.

R=scottmg
BUG=573768

Committed: https://crrev.com/0b208a502be9d60929be48056dd4213efd998076
Cr-Commit-Position: refs/heads/master@{#369733}

Review URL: https://codereview.chromium.org/1562133002

Cr-Commit-Position: refs/heads/master@{#369966}
tommyt
Clear the BLE services list on disconnect.
This lets us recreate the services list correctly upon the next
reconnect, which fixes some problems with a device we have, which
disconnects automatically after 30 seconds.

Also reset the services_discovered flag for this device on disconnect.
In order to accomplish this, I had to move this flag from the dispatcher
host, to the bluetooth device instance.

BUG=570804

Review URL: https://codereview.chromium.org/1592733002

Cr-Commit-Position: refs/heads/master@{#369826}
rune
removeBetween() -> detach() performance fix.
In [1] we started to persist invalidation sets on elements getting
reattach style change because sibling invalidation sets scheduled on
detached elements still need to be processed for attached siblings.

However, the invalidation sets need to be cleared when such elements
are removed from the document tree. Clearing that invalidation set were
done with a detach() which also would go through detach() on an
already detached subtree. That caused a performance regression in the
the blink_perf.dom:select-single-add micro benchmark.

Instead of brute forcing with detach(), we clear the invalidation sets
for the elements of the disconnected subtree in Element::removedFrom().

[1] https://codereview.chromium.org/1533683002

R=esprehn@chromium.org
BUG=577439
TEST=PerformanceTests/DOM/select-single-add.html

Review URL: https://codereview.chromium.org/1590143002

Cr-Commit-Position: refs/heads/master@{#369798}
rune
Restrict use of pseudo elements within compound.
Start dropping selectors whose compound have pseudo elements followed
by other simple selectors with the exception of simple selectors which
are actually allowed to follow certain pseudo elements.

The exceptions are:

- User action pseudo classes and their negations for custom pseudo
  elements.

  Matching other simple selectors on custom elements worked before, but
  that revealed the inner structure of the UA shadow DOM for form
  elements, which I believe was not intentional.

  According to the latest ED of Selectors Level 4, user action pseudo
  classes are allowed after pseudo elements in general, but we don't
  support that, so the selector should be dropped. Gecko also drops
  those selectors.

- A restricted set of pseudo classes, in addition to the user action
  pseudo classes, which apply to custom scrollbar pseudo elements.

The new restrictions do not yet apply to UA stylesheets as we rely on
invalid selectors in the UA stylesheet for media controls.

Fixed a couple of range-based iterations in the unit test.

This CL does not address the fact that pseudo elements, in most cases,
only may be present in rightmost compound selectors. That will be fixed
in another CL.

R=timloh@chromium.org
BUG=489481,577404

Review URL: https://codereview.chromium.org/1587643004

Cr-Commit-Position: refs/heads/master@{#369760}
sigbjornf
libxml2: linearly optimize XPath expressions.
Some XPath expression nodes keep a back pointer to the last/previous
expression node for optimization purposes. Such pointers will result
in repeated work when walking over the expression
tree/graph, peephole optimizing it. Unacceptable amounts of repeated
work as the expression tree becomes deeper.

Avoid by marking the expression nodes during the optimization pass.

R=scottmg
BUG=573768

Review URL: https://codereview.chromium.org/1562133002

Cr-Commit-Position: refs/heads/master@{#369733}
rune
Use ::cue for VTT UA styles.
Instead of using a custom pseudo element for the track container to
apply UA styling to b, i, and u elements, use ::cue selectors.

R=fs@opera.com
TEST=media/track/track-css-matching-default.html
NO_DEPENDENCY_CHECKS=true

Review URL: https://codereview.chromium.org/1582403003

Cr-Commit-Position: refs/heads/master@{#369732}
rune
Split compound selector after consume finished.
CSSSelectorParser::consumeCompoundSelector() will split a compound into
two compounds when it contains a simple selector which needs a synthetic
ShadowPseudo combinator. This split was done as simple selectors were
added. That code was complicated and and yielded some strange
serializations like what was reported in https://crbug.com/478563.

This CL adds simple selectors to the compound in the selector text
order, and splits the compound into two compounds and re-order them
after the whole compound has been consumed. This makes the code simpler
and makes it simpler to check selector validity (before the split).

This fixes issue 478563 and prepares for validity checking. A side
effect is that unnecessary universal selectors are left out of the
serialization (issue 478969).

::content is no longer kept leftmost in the compound, which is the
reason why contentPseudoCrossing is set when the combinators which are
affectedByPseudoContent instead of when the actual ::content selector
is seen.

R=timloh@chromium.org
BUG=478563,489481,478969

Review URL: https://codereview.chromium.org/1574323003

Cr-Commit-Position: refs/heads/master@{#369723}
tommyt
Clear the BLE services list on disconnect.
This lets us recreate the services list correctly upon the next
reconnect, which fixes some problems with a device we have, which
disconnects automatically after 30 seconds.

Also reset the services_discovered flag for this device on disconnect.
In order to accomplish this, I had to move this flag from the dispatcher
host to the bluetooth device instance.

BUG=570804

Review URL: https://codereview.chromium.org/1565773002

Cr-Commit-Position: refs/heads/master@{#369593}
fs
Re-instate geometry sharing optimization for 'd' on <use>'d <path>s
This adds back the geometry sharing optimization initially added in
https://codereview.chromium.org/1425913004 and removed by
https://codereview.chromium.org/1439793003.
This CL moves the optimization from asPath() to
collectStyleForPresentationAttribute(), meaning the optimization only
applies to the presentation attribute style (which is equivalent to
the old version.)

BUG=535429

Review URL: https://codereview.chromium.org/1578363007

Cr-Commit-Position: refs/heads/master@{#369473}
davve
Polish icecc instructions
Be more specific about when you have to use system linker with
icecc. It seems to have broke with a glibc 2.21 upgrade.

Review URL: https://codereview.chromium.org/1584133002

Cr-Commit-Position: refs/heads/master@{#369432}
fs
Use a local variable as a character cursor in genericParseNumber
Don't move the 'out' variable |cursor| until a valid number has been
parsed (disregarding the leading whitespace).
This will allow generating better error messages in some cases (the cursor
will not "stop" randomly within the number upon encountering overflows
etc.). It also enables "re-parsing" although currently no call-sites
require that. Code size virtually unaffected (-7 for LChar, +2 for UChar.)

BUG=231612

Review URL: https://codereview.chromium.org/1588453006

Cr-Commit-Position: refs/heads/master@{#369391}
davve
Eliminate use of SVG1DOM counter by final split
BUG=415074

Review URL: https://codereview.chromium.org/1586623002

Cr-Commit-Position: refs/heads/master@{#369380}
mstensho
Recalculate column heights as part of column set layout.
This is a tad earlier than what we used to do; we used to do it for all sets in
one go at the end of layout of the multicol container. We now do it
individually for each column set (children of the multicol container) as we lay
them out.

This way we have an up-to-date column height when positioning column sets
during multicol container child layout (children being either spanner
placeholders or column sets).

For the bug in question, this is particularly important in the first layout
pass, where column heights are completely bogus. When we're in a nested
fragmentation context, inner column heights are typically set to the remaining
height of an outer column, which may be more space than the contents actually
need. This could in turn trick the machinery into believing that we need to
insert another fragmentainer group for a spanner following a column set, even
if column heights were completely unconstrained.

BUG=552615
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1558963003

Cr-Commit-Position: refs/heads/master@{#369366}
fs
Remove redundant emptiness check from genericParseNumber
When the 'start == ptr' condition was reached we could be sure that we
had already consumed at least one character - one of '.' or '0'-'9' or
whitespace (potentially also '+'/'-' as a prefix) - and that even holds
true moving the definition of |start| after consuming any leading
whitespace. The reason for this is the up-front check for any character
in the set '0'-'9' or '.'.
Remove the redundant checks - replacing them with an assert - while
moving the definition of |start| so that it doesn't point before any
leading whitespace.

BUG=231612

Review URL: https://codereview.chromium.org/1582813003

Cr-Commit-Position: refs/heads/master@{#369292}
davve
Add note about using the system linker with icecc
Review URL: https://codereview.chromium.org/1575843002

Cr-Commit-Position: refs/heads/master@{#369177}
davve
Support SVG fragment URLs in cross faded images
Extract url from CSSImageValue and pass it along to the SVGImage
wrapper. Constify CSSImageValue::url() in the process.

Also, fix typo and indentation in related test.

BUG=574172

Review URL: https://codereview.chromium.org/1585623003

Cr-Commit-Position: refs/heads/master@{#369156}
sigbjornf
Oilpan: move AsyncMethodRunner to the heap.
Simplify and keep AsyncMethodRunner<T> on the heap always.

R=haraken
BUG=363031

Review URL: https://codereview.chromium.org/1580883002

Cr-Commit-Position: refs/heads/master@{#369141}
davve
Split SVG1DOM counter further
Split all counters relating to basic data types into smaller
parts. Use MeasureAs when these interfaces are implemented by multiple
other interfaces. Using Measure for them would give a lot of
unnecessary UseCounters. It seems more likely that we try to remove
interface methods in its entirety than splitting the interface, moving
some and removing some.

Also remove the counter from constants in affected interfaces. If we
get to remove the interfaces where the constants are used, they can go
too. Otherwise they likely have to stay.

BUG=415074

Review URL: https://codereview.chromium.org/1574183002

Cr-Commit-Position: refs/heads/master@{#369139}
rune
Cousins may not share style when ascendant affected bits set.
childrenOrSiblingsAffectedBy* are set during style matching. Cousins may
not share style in such cases since those affected bits may be set on
uncommon ancestors. Calling setUnique on ComputedStyle in such cases to
avoid style sharing.

This is also true for siblings in which case preceding siblings need to
get the affected bits set when we have adjacent selectors.

BUG=424104

Review URL: https://codereview.chromium.org/1562493002

Cr-Commit-Position: refs/heads/master@{#369029}
rune
Persist invalidation sets on detach root
This is a second attempt at not clearing sibling invalidation sets on
detached and SubtreeStyleChange nodes. The first[1] failed because
childNeedsStyleInvalidation() was still cleared on detach().

This approach keeps invalidation sets on the detach root, but clears
invalidation sets on descendants. However, when we detach a node to be
removed, we also clear the detach root as that will not have a chance of
being used on the next invalidation. Also, there are asserts checking
that we don't re-insert nodes into the tree with needsStyleInvalidation().

Removed scheduled sibling invalidation sets from nodes being removed from
the tree is not a problem as the checkForSiblingStyleChanges() method
will make sure sibling trees are invalidated.

The early return in StyleInvalidator::scheduleInvalidationSetsForElement
is removed to be able to schedule sibling invalidation sets although we
have a SubtreeStyleChange or ReattachStyleChange on the element itself.

The added test checks that the invalidation works properly, also after
the checkForChildrenAdjacentRuleChanges() removal.

[1] https://codereview.chromium.org/1507653002

R=esprehn@chromium.org,ericwilligers@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1533683002

Cr-Commit-Position: refs/heads/master@{#369021}
rune
Avoid crash when updating stylesheets during a remove operation.
When we are in the middle of removing a subtree of a shadow tree
containing a style element, and one of the other elements schedules
style invalidation, we are synchronously trying to update rule features
when the style node is still inDocument() and isInShadowTree() while the
treeScope() has been reset to the document scope in preparation for
removing it from the tree. That caused us to add the sheet for the style
element being removed to our style data/rule features.

We should make updateActiveStyleSheets asynchronous (crbug.com/567021)
and schedule invalidations with the current rule features instead of
forcing an update of rule features through appendPendingAuthorStyleSheets.

Since updateActiveStyleSheets is currently synchronous and
appendPendingAuthorStyleSheets happens lazily, we are in an inconsistent
state which means we need to execute the latter in order to avoid
glitches in style invalidation because we are marking for
invalidation/recalc in the former step.

This crasher surfaced when we started looking up the treeScope() directly
in https://codereview.chromium.org/1285293003

R=esprehn@chromium.org
BUG=559292

Review URL: https://codereview.chromium.org/1556963002

Cr-Commit-Position: refs/heads/master@{#369004}
sigbjornf
Oilpan: fix build after r368875.
TBR=oilpan-reviews
BUG=550994
NOTRY=true

Review URL: https://codereview.chromium.org/1580593005

Cr-Commit-Position: refs/heads/master@{#368938}
sigbjornf
Oilpan: provide a weak 'this' pointer abstraction for cancellable closures.
For CancellableTaskFactory objects owned by an Oilpan heap object, the
factory's closure maintain a weak reference back to its heap
object owner -- the closure must not invoke a method on that heap object
once the weak reference is cleared.

That latter check for a cleared weak reference wasn't in place; provide
it here. Due to wtf/ and platform/heap/ dependency constraints, we're
forced to do that indirectly by way of using a WeakPtr<>.

R=haraken
BUG=575272

Review URL: https://codereview.chromium.org/1573283004

Cr-Commit-Position: refs/heads/master@{#368851}
sigbjornf
Oilpan: fix uninitialized pointers following r368596, part 2.
TBR=oilpan-reviews
BUG=499780
NOTRY=true

Review URL: https://codereview.chromium.org/1576373002

Cr-Commit-Position: refs/heads/master@{#368836}
philipj
Update Selection IDL TODOs to match nullability change in spec
The node arguments of collapse and setPosition were made nullable:
https://github.com/w3c/selection-api/issues/64

Also move out the optional arguments issues into a single comment:
https://github.com/w3c/selection-api/issues/30

BUG=391673
R=yoichio@chromium.org

Review URL: https://codereview.chromium.org/1576863002

Cr-Commit-Position: refs/heads/master@{#368825}
sigbjornf
Oilpan: fix uninitialized pointers following r368596.
R=haraken,timloh
BUG=499780
NOTRY=true

Review URL: https://codereview.chromium.org/1578763003

Cr-Commit-Position: refs/heads/master@{#368824}
rune
Pseudo element selectors in compound selector lists are invalid.
These selectors were never matching, but they are invalid and rules with
invalid selectors should not show up in the CSSOM.

This is just partly fixing detection of invalid use of pseudo elements.
We also incorrectly accept simple selectors following pseudo elements.
In most cases those are invalid selectors.

The modified existing cases contained invalid selectors and they were
modified to make them valid for serialization testing purposes.

R=timloh@chromium.org
BUG=489481,393490

Review URL: https://codereview.chromium.org/1576553002

Cr-Commit-Position: refs/heads/master@{#368823}
sigbjornf
Oilpan: fix build after r368814.
TBR=oilpan-reviews
BUG=540528
NOTRY=true
NOTREECHECKS=true
NOPRESUBMIT=true

Committed: https://crrev.com/2cf2fab949e741b56be51d1197b064083ec45441
Cr-Commit-Position: refs/heads/master@{#368817}

Review URL: https://codereview.chromium.org/1575323002

Cr-Commit-Position: refs/heads/master@{#368820}
sigbjornf
Revert of Oilpan: fix build after r368814. (patchset #1 id:1 of https://codereview.chromium.org/1575323002/ )
Reason for revert:
Breaks non-Oilpan compilation.

Original issue's description:
> Oilpan: fix build after r368814.
>
> TBR=oilpan-reviews
> BUG=540528
> NOTRY=true
> NOTREECHECKS=true
> NOPRESUBMIT=true
>
> Committed: https://crrev.com/2cf2fab949e741b56be51d1197b064083ec45441
> Cr-Commit-Position: refs/heads/master@{#368817}

TBR=oilpan-reviews@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=540528

Review URL: https://codereview.chromium.org/1580683002

Cr-Commit-Position: refs/heads/master@{#368819}
sigbjornf
Oilpan: fix build after r368814.
TBR=oilpan-reviews
BUG=540528
NOTRY=true
NOTREECHECKS=true
NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1575323002

Cr-Commit-Position: refs/heads/master@{#368817}
davve
Fix SVG sizing in crossfaded images
Wrap SVGImages inside SVGImageForContainer to maintain the correct
size. SVGImages are shared between all places the same resource is
used and the wrapper is necessary to get the proper size for a
particular instantiation.

BUG=574172

Review URL: https://codereview.chromium.org/1577843002

Cr-Commit-Position: refs/heads/master@{#368816}
sigbjornf
Oilpan: mark two fast/text tests as failing on Windows.
TBR=oilpan-reviews
BUG=553613
NOTRY=true

Review URL: https://codereview.chromium.org/1579653002

Cr-Commit-Position: refs/heads/master@{#368593}
sigbjornf
Oilpan: retire dated DataRef<> GC_PLUGIN_IGNORE().
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1577753002

Cr-Commit-Position: refs/heads/master@{#368560}
sigbjornf
Restrict the scope of PointerFieldStorageTrait<>.
Float it into ScopedDisposal<> as it isn't used anywhere
else.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1579463002

Cr-Commit-Position: refs/heads/master@{#368552}
sigbjornf
Ensure Oilpan garbage is collected on JavaBridgeChildFrameTest test.
In order for testHolderFrame's testing of the liveness of its weak
reference to be accurate with Oilpan is enabled, another GC round
is required to have both v8 and Oilpan GCs get to sweep out all
their dead objects before checking the weak reference.

R=haraken,jochen
BUG=575696

Review URL: https://codereview.chromium.org/1574753002

Cr-Commit-Position: refs/heads/master@{#368550}
rune
Renamed check for requiring ShadowPseudo combinator.
Some selectors have an implicit boundary crossing combinator inside what
is a compound selector in the selector text. This is an implementation
detail, but we insert such combinators for our SelectorChecker to switch
scopes during matching. Example:

input::-webkit-clear-button

This is a compund selector matching a pseudo element inside the input's
shadow tree. In the implementation, we store that as:

input /implicit-shadow-crossing-combinator/ ::-webkit-clear-button

Where the pseudo element simple selector will match the element inside
the shadow tree, and the implicit combinator will act as a descendant
combinator that can reach into the shadow so that we make the way up to
matching the input type selector on the host element.

Here, we rename methods in the selector parser to reflect that and make
the code easier to understand.

There should be no behavioral changes.

R=timloh@chromium.org,esprehn@chromium.org

Review URL: https://codereview.chromium.org/1568303002

Cr-Commit-Position: refs/heads/master@{#368548}
sigbjornf
Avoid LSan false positives from CSSPathValue::emptyValue().
LSan reports a leak on SVGComputedStyleTest.MiscStyleShouldCompareValue
(with Oilpan), stemming from emptyValue()'s allocation of an
SVGPathByteStream object. Introduce a local constructor function that
explicitly keeps this sub-object from LSan's view -- it is owned by
the emptyValue singleton and shouldn't be considered a leak.

R=haraken
BUG=

Committed: https://crrev.com/08494b981bbe6e9925ffd6663e65b6151bdd9425
Cr-Commit-Position: refs/heads/master@{#368329}

Review URL: https://codereview.chromium.org/1566423002

Cr-Commit-Position: refs/heads/master@{#368346}
sigbjornf
Avoid LSan false positives from CSSPathValue::emptyValue().
LSan reports a leak on SVGComputedStyleTest.MiscStyleShouldCompareValue
(with Oilpan), stemming from emptyValue()'s allocation of an
SVGPathByteStream object. Introduce a local constructor function that
explicitly keeps this sub-object from LSan's view -- it is owned by
the emptyValue singleton and shouldn't be considered a leak.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1566423002

Cr-Commit-Position: refs/heads/master@{#368329}
mostynb
call static SequencedWorkerPool::GetSequenceToken() method directly
Followup to https://codereview.chromium.org/1414793009/ in order
to avoid a GCC unused result warning.

SequencedWorkerPool::GetSequenceToken() is now a static method, GCC
emits a warning for BrowserThread::GetBlockingPool()->GetSequenceToken()
since the return value of BrowserThread::GetBlockingPool() is not
used.  We should just all the static method directly.

Review URL: https://codereview.chromium.org/1567983003

Cr-Commit-Position: refs/heads/master@{#368326}
sigbjornf
Handle some failing DocumentOrderedMap ID lookups across tree removals.
r366066's attempt to better handle failing DocumentOrderedMap lookups
while an element is being removed from a tree with duplicate IDs, didn't
accommodate all cases where the document map might end up being consulted.

Widen the assert and have it scope over node removals; should the unlikely
case happen, recognize that the tree is in a transitory state and allow
the lookup to quietly fail.

TBR=esprehn
BUG=571351

Review URL: https://codereview.chromium.org/1555653002

Cr-Commit-Position: refs/heads/master@{#368321}
fs
Add StylePath and use it to store 'd' in ComputedStyle
This adds a new class StylePath, that wraps a SVGPathByteStream and a
Path to be used when painting et.c. Create a StylePath on-demand from
CSSPathValue, and then cache the resulting value.
This allows sharing the various levels of path-data between different
instances/elements. It also avoids eagerly constructing the Path object
at setAttribute-time.
To be able to achieve this, SVGPathByteStream is made to be reference-
counted.

BUG=535429

Review URL: https://codereview.chromium.org/1545713003

Cr-Commit-Position: refs/heads/master@{#368320}
sigbjornf
Fix std::enable_if<> conversion bug.
after r367242 - "::type" not "::Type".

R=haraken
BUG=554293

Review URL: https://codereview.chromium.org/1564323002

Cr-Commit-Position: refs/heads/master@{#368319}
sigbjornf
DEFINE_STATIC_LOCAL(): assert against illegal use of GCed types.
A singleton static local cannot refer to a Blink garbage collected
object directly, as that fails to keep the singleton alive. A
strong off-heap persistent reference, a Persistent<> variant
or a persistent collection type, is required.

Add a static assert which catches out such incorrect uses of
GCed types.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1568213002

Cr-Commit-Position: refs/heads/master@{#368313}
sigbjornf
Oilpan: hold onto MediaQueryEvaluator singletons with Persistents.
Add missing Persistent<> wrappers around MediaQueryEvaluator singletons;
a regression introduced by r367489.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1562353004

Cr-Commit-Position: refs/heads/master@{#368310}
landell
Don't use pulse/alsa in embedded config
The embedded check was removed in CL
https://codereview.chromium.org/1528533002 which broke our builds.

BUG=

Review URL: https://codereview.chromium.org/1530713006

Cr-Commit-Position: refs/heads/master@{#368304}
sigbjornf
Oilpan: fix build after r368275.
R=haraken
BUG=266276
NOTRY=true

Review URL: https://codereview.chromium.org/1571443004

Cr-Commit-Position: refs/heads/master@{#368299}
tmoniuszko
Allow enable_topchrome_md to be overridden in gn build
BUG=

Review URL: https://codereview.chromium.org/1558123002

Cr-Commit-Position: refs/heads/master@{#368298}
davve
Remove FrameView::m_inPerformLayout
Use the document lifecycle instead of a flag in FrameView to find out
if we're inside performLayout().

Review URL: https://codereview.chromium.org/1562293002

Cr-Commit-Position: refs/heads/master@{#368289}
fs
Don't give 'pathLength' semantic errors special treatment
Just set the parse status to the error code for "negative forbidden"
and let it propagate. the fidelity of the message is roughly the same.

BUG=231612

Review URL: https://codereview.chromium.org/1548933002

Cr-Commit-Position: refs/heads/master@{#368160}
sigbjornf
Remove LocalDOMWindow unuseds.
R=
BUG=

Review URL: https://codereview.chromium.org/1567013002

Cr-Commit-Position: refs/heads/master@{#368090}
bratell
[gn] Detect location of Visual Studio in the registry.
Look in the registry to figure out where Visual Studio is located
on the disk.

BUG=460462

Review URL: https://codereview.chromium.org/1556993002

Cr-Commit-Position: refs/heads/master@{#368089}
rune
Don't add rule features across ::content.
When we see a ::content selector, we mark the invalidation sets for the
selectors left of ::content as insertion-point-crossing. For such
invalidation sets, we mark insertion points for subtree style recalc,
which means that we don't need to look at the selector features right of
::content selectors for invalidations.

For instance for:

.a ::content .b .c

The invalidation set for '.b' contains '.c', and the invalidation set for
'.a' contains '.c' and has the insertion-point-crossing flag set. Adding
'c' is however unnecessary since ::content already causes a subtree style
recalc. Also, this may cause unnecessary invalidations in '.a's scope if
there are in-scope '.c' descendants of '.a'.

This CL avoids adding invalidation set features like '.c' to the
invalidation set for '.a' as illustrated above. Now invalidation sets
may have the insertion-point-crossing flag set while otherwise being
empty, and they should not be considered empty as we need to traverse
and mark all insertion points for such sets.

Review URL: https://codereview.chromium.org/1544893003

Cr-Commit-Position: refs/heads/master@{#368064}
fs
Store a <scale, bias> tuple for textLength scale adjustment
SVGTextFragment::lengthAdjustTransform only ever has two values that
could make it differ from the identity transform.
By storing only these two values - and as floats rather than doubles -
instead of the full AffineTransform, the size of SVGTextFragment is
reduced by 40 bytes.
To enable this we however need to store whether the writing-mode is
vertical or horizontal, so steal one bit from the length field for
that.

BUG=571415

Review URL: https://codereview.chromium.org/1548913002

Cr-Commit-Position: refs/heads/master@{#368051}
mostynb
gn: leave PKG_CONFIG_PATH untouched when not using a sysroot
This makes cross-compilation possible when not using a sysroot.

Review URL: https://codereview.chromium.org/1543483002

Cr-Commit-Position: refs/heads/master@{#367906}
rune
[Printing] Remove unnecessary styleResolverChanged().
styleResolverChanged is already called for media query changes in the
following call chain:

FrameView::adjustMediaTypeForPrinting() ->
FrameView::setMediaType() ->
Document::mediaQueryAffectingValueChanged() ->
Document::styleResolverChanged()

Calling it afterwards should not be necessary.

R=mstensho@opera.com
TEST=printing/print-media-recalc.html

Review URL: https://codereview.chromium.org/1569503002

Cr-Commit-Position: refs/heads/master@{#367895}
davve
Simplify arguments to logical[Left,Right]OffsetForPositioningFloat
|applyTextIndent=false| is always passed to
logical[Left,Right]OffsetForPositioningFloat(). Might as well remove
the parameter and pass |false| where it's needed. No functional change
expected.

Review URL: https://codereview.chromium.org/1557373002

Cr-Commit-Position: refs/heads/master@{#367792}
sigbjornf
Oilpan: fix build after r367779.
TBR=oilpan-reviews
BUG=488373
NOTRY=true

Review URL: https://codereview.chromium.org/1568443002

Cr-Commit-Position: refs/heads/master@{#367787}
davve
Simplify paintFillLayer
paintFillLayer() was only used in one place. Expand the two default
arguments and rename paintFillLayerExtended to paintFillLayer.

Review URL: https://codereview.chromium.org/1527343002

Cr-Commit-Position: refs/heads/master@{#367659}
rune
Avoid unnecessary invalidation scheduling.
This is a reland of https://codereview.chromium.org/1514733002 without
the removal of an assumed-to-be SubtreeStyleChange for attribute changes
when you have a null style resolver, which turned out to cause asserts.

We skip scheduling invalidation sets for an element when:

* StyleResolver is null
* Element is not inActiveDocument()
* Element does not have a parent
* Element parent has SubtreeStyleChange or ReattachStyleChange

Additionally we skip descendant invalidations when:

* Element has SubtreeStyleChange or ReattachStyleChange

and sibling invalidations when:

* Element.nextSibling is null

R=ruuda@google.com
BUG=557440

Review URL: https://codereview.chromium.org/1560693002

Cr-Commit-Position: refs/heads/master@{#367617}
robertn
Use the correct variable in the DCHECK
A patch changed how a value was retrieved to use a different variable,
but the DCHECK was not updated to do the same. The change was
introduced in the following CL:

https://codereview.chromium.org/1479883002

TEST=Load youtube.com/tv, start a video and switch to a suggested video.
     The above steps will trigger the dcheck in content_shell.
R=ajuma@chromium.org
BUG=560275
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1556333003

Cr-Commit-Position: refs/heads/master@{#367527}
arjanl
Don't unnecessarily copy strings
Add a function base::SplitStringPieceUsingSubstr that splits a string
using a substring delimiter without copying the string parts. Use it in
HttpRequestHeaders::AddHeadersFromString.

BUG=572076

Review URL: https://codereview.chromium.org/1549063003

Cr-Commit-Position: refs/heads/master@{#367504}
tmoniuszko
Fix possible loss of data warnings in media_unittests
Fix compiler warning about size_t to uint8_t conversion.

BUG=

Review URL: https://codereview.chromium.org/1559013002

Cr-Commit-Position: refs/heads/master@{#367491}
sigbjornf
Reduce risk of MediaQueryEvaluator-induced leaks.
With Oilpan, having MediaQueryEvaluator keep a Persistent<> reference
to MediaValues isn't necessary and by doing so, increases the risk
of creating inadvertent leaks. Move MediaQueryEvaluator to the heap
instead.

R=haraken
BUG=509911

Review URL: https://codereview.chromium.org/1555993002

Cr-Commit-Position: refs/heads/master@{#367489}
rune
Layout test for 571040.
The fix for issue 571040 did not add a test. Here is one.
Node::virtualEnsureComputedStyle returns nullptr when there is no parent
node (which is strange since the method is called *Ensure*). However,
that's what caused the crash. Confirmed that the added test crashes in a
pre-christmas checkout.

R=shans@chromium.org,dstockwell@chromium.org
BUG=571040

Review URL: https://codereview.chromium.org/1553083002

Cr-Commit-Position: refs/heads/master@{#367393}
mstensho
Internals: throw an exception when page height or width is 0.
The two methods pageNumber() and numberOfPages() on the window.internals object
allowed 0 as page height, which results in a division by zero in multicol (and
general failure to paginate in other parts of the code). Have the methods raise
an exception when such values are provided. Also specify the default width and
height values in Internals.idl rather than in Internals.h, so that they
actually do something. Our default page width and height were effectively 0 for
these methods.

Assert that width and height have valid values (i.e. greater than 0) in
PrintContext::begin().

BUG=571348
R=rune@opera.com

Review URL: https://codereview.chromium.org/1552703003

Cr-Commit-Position: refs/heads/master@{#367304}
sigbjornf
Clarify ordinary page handling.
Clarify that it is precise to use ordinaryPages() to locate storage
event targets (by StorageArea), along with generally tidying up Page
creation - "ordinary" ones as well as ones needed for internal purposes.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1507633003

Cr-Commit-Position: refs/heads/master@{#367296}
davve
Remove unused constant kInvalidFrameRoutingID
All use of kInvalidFrameRoutingID was removed in
https://codereview.chromium.org/1138543002 but for the constant.

Review URL: https://codereview.chromium.org/1532323002

Cr-Commit-Position: refs/heads/master@{#367287}
sigbjornf
EventSender<T> singletons are better off on the Oilpan heap.
Rather than keeping two off-heap persistent collections per EventSender
singleton, have the singletons reside on the Oilpan heap instead.

This also removes no-op cancelEvent()s from various destructors.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1554903002

Cr-Commit-Position: refs/heads/master@{#367282}
sigbjornf
Revert of mac and ios: Build third-party code with -Wall. (patchset #1 id:1 of https://codereview.chromium.org/1555843002/ )
Reason for revert:
ios_Device builder isn't quite ready for -Wall,

 http://build.chromium.org/p/chromium.mac/builders/iOS_Device/builds/33368

breaking compilation.

Original issue's description:
> mac and ios: Build third-party code with -Wall.
>
> This lands the mac and ios build/common.gypi bits of
> https://codereview.chromium.org/1551753002/ (reviewed there)
>
> BUG=573250
> R=thestig@chromium.org
> TBR=thestig@chromium.org
>
> Committed: https://crrev.com/9830789346abd3d8211deff1ebe7a7f5753ba3fc
> Cr-Commit-Position: refs/heads/master@{#367255}

TBR=thestig@chromium.org,thakis@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=573250

Review URL: https://codereview.chromium.org/1553943002

Cr-Commit-Position: refs/heads/master@{#367258}
sigbjornf
Oilpan: avoid heap allocation in MajorGCWrapperVisitor
The collection of retained object roots is preferably not allocated on
the Oilpan heap as that risks triggering an unnecessary GC.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1539133002

Cr-Commit-Position: refs/heads/master@{#367161}
mstensho
Update bug number for block-layout-inline-children-replaced.html in TestExpectations.
This test has been flaky (and marked as such) for a long time, and it wasn't
introduced by the fix for bug 537638. It just got accidentally auto-rebaselined
as part of that fix. Revert the bug number in TestExpectations back to what it
used to be.

R=noel@chromium.org
BUG=571590

Review URL: https://codereview.chromium.org/1555533002

Cr-Commit-Position: refs/heads/master@{#367152}
sigbjornf
Diagnose failing GC transition on forced Oilpan GC.
Temporary release asserts to help diagnose an unexpected&unsupported
Blink GC transition.

R=haraken
BUG=571207

Review URL: https://codereview.chromium.org/1559443002

Cr-Commit-Position: refs/heads/master@{#367150}
sigbjornf
Oilpan: prefinalize CSSCrossfadeValue.
Consistently use prefinalizers for ImageResourceClients, following on
from r366092.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1555633002

Cr-Commit-Position: refs/heads/master@{#367146}
mostynb
fix some obsolete code.google.com sandbox links
TBR=thakis@chromium.org

Review URL: https://codereview.chromium.org/1538613002

Cr-Commit-Position: refs/heads/master@{#366972}
fs
Refactor propagation of parsing errors for SVG attributes
Use the return value of SVG{...}::setValueAsString to signal errors
rather than an out parameter and the (mostly faux) ExceptionState
object (for setBaseValueAsString). In the few cases where the latter
is not using an TrackExceptionState - in tear-offs for SVGAngle and
SVGLength - it's easy enough to handle the exception-throwing there
and then.
This makes SVG{...} objects mostly independent of ExceptionState,
saving on footprint from string-construction and argument passing as
a side-effect.
Also remove some unnecessary virtuals on SVGInteger and
SVGPreserveAspectRatio.

BUG=231612

Review URL: https://codereview.chromium.org/1544673003

Cr-Commit-Position: refs/heads/master@{#366715}
fs
Return AffineTransform from SVGTextFragment::buildFragmentTransform
Instead of passing an AffineTransform as an out-parameter, just return
it instead. Since we always copy the resulting transform into the
out-parameter anyway, there should be no loss of efficiency.
This also enables some of the users to be written in a more compact
way.

Also add boundingBox(), boundingQuad() and overflowBoundingBox()
helpers to SVGTextFragment and use where possible.

BUG=571415

Review URL: https://codereview.chromium.org/1549503002

Cr-Commit-Position: refs/heads/master@{#366713}
bratell
Teach Chromium on Windows where to find Ogham glyphs
Ogham glyphs are found in Segoe UI Symbol.

BUG=569938
R=drott@chromium.org

Review URL: https://codereview.chromium.org/1521993008

Cr-Commit-Position: refs/heads/master@{#366616}
bratell
Use clampTo instead of chaining std::max(std::min(...))
It's common to make a value end up between two other values by using
std::min and std::max but we have a clampTo function that will
make the code much easier to read so we should use it.

The performance is the same (both end up doing inline comparisons and
value selection) but not having to include <algorithm> can bring a
very slight compilation speed boost.

BUG=563433

Review URL: https://codereview.chromium.org/1530723004

Cr-Commit-Position: refs/heads/master@{#366585}
davve
Polish recently added documentation for PaintLayerFilterInfo
NOTRY=true

Review URL: https://codereview.chromium.org/1545523003

Cr-Commit-Position: refs/heads/master@{#366571}
fs
Helper for checking if an SVGTextFragment is transformed
Add a isTransformed() helper to SVGTextFragment. Since it's a commonly
recurring pattern to compute the fragment transform and then check if
it is the identity transform - and doing the check before actually
computing the transform is only marginally more expensive (since we
know the structure of SVGTextFragment::lengthAdjustTransform) we can
use this helper and switch order of computation and check. The only
potential downside would be if the resulting transform ends up being
the identity transform - which seems like an edge-case.

With this in place, we can do additional improvements around the
handling of fragment bounding boxes et.c. and change how the fragment
is "parametrized".

BUG=571415

Review URL: https://codereview.chromium.org/1545443002

Cr-Commit-Position: refs/heads/master@{#366567}
fs
Make SVGElement::propertyFromAttribute return raw pointer
Ownership does not transfer from the element, so we can make the return
value a raw pointer, and hence avoid ref-churn, save some footprint and
allow tail-calls in collectStyleForPresentationAttribute.

Review URL: https://codereview.chromium.org/1541923002

Cr-Commit-Position: refs/heads/master@{#366536}
mstensho
Partially manual rebaseline for r366396 https://codereview.chromium.org/1536663004
Re-mark the two tests as failing again for Mac. They were temporarily commented
out in order to get the rebaselining working.

BUG=537638
TBR=wangxianzhu@chromium.org

Review URL: https://codereview.chromium.org/1536233005

Cr-Commit-Position: refs/heads/master@{#366451}
mstensho
Need to repaint its ::first-line background when a block moves.
Everything else pertaining to ::first-line is painted by the InlineBox objects
established by DOM nodes (text, inline SPAN, whatever), so they get invalidated
when their LayoutObjects get invalidated, but ::first-line background is
special and is painted by RootInlineBox, which wasn't properly invalidated
along with the rest.

BUG=537638
R=chrishtr@chromium.org,eae@chromium.org,wangxianzhu@chromium.org

Review URL: https://codereview.chromium.org/1536663004

Cr-Commit-Position: refs/heads/master@{#366396}
davve
Rewrite LayoutTest svg/wicd/rightsizing-grid as a reftest
A number of changes were made to reduce flakyness and make the test
more useful:

 * Rewrite as html reftest.

 * Apply a static body width. The test is no longer depending on the
   viewport width.

 * Use a slim body width. The way the test was written a lot of the
   test actually ended up outside the viewport. Layout tests use
   default size 800x600 and this test expected up to double the height
   compared to the width.

 * Avoid gradients and rounded rectangles since they add nothing to
   what's actually meant to be tested.

The test svg/wicd/sizing-flakiness.html is a subset of the
rightsizing-grid test and should provide little value of its own. It
is thus removed.

BUG=571301

Review URL: https://codereview.chromium.org/1542563002

Cr-Commit-Position: refs/heads/master@{#366388}
mostynb
gn format BUILD.gn after CL1535803002
BUG=539572
TBR=dpranke

Review URL: https://codereview.chromium.org/1544453002

Cr-Commit-Position: refs/heads/master@{#366371}
sigbjornf
Oilpan: prefinalize StyleFetchedImage* image resource clients.
Followup r366092 and switch finalization mechanism for
StyleFetchedImage and StyleFetchedImageSet to prefinalizers.

Having them be eagerly finalized conflicted in some cases with
another eagerly finalized object (a FrameView scrollable area),
as these StyleFetchedImage objects cannot be allowed to
touch another eagerly finalized object.

Avoid the finalization (non-)ordering issue by switching these
to prefinalized objects instead.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1536113003

Cr-Commit-Position: refs/heads/master@{#366275}
fs
Drop SkPathContainsPoint in favor of SkPath::contains
This will increase the fidelity in some cases when hit-testing.

BUG=373638,523102

Review URL: https://codereview.chromium.org/1536803003

Cr-Commit-Position: refs/heads/master@{#366141}
philipj
Deprecate document.defaultCharset (to be removed in M50)
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/pWSb_tq13Kg/Dmk59Fb9AQAJ

BUG=567738

Review URL: https://codereview.chromium.org/1526563005

Cr-Commit-Position: refs/heads/master@{#366133}
bratell
Use Ebrima as fallback font for Tifinagh in Windows.
BUG=569421

Review URL: https://codereview.chromium.org/1525653002

Cr-Commit-Position: refs/heads/master@{#366131}
sigbjornf
Oilpan: fix build after r366113.
TBR=oilpan-reviews
BUG=505851
NOTRY=true

Review URL: https://codereview.chromium.org/1537683004

Cr-Commit-Position: refs/heads/master@{#366126}
philipj
Update the XMLHttpRequestProgressEvent deprecation messages for M50 removal
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/bpbq0Rcpauk/cnpJtHddAgAJ

BUG=357112

Review URL: https://codereview.chromium.org/1526003002

Cr-Commit-Position: refs/heads/master@{#366114}
philipj
Update the keyLocation deprecation message for M50 removal
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/lqknEaUYCJM/UbNahDDMAwAJ

BUG=568261

Review URL: https://codereview.chromium.org/1529623002

Cr-Commit-Position: refs/heads/master@{#366112}
philipj
Add willBeRemoved and replacedWillBeRemoved deprecation message helpers
The fullscreen deprecation messages are updated, because the old
advice was not as good as the new advice.

R=jochen@chromium.org

Review URL: https://codereview.chromium.org/1533913003

Cr-Commit-Position: refs/heads/master@{#366096}
sigbjornf
Oilpan: eagerly finalize StyleFetchedImage* image resource clients.
Extend our practice of eagerly finalizing ImageResourceClients to
StyleFetchedImage and StyleFetchedImageSet.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1535643005

Cr-Commit-Position: refs/heads/master@{#366092}
fs
Add a Path::contains() version that use the Path's winding rule
In preparation for using SkPath::contains() for Path::contains(), add an
overload that uses the winding rule (fill type) from the SkPath, since
that the version which will require less impedance matching with the
Skia API. Convert "obvious" current users to the new overload, and remove
some unused winding rule accessors.
Attempt to clean up some related includes while in the general area.

BUG=523102

Review URL: https://codereview.chromium.org/1532923002

Cr-Commit-Position: refs/heads/master@{#366080}
mharanczyk
Change how DOM Inspector fetches document's base URL.
With integration of https://codereview.chromium.org/1409293007 appending
empty string is invalid operation for non hierarchical base urls. Since
DOM Inspector Agent actually want to determine base URL ask for that
data directly.
Without this change base url for non hierarchical (data:) urls was
always empty for inspector, which in turn caused webdriver to freeze
when trying to communicate with such documents, because it wrongly
assumed it is still in loading state (base url was empty),
so it waited for load complete.

Review URL: https://codereview.chromium.org/1530153002

Cr-Commit-Position: refs/heads/master@{#366079}
sigbjornf
Allow -webkit-text-decorations-in-effect preservation during para move.
Adjust assert to allow it; moving paragraphs as part of performing
JustifyRight will want to preserve styles, but this is done without
extra annotation. For which -webkit-text-decorations-in-effect is
also preserved.

R=tkent
BUG=498130
TEST=editing/execCommand/justify-right-in-effect-crash.html

Review URL: https://codereview.chromium.org/1522063002

Cr-Commit-Position: refs/heads/master@{#366067}
sigbjornf
Better handling of DocumentOrderedMap same-ID lookups during tree removals
Under select and unusal conditions, the removal of an element with ID
A might trigger further lookups of A from a TreeScope's DocumentOrderedMap
as part of handling the removal of that element. The tree and
DocumentOrderedMap is not in a consistent state to precisely handle such
lookups -- add machinery to spot that we're in a transitory state and
not trigger an assert over such failing lookups.

See code comments for further details.

R=tkent,esprehn
BUG=426005

Review URL: https://codereview.chromium.org/1532103002

Cr-Commit-Position: refs/heads/master@{#366066}
philipj
Simplify Node.prototype.baseURI to match the DOM spec
https://dom.spec.whatwg.org/#dom-node-baseuri

This simplification was made possible by the removal of xml:base in spec
and implementation:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976
https://code.google.com/p/chromium/issues/detail?id=341854

BUG=570679

Review URL: https://codereview.chromium.org/1529363004

Cr-Commit-Position: refs/heads/master@{#365934}
landell
Include missing errno.h
BUG=

Review URL: https://codereview.chromium.org/1532833002

Cr-Commit-Position: refs/heads/master@{#365839}
bratell
Include <algorithm> if you use functions from <algorithm>.
I'm trying to remove #include <algorithm> from common headers because
it takes a long time to compile, but then code that actually need
<algorithm> need to include that header themselves.

This will bring no functional change.

BUG=563433

Review URL: https://codereview.chromium.org/1528323002

Cr-Commit-Position: refs/heads/master@{#365830}
philipj
Import the baseURI test from web-platform-tests
Import web-platform-tests@0bb3d73f26aa5a21326b6c1c7aaf35029222223f

Using update-w3c-deps in Blink 731a1238920ae9b7216cd2ced12267deb0d63e19.

This fails, but is imported so that it can be fixed.

BUG=570679

Review URL: https://codereview.chromium.org/1533653002

Cr-Commit-Position: refs/heads/master@{#365828}
wmaslowski
Permissions channel filter should use IDS_PRODUCT_NAME
... instead of explicit 'Google Chrome'.

BUG=560262

Review URL: https://codereview.chromium.org/1469003002

Cr-Commit-Position: refs/heads/master@{#365825}
sigbjornf
Oilpan: simplify plugin container finalization.
Simplify the finalization of WebPluginContainerImpl by registering a
prefinalizer for it. By doing so, we can let go of the LocalFrame
registration scheme currently used -- a scheme needed to ensure
that plugin containers could safely dispose of their plugin while
the owning LocalFrame was still alive and accessible. That
mechanism predated prefinalizer/eager finalization support. But
with it well in place, we can make good use of it here -- the
prefinalizer disposing of the plugin container while the LocalFrame
is accessible.

Notice that plugin containers (PluginView widgets) still need to
be explicitly disposed of in places. Their plugins will have to
be summarily & predictably destroyed at those points, something
that cannot be left until the next GC (whenever it goes ahead.)

R=dcheng
BUG=340522

Review URL: https://codereview.chromium.org/1517993004

Cr-Commit-Position: refs/heads/master@{#365792}
ljagielski
[Linux] Turn off -mstackrealign for breakpad in ia32.
There's a clang bug which causes crashes of syscalls which use many
registers for argument passing in ia32 architecture.
https://llvm.org/bugs/show_bug.cgi?id=16830

BUG=556393

Review URL: https://codereview.chromium.org/1473203002

Cr-Commit-Position: refs/heads/master@{#365770}
sigbjornf
Gracefully discharge a failed script load in disposed documents.
Should a ScriptLoader's resource end up being cancelled as part of
Document and ScriptRunner disposal, handle the error notification without
falsely asserting. Speculative crash fix.

R=haraken
BUG=536796

Review URL: https://codereview.chromium.org/1526293003

Cr-Commit-Position: refs/heads/master@{#365541}
bratell
Include <algorithm> if you use functions from <algorithm>.
I'm trying to remove #include <algorithm> from common headers because
it takes a long time to compile, but then code that actually need
<algorithm> need to include that header themselves.

This will bring no functional change.

BUG=563433

Review URL: https://codereview.chromium.org/1531703002

Cr-Commit-Position: refs/heads/master@{#365524}
sigbjornf
Oilpan: make ScrollableAreaTest.ScrollbarTrackAndThumbRepaint work.
Scrollbars assume that their associated theme objects live longer,
unregistering themselves upon finalization.

Make it clear that this lifetime assumption must also hold for Scrollbars
created by the test-only constructor Scrollbar::createForTesting() +
alter ScrollableAreaTest.ScrollbarTrackAndThumbRepaint so that the
scrollbars it creates are finalized before the mock theme object is.
With Oilpan, explicit flushing out of garbage is needed.

R=haraken
BUG=549277

Review URL: https://codereview.chromium.org/1528613006

Cr-Commit-Position: refs/heads/master@{#365517}
davve
Measure SVGSVGElement.viewport
The implementation is trivial but entirely useless and has been since
2012. The attribute is not present at all in Gecko.

It has been removed from the spec:
http://www.w3.org/Graphics/SVG/WG/track/actions/3815

BUG=395838, 415074

Review URL: https://codereview.chromium.org/1523273002

Cr-Commit-Position: refs/heads/master@{#365515}
philipj
Import dom/ from web-platform-tests
Import web-platform-tests@0bb3d73f26aa5a21326b6c1c7aaf35029222223f

Using update-w3c-deps in Blink adcc203a3f95a64d9bd7018adec276cfb7eadeb5.

Review URL: https://codereview.chromium.org/1529523002

Cr-Commit-Position: refs/heads/master@{#365433}
fs
Tidy up SVGParserUtilities
Remove unused typedefs and includes. Move 'transform'-related parsing
bits to SVGTransformList.cpp.

Review URL: https://codereview.chromium.org/1527993002

Cr-Commit-Position: refs/heads/master@{#365379}
fs
Use Vector<...>::append(const U*, size_t) in SVGPathByteStream
This appears to help larger paths a decent amount, while not hurting
smaller paths. Payload for this copy is 2-26 bytes. For a ~3.5k
character path string this reduced runtime of a
setAttribute('d', <path>) micro-benchmark (w/ mostly 10 byte payloads)
by roughly 17%.

BUG=568735

Review URL: https://codereview.chromium.org/1527613006

Cr-Commit-Position: refs/heads/master@{#365365}
fs
Shrink SVGTransform::valueAsString
Use a StringBuilder and convert transformTypePrefixForParsing to return
const char*.
Since this is a uniform arguments notation, put the arguments in an
array and loop through them, appending them to the result.
This reduces the size of this method from a bit of 6k to a bit over 950
bytes (x86-64).

Review URL: https://codereview.chromium.org/1525213002

Cr-Commit-Position: refs/heads/master@{#365354}
fs
Shrink SVGPreserveAspectRatio::valueAsString
No need to instantiate String for all the cases. Use a StringBuilder and
const char* instead.
Shrinks the method by nearly 500 bytes (x86-64)

Review URL: https://codereview.chromium.org/1526103002

Cr-Commit-Position: refs/heads/master@{#365319}
sigbjornf
Canonicalize creation of ServiceWorkerContainerClient supplement.
Follow the lazy from-new-provideTo pattern used elsewhere for instantiating
supplements.

R=horo
BUG=

Review URL: https://codereview.chromium.org/1518323002

Cr-Commit-Position: refs/heads/master@{#365230}
wdzierzanowski
Don't assume correct image format in CopyVpxImageToVideoFrame()
The data arriving inside the |vpx_image| struct is not guaranteed by
libvpx to be in one of the formats supported by VpxVideoDecoder.

BUG=569574
TEST=Loading http://shion.ru/crash.webm should result in video decoding error

Review URL: https://codereview.chromium.org/1520313002

Cr-Commit-Position: refs/heads/master@{#365213}
rune
Avoid unnecessary invalidation scheduling.
We skip scheduling invalidation sets for an element when:

* StyleResolver is null
* Element is not inActiveDocument()
* Element does not have a parent
* Element parent has SubtreeStyleChange or ReattachStyleChange

Additionally we skip descendant invalidations when:

* Element has SubtreeStyleChange or ReattachStyleChange

and sibling invalidations when:

* Element.nextSibling is null

Removed an unnecessary SubtreeStyleChange when StyleResolver is null for
attribute changes.

BUG=557440

Review URL: https://codereview.chromium.org/1514733002

Cr-Commit-Position: refs/heads/master@{#365188}
fs
Fix ImageResource null-check in LayoutImage::foregroundIsKnownToBeOpaqueInRect
Make sure m_imageResource->cachedImage() is non-null before
dereferencing even for the use in the context of the TRACE_EVENT.

BUG=569624

Review URL: https://codereview.chromium.org/1527453003

Cr-Commit-Position: refs/heads/master@{#365097}
sigbjornf
Document LEAK_SANITIZER_IGNORE_OBJECT() more precisely.
R=haraken
BUG=567257
NOTRY=true

Review URL: https://codereview.chromium.org/1511833006

Cr-Commit-Position: refs/heads/master@{#365025}
sigbjornf
Oilpan: support OSX thread stack size discovery.
We do know enough about OSX stack sizes to be able to work around
bugginess of 10.9's pthread_get_stacksize_np().

R=haraken
BUG=569480

Review URL: https://codereview.chromium.org/1527513002

Cr-Commit-Position: refs/heads/master@{#364996}
sigbjornf
Revert of Response construction with a ReadableStream (patchset #13 id:320001 of https://codereview.chromium.org/1506023003/ )
Reason for revert:
Caused some UAFs,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/builds/21811

Original issue's description:
> Response construction with a ReadableStream
>
> This CL implements Response construction with a ReadableStream provided
> by V8 Extras. The feature is behind a runtime enabled flag.
>
> The implementation is not perfect.
>  - ReadableStreamDataConsumerHandle should be thread-safe but is not.
>  - ReadableStreamDataConsumerHandle may cause memory leaks.
> But these problems don't bother stable users.
>
> BUG=564479
>
> Committed: https://crrev.com/6aa006ba0f0f8a60c20167ad009f5699e40b8ef2
> Cr-Commit-Position: refs/heads/master@{#364968}

TBR=domenic@chromium.org,bashi@google.com,bashi@chromium.org,haraken@chromium.org,tyoshino@chromium.org,yhirano@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=564479

Review URL: https://codereview.chromium.org/1527493002

Cr-Commit-Position: refs/heads/master@{#364981}
fs
Restore TextCaseSensitivity argument to literal {start,end}sWith
This reverts the change made by:
  https://codereview.chromium.org/1507763003
hence restoring the method signatures. Implementations are adjusted
based on intermediate changes, like supporting ASCII case-insensitive.

Reorganize the equalSubstring* helpers so that more code can be shared
(at least textually.)
Also try to make the naming of arguments consistent for the various
startsWith/endsWith implementations ("prefix"/"suffix" rather than
"match").

BUG=568584

Review URL: https://codereview.chromium.org/1523463004

Cr-Commit-Position: refs/heads/master@{#364957}
sigbjornf
Oilpan: fixup Handle.h include.
R=haraken
BUG=357163

Review URL: https://codereview.chromium.org/1520083002

Cr-Commit-Position: refs/heads/master@{#364950}
fs
Ship Case-insensitive attribute selectors
Intent-to-ship:
  https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/vAWK0ldpyrc

BUG=567732

Review URL: https://codereview.chromium.org/1519833002

Cr-Commit-Position: refs/heads/master@{#364831}
philipj
Remove deprecation messages for no-ops that are left in the specs
Since these will not be removed, warning developers about them is
not a good use of attention.

Take the opportunity to remove the detach() calls from a few tests where
it does nothing anyway. Remove detach-range-during-deletecontents.html
as that was testing specifically detach() which cannot be relevant now
that it is a no-op. Some of the range-* tests are left untouched as they
explicitly call out that detach() is a no-op in comments.

These are the reviews where these deprecation messages were added:
https://codereview.chromium.org/256013002
https://codereview.chromium.org/252783002
https://codereview.chromium.org/901623002

BUG=568218
R=rbyers@chromium.org

Review URL: https://codereview.chromium.org/1516553002

Cr-Commit-Position: refs/heads/master@{#364745}
fs
Use ASCII case-insensitive matching for attribute selectors
When matching attribute selectors in a case-insensitive manner, the
match should be performed using "ASCII case-insensitive" matching per
the "document language" specification (HTML) [1]. Similarly when the "i"
modifier is used [2].

New behavior matches Gecko (for [1]) and WebKit (for [1] and [2]).

This requires adding some new functions to support the various matching
operations: startsWith, endsWith and find.
Add TextCaseSensitivity value TextCaseASCIIInsensitive and
implementations for the methods mentioned above.
Replace current use of startsWithIgnoringASCIICase with startsWith,
passing TextCaseASCIIInsensitive.

[1] https://html.spec.whatwg.org/multipage/scripting.html#case-sensitivity
[2] https://drafts.csswg.org/selectors-4/#attribute-case

BUG=565878

Review URL: https://codereview.chromium.org/1499933003

Cr-Commit-Position: refs/heads/master@{#364703}
davve
Split SVGSVGElement.create* functions from SVG1DOM counter
Measure them individually to see which ones, if any, has any
usage. They are interesting in the sense of being the only way of
creating such objects.

BUG=415074

Review URL: https://codereview.chromium.org/1505953008

Cr-Commit-Position: refs/heads/master@{#364695}
sigbjornf
Oilpan: fix build after r364654, part 3.
TBR=oilpan-reviews
BUG=531990
NOTRY=true

Review URL: https://codereview.chromium.org/1514393002

Cr-Commit-Position: refs/heads/master@{#364692}
sigbjornf
Oilpan: always limit persisted plugin disposal to PluginViews instances.
With Oilpan enabled, the plugin element needs to synchronously inform
its 'persisted' plugin widget that it is slated for destruction and
call its dispose() method. This is needed so as to have that plugin
unregister in a timely fashion (without waiting on the next GC.)

This disposal step is only needed for PluginView widgets; it is indeed
harmful to call it for a FrameView widget should it be disposed while
being in the middle of performing a full layout.

R=dcheng
BUG=568383

Review URL: https://codereview.chromium.org/1514073002

Cr-Commit-Position: refs/heads/master@{#364690}
sigbjornf
Oilpan: fix build after r364654, part 2.
Follow up r364678, unit test breakages.

TBR=oilpan-reviews
BUG=531990
NOTRY=true

Review URL: https://codereview.chromium.org/1520523005

Cr-Commit-Position: refs/heads/master@{#364683}
sigbjornf
Oilpan: fix build after r364654.
TBR=oilpan-reviews
BUG=531990
NOTRY=true

Review URL: https://codereview.chromium.org/1521583002

Cr-Commit-Position: refs/heads/master@{#364678}
davve
Hook up RendererMediaSessionManager with browser side
Implements the basic IPC messages for activation and deactivation back
and forth.

The browser side is still unimplemented.

BUG=497735

Review URL: https://codereview.chromium.org/1441883003

Cr-Commit-Position: refs/heads/master@{#364673}
davve
Remove --disable-svg1dom runtime flag
Because the SVG1DOM UseCounter was high enough that we couldn't rip
all of it out together[1] we might as well drop the run-time flag for
disabling it. It carries a non-significant cost of generated bindings
code (~700 lines less and simpler code) and won't be of much use now
anyway.

[1] https://code.google.com/p/chromium/issues/detail?id=415074#c4

BUG=415074

Review URL: https://codereview.chromium.org/1514853002

Cr-Commit-Position: refs/heads/master@{#364657}
christiank
Allow one-copy and zero-copy task tile worker pools to use compressed textures.
BUG=434699
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Committed: https://crrev.com/7d60ce9a132a88ead407a2a58c91edc431e68259
Cr-Commit-Position: refs/heads/master@{#364326}

Review URL: https://codereview.chromium.org/1379783002

Cr-Commit-Position: refs/heads/master@{#364484}
fs
Remove String::reverseFindIgnoringCase
No longer used. Also remove the "dynamic" TextCaseSensitivity version
of String::reverseFind.

BUG=565878

Review URL: https://codereview.chromium.org/1508423004

Cr-Commit-Position: refs/heads/master@{#364375}
philipj
Add UseCounters for Selection methods that take null
Making collapse's argument non-nullable appears risky:
https://codereview.chromium.org/1498253002/#msg9

The risk for setBaseAndExtent is entirely unknown.

Measure both cases before proceeding further.

The change to Selection.idl is for clarity only, these are implicitly
nullable because of [LegacyInterfaceTypeChecking], and adding making
them explicitly nullable does not change the generated code.

Review URL: https://codereview.chromium.org/1509353004

Cr-Commit-Position: refs/heads/master@{#364344}
mstensho
PrintContext::pageProperty() shouldn't use 0 as page height.
This function only seems to be used by window.internals,
although WebFrame also provides a method that ends up there. It's only
partially implemented, though. It recognizes "margin-left", but not
"margin-right", for instance. Anyway, use a better page height than 0.

Also no need to explicitly lay out the document here, since
PrintContext::begin() does it for us.

With this change, we no longer need to perform a page height sanity check in
LayoutView::layout() before creating a ViewFragmentationContext.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1510353002

Cr-Commit-Position: refs/heads/master@{#364333}
mostynb
remove duplicate friend declaration
GCC builds fail with duplicate friend declaration introduced
by https://codereview.chromium.org/1407383005

BUG=543655
TBR=vollick

Review URL: https://codereview.chromium.org/1515673004

Cr-Commit-Position: refs/heads/master@{#364328}
christiank
Allow one-copy and zero-copy task tile worker pools to use compressed textures.
BUG=434699
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1379783002

Cr-Commit-Position: refs/heads/master@{#364326}
philipj
Drop [LegacyInterfaceTypeChecking] for Selection.prototype.addRange
This already throws in Firefox and IE11 when the argument is null:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3781

DOMSelection::addRange is only called from generated bindings, so the
assert will hold.

BUG=561338

Review URL: https://codereview.chromium.org/1511913002

Cr-Commit-Position: refs/heads/master@{#364322}
philipj
Drop [LegacyInterfaceTypeChecking] for SpeechSynthesis.prototype.speak
This changes only the exception message. There are no internal calls to
SpeechSynthesis::speak, so the ASSERT(utterance) will hold.

BUG=561338

Review URL: https://codereview.chromium.org/1481163002

Cr-Commit-Position: refs/heads/master@{#364303}
sigbjornf
Safely finalize an AnimationTimeline's still-attached Animations.
R=haraken
BUG=568084

Review URL: https://codereview.chromium.org/1515573002

Cr-Commit-Position: refs/heads/master@{#364300}
fs
Refactor StringImpl::{start,end}sWith(StringImpl*, ...)
In preparation for ASCII case-insensitive matching in these two methods,
add a macro for handling the "dispatch" to the right method, and split
the single method into two in both instances. Make the argument to the
new methods as well as the methods themselves const.
Add equalSubstring{,IgnoringCase} helpers and use those to implement
both of the methods.

BUG=565878

Review URL: https://codereview.chromium.org/1511813004

Cr-Commit-Position: refs/heads/master@{#364243}
philipj
Import web-platform-tests@5dbe45af3ad3a933c03187c72f1c12cbe2877703
Using update-w3c-deps in Blink 2fdb258ddf7fa6834750711a10a01d26766b7d46.

Failing test expectations were added for two tests:

 * maxlength.html fails because the internal maxlength 524288 is exposed to
   scripts instead of -1.

 * document.getElementsByName-namespace-xhtml.xhtml fails because
   getElementsByName() tests all elements, while the spec says to only
   include HTML elements in the collection:
   https://html.spec.whatwg.org/multipage/dom.html#dom-document-getelementsbyname

R=tkent@chromium.org

Review URL: https://codereview.chromium.org/1515563002

Cr-Commit-Position: refs/heads/master@{#364149}
rune
Don't early return on SubtreeStyleChange for scheduling invalidations.
Sibling invalidation sets still need to be scheduled for elements with
SubtreeStyleChange when SubtreeStyleChange is for strict subtree.

R=dstockwell@chromium.org,ericwilligers@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1503993002

Cr-Commit-Position: refs/heads/master@{#364092}
davve
Split SVGStringList related measurements from SVG1DOM counter
Measure users of SVGStringList individually to see if the
SVGStringList and SVGTests interfaces can be removed or needs to stay.

BUG=415074

Review URL: https://codereview.chromium.org/1507613002

Cr-Commit-Position: refs/heads/master@{#364074}
rune
Remove clearing of pending invalidation sets.
In preparation for making SubtreeStyleChange not affect the sibling
forest.

We can skip scheduling descendant invalidation sets for elements whose
styleChangeType is SubtreeStyleChange. However, with sibling invalidation
sets, we still need to schedule invalidations for invalidating the
sibling forest when we change SubtreeStyleChange to be a strict subtree
recalc.

We may not clear pending invalidations on detach either, unless the node
was actually removed from the dom tree, since there might be pending
sibling invalidations.

R=dstockwell@chromium.org,ericwilligers@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1507653002

Cr-Commit-Position: refs/heads/master@{#364064}
bratell
[net] Make state table const to share between processes.
When studying the contents of the duplicated data between
processes I found the parser_state variable in http_server.cc.

It's only about 200 bytes but the fix is trivial (add a const).

The rest of the change is a git cl format net to make presubmit happy.

R=yhirano@chromium.org, mmenke@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1506893004

Cr-Commit-Position: refs/heads/master@{#364061}
mstensho
The column balancer should ignore things outside the bounds of the row.
The column balancer examines one row (fragmentainer group) at a time, and it
needs to ignore things that happen at hard or soft column breaks in other rows.
Do some flow thread coordinate bounds checking to avoid being affected by
pagination struts and hard breaks in other rows.

BUG=556481
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1501053002

Cr-Commit-Position: refs/heads/master@{#364040}
mstensho
Paginated containers are opaque to enclosing fragmentation contexts.
Only multicol containers may be fragmented by enclosing fragmentation contexts.
Unlike multicol containers, containers with overflow:paged-x or paged-y cannot
create additional fragmentainer groups for each outer column that it lives in.

Added a basic test for multicol inside paged overflow, since it was missing,
just to make sure that this CL doesn't break anything.

BUG=479074
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1503003002

Cr-Commit-Position: refs/heads/master@{#364036}
mateuszs
Fixed i-cursor height calculation.
In previous solution only AND part of cursor mask
was taken into account. Now both AND and XOR parts
are considered to properly determine bottom point
of cursor pointer.

BUG=446810

Review URL: https://codereview.chromium.org/1067163003

Cr-Commit-Position: refs/heads/master@{#364026}
sigbjornf
Oilpan: fix build after r363998.
The struct contains a raw pointer to an Oilpan heap object (Scrollbar*),
which is not allowed without either accounting for its safety (or
by having it be traced.)

But as the struct is unused, just remove it.

R=haraken
BUG=560418
NOTRY=true

Review URL: https://codereview.chromium.org/1515503002

Cr-Commit-Position: refs/heads/master@{#364015}
fs
Drop TextCaseSensitivity from {start,end}sWith(const char*, ...)
The only user that's uses case-insensitive matching is
localeIdMatchesLang(), which can get a helper of its own (broken out of
equalInner).
Also rearrange/rewrite localeIdMatchesLang() a bit to not compare the
language prefix again for each possible delimiter, and skip the "full"
comparison at the start (using a prefix match+length check instead.)
Also remove the templated StringImpl::{start,end}sWith.

BUG=565878

Review URL: https://codereview.chromium.org/1507763003

Cr-Commit-Position: refs/heads/master@{#364014}
sigbjornf
Reland of Fix several corner case issues of scrollbar paint invalidation (patchset #1 id:1 of https://codereview.chromium.org/1513573004/ )
Reason for revert:
Thanks for looking after the health of Oilpan builds. But as Oilpan is yet to be CQ-blocking, we don't want to be unnecessarily causing post-landing revert consternation & be in the way of overall progress.

Hence, I'm going to undo this revert & address the problem the Oilpan static checks are picking up on; it's a trivial one.

Original issue's description:
> Revert of Fix several corner case issues of scrollbar paint invalidation (patchset #7 id:120001 of https://codereview.chromium.org/1491193003/ )
>
> Reason for revert:
> I suspect this may have broken the Oilpan build:
>
> https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Mac%20Oilpan/builds/27442
>
> Original issue's description:
> > Fix several corner case issues of scrollbar paint invalidation
> >
> > - Invalidate composited scrollbars also during paint invalidation to
> >   avoid unnecessary invalidation on intermediate changes;
> >
> > - Invalidate also on the containing box for moved/resized composited
> >   non-overlay scrollbars. This ensures the expanded/shrunk areas of the
> >   box because of scrollbar existence/width change are invalidated. This
> >   is the root cause of bug 535161.
> >
> > - Avoid unnecessary invalidations on overlay scrollbar changes.
> >
> > BUG=535161,560418
> >
> > Committed: https://crrev.com/48e402acbebf2717b8e79b89dba5310d31bf95da
> > Cr-Commit-Position: refs/heads/master@{#363998}
>
> TBR=chrishtr@chromium.org,skobes@chromium.org,wangxianzhu@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=535161,560418
>
> Committed: https://crrev.com/ed0577e5a8952de3976d6b18fa0ed39fe2a0e418
> Cr-Commit-Position: refs/heads/master@{#364000}

TBR=chrishtr@chromium.org,skobes@chromium.org,wangxianzhu@chromium.org,dominicc@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=535161,560418

Review URL: https://codereview.chromium.org/1511143002

Cr-Commit-Position: refs/heads/master@{#364006}
sigbjornf
GC plugin: remove mixin trace override restriction.
The GC plugin currently insists that a class that is declared as a
mixin instance (i.e., uses USING_GARBAGE_COLLECTED_MIXIN()) must also
declare its own local trace implementation override.

This is an unnecessary restriction to impose:

 - if the class derives from one GarbageCollectedMixin<> instance,
   it will have its virtual trace method in scope.
 - if it inherits from multiple, ambiguity exists and the compiler
   will already complain.
 - if the class declares traceable members of its own, then not providing
   a trace implementation that correctly handles these members will
   be otherwise flagged as an error by the GC plugin.

Remove the static check from the plugin, along with adding a unit test
which verifies that the virtual trace is inherited as expected.

R=thakis,haraken
BUG=444565

Review URL: https://codereview.chromium.org/1504013004

Cr-Commit-Position: refs/heads/master@{#364001}
sigbjornf
Release Oilpan heap singletons prior to LSan leak detection.
Make Oilpan and LSan cooperate better. As Persistent<> references
created via DEFINE_STATIC_LOCAL() and similar will be reachable to
LSan's leak detection pass, the objects they refer to outside of
the Oilpan heap will be reported as leaking.

(This is in contrast to what happens in the non-Oilpan setting,
where the (leaked) pointer created via DEFINE_STATIC_LOCAL() is
stored in a local "static"; such non-global references are not
considered roots to LSan and hence the objects reachable from
those will not be reported as leaking.)

Address the problem on the Oilpan side by having such "static"
Persistent<>ly-held singletons be registered and tracked such
that we're able to release them all just before shutting down
and performing an extra round of GCs. Leaving a cleaner heap
for LSan to work over. And to report no leaks over, ideally.

As part of the changes needed to support this for Oilpan,
wtf/LeakAnnotations.h offerings has been renamed and changed
a bit:

 * WTF_ANNOTATE_MEMORY_LEAK_SCOPE => LEAK_SANITIZER_DISABLED_SCOPE.
   (but see LeakAnnotations.h for macro to use local to wtf/.)
 * WTF_ANNOTATE_IGNORE_OBJECT_PTR => LEAK_SANITIZER_IGNORE_OBJECT.
 * LEAK_SANITIZER_REGISTER_STATIC_LOCAL().

(Reland of r363780.)

R=haraken
BUG=567257

Committed: https://crrev.com/6918d00fae1ab739f89393378fa4adddabacafd2
Cr-Commit-Position: refs/heads/master@{#363780}

Review URL: https://codereview.chromium.org/1491253004

Cr-Commit-Position: refs/heads/master@{#363994}
mostynb
don't rely on -Wno-narrowing in skcanvas_video_renderer.cc
Review URL: https://codereview.chromium.org/1504673003

Cr-Commit-Position: refs/heads/master@{#363947}
philipj
Remove unused [RaisesException] for createNodeIterator() and createTreeWalker()
While in the area, also assert that the root argument is not null, which
is guaranteed since https://codereview.chromium.org/360463005

The FIXME is removed because the whatToShow default value is 0xFFFFFFFF,
so any such warning would trigger by default.

R=haraken@chromium.org

Review URL: https://codereview.chromium.org/1510753004

Cr-Commit-Position: refs/heads/master@{#363850}
mstensho
Add support for printing multicol containers, and enable it.
Introduce an abstract class FragmentationContext, which is either implemented
by LayoutMultiColumnFlowThread for multicol, or by the new
ViewFragmentationContext class, which is attached to a LayoutView when
printing. This way it will act as an enclosing fragmentation context for a
multicol container in the document. This is similar to how an outer multicol
container acts as an enclosing fragmentation context for an inner multicol
container.

The multicol flow thread implementation will now obtain and use a
FragmentationContext when attempting to locate its enclosing fragmentation
context, rather than only looking for another flowthread up there (and assume
that it's not nested if none was found). A big part of this CL is to teach the
multicol implementation about this, which means that there are quite a few
mechanical changes from enclosingFlowThread() (and LayoutMultiColumnFlowThread
method calls) to enclosingFragmentationContext() (and FragmentationContext
method calls).

Replaced an old printing test that tested that multicol didn't work, with one
that tests that multicol does work. :)

Also added another test that splits a multicol container over two pages.

BUG=99358
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1492143002

Cr-Commit-Position: refs/heads/master@{#363838}
davve
Remove special handling of xpointer( as fragment url
Unless we're implementing xpointer( real soon now, we might as well be
honest about not supporting it.

BUG=567693

Review URL: https://codereview.chromium.org/1504333002

Cr-Commit-Position: refs/heads/master@{#363787}
sigbjornf
Release Oilpan heap singletons prior to LSan leak detection.
Make Oilpan and LSan cooperate better. As Persistent<> references
created via DEFINE_STATIC_LOCAL() and similar will be reachable to
LSan's leak detection pass, the objects they refer to outside of
the Oilpan heap will be reported as leaking.

(This is in contrast to what happens in the non-Oilpan setting,
where the (leaked) pointer created via DEFINE_STATIC_LOCAL() is
stored in a local "static"; such non-global references are not
considered roots to LSan and hence the objects reachable from
those will not be reported as leaking.)

Address the problem on the Oilpan side by having such "static"
Persistent<>ly-held singletons be registered and tracked such
that we're able to release them all just before shutting down
and performing an extra round of GCs. Leaving a cleaner heap
for LSan to work over. And to report no leaks over, ideally.

As part of the changes needed to support this for Oilpan,
wtf/LeakAnnotations.h offerings has been renamed and changed
a bit:

 * WTF_ANNOTATE_MEMORY_LEAK_SCOPE => LEAK_SANITIZER_DISABLED_SCOPE.
   (but see LeakAnnotations.h for macro to use local to wtf/.)
 * WTF_ANNOTATE_IGNORE_OBJECT_PTR => LEAK_SANITIZER_IGNORE_OBJECT.
 * LEAK_SANITIZER_REGISTER_STATIC_LOCAL().

R=haraken
BUG=567257

Review URL: https://codereview.chromium.org/1491253004

Cr-Commit-Position: refs/heads/master@{#363780}
sigbjornf
Oilpan: fix build after r363737.
Leave CompositorProxiedPropertySet off the Oilpan heap for now.

R=haraken
BUG=430155
NOTRY=true

Review URL: https://codereview.chromium.org/1512473002

Cr-Commit-Position: refs/heads/master@{#363762}
fs
Avoid race-warning for access to animatableAttributes
Collecting debug data during a commit in CC can land us in this method
while not running in the main thread  (although it'll be blocked).
Since this is assert-only code, switch to a thread-safe initializer to
avoid triggering this warning. Hopefully this doesn't slow things down
to badly on bots.

BUG=545972

Review URL: https://codereview.chromium.org/1487813002

Cr-Commit-Position: refs/heads/master@{#363687}
sigbjornf
Release Oilpan heap singletons prior to LSan leak detection.
Make Oilpan and LSan cooperate better. As Persistent<> references
created via DEFINE_STATIC_LOCAL() and similar will be reachable to
LSan's leak detection pass, the objects they refer to outside of
the Oilpan heap will be reported as leaking.

(This is in contrast to what happens in the non-Oilpan setting,
where the (leaked) pointer created via DEFINE_STATIC_LOCAL() is
stored in a local "static"; such non-global references are not
considered roots to LSan and hence the objects reachable from
those will not be reported as leaking.)

Address the problem on the Oilpan side by having such "static"
Persistent<>ly-held singletons be registered and tracked such
that we're able to release them all just before shutting down
and performing an extra round of GCs. Leaving a cleaner heap
for LSan to work over. And to report no leaks over, ideally.

As part of the changes needed to support this for Oilpan,
wtf/LeakAnnotations.h offerings has been renamed and changed
a bit:

 * WTF_ANNOTATE_MEMORY_LEAK_SCOPE => LEAK_SANITIZER_DISABLED_SCOPE.
   (but see LeakAnnotations.h for macro to use local to wtf/.)
 * WTF_ANNOTATE_IGNORE_OBJECT_PTR => LEAK_SANITIZER_IGNORE_OBJECT.
 * LEAK_SANITIZER_REGISTER_STATIC_LOCAL().

R=haraken
BUG=567257

Review URL: https://codereview.chromium.org/1491253004

Cr-Commit-Position: refs/heads/master@{#363591}
davve
Disallow [Measure] and [MeasureAs] on interfaces without a constructor
For the instances where MeasureAs was specified on interfaces without
a constructor, simply remove the MeasureAs. Since they can't be
created by script, it seems more worthwhile want to measure where
these object are returned rather than the use of the interfaces
themselves.

The only change in generated code will be less includes of
core/frame/UseCounter.h, as can be seen in the binding testsuite
update.

BUG=415074, 567015

Review URL: https://codereview.chromium.org/1509493002

Cr-Commit-Position: refs/heads/master@{#363503}
sigbjornf
Oilpan: remove unnecessary MultisamplingChangedObserver unregistration.
As the Page keeps weak references to its MultisamplingChangedObservers,
there is no need to explicitly unregister upon finalization of
WebGLRenderingContextBase. It will already have been removed by
weak processing.

That unregistration step was made safe by virtue of the context object
being eagerly finalized.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1508673002

Cr-Commit-Position: refs/heads/master@{#363489}
davve
Teach SVGImageForContainer::imageForCurrentFrame about the URL
Pass URL from SVGImageForContainer to SVGImage when fetching an
snapshot for current frame.

BUG=565282

Review URL: https://codereview.chromium.org/1498683003

Cr-Commit-Position: refs/heads/master@{#363466}
philipj
Drop [LegacyInterfaceTypeChecking] for the Presentation API
The change to the send() methods are unobservable, because the added
TypeError exceptions in the generated code are unreachable, as type
testing is first used to pick which send() to dispatch to.

The change to defaultRequest is observable, in that something like
`presentation.defaultRequest = {}` will now throw TypeError instead of
setting defaultRequest to null. Since this is a very new API, this is
very unlikely to be a problem.

BUG=561338

Review URL: https://codereview.chromium.org/1484463003

Cr-Commit-Position: refs/heads/master@{#363464}
sigbjornf
Improve ScriptForbiddenScope handling in cross-threaded code.
For code that is used by multiple threads, we currently have to resort
to explicit main thread checks and manually adjust script forbidden
counts depending. Introduce ScriptForbiddenIfMainThreadScope that
reliably takes care of the details instead, entering&leaving a script
forbidden scope iff on the main thread.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1502093002

Cr-Commit-Position: refs/heads/master@{#363454}
davve
Remove redundant code from v8_interface.py
The 'UseCounter.h' include is added when needed by deprecate_as and
measure_as methods.

BUG=567015

Review URL: https://codereview.chromium.org/1500423002

Cr-Commit-Position: refs/heads/master@{#363449}
davve
Drop Image::setContainerSize()
Prior to this patch, the only user of Image::setContainerSize() was
HTMLImageElement::getSourceImageForCanvas().

SVGImage, one the relevant kinds of image that return true for
Image::usesContainerSize(), is a shared resource between all places in
the document pointing to the same SVG image. Each time a SVGImage is
drawn, the container size it is drawn relative to is saved. This may
cause subsequent paints of the same SVGImage to re-use the old
container size unless a new one is provided.

The old code addressed just that. When it detected that there was no
layout object attached, it overwrote the old container size with the
size of the image itself, to avoid reusing an old container size.

The new code uses the SVGImageForContainer wrapper to insert the image
size as container size. This closes the loop for using _any_ container
size at all from the Image element. It seems unreasonable that the
layout'ed size should have anything to do with what's drawn to the
canvas anyway.

GeneratedImage had a setContainerSize() implementation too, which is
removed in this patch. It's suspected that this implementation was
unused since a generated image can't be set on a HTMLImageElement
directly.

BUG=563923

Review URL: https://codereview.chromium.org/1489003002

Cr-Commit-Position: refs/heads/master@{#363437}
sigbjornf
Simplify prefinalizer processing.
The processing can be performed in one pass.

R=haraken
BUG=420515
NOTRY=true

Review URL: https://codereview.chromium.org/1507483002

Cr-Commit-Position: refs/heads/master@{#363426}
philipj
Add use counters for NodeFilter being a function or an object
NodeFilter is a callback interface in the spec, but a plain interface in
Blink. It's the only callback interface that also has attributes, so
that there must be a NodeFilter attribute on the global object. In order
to make NodeFilter a callback interface per spec, the bindings generator
would need new code to generate that object.

If it's possible to make the createNodeIterator() and createTreeWalker()
filter arguments callback functions instead of callback interfaces, it
looks like this could all be simplified significantly. NodeFilter would
then remain as a plain interface with only the const attributes.

There is also a minor incompatiblity with Gecko related to NodeFilter.
Blink always wraps the function or object inside a new object which is
instanceof NodeFilter, and NodeIterator.prototype.filter returns this
object. Gecko, on the other hand, returns the same object thas was
passed in to createNodeIterator(), and instanceof NodeFilter throws a
TypeError.

BUG=462946

Review URL: https://codereview.chromium.org/1493023004

Cr-Commit-Position: refs/heads/master@{#363366}
philipj
Drop [LegacyInterfaceTypeChecking] for the Web Audio API
This aligns Web Audio with what WebIDL requires given the IDL it uses.

The risk of these changes is bounded by these use counters:

AnalyserNode ~0.01%:
https://www.chromestatus.com/metrics/feature/timeline/popularity/631

BiquadFilterNode ~0.001%:
https://www.chromestatus.com/metrics/feature/timeline/popularity/632

ConvolverNode ~0.0001%:
https://www.chromestatus.com/metrics/feature/timeline/popularity/636

OscillatorNode ~0.001%:
https://www.chromestatus.com/metrics/feature/timeline/popularity/643

WaveShaperNode <0.0001%:
https://www.chromestatus.com/metrics/feature/timeline/popularity/648

AudioParam.prototype.setValueCurveAtTime <0.0001%:
https://www.chromestatus.com/metrics/feature/timeline/popularity/913

With such lower usage, fixing corner cases like this is unlikely to
cause any trouble. Usage of AudioContext itself is at most ~0.2%, but
that counter is not for the constructor but merely access to
window.AudioContext, and thus not a good indicator of real usage:
https://www.chromestatus.com/metrics/feature/timeline/popularity/652

BUG=561338

Review URL: https://codereview.chromium.org/1493753003

Cr-Commit-Position: refs/heads/master@{#363297}
rune
Renamed authorStyleSheets to injectedAuthorStyleSheets.
The naming in StyleEngine was too general to grasp which stylesheets these
actually were. They are stylesheets injected through
WebDocument::insertStyleSheet which are injected by extensions afaict.

R=jochen@chromium.org

Review URL: https://codereview.chromium.org/1493323002

Cr-Commit-Position: refs/heads/master@{#363219}
sigbjornf
Prevent reported RenderViewImplTest LSan leaks.
Add missing calls to ProcessPendingMessages() to a pair of
RenderViewImplTest unit tests. Not doing so would, with Oilpan enabled,
flakily hold on to the entire view of the test and report it as leaking
with LSan.

R=jochen
BUG=

Review URL: https://codereview.chromium.org/1495923002

Cr-Commit-Position: refs/heads/master@{#363196}
tmoniuszko
Adjust text fade width and alpha
Slightly increase fade gradient width.

Use 0 target alpha for wide texts. Linearly increase alpha for narrower
texts.

BUG=563390

Review URL: https://codereview.chromium.org/1493713002

Cr-Commit-Position: refs/heads/master@{#363188}
rune
Call pseudoStateChangedForElement from Element::pseudoStateChanged only.
There were a few places where StyleEngine::pseudoStateChangedForElement
was called directly instead of via Element::pseudoStateChanged. Changed
to have consistently common code paths.

Review URL: https://codereview.chromium.org/1491183007

Cr-Commit-Position: refs/heads/master@{#363177}
wdzierzanowski
Revert "Fix race on demuxer memory usage. Reuse previous calculation."
This reverts commit 9ac642d1d2ed95b810ff276fb65c2be7b461e791.

Now that Demuxer::GetMemoryUsage() runs on the media thread
(fd4cd91c5eea8b3a4970f5512a306e4a03e33101), the reason for the race is
removed and so the synchronization in FFmpegDemuxer can be removed too.

BUG=564034
TEST=Crash page from https://crbug.com/447898 still doesn't crash

Review URL: https://codereview.chromium.org/1494113002

Cr-Commit-Position: refs/heads/master@{#363173}
mstensho
Support enclosing fragmentainer breaks inside spanners.
A column-span:all object in a nested multicol container is part of one or more
columns in the outer multicol container, so we need to allow it to be
paginated. In order to paginate it correctly, we also need to set its correct
logical top before laying it out, or we'd risk inserting pagination struts at
the wrong places.

BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1492993002

Cr-Commit-Position: refs/heads/master@{#363160}
philipj
Make ConvolverNode.buffer and WaveShaperNode.curve nullable
These are nullable in the spec:
https://webaudio.github.io/web-audio-api/#ConvolverNode
https://webaudio.github.io/web-audio-api/#WaveShaperNode

Because of [LegacyInterfaceTypeChecking], this does not change the
generated code at all, and is therefore not testable. However, it will
result in the correct behavior once [LegacyInterfaceTypeChecking] is
removed, to be done separately.

BUG=561338

Review URL: https://codereview.chromium.org/1497823003

Cr-Commit-Position: refs/heads/master@{#363159}
sigbjornf
Explicitly detach remote window from its frame.
See RemoteFrame::setView() comment explaining why this is needed
over RemoteFrames.

R=haraken,dcheng
BUG=

Review URL: https://codereview.chromium.org/1487253006

Cr-Commit-Position: refs/heads/master@{#363150}
philipj
Drop [LegacyInterfaceTypeChecking] for URL.createObjectURL(blob)
The change to the generated code is such that only calls to
URL.createObjectURL(null) and URL.createObjectURL(undefined) are
affected, as those would previously match the nullable Blob argument.

This is very low risk, due to the behavior of other browsers:

Firefox and IE11 throw for both URL.createObjectURL(null) and
URL.createObjectURL(undefined). Edge presumably matches IE11.

Safari throws for URL.createObjectURL(undefined) but returns null for
URL.createObjectURL(null), which was our behavior before this change.

There are no internal calls to DOMURL::createObjectURL, so the ASSERT
will hold.

BUG=561338

Review URL: https://codereview.chromium.org/1492093002

Cr-Commit-Position: refs/heads/master@{#363031}
philipj
Sync the Storage API with the spec
https://html.spec.whatwg.org/multipage/webstorage.html

The only change to the generated code is the data->value rename.

BUG=460722
R=jsbell@chromium.org

Review URL: https://codereview.chromium.org/1498823002

Cr-Commit-Position: refs/heads/master@{#362999}
sigbjornf
Oilpan: add missing pointer initialization following r362974.
TBR=oilpan-reviews
BUG=499780
NOTRY=true

Review URL: https://codereview.chromium.org/1494563005

Cr-Commit-Position: refs/heads/master@{#362989}
davve
Drop dead code path in SVGImage
The SVGImage class is marked final and SVGImage::usesContainerSize()
returns true.  This means setContainerSize should never have to bail
out early over not using container size.

Review URL: https://codereview.chromium.org/1500573003

Cr-Commit-Position: refs/heads/master@{#362984}
rune
Remove unused activeAuthorStyleSheets method.
R=mstensho@opera.com

Review URL: https://codereview.chromium.org/1498593004

Cr-Commit-Position: refs/heads/master@{#362959}
sigbjornf
Oilpan: no destructor needed for CSSPrimitiveValue.
Any unregistration is (already) taken care of by Oilpan.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1485353006

Cr-Commit-Position: refs/heads/master@{#362931}
wdzierzanowski
Run Demuxer::GetMemoryUsage() on media thread
Split the memory usage reporting in WebMediaPlayerImpl into two steps so
that |demuxer_| can be accessed on the media thread only.

This change makes no practical difference for ChunkDemuxer ATM, which
uses locks extensively anyway.  But it does make a difference for
FFmpegDemuxer (as evidenced by
https://codereview.chromium.org/1419753007 -- can be reverted now).
Also, other Chromium-based products are better off if Demuxer
implementations are not forced to worry about synchronization
themselves.

BUG=564034
TEST=Crash page from 447898 still doesn't crash

Review URL: https://codereview.chromium.org/1480213005

Cr-Commit-Position: refs/heads/master@{#362821}
fs
Robustify state-transitions in HTMLMediaElement::startDeferredLoad
A preload=none load() followed by setting preload != none would try to
transition to ExecuteOnStopDelayingLoadEventTask while in that state
already.

BUG=562535

Review URL: https://codereview.chromium.org/1495533002

Cr-Commit-Position: refs/heads/master@{#362735}
philipj
Drop [LegacyInterfaceTypeChecking] for most init*Event() methods
This will only affect cases where the argument provided but is neither null nor
an object of the required type. The main risk is therefore that people have
passed shifted all the arguments by accident, so that a boolean, string or
number is passed for one of the affected arguments.

Cases where undefined is passed or the argument is omitted entirely are not
affected, they behave just as if null were passed.

Also drop the *Arg suffix in arguments for initTextEvent().

BUG=561338

Review URL: https://codereview.chromium.org/1485833004

Cr-Commit-Position: refs/heads/master@{#362727}
philipj
Drop [LegacyInterfaceTypeChecking] for HTMLTableElement
Although the behavior when setting caption/tHead/tFoot to null is still
not per spec, it's still nice to get the correct exception message when
passing some non-null value of the wrong type.

BUG=561338

Review URL: https://codereview.chromium.org/1493673002

Cr-Commit-Position: refs/heads/master@{#362700}
philipj
Drop [LegacyInterfaceTypeChecking] for HTMLInputElement.prototype.files
The setter is non-standard, but if it is standardized it wouldn't make
sense to have the existing behavior. For any case that this starts
throwing there's a programming error, so unless it breaks the web it
should throw TypeError.

BUG=561338

Review URL: https://codereview.chromium.org/1492523003

Cr-Commit-Position: refs/heads/master@{#362689}
tmoniuszko
Fix path_parser dependency on policy component
BUG=

Review URL: https://codereview.chromium.org/1133853005

Cr-Commit-Position: refs/heads/master@{#362684}
fs
Use SVGLength's wrapped CSSPrimitiveValue for pres.attr. style
Since SVGLength now wraps a CSSPrimitiveValue, there's no need to create
a (potentially new) CSSPrimitiveValue when collecting presentation
attribute style for SVG elements. Could save an allocation in some
cases.
Gets rid of the addSVGLengthPropertyToPresentationAttributeStyle helper
on SVGElement.

Review URL: https://codereview.chromium.org/1481123002

Cr-Commit-Position: refs/heads/master@{#362680}
rune
Use invalidation sets for :lang changes.
Modifying lang or xml:lang attributes caused a LocalStyleChange for the
corresponding element in the presentational attribute check, but other
elements may be affected using selector combinators.

Use invalidation sets like we do for other pseudo classes.

BUG=564331

Review URL: https://codereview.chromium.org/1485363002

Cr-Commit-Position: refs/heads/master@{#362675}
philipj
Sync the HTMLTableElement return types with the spec
https://html.spec.whatwg.org/#the-table-element

Changed in https://github.com/whatwg/html/pull/363

BUG=460722

Review URL: https://codereview.chromium.org/1486843002

Cr-Commit-Position: refs/heads/master@{#362665}
mstensho
It's not just the last column set that may need additional fragmentainer groups.
appendNewFragmentainerGroupIfNeeded() assumed that we were always dealing with
the last column set, but we need to use the column set that contains the
specified flow thread block offset. Moved hasFragmentainerGroupForColumnAt()
from LayoutMultiColumnFlowThread to LayoutMultiColumnSet and simplified the
code somewhat.

BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1487083003

Cr-Commit-Position: refs/heads/master@{#362604}
davve
Split text related measurements from SVG1DOM counter
Create a SVG1DOMText UseCounter to measure all text related SVG DOM
functionality. The assumption we want to test is that the text related
SVG DOM has really low usage.

BUG=415074

Review URL: https://codereview.chromium.org/1491573002

Cr-Commit-Position: refs/heads/master@{#362543}
mstensho
column-span:all in nested multicol requires re-insertion of fragmentainer groups.
A column set that follows a spanner will typically have an incorrect logical
top in the first layout pass (because the spanner hasn't been laid out yet). We
already have code in place to make sure that we re-lay out when we need to, but
we also need to delete and re-insert fragmentainer groups when this happens in
a nested fragmentation context.

If a column set gets a new logical top, it means that previously inserted
fragmentainer groups are now out of sync with reality, and have to be
re-inserted.

Remove the BalancedColumnHeightCalculation enum. There's no need for it
anymore, since picking calculation mode is now something we need to do for each
individual column set. m_tallestUnbreakableLogicalHeight is now reset in
resetColumnHeight() (that's where it ought to have been all along, anyway).

BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1489663003

Cr-Commit-Position: refs/heads/master@{#362492}
philipj
Drop [LegacyInterfaceTypeChecking] for PagePopupController
This is an internal API, used only by web/resources/listPicker.js,
where document is passed as an argument, which is not null.

BUG=561338

Review URL: https://codereview.chromium.org/1485123002

Cr-Commit-Position: refs/heads/master@{#362479}
philipj
Make init*Event() arguments nullable where appropriate
Because these methods have [LegacyInterfaceTypeChecking], this does not
change the generated code, but it will limit the impact of dropping
[LegacyInterfaceTypeChecking].

Only initKeyboardEvent() appears to have a spec:
https://w3c.github.io/uievents/#idl-interface-KeyboardEvent-initializers

For the others, the nullability matches that of the *Event member.

BUG=561338
R=rbyers@chromium.org

Review URL: https://codereview.chromium.org/1488803002

Cr-Commit-Position: refs/heads/master@{#362470}
wdzierzanowski
Allow multiple OnMoreData() calls in WASAPIAudioOutputStreamTest.ValidPacketSize
Follow up on https://codereview.chromium.org/1318933003/ and allow
OnMoreData() to be called more than once in the test.

BUG=524947
TEST=WASAPIAudioOutputStreamTest.ValidPacketSize passes

Review URL: https://codereview.chromium.org/1487733003

Cr-Commit-Position: refs/heads/master@{#362439}
rune
Invalidate visited state changes for svg links.
SVGAElement only caused :link/:visited recalcs when it became a link or
stopped being so. Now recalculate style whenever href changes in case the
:visited/:link state changes. Also use style invalidation instead of
SubtreeStyleChange, as the latter entails sibling forest recalc in case
we have adjacent combinators.

R=fs@opera.com
BUG=563485,557440

Review URL: https://codereview.chromium.org/1484083005

Cr-Commit-Position: refs/heads/master@{#362425}
philipj
Drop [LegacyInterfaceTypeChecking] for the MIDI API
The added exception in the generated code is unreachable and thus
untestable, because there are two send() methods and the one changed
is only taken if the argument is of the correct type.

There are no internal calls where data could be null.

BUG=561338

Review URL: https://codereview.chromium.org/1485443002

Cr-Commit-Position: refs/heads/master@{#362392}
tmoniuszko
Fix resource-related issues in views_unittests
Make sure ui_test.pak file is available for views_unittests.

Also make views_unittests independent from chrome locale pak files by replacing l10n_util::GetApplicationLocale() with base::i18n::GetConfiguredLocale() for tests. The first function needs chrome locale pak files to exist or it returns empty locale string.

BUG=

TEST=Remove all output files. Build only views_unittests. Run views_unittests.

Review URL: https://codereview.chromium.org/1464503002

Cr-Commit-Position: refs/heads/master@{#362370}
sigbjornf
Oilpan: fix build after r362358.
HashSet<String> is not an Oilpan heap object collection, hence no tracing
needed.

TBR=oilpan-reviews
BUG=447083
NOTRY=true

Review URL: https://codereview.chromium.org/1486883003

Cr-Commit-Position: refs/heads/master@{#362366}
davve
Less type conversion for NinePieceImage painting
Avoid float -> int -> float conversion when passing through the
GraphicsContext layer, the ints are immediately converted back to
floats anyway in GraphicsContext::drawTiledImage().

No functional change expected as along as the position of the
NinePieceGrid is pixel-aligned, but bug is 66498 moving along and will
enable sub-pixel positioning of the background image geometries.

BUG=561519

Review URL: https://codereview.chromium.org/1478283002

Cr-Commit-Position: refs/heads/master@{#362350}
philipj
Drop [LegacyInterfaceTypeChecking] where trivial in Web Audio
Also drop redundant [RaisesException] in a few places.

BUG=561338

Review URL: https://codereview.chromium.org/1481793002

Cr-Commit-Position: refs/heads/master@{#362282}
philipj
Drop [LegacyInterfaceTypeChecking] for the Crypto API
BUG=561338

Review URL: https://codereview.chromium.org/1480063002

Cr-Commit-Position: refs/heads/master@{#362247}
philipj
Import web-platform-tests@7dda9a13574b33d55a73e995e3d1f1fbd4da0f2b
Using update-w3c-deps in Blink 2599bb8937ac95bf0f447960b4e61464aa640e49.

R=dpranke@chromium.org

Review URL: https://codereview.chromium.org/1483983003

Cr-Commit-Position: refs/heads/master@{#362222}
philipj
Drop [LegacyInterfaceTypeChecking] for EventTarget's dispatchEvent()
This changes the exception for InvalidStateError to TypeError, which is
per spec and what Gecko does. IE and Safari throw a generic Error.

BUG=561338

Review URL: https://codereview.chromium.org/1479063003

Cr-Commit-Position: refs/heads/master@{#362153}
rune
Use LocalStyleChange for element cursor changes in SVG.
Propagating the change to the computed cursor property value through
inheritance is handled correctly when using LocalStyleChange. No need to
force a recalc of the whole subtree.

This is part of making sure non of our SubtreeStyleChanges rely on sibling
tree invalidations, and removing unnecessary use of SubtreeStyleChange, so
that we can make SubtreeStyleChange mean subtree only, and not have to
consider the sibling forest.

R=fs@opera.com
BUG=557440

Review URL: https://codereview.chromium.org/1488603002

Cr-Commit-Position: refs/heads/master@{#362140}
sigbjornf
Oilpan: improve adopt{Ref,Ptr}WillBeNoop(T*) static asserts.
R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1487603002

Cr-Commit-Position: refs/heads/master@{#362138}
philipj
Drop the [Immutable] IDL extended attribute (it is a no-op)
It was only used for WebKitCSSMatrix, and the proposed spec for that
does not use [Immutable]:
https://compat.spec.whatwg.org/#webkitcssmatrix-interface

Review URL: https://codereview.chromium.org/1485643002

Cr-Commit-Position: refs/heads/master@{#362137}
sigbjornf
GC plugin: have -Werror issue errors for inputs having only warnings.
If a translation unit contains only warnings, the GC plugin will issue
a warning diagnostic along with details/notes of the warnings encountered.

Have that warning be under the control of -Werror; the reason for not
having it as such up until now is that warnings have been far too plentiful
for the Blink codebase. This is no longer the case.

R=haraken,yutak,thakis
BUG=

Review URL: https://codereview.chromium.org/1481523005

Cr-Commit-Position: refs/heads/master@{#362128}
davve
Drop dependency on LayoutObject in fetch/
Move out code from ImageResource depending on LayoutObject. Instead
request pre-caching explictly at the three places that currently has
reason for doing so.

The pre-caching itself is moved to BitmapImage and made part of
Image::currentFrameKnownToBeOpaque as a special metadata mode.

BUG=559131

Review URL: https://codereview.chromium.org/1482953002

Cr-Commit-Position: refs/heads/master@{#362127}
sigbjornf
DocumentMarkerControllerTest: drop unnecessary caching of Document reference.
Tidying; no need to use a strong reference to the page's document here.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1488543002

Cr-Commit-Position: refs/heads/master@{#362125}
philipj
Drop [LegacyInterfaceTypeChecking] where trivial in core/
These are cases where passing null to the implementation would already
throw an exception, and so letting the bindings code do it is cleaner.
In a few cases this means that the implementation no longer throws any
exceptions.

For each method affected, it was verified using cs.chromium.org that
there are no internal calls where nullptr could be passed, the only
calls are from bindings.

BUG=561338

Review URL: https://codereview.chromium.org/1481983002

Cr-Commit-Position: refs/heads/master@{#362117}
sigbjornf
Oilpan: fix build after r362110.
TBR=oilpan-reviews
BUG=562986
NOTRY=true

Review URL: https://codereview.chromium.org/1480303003

Cr-Commit-Position: refs/heads/master@{#362113}
sigbjornf
Revert of "[sql] Remove part of WebDatabase SQLite patch." (patchset #1 of https://codereview.chromium.org/1473963002 )
Reason for revert:

Unfortunately, this seems to have introduced flaky shutdown crashes on storage/websql/open-database-creation-callback.html across bots,

 http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=storage%2Fwebsql%2Fopen-database-creation-callback.html

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Trusty/builds/5769

Original issue's description:
> [sql] Remove part of WebDatabase SQLite patch.
>
> findReusableFd() calls stat() on the filename to determine the inode
> and device to figure out if a previously-closed file descriptor can be
> reused.  Since WebDatabase file names are resolved by the browser,
> this stat() can never succeed in the renderer, thus there is no point
> to calling the function.
>
> This SQLite code path is an optimization to reduce close/open churn,
> it is not necessary for correct operation.
>
> BUG=none
>
> Review URL: https://codereview.chromium.org/1473963002
> Cr-Commit-Position: refs/heads/master@{#361825}

TBR=shess@chromium.org,michaeln@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1485603003

Cr-Commit-Position: refs/heads/master@{#362112}
sigbjornf
Oilpan: initialize stack allocated raw pointers following r362079.
TBR=oilpan-reviews
BUG=499780
NOTRY=true

Review URL: https://codereview.chromium.org/1481423002

Cr-Commit-Position: refs/heads/master@{#362109}
davve
Split shape related measurements from SVG1DOM counter
Create a SVG1DOMShapes UseCounter to measure all shape/graphics
element related SVG DOM functionality. The assumption we want to test
is that the shape related SVG DOM has really low usage.

BUG=415074

Review URL: https://codereview.chromium.org/1479863003

Cr-Commit-Position: refs/heads/master@{#362107}
rune
No need for SubtreeStyleChange for results attribute change.
The results attribute change causes appearance changes when changing
between negative and non-negative values. That is currently handled by a
lazyReattachIfAttached. The following SubtreeStyleChange should not have
an effect in that case.

The reattach condition was changed to not include the change between
different negative values.

R=tkent@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1483543003

Cr-Commit-Position: refs/heads/master@{#362077}
rune
Removed unnecessary SubtreeStyleChange for incrementalAttr.
Changing the incremental attribute on input type=search does not affect
style unless there are attribute selectors for it which will be handled
other places.

R=tkent@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1478953004

Cr-Commit-Position: refs/heads/master@{#362076}
sigbjornf
Remove mojo unit tests from WebKit Linux Oilpan bot
No need to test these for the time being.

BUG=
TBR=haraken
NOTRY=true

Review URL: https://codereview.chromium.org/1481323002

Cr-Commit-Position: refs/heads/master@{#362068}
sigbjornf
Remove window_manager_unittests from WebKit Linux Oilpan bot
Another unknown.

BUG=
TBR=haraken
NOTRY=true

Review URL: https://codereview.chromium.org/1481293002

Cr-Commit-Position: refs/heads/master@{#362058}
sigbjornf
Remove unknown unit tests targets from WebKit Linux Oilpan bot
Follow up on r362053 and remove some other unknown unittests targets
for this bot.

BUG=
TBR=haraken
NOTRY=true

Review URL: https://codereview.chromium.org/1474413002

Cr-Commit-Position: refs/heads/master@{#362056}
philipj
Drop [LegacyInterfaceTypeChecking] where trivial in WebRTC
The extra type checking in the bindings of the MediaStream constructor
and RTCDataChannel's send() methods is actually not observable, because
there is type testing to determine which override to use that makes sure
those code paths aren't reached if the types aren't correct.

For each method affected, it was verified using cs.chromium.org that
there are no internal calls where nullptr could be passed, the only
calls were from bindings an unit tests.

BUG=561338

Review URL: https://codereview.chromium.org/1480953002

Cr-Commit-Position: refs/heads/master@{#362024}
philipj
Drop [LegacyInterfaceTypeChecking] for APIs that are not enabled by default
These are all on interfaces or members that are [RuntimeEnabled=*] for
a feature that is status=experimental or status=test.

An existing contextMenu test was updated, but for the other APIs there
was no test coverage, and it would be overkill to test that the bindings
generator is working for every new feature going forward.

BUG=561338

Review URL: https://codereview.chromium.org/1476153002

Cr-Commit-Position: refs/heads/master@{#362005}
davve
Count usage of #svgView(...) and plain SVG <view> targets
BUG=562099

Review URL: https://codereview.chromium.org/1471963007

Cr-Commit-Position: refs/heads/master@{#361993}
davve
Clean up border-image-style-none.html layout test
BUG=356802

Review URL: https://codereview.chromium.org/1476423002

Cr-Commit-Position: refs/heads/master@{#361991}
fs
Drop PathParsingMode argument to buildStringFromByteStream
Just always produce a String with whatever format the input is.

Also cleanup some related code, and expose SVGPath from SVGPathElement
rather than the SVGPathByteStream.

BUG=467592

Review URL: https://codereview.chromium.org/1476283002

Cr-Commit-Position: refs/heads/master@{#361988}
davve
Add render-side manager for MediaSession
RendererMediaSessionManager is responsible for storing all
user-created media sessions and keeping track for id allocation for
those.

BUG=497735

Review URL: https://codereview.chromium.org/1436243002

Cr-Commit-Position: refs/heads/master@{#361973}
davve
Split paint server related measurements from SVG1DOM counter
Create a SVG1DOMPaintServer UseCounter to measure all paint server
related SVG DOM functionality. The assumption we want to test is that
the paint server related SVG DOM has really low usage.

BUG=415074

Review URL: https://codereview.chromium.org/1476093004

Cr-Commit-Position: refs/heads/master@{#361963}
philipj
Add a use counter for Attr.prototype.cloneNode()
This is being measured as requested in a spec discussion:
https://github.com/whatwg/dom/issues/102#issuecomment-158833267

To avoid making a observable change to Attr.prototype, measure this
internally. This risks including internal uses, but there appear to be
none. All calls were checked and they seem to be for either parent or
child nodes of some kind, and Attr cannot be a parent or child.

Also, a deprecation message was added to see if it would be triggered
unexpectedly on any tests, but it was only emitted for tests that
actually clone attributes, as expected.

Drive-by: Drop an unused ShadowRoot::cloneNode() that was missed in
https://codereview.chromium.org/1482433003

BUG=305105

Review URL: https://codereview.chromium.org/1474083002

Cr-Commit-Position: refs/heads/master@{#361932}
fs
XP baselines refresh after crrev.com/361886
Did not quite pick everything up on the first attempt.

TBR=fmalita@chromium.org
NOTRY=true
BUG=467592

Review URL: https://codereview.chromium.org/1480923002

Cr-Commit-Position: refs/heads/master@{#361893}
davve
Rename imageSizeForLayoutObject() to imageSize()
No need to pass the layout object anymore. It only uses the layout
object for knowing whether to respect image orientation or not. We
might as well pass that explicitly.

BUG=559131

Review URL: https://codereview.chromium.org/1468023002

Cr-Commit-Position: refs/heads/master@{#361892}
fs
Restore TestExpectations rules disabled by crrev.com/361873
TBR=fmalita@chromium.org
NOTRY=true
BUG=467592

Review URL: https://codereview.chromium.org/1477193002

Cr-Commit-Position: refs/heads/master@{#361888}
sigbjornf
Sync OilpanExpectations for plugin tests.
Three plugin tests that no longer time out on the Mac
Oilpan bot -- last two having already been removed
(https://codereview.chromium.org/1319473007) as tests.

R=haraken
BUG=515250
NOTRY=true

Review URL: https://codereview.chromium.org/1479833002

Cr-Commit-Position: refs/heads/master@{#361882}
fs
Stop normalizing path data for layout tree text output
BUG=467592

Review URL: https://codereview.chromium.org/1476523002

Cr-Commit-Position: refs/heads/master@{#361873}
rune
Clear link element sheet before clearing ownerNode.
clearOwnerNode synchronously updates the list of active stylesheets, and
if the m_sheet member of HTMLLinkElement is set, it is considered to be
an active stylesheet. If it is later added to the StyleResolver, it will
crash when ownerNode and ownerDocument are null.

This was already fixed a long time ago for StyleElement in [1].

[1] https://codereview.chromium.org/13508006

R=dstockwell@chromium.org
BUG=426959

Review URL: https://codereview.chromium.org/1472243004

Cr-Commit-Position: refs/heads/master@{#361867}
philipj
Sync cloneNode() IDL with the spec
All internal callers pass an argument, so the default value can be in
the IDL only.

BUG=460722

Review URL: https://codereview.chromium.org/1482433003

Cr-Commit-Position: refs/heads/master@{#361856}
sigbjornf
Oilpan: tidy up unsafe heap pointer reference following r361300.
R=dcheng
BUG=

Review URL: https://codereview.chromium.org/1482493002

Cr-Commit-Position: refs/heads/master@{#361852}
sigbjornf
Oilpan: fix build after r361838.
TBR=oilpan-reviews, dcheng
BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/1478073002

Cr-Commit-Position: refs/heads/master@{#361843}
mstensho
Jump to the next outer column when an inner column is too short.
If an inner multicol ends up near the bottom in a column in an outer multicol
container, we get inner columns that are shorter in the first row than in
subsequent rows. In such cases it may be necessary to break past all inner
columns in the first row, so that we push the content all the way to the next
row (and thus to the next outer column), in order to fit unbreakable content
(such as lines or unbreakable blocks).

BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1472053002

Cr-Commit-Position: refs/heads/master@{#361769}
mstensho
Document early bail in contentWasLaidOut() better.
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1476773002

Cr-Commit-Position: refs/heads/master@{#361717}
sigbjornf
Oilpan: hide persisted plugin object before disposing.
When clearing out the persisted plugin object, hide the object before
going ahead with the disposal. This mirrors what will happen non-Oilpan.

R=haraken
BUG=561473

Review URL: https://codereview.chromium.org/1475023002

Cr-Commit-Position: refs/heads/master@{#361665}
sigbjornf
If Oilpan is enabled, warn of raw heap pointer fields by default.
It is unsafe to keep fields with raw pointers into the Oilpan heap, as
such untraced references risk going stale. With potentially undesirable
consequences.

Now that we've addressed and handled all such untraced references as part
of Blink's transition to Oilpan, it is time to enable the clang GC plugin
warning for such raw pointer uses.

It shouldn't represent a major imposition to developers to handle such
raw pointer uses correctly, but for now we will only emit a warning and
not an error.

R=haraken
BUG=515524

Review URL: https://codereview.chromium.org/1464293002

Cr-Commit-Position: refs/heads/master@{#361656}
lstorset
Earlier, the script looked for dirs named 'out' or 'out_*'.
Recently it started looking for 'out' following by an alphanumeric word
boundary. Python considers underscores as alphanumeric, so this
unfortunately broke the 'out_*' pattern.

BUG=

Review URL: https://codereview.chromium.org/1469023002

Cr-Commit-Position: refs/heads/master@{#361655}
philipj
update-w3c-deps import using blink 5636fefe1d743cc2a8af65f78eaeed4b98f0012b:
imported csswg-test@7cfea4d5ba33861b0b1a6839c27090bc504a169f
imported web-platform-tests@5f8361dcef1a7c80b61d6319f7b510fa431f9a47

R=dpranke@chromium.org,kojii@chromium.org

Review URL: https://codereview.chromium.org/1471763006

Cr-Commit-Position: refs/heads/master@{#361653}
sigbjornf
Oilpan: fix build after r361631.
TBR=oilpan-reviews
BUG=554293
NOTRY=true

Review URL: https://codereview.chromium.org/1476803002

Cr-Commit-Position: refs/heads/master@{#361642}
davve
Avoid RefPtr churn
This is a speculative fix for 560890, but seems like it might be a
good idea anyway. We have a reference to the thing having a
reference. No need to add another reference on top of that.

In the process drop a null check in StyleFetchedImageSet::image(),
ImageResource::image always returns an Image object. If nothing else
the Image::nullImage().

BUG=560890

Review URL: https://codereview.chromium.org/1472253003

Cr-Commit-Position: refs/heads/master@{#361640}
sigbjornf
Split up leak detector into two stages for better leak reporting.
The leak detector clears out resources along with issuing a sequence of GCs
before taking object census. It then counting up resources that are left and
reporting these as leaking.

With Oilpan enabled, RenderViewTest needs to carefully orchestrate its shutdown
to reliably not report the frame(s) attached to the view as leaking. (With Oilpan
enabled, frames will delayed'ly release resources upon frame close()ing requiring
a follow-on GC to clear out those resources.)

Accommodate that by splitting out the leak detector into two -- with RenderViewTest
injecting the clearing of its view in between those.

R=haraken, jochen, hajimehoshi
BUG=561293

Review URL: https://codereview.chromium.org/1472943004

Cr-Commit-Position: refs/heads/master@{#361638}
mstensho
Add myself to third_party/WebKit/LayoutTests/printing/ WATCHLIST
TBR=leviw@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/1479533002

Cr-Commit-Position: refs/heads/master@{#361632}
rune
Use invalidation sets for :in-range and :out-of-range.
Gets rid of a SubtreeStyleChange which relies on sibling tree recalcs.

The changes in expectations for video-mute-repaint.html and
video-unmute-repaint.html are due to the following facts:

* We used to do SubtreeStyleChange for an input whose value changed.
* The video controls have input elements in the UA shadow which are
  modified when the volume is changed.
* Doing the recalc of the input means calling Element::recalcStyle on the
  ancestor chain, which includes the video element, just to reach the
  descendants which need to be recalculated.
* HTMLMediaElement has a didRecalcStyle, which will call updateFromElement
  for LayoutVideo, which in turn does an unconditional
  setShouldDoFullPaintInvalidation.
* Since the whole SubtreeStyleChange -> recalc is gone for the mentioned
  tests, the paint invalidation for LayoutVideo is gone, hence the test
  expectation changes.

R=tkent@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1469183003

Cr-Commit-Position: refs/heads/master@{#361601}
philipj
Make [TypeChecking=Interface] the default
Add [LegacyInterfaceTypeChecking] as needed to ensure that there are no
changes to the generated code. It was added to the members wherever
possible, but in a few cases it was necessary to keep at the interface
level. In all but one of these are cases it is because the constructor
would otherwise change. The remaining case is FontFaceSet, where
setlike<FontFace> results in generated has(), add() and delete() methods
which would otherwise change.

90 instances of [LegacyInterfaceTypeChecking] were added, and 206
instances of [TypeChecking=Interface] were removed, in source/ and
modules/ combined.

In bindings/tests/, most tests that were previously for
[TypeChecking=Interface] were changed to instead test
[LegacyInterfaceTypeChecking], as that is now the special case.

BUG=462561

Review URL: https://codereview.chromium.org/1466563003

Cr-Commit-Position: refs/heads/master@{#361599}
mstensho
Look inside inner nested multicols to calculate minimum space shortage.
This is needed in order to make sure that the column balancer gives us as short
outer columns as possible. Otherwise we risk not finding the absolute minimum
space shortage (and thus over-stretch) (or, even worse, not be able to find any
shortage at all).

BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1471403002

Cr-Commit-Position: refs/heads/master@{#361501}
davve
Add note about sysroot not working with icecc
Or is it the other way around...

Review URL: https://codereview.chromium.org/1477433002

Cr-Commit-Position: refs/heads/master@{#361389}
fs
Introduce SVGPathQuery to hold SVG path query methods
Rename SVGPathTraversalStateBuilder.{cpp,h} to SVGPathQuery.{cpp,h}, and
similarly rename the class itself. Move the query methods in
SVGPathUtilities (getSVGPathSegAtLengthFromSVGPathByteStream,
getTotalLengthOfSVGPathByteStream, getPointAtLengthOfSVGPathByteStream)
to that class, shortening their names in the process.
Open-code the SVGPathParser driver to allow the general SVGPathConsumer
interface to be simplified - incrementPathSegmentCount and
continueConsuming are only used for path queries.

BUG=467592

Review URL: https://codereview.chromium.org/1471943003

Cr-Commit-Position: refs/heads/master@{#361351}
philipj
Sync the URL constructor with the spec
https://url.spec.whatwg.org/#api

This changes the generated code, but ought not be observable, as any
call to `new URL(x, urlObject)` will now instead behaves as
`new URL(x, urlObject.toString())`.

BUG=460722

Review URL: https://codereview.chromium.org/1464133002

Cr-Commit-Position: refs/heads/master@{#361342}
fs
SVGPathUtilities tidying
Rename buildSVGPathByteStreamFromString to buildByteStreamFromString to
be more consistent with other functions (buildStringFromByteStream and
buildPathFromByteStream). Also drop the PathParsingMode argument, since
it's always UnalteredParsing (and it's unlikely we'll need to build
normalized byte streams ATM.)

Make buildStringFromByteStream return the resulting String instead of
using an out-parameter. Tidies up call-sites and makes for slightly
smaller code.

BUG=467592

Review URL: https://codereview.chromium.org/1469323002

Cr-Commit-Position: refs/heads/master@{#361338}
philipj
Add [TypeChecking=Interface] to the V8Path2D interface
This affects the generated code of the constructor, which will now throw
a TypeError if "parameter 1 is not of type 'Path2D'."

However, this code path is unreachable, because there's a type check
(V8Path2D::hasInstance()) to determine that this form of the constructor
should be used.

Promoting [TypeChecking=Interface] to the interface level will make it
possible to make [TypeChecking=Interface] the default without changing
the generated code for this interface.

BUG=462561

Review URL: https://codereview.chromium.org/1471563002

Cr-Commit-Position: refs/heads/master@{#361317}
philipj
Make addEventListener/removeEventListener arguments non-optional
Intent to Implement and Ship:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/3rsQQJvhY8k/P2cAFq3hAwAJ

BUG=353484

Review URL: https://codereview.chromium.org/1461993002

Cr-Commit-Position: refs/heads/master@{#361316}
mstensho
Record space shortage that prevented an object from fitting in one column.
The breakability of the object doesn't matter here. The space shortage that
prevented an object from fitting in one column may very well be the lowest
space shortage that we'll ever find. So always record it, to avoid
over-stretching columns.

BUG=559133
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1465193002

Cr-Commit-Position: refs/heads/master@{#361232}
philipj
Remove AttributeCollection's findIndex(Attr*) by using QualifiedName
The internal Attribute and AttributeCollection need not know anything
about the web-exposed Attr.

Since Attr::qualifiedName() is not just a trivial getter, calling that
outside of the loop is probably a good idea anyway.

Review URL: https://codereview.chromium.org/1467143004

Cr-Commit-Position: refs/heads/master@{#361221}
fs
Expose the SVG path normalizer in SVGPathParser.h
Rename the internal NormalizingConsumer to SVGPathNormalizer and move
the class declaration to SVGPathParser.h. This will allow simplifying
the "path processor" (SVGPathParser) a bit in later CLs.
Also modify the normalizer so that it normalizes into a new
PathSegmentData, to make it more "stackable" and reusable.

BUG=467592

Review URL: https://codereview.chromium.org/1472853005

Cr-Commit-Position: refs/heads/master@{#361199}
davve
Split filter related measurements from SVG1DOM counter
Create a SVG1DOMFilter UseCounter to measure all filter related SVG
DOM functionality. The assumption we want to test is that the filter
related SVG DOM has really low usage.

From a quick test it would shave off 90kb of the binary if we could
remove it. That's only counting binding code and there is a good
chance number-optional-number related functionality can be removed
too, if these interfaces can be removed.

BUG=415074

Review URL: https://codereview.chromium.org/1472773002

Cr-Commit-Position: refs/heads/master@{#361181}
sigbjornf
Enable webaudio unit tests iff ENABLE(WEB_AUDIO).
R=tkent
BUG=

Review URL: https://codereview.chromium.org/1470873002

Cr-Commit-Position: refs/heads/master@{#361171}
fs
SVGPath object "mutability" cleanup
Move addToSVGPathByteStream to SVGPath.cpp (the only place using it),
rename it to addPathByteStreams. Move the "regular" blending out into a
helper(blendPathByteStreams), and eliminate the redundant copy. Make the
functions more "functional" (return the result.)

Add a (private) setter for byte-stream data and use that to ensure
invalidation of the cached path. Also add an SVGPath::create(...)
accepting a SVGPathByteStream and use that in PathSVGInterpolation.

Inline mutableByteStream into the remaining user.

Review URL: https://codereview.chromium.org/1460253002

Cr-Commit-Position: refs/heads/master@{#361128}
rune
Remove extraneous SubtreeStyleChange for min/maxlength changes.
Validation already takes care of :valid/:invalid changes through
invalidation sets. This reduces the number of elements being recalculated
and gets rid of a SubtreeStyleChange which relies on sibling tree recalcs.

R=tkent@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1458363003

Cr-Commit-Position: refs/heads/master@{#361123}
rune
Use invalidation sets for visited link updates.
We did use invalidation sets when adding/removing href from an anchor tag,
while the code that notifies that the visited state of a given url has
changed, use SubtreeStyleChange. This change gets rid of SubtreeStyleChange
which relies on sibling tree recalcs.

R=tkent@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1459063004

Cr-Commit-Position: refs/heads/master@{#361121}
davve
Update comments regarding image caching
While attempting to remove the layoutObject parameter the following
observations were made:

 * The decoding forced by BitmapImage::imageForCurrentFrame will be
   deferred so the comment in the header may be removed.

 * BitmapImage::currentFrameKnownToBeOpaque() conservatively returns
   false for uncached images, not true.

 * Since decoding is deferred, there is no guarantee that the
   opaqueness metadata is available after the imageForCurrentFrame
   call has returned. It may increase the chance though, depending on
   image decoder for the particular image.

NOTRY=true
BUG=559131

Review URL: https://codereview.chromium.org/1454373005

Cr-Commit-Position: refs/heads/master@{#361094}
mstensho
Add marginBeforeIfFloating() to LayoutBlockFlow.
Floats' margins need special attention for pagination, because they are not to
be eaten by page or column boundaries.

Clamp strut to >= 0 in LayoutBlockFlow::setPaginationStrutPropagatedFromChild()
instead of doing it (poorly) in calculateStrutForPropagation().

Removed calculateStrutForPropagation(), because there was hardly anything left
there now (and this lets us make marginBeforeIfFloating() private). This
function also turned out not to be universally usable, since we were already
calculating the strut on our own in adjustLinePositionForPagination() in one
case.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1460203003

Cr-Commit-Position: refs/heads/master@{#361084}
mstensho
When balancing columns, we must check inner multicols for unbreakable content.
No multicol container should suggest to initially use a column height less than
the height of the tallest piece of unbreakable content inside.

TL;DR some related cleanup.

Introduce the term tallestUnbreakableLogicalHeight in favor of
minimumColumnLogicalHeight, as the latter could easily be confused with initial
column height; the height found by InitialColumnHeightFinder, which is also
sometimes referred to as initial minimal column height. Furthermore, there's
already a concept of *maximum* column logical height in fragmentainer groups,
which is derived from such things as CSS max-height. Since max-height actually
trumps the height of the tallest piece of unbreakable content in multicol
(while in CSS, min-height wins over max-height), it was just too confusing to
keep using "minimum column height" for this.

This change also makes it necessary to modify the containing column set when
calculating the initial column height for fragmentainer groups, so this part
kind of had to be moved from the const method calculateColumnHeight(). There
was already code that walked around that method when calculating the column
height, so being even more of a misnomer than before, it was renamed to
rebalanceColumnHeightIfNeeded().

BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1461923005

Cr-Commit-Position: refs/heads/master@{#361082}
sigbjornf
Add unit test for non-leftmost GC mixin instance.
Verify that deriving from a USING_GARBAGE_COLLECTED_MIXIN() annotated
class is traced as expected.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1465083002

Cr-Commit-Position: refs/heads/master@{#361072}
sigbjornf
Oilpan: move BaseChooserOnlyDateAndTimeInputType to the heap.
Move this !ENABLE(INPUT_MULTIPLE_FIELDS_UI) object to the Oilpan heap,
where it belongs as it derives from the on-heap BaseDateAndTimeInputType
class.

At the same time, turn DateTimeChooserClient into a GC mixin.

R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1466113002

Cr-Commit-Position: refs/heads/master@{#361071}
sigbjornf
Oilpan: trace ColorChooserPopupUIController::m_chromeClient
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1442543003

Cr-Commit-Position: refs/heads/master@{#361043}
philipj
Remove another trace of [TypeChecking=Unrestricted]
This was overlooked in https://codereview.chromium.org/971783002

BUG=354298
R=jl@opera.com

Review URL: https://codereview.chromium.org/1465003002

Cr-Commit-Position: refs/heads/master@{#361042}
sigbjornf
More regular Platform implementations in unit tests (reland.)
R=haraken,jbroman
BUG=

Review URL: https://codereview.chromium.org/1456873003

Cr-Commit-Position: refs/heads/master@{#361030}
davve
Simplify ImageResource::canRender()
Assume that neither image rotation nor scale can affect the image size
emptiness. This makes it easier to further simplify
imageSizeForLayoutObject later.

BUG=559131

Review URL: https://codereview.chromium.org/1463793002

Cr-Commit-Position: refs/heads/master@{#361025}
sigbjornf
More regular Platform implementations in unit tests.
R=haraken,jbroman
BUG=

Review URL: https://codereview.chromium.org/1456873003

Cr-Commit-Position: refs/heads/master@{#361019}
philipj
Add event name to bare removeEventListener(listener) calls
This mistake was possible because removeEventListener's arguments are
all optional, and these calls would throw exceptions if the argument
were non-optional.

Since these code paths supposedly current work, removing the event
listeners cannot be critical, but do it anyway as was originally
intended.

BUG=353484

Review URL: https://codereview.chromium.org/1463763002

Cr-Commit-Position: refs/heads/master@{#360949}
davve
Remove redundant IntrinsicSize argument
IntrinsicSize is the default. IntrinsicCorrectedToDPR is the uncommon
one. Leaving it out makes it obvious nothing special is requested
here, just the normal image size.

BUG=559131

Review URL: https://codereview.chromium.org/1468473002

Cr-Commit-Position: refs/heads/master@{#360893}
mstensho
A line that ends up naturally in the next column may need to propagate a strut.
Even if the line itself didn't need a strut, we may have to calculate and
propagate one to the block, or we risk violating orphan requirements or
breaking in the middle of the top border, padding or (in case it's a float)
margin.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1462913002

Cr-Commit-Position: refs/heads/master@{#360798}
davve
Support fragment URLs for more kinds of SVG images
This patch adds support for SVG fragment URLs in CSS backgrounds,
video poster images, image inputs, content property and svg:image
scenarios. It does so by storing fragment URLs for each
SVGImageForContainer and propgates this URL to SVGImage when drawing.

BUG=128055

Review URL: https://codereview.chromium.org/1458083002

Cr-Commit-Position: refs/heads/master@{#360787}
sigbjornf
More regular Platform implementations in unit tests.
R=haraken,jbroman
BUG=

Review URL: https://codereview.chromium.org/1456873003

Cr-Commit-Position: refs/heads/master@{#360763}
sigbjornf
Avoid implicit size_t conversions on setting HeapObjectHeader::m_encoded.
Cannot assume that sizeof(size_t) matches that of uint32_t.

R=
BUG=

Review URL: https://codereview.chromium.org/1459933002

Cr-Commit-Position: refs/heads/master@{#360703}
mostynb
avoid 'may be used uninitialized' warnings in stack_sampling_profiler_unittest.cc
Without this patch, some toolchains may trigger this warning:
../../base/profiler/stack_sampling_profiler_unittest.cc:275:17: error: 'library' may be used uninitialized in this function [-Werror=maybe-uninitialized]

BUG=545051

Review URL: https://codereview.chromium.org/1459033003

Cr-Commit-Position: refs/heads/master@{#360647}
mostynb
unbreak the no-webrtc build
Followup to https://codereview.chromium.org/1427003009

The third_party/libjingle/libjingle.gyp:libjingle_webrtc target is defined
inside an enable_webrtc==1 condition, so it can only be depended on inside
a similar condition.

BUG=547158

Review URL: https://codereview.chromium.org/1457793004

Cr-Commit-Position: refs/heads/master@{#360646}
fs
Move application of filter effect boundaries to a helper
Add FilterEffect::applyEffectBoundaries and use that to replace the
three chunks that does the same thing.
Drop a redundant null-check in FETile::createImageFilter.

Review URL: https://codereview.chromium.org/1463513002

Cr-Commit-Position: refs/heads/master@{#360625}
sigbjornf
More regular Platform implementations in unit tests.
R=haraken,jbroman
BUG=

Review URL: https://codereview.chromium.org/1456873003

Cr-Commit-Position: refs/heads/master@{#360583}
fs
Remove unused FilterOperation* includes
Review URL: https://codereview.chromium.org/1459853002

Cr-Commit-Position: refs/heads/master@{#360572}
philipj
Drop [TreatNullAs=NullString] for Document.cookie
https://html.spec.whatwg.org/#document

After this change, setting document.cookie to null will stringify to
"null", so it's simply like setting a cookie by that name. This matches
Firefox Nightly and Edge.

BUG=497307

Review URL: https://codereview.chromium.org/1458753003

Cr-Commit-Position: refs/heads/master@{#360567}
davve
Wrap SVGImage for container during paint
Before this patch, one SVGImageForContainer object is saved in
ImageResource for each corresponding use of SVGImage.

<img style="width: 1000px" src="image.svg">
...
<img style="width: 500px" src="image.svg">

This example would give one ImageResource (for image.svg) and within
it two SVGImageForContainer, one for each <img>. SVGImageForContainer
contains the unzoomed container size along with the zoom level,
indexed on the layout object of the container in
SVGImageFor*Container*.

There were at least three problems with this approach:

1. It's racy. setContainerSizeForLayoutObject is called sometimes from
   layout(), sometimes during paint(). Users of APIs such as
   imageForLayoutObject or imageSizeForLayoutObject that depend on
   setContainerSizeForLayoutObject would get different results
   depending on when they are called. Basically the only "safe" time
   to call these methods are right before paint.

2. It limits the number of associations between layout object and
   SVGImage to one. Consider an element/layout object having one
   SVGImage as content and another SVGImage as background. The
   container size for those two SVGImages in this case isn't
   necessarily the same and strictly speaking we should need two
   SVGImageForContainer objects. Only one SVGImageForContainer can be
   stored per layout object.

3. It breaks layering. ImageResource lives in fetch and having fetch/
   depend on svg code is undesirable. DEPS for fetch/ states
   "core/fetch/ shouldn't depend on anything else in core/".

After this patch, these three problems have been
addressed. SVGImageForContainer is now only allocated when it's
needed, to be passed through the GraphicsContext layer as a wrapper to
get the correct size and zoom level to avoid pixelated rasterization.

There are risks with this patch. In some cases code may rely on having
the container size saved inside ImageResource.cpp. However, such code
is most often already brittle and unreliable due to (1) above.

One quirk is the added BackgroundImageGeometry::imageContainerSize()
containing the tile size before 'background-repeat: round' has been
applied. Before this patch, this size was the one kept for the
respective container in ImageResource (since
setContainerSizeForLayoutObject were called before tile size
adjustments for background-repeat: round). It turns out this is
important to get the stretching correct, i.e. makes the underlying
drawing code ignore the intrinsic ratio of the background
image. svg/as-background-image/background-repeat.html exercises this
behavior.

BUG=128055, 306222

Review URL: https://codereview.chromium.org/1427943002

Cr-Commit-Position: refs/heads/master@{#360558}
mstensho
Don't set bogus height on new fragmentainer groups initially.
This essentially made it impossible to support more than two column rows in
auto-height multicol containers.

When a new fragmentainer group is created, resetColumnHeight() is called right
*before* the fragmentainer group is inserted into the array, so we'd trick
ourselves into believing that height always was non-auto, because the
heightIsAuto() method on MultiColumnFragmentainerGroup would require the
fragmentainer group to be the last one in the array to count as auto.

We could fix the order in which things are done, or just make the whole thing a
bit more robust, which this CL aims to do.

BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1424913003

Cr-Commit-Position: refs/heads/master@{#360540}
rune
Use invalidation sets for :unresolved.
Gets rid of SubtreeStyleChange which relies on sibling tree recalcs.

Added TODO with issue for :default which just doesn't trigger any updates
from the DOM side.

R=hayato@chromium.org,ericwilligers@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1461653002

Cr-Commit-Position: refs/heads/master@{#360537}
sigbjornf
Avoid unnecessary wtf/text/WTFString.h includes in platform/heap/
Oilpan header files are included across most of Blink, so tidy up various
downstream code that implicitly assumed WTFString.h's offerings to be
in scope.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1460523004

Cr-Commit-Position: refs/heads/master@{#360525}
rune
Use invalidation sets for :-webkit-drag.
Gets rid of SubtreeStyleChange which relies on sibling tree recalcs.

R=tkent@chromium.org,ericwilligers@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1459553002

Cr-Commit-Position: refs/heads/master@{#360465}
jsokol
Initialize member variables of ui::ScrollEvent
With current implementation of GetScrollOffsets on Windows, none values
are changed and remain garbage. To make sure none of this will lead to
crash, just initialize values with zeros.

BUG=

Review URL: https://codereview.chromium.org/1461643002

Cr-Commit-Position: refs/heads/master@{#360389}
mstensho
Disable stretch-to-viewport quirk for multicol.
We don't want to stretch the height of BODY to that of the viewport if BODY is
inside a multicol container. There should be no need for this quirk in
multicol, and even if we had wanted to do something like that, what used to be
there was utterly wrong, since we'd end up with the viewport height divided by
the number of columns, which is just unpredictable silliness that nobody wants.

Un-inline the quirks mode part of stretchesToViewport() into
stretchesToViewportInQuirksMode() and check the condition that's most unlikely
to be true first, so that we can bail early.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1461623002

Cr-Commit-Position: refs/heads/master@{#360388}
sigbjornf
Oilpan: move ServiceWorkerGlobalScopeProxy to the heap.
The object maintains two references to heap objects, so by having it
also be on the Oilpan heap, these refs can be correctly traced & handled.

R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1448353002

Cr-Commit-Position: refs/heads/master@{#360381}
davve
Add UseCounter for border-image overriding border-widths
According to the specification, if one border-style is 'none' the
corresponding border-width should be zero and thus border-image-width
resolve to zero. No border-image can be drawn at zero-width border.

WebKit implemented an old version of the css border specification for
border-image and does not reset border-widths to zero for border-style
'none' when there is a border-image.

Add a use counter to get data on how many views that rely on this
behavior.

BUG=356802

Review URL: https://codereview.chromium.org/1455673002

Cr-Commit-Position: refs/heads/master@{#360357}
rune
Use invalidation sets for :read-only and :read-write.
Gets rid of SubtreeStyleChange which relies on sibling tree recalcs.

R=tkent@chromium.org,ericwilligers@chromium.org
BUG=557440

Review URL: https://codereview.chromium.org/1454003002

Cr-Commit-Position: refs/heads/master@{#360298}
mostynb
include what you use: errno.h and string.h in media/
Add missing errno.h includes for errno and string.h includes for
strerror.

TBR=qinmin

Review URL: https://codereview.chromium.org/1429383002

Cr-Commit-Position: refs/heads/master@{#360276}
mostynb
don't try to adjust oom score with the suid sandbox if there is no such binary
BUG=312380

Review URL: https://codereview.chromium.org/1452403003

Cr-Commit-Position: refs/heads/master@{#360262}
sigbjornf
Oilpan: support GC event tracing following r360126.
TBR=oilpan-reviews,jbroman,mkwst@chromium.org
BUG=none

Review URL: https://codereview.chromium.org/1460463002

Cr-Commit-Position: refs/heads/master@{#360170}
philipj
Remove navigator.getStorageUpdates()
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/ak1kVjiX9T4/mo1rqcyQAQAJ

navigator.yieldForStorageUpdates() will be removed from the spec:
https://github.com/whatwg/html/pull/342

BUG=465255

Review URL: https://codereview.chromium.org/1439973005

Cr-Commit-Position: refs/heads/master@{#360140}
sigbjornf
Deflake http/tests/misc/script-sync-slow-scripts-onerror.html
Cope with sync scripts failing to load in any order, testing instead
their collective outcome when finishing up.

R=mkwst
BUG=555052

Review URL: https://codereview.chromium.org/1449413002

Cr-Commit-Position: refs/heads/master@{#360123}
sigbjornf
Oilpan: tidy up CSSCustomFontData::m_fontFaceSource back ref somewhat.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1439033002

Cr-Commit-Position: refs/heads/master@{#360062}
sigbjornf
Oilpan: move WorkerInspectorController's frontend channel to the heap.
Move along this WorkerInspectorController-owned object to the heap also,
allowing it to keep a traced reference to its worker global scope.

R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1449963002

Cr-Commit-Position: refs/heads/master@{#360052}
sigbjornf
KeyframeEffectTest: avoid keeping unnecessary Document reference.
Avoid introducing a Persistent<> to a Document for these unit tests,
thereby not keeping an untraced heap reference with Oilpan.

R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1452613002

Cr-Commit-Position: refs/heads/master@{#360029}
sigbjornf
WebGeolocationController: improve handling of bare GeolocationController*
While GeolocationController is still being transitioned to Oilpan,
introduce an intermediary abstraction that allows WebGeolocationController
to keep a WebPrivatePtr<>. Thereby letting us correctly trace the
GeolocationController it wraps.

R=haraken,tkent
BUG=553613

Review URL: https://codereview.chromium.org/1444333002

Cr-Commit-Position: refs/heads/master@{#360027}
sigbjornf
Oilpan: account for DocumentThreadableLoader::m_document back ref.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1435263002

Cr-Commit-Position: refs/heads/master@{#360025}
sigbjornf
Oilpan: account for DevToolsEmulator reference from WebSettingsImpl.
WebSettingsImpl and DevToolsEmulator are both owned by WebViewImpl;
let the former keep an untracked reference to the latter.

R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1437003005

Cr-Commit-Position: refs/heads/master@{#359854}
sigbjornf
Oilpan: tidy up InspectorState weak references.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1446973002

Cr-Commit-Position: refs/heads/master@{#359842}
sigbjornf
Oilpan: tidier ContentSecurityPolicy back refs from auxillary CSP objects.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1436103004

Cr-Commit-Position: refs/heads/master@{#359831}
sigbjornf
Oilpan: move HTMLParserScheduler to the heap.
The benefit being that the back reference it keeps to
HTMLDocumentParser can be traced per normal.

R=kouhei,haraken
BUG=553613

Review URL: https://codereview.chromium.org/1438193002

Cr-Commit-Position: refs/heads/master@{#359824}
sigbjornf
Oilpan: move InspectedFrames to the heap.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1434383002

Cr-Commit-Position: refs/heads/master@{#359811}
sigbjornf
Oilpan: move NavigatorContentUtilsClients to the heap.
Done so as to allow the client implementation keep a Member reference to
its WebLocalFrameImpl.

R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1441083002

Cr-Commit-Position: refs/heads/master@{#359775}
sigbjornf
Oilpan: correctly track MediaControlsTest's MediaControls reference.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1442153002

Cr-Commit-Position: refs/heads/master@{#359753}
sigbjornf
Oilpan: track ScriptStateForTesting's ExecutionContext reference better.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1445913002

Cr-Commit-Position: refs/heads/master@{#359750}
sigbjornf
Oilpan: tidy up ChromeClientImplTest's ChromeClientImpl ref.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1442843004

Cr-Commit-Position: refs/heads/master@{#359748}
mharanczyk
Properly call string fill constructor in win shell integration unittest.
Before it was always creating string of 49 size (value of L'1') filled
with random character based of size of app id string. Found it just
because size after my local changes resulted in inserting forbidden
space ' ' character.

Review URL: https://codereview.chromium.org/1439323003

Cr-Commit-Position: refs/heads/master@{#359744}
sigbjornf
Oilpan: move WebPluginLoadObserver to the heap.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1442643003

Cr-Commit-Position: refs/heads/master@{#359556}
sigbjornf
Oilpan: tidy up InspectorResourceContentLoader's ResourceClient handling.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1436723005

Cr-Commit-Position: refs/heads/master@{#359553}
sigbjornf
Oilpan: account for RetainedDOMInfo::m_root temporary Node reference.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1440003002

Cr-Commit-Position: refs/heads/master@{#359540}
sigbjornf
Oilpan: turn MuteConsoleScope into a stack allocated object.
Do so in order to have its embedded agent referenced be handled as
required.

R=keishi
BUG=553613

Review URL: https://codereview.chromium.org/1442953002

Cr-Commit-Position: refs/heads/master@{#359538}
sigbjornf
Oilpan: fix build after r359531.
~ScriptWrappable is only provided !OILPAN.

R=haraken
BUG=520391
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1441303002

Cr-Commit-Position: refs/heads/master@{#359533}
tmoniuszko
Fix dependencies on policy_component_test_support
BUG=

Review URL: https://codereview.chromium.org/1321013007

Cr-Commit-Position: refs/heads/master@{#359529}
sigbjornf
Oilpan: move DateTimeChooser to the heap.
Done so as to allow DateTimeChooserImpl::m_chromeClient to be correctly
traced, but consistent to have this on the heap alongside the other
'chooser' object, ColorChooser.

R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1432243003

Cr-Commit-Position: refs/heads/master@{#359321}
sigbjornf
Oilpan: account for V8NPObject::rootObject bare pointer.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1436173002

Cr-Commit-Position: refs/heads/master@{#359319}
sigbjornf
Oilpan: add missing tracing of WebLocalFrameImpls from inspector agents.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1434243002

Cr-Commit-Position: refs/heads/master@{#359314}
sigbjornf
Oilpan: add missing tracing of Page::m_chromeClient.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1436143002

Cr-Commit-Position: refs/heads/master@{#359310}
sigbjornf
Oilpan: add reqd tracing of ImportedStyleSheetClients.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1439023002

Cr-Commit-Position: refs/heads/master@{#359309}
sigbjornf
Oilpan: add missing tracing of PopupMenuImpl::m_chromeClient.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1434093003

Cr-Commit-Position: refs/heads/master@{#359306}
sigbjornf
Oilpan: add missing tracing of SVGSMILElement condition.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1438823003

Cr-Commit-Position: refs/heads/master@{#359301}
tsniatowski
Run gn_unittests on Mac bots
With Linux already there and Windows added recently this should make
gn_unittests run on all relevant platforms in CQ.

R=dpranke@chromium.org
BUG=549254

Review URL: https://codereview.chromium.org/1437863002

Cr-Commit-Position: refs/heads/master@{#359290}
sigbjornf
Oilpan: add missing LocalFrame::m_pluginElements annotation.
TBR=oilpan-reviews
BUG=553613
NOTRY=true

Review URL: https://codereview.chromium.org/1438143002

Cr-Commit-Position: refs/heads/master@{#359274}
sigbjornf
Oilpan: turn Frame::m_client into the Member it is.
R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1437973002

Cr-Commit-Position: refs/heads/master@{#359210}
sigbjornf
Oilpan: handle WorkerObjectProxy::m_executionContext ref better.
The proxy object outlives its ExecutionContext reference; exempt it
from any GC plugin checks.

R=
BUG=553613

Review URL: https://codereview.chromium.org/1438823002

Cr-Commit-Position: refs/heads/master@{#359162}
sigbjornf
Do not attempt an Oilpan memory pressure GC if nested.
Nested GCs aren't supported, so only trigger an urgent memory pressure
GC if we're not sweeping up after another.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1438733002

Cr-Commit-Position: refs/heads/master@{#359127}
sigbjornf
Rename IsAllowOnlyInlineAllocation<T> to AllowsOnlyPlacementNew<T>.
R=haraken
BUG=

Review URL: https://codereview.chromium.org/1433983002

Cr-Commit-Position: refs/heads/master@{#359126}
mostynb
include what you use: errno.h and string.h in content/
Adding some missing errno.h includes for errno and
string.h for strerror in content/

Review URL: https://codereview.chromium.org/1417483018

Cr-Commit-Position: refs/heads/master@{#359110}
davve
Avoid truncation to int when setting background-position coordinates
This error was part of the original
https://bugs.webkit.org/show_bug.cgi?id=103440 implementation of
background-position but then only for non-repeating backgrounds. When
also used for repeating backgrounds through
https://codereview.chromium.org/1287293002 it has been noticed that
the background-position was sometimes a pixel off when zooming.

BUG=535504

Review URL: https://codereview.chromium.org/1431103005

Cr-Commit-Position: refs/heads/master@{#359101}
sigbjornf
Oilpan: add temporary plugin ignore exemption for DataRef<T>::RefPtr<T>.
Until the clang Blink GC plugin has been updated to include r359074,
the GC plugin will erroneously complain if DataRef<T> is used with a
RefCountedGarbageCollected<T> class type. Add a GC_PLUGIN_IGNORE()
to temporarily prevent such false errors from being reported.

R=
BUG=553613

Review URL: https://codereview.chromium.org/1440553002

Cr-Commit-Position: refs/heads/master@{#359094}
sigbjornf
MemoryCacheTest: tidy up task's Resource reference.
R=haraken
BUG=503485

Review URL: https://codereview.chromium.org/1437823003

Cr-Commit-Position: refs/heads/master@{#359084}
sigbjornf
MockImageResourceClient: tidy up Resource reference.
R=haraken
BUG=503485

Review URL: https://codereview.chromium.org/1432213002

Cr-Commit-Position: refs/heads/master@{#359083}
sigbjornf
Oilpan: move NetworkResourcesData to the heap.
Do so in order to properly handle the Resource pointers that its
ResourceData keeps.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1436793002

Cr-Commit-Position: refs/heads/master@{#359082}
sigbjornf
InternalResourcePtr: allowed only as stack allocated.
R=haraken
BUG=503485

Review URL: https://codereview.chromium.org/1434903002

Cr-Commit-Position: refs/heads/master@{#359079}
sigbjornf
Oilpan: tidy up AutoplayExperimentHelper.
Have this part object handle its HTMLMediaElement heap reference properly.

R=haraken
BUG=553613

Review URL: https://codereview.chromium.org/1436783002

Cr-Commit-Position: refs/heads/master@{#359076}
sigbjornf
GC plugin: RefPtr<T> is legal if T is RefCountedGC-derived.
Allow RefPtr<T> uses for classes that derive from
RefCountedGarbageCollected<T>.

R=
BUG=553613

Review URL: https://codereview.chromium.org/1433883003

Cr-Commit-Position: refs/heads/master@{#359074}
mostynb
simplify the is_desktop_linux default value expression
Let's remove the redundant '&& current_is != "chromeos"' part of the
is_desktop_linux default value expression.

BUG=554006

Review URL: https://codereview.chromium.org/1433033002

Cr-Commit-Position: refs/heads/master@{#358946}
mostynb
include what you use: errno.h in exec_process.cc
Add missing errno.h inclusion - this is less likely to
break uncommon toolchains (eg uClibc).  And while we're
at it, merge posix includes into else case for an
#ifdef OS_WIN block to match the code that uses these
includes.

R=brettw@chromium.org,tfarina@chromium.org

Review URL: https://codereview.chromium.org/1421293008

Cr-Commit-Position: refs/heads/master@{#358944}
sigbjornf
dispatchTouchEvents(): mark local class as stack allocated.
The Blink GC plugin checks requires that the Oilpan heap references contained
within the "changed touches" values are properly handled during GCs. They're
all stack allocated, so mark the local class as STACK_ALLOCATED(). MSVC
presents a problem in carrying that through (see comment), so lift out the
local class from the dispatchTouchEvents() method at the same time.

R=haraken
BUG=553700

Review URL: https://codereview.chromium.org/1419423004

Cr-Commit-Position: refs/heads/master@{#358861}
mostynb
include what you use: errno.h and string.h in net/
Adding some missing errno.h and string.h includes.

Review URL: https://codereview.chromium.org/1427143003

Cr-Commit-Position: refs/heads/master@{#358844}
davve
Reland of Make LayoutImageResource::image() parameter explicit (patchset #1 id:1 of https://codereview.chromium.org/1431973002/ )
Reason for revert:
Revert the revert. It looks like "Enable slimming paint synchronized painting" was the culprit this time. Relanding.

Original issue's description:
> Revert of Make LayoutImageResource::image() parameter explicit (patchset #2 id:20001 of https://codereview.chromium.org/1411693006/ )
>
> Reason for revert:
> Seems to have caused 553045
>
> Original issue's description:
> > Make LayoutImageResource::image() parameter explicit
> >
> > It makes the code more explicit and easier to read. No functional
> > change expected.
> >
> > BUG=551419
> >
> > Committed: https://crrev.com/3059b983258e55aeacef6e0b04bdd35a72436d3b
> > Cr-Commit-Position: refs/heads/master@{#358287}
>
> TBR=fs@opera.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=551419
>
> Committed: https://crrev.com/20fa2832b2650a8654bfd8226561046760ebbfc9
> Cr-Commit-Position: refs/heads/master@{#358551}

TBR=fs@opera.com
BUG=551419

Review URL: https://codereview.chromium.org/1431193004

Cr-Commit-Position: refs/heads/master@{#358818}
sigbjornf
Oilpan: annotate weak ScrollableArea* refs with GC_PLUGIN_IGNORE()s.
ScrollAnimators keep a back reference to their owning ScrollableArea;
annotate these weak references with GC_PLUGIN_IGNORE() to inform
the GC plugin checks that these references have been checked & accounted
for.

R=haraken
BUG=509911,553613

Review URL: https://codereview.chromium.org/1427973008

Cr-Commit-Position: refs/heads/master@{#358747}
philipj
Remove unused UseCounter features
Review URL: https://codereview.chromium.org/1419823012

Cr-Commit-Position: refs/heads/master@{#358629}
mostynb
include what you use: errno.h in ui/ozone/
Add missing errno.h include.

Review URL: https://codereview.chromium.org/1417503013

Cr-Commit-Position: refs/heads/master@{#358589}
sigbjornf
Avoid data races on initializing GCScope.
Fully initialize the stack-allocated GCScope object before having it
enter a safe point, and attempt to have all the attached threads do
the same ("parking" them.)

By arranging for all updates to the GCScope object to happen before
safe points are entered, we avoid overlapping r/w access of the
thread stack regions that marking will proceed to conservatively scan
for heap references. Such overlaps can happen if two threads concurrently
attempt to initiate a GC.

R=haraken
BUG=527338

Review URL: https://codereview.chromium.org/1411643006

Cr-Commit-Position: refs/heads/master@{#358573}
mostynb
include what you use: errno.h in tools/android/
Add missing errno.h includes.

BUG=134180

Review URL: https://codereview.chromium.org/1424943009

Cr-Commit-Position: refs/heads/master@{#358563}
sigbjornf
ScriptRunner::notifyScriptLoadError(): fix broken sanity check.
Asserting for the presence of 'scriptLoader' in the pending script loader
Deque cannot use the iterator to do so if the Deque is mutated at the
same time; last loader will be confused with end(). Do better.

Regression introduced by r357778.

R=haraken
BUG=552871

Review URL: https://codereview.chromium.org/1413363012

Cr-Commit-Position: refs/heads/master@{#358556}
davve
Avoid using ImageResource->imageSize() to get the marker size
In cases when LayoutListMarker represents an image it has a StyleImage
to determine the size of the the marker. Prior to this patch the
computed size is saved back to the StyleImage for later use. This
should be unnecessary since the size can be computed (or saved
locally) when it's actually needed.

When looking closer at one may notice that the zoom level is stored
inside SVGImageForContainer so that SVGImageForContainer::size()
actually returns the size _including zoom_. When LayoutListMarker
asked for the image size and provided zoom, the zoom level was applied
once more resulting in double zoom. The added test exposes this.

As part of 551419, the aim it to get rid of
ImageResource::setContainerSizeForLayoutObject and friends (storing
SVG image specific data inside ImageResource) and this is a step in
that direction.

BUG=551419, 551808

Review URL: https://codereview.chromium.org/1433503003

Cr-Commit-Position: refs/heads/master@{#358552}
davve
Revert of Make LayoutImageResource::image() parameter explicit (patchset #2 id:20001 of https://codereview.chromium.org/1411693006/ )
Reason for revert:
Seems to have caused 553045

Original issue's description:
> Make LayoutImageResource::image() parameter explicit
>
> It makes the code more explicit and easier to read. No functional
> change expected.
>
> BUG=551419
>
> Committed: https://crrev.com/3059b983258e55aeacef6e0b04bdd35a72436d3b
> Cr-Commit-Position: refs/heads/master@{#358287}

TBR=fs@opera.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=551419

Review URL: https://codereview.chromium.org/1431973002

Cr-Commit-Position: refs/heads/master@{#358551}
mostynb
include what you use: errno.h in components/
Adding some missing errno.h includes for errno in components/

NOPRESUBMIT=TRUE

Review URL: https://codereview.chromium.org/1424273004

Cr-Commit-Position: refs/heads/master@{#358522}
sigbjornf
Sync test expectations following r358425.
TBR=peria@chromium.org,szager1@chromium.org
BUG=552456
NOTRY=true

Review URL: https://codereview.chromium.org/1423593007

Cr-Commit-Position: refs/heads/master@{#358521}
mostynb
include what you use: errno.h and string.h in base/
Adding some missing errno.h includes for errno and
string.h for strerror in base/

Review URL: https://codereview.chromium.org/1434533004

Cr-Commit-Position: refs/heads/master@{#358477}
mostynb
include what you use: errno.h in sandbox/
Adding some missing errno.h includes for errno in sandbox/

Review URL: https://codereview.chromium.org/1422253004

Cr-Commit-Position: refs/heads/master@{#358474}
mostynb
include what you use: errno.h in v4l2_webcam.cc
Add missing errno.h include in v4l2_webcam.cc

Review URL: https://codereview.chromium.org/1430183002

Cr-Commit-Position: refs/heads/master@{#358468}
mostynb
include what you use: errno.h and string.h in ipc_channel_posix_unittest.cc
Add missing errno.h include for errno and string.h include for strerror.

Review URL: https://codereview.chromium.org/1409833013

Cr-Commit-Position: refs/heads/master@{#358467}
mostynb
include what you use: errno.h in chrome/
Adding some missing errno.h includes for errno in chrome/

Review URL: https://codereview.chromium.org/1413373010

Cr-Commit-Position: refs/heads/master@{#358463}
mostynb
include what you use: errno.h in chromecast/
Adding some missing errno.h includes for errno in chromecast/

Review URL: https://codereview.chromium.org/1429373002

Cr-Commit-Position: refs/heads/master@{#358454}
mstensho
Fix off-by-one (or off-by-one-sixtyfourth) error when checking what a column can hold.
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1428063009

Cr-Commit-Position: refs/heads/master@{#358447}
sigbjornf
Add missing prefinalizer registration after r358299.
TBR=oilpan-reviews
BUG=541338

Review URL: https://codereview.chromium.org/1427023007

Cr-Commit-Position: refs/heads/master@{#358425}
mostynb
telemetry_chrome_test_base should depend on dump_syms for the host toolset specifically
On Linux, dump_syms is only defined for the host toolset.
Without this patch, linux gcc cross-compile builds fail
when running gyp, ever since
https://codereview.chromium.org/1419143006/ landed.

Clang builds are unaffected, because they don't have
separate host and target toolsets.

BUG=507796,552436
CQ_EXTRA_TRYBOTS=tryserver.chromium.perf:linux_perf_bisect;tryserver.chromium.perf:mac_10_10_perf_bisect;tryserver.chromium.perf:android_nexus5_perf_bisect

Review URL: https://codereview.chromium.org/1422703008

Cr-Commit-Position: refs/heads/master@{#358406}
fs
Rebaseline a few SVG tests for XP
 svg/dom/length-list-parser.html
 svg/transforms/text-with-pattern-with-svg-transform.svg
 svg/hixie/perf/006.xml

TBR=szager@chromium.org
BUG=552433,467464

Review URL: https://codereview.chromium.org/1413183008

Cr-Commit-Position: refs/heads/master@{#358405}
philipj
Deprecate SVGElement.offsetParent/offsetTop/offsetLeft/offsetWidth/offsetHeight
Intent to Deprecate:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/JlAEmQpWMWA/63acYbmdDwAJ

Simply using [Deprecate] is unfortunately not supported.

Tests are updated to avoid the attributes to the extent possible.

BUG=463116

Review URL: https://codereview.chromium.org/1405283006

Cr-Commit-Position: refs/heads/master@{#358333}
mstensho
Manually revert "Fold out-of-flow objects into anonymous blocks when removing children"
Also revert "Auto-rebaseline for r357886"

First attempt at reverting failed: https://codereview.chromium.org/1419053004/

Reason for revert:
Causing use-after-free crashes in entire rendering pipeline, reverting.

Original issue's description:
> Fold out-of-flow objects into anonymous blocks when removing children
>
> Sometimes when we remove a child we end up with a float or out-of-flow object beside
> an anonymous block. When that happens, fold the float/out-of-flow object into the
> anonymous box as that is where it would have lived if they were siblings in the
> first place.
>
> BUG=322039
>
> Committed: https://crrev.com/44402d152cd0bb788db3136ab08c3c76ec348cd1
> Cr-Commit-Position: refs/heads/master@{#357886}

TBR=robhogan@gmail.com
BUG=322039

Review URL: https://codereview.chromium.org/1411543009

Cr-Commit-Position: refs/heads/master@{#358293}
davve
Make LayoutImageResource::image() parameter explicit
It makes the code more explicit and easier to read. No functional
change expected.

BUG=551419

Review URL: https://codereview.chromium.org/1411693006

Cr-Commit-Position: refs/heads/master@{#358287}
sigbjornf
Disable eager tracing for thread-terminated GCs.
The Oilpan marking phase enables and sets up a stack limit
that the eager tracing calls should not exceed while visiting the live
object graph. The marking phase is single threaded. The stack limit
is reset and eager marking disabled once the marking phase has
completed -- thread local weak processing (and its slight amount of
tracing) is run with it disabled.

Do not enable such an eager marking stack limit for the GCs that are run
for a thread's heap when the thread is terminated, as this risks conflicting
with any thread-local weak processing that is still underway. The slight
performance gain that eager marking brings is not an issue for such GCs.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1429273002

Cr-Commit-Position: refs/heads/master@{#358273}
mstensho
Don't propagate pagination struts to flow threads.
We'd lose the strut that way, since there's nobody to pick it up from a flow
thread.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1419703006

Cr-Commit-Position: refs/heads/master@{#358195}
mstensho
Calculate minimum column height after layout.
This moves some multicol specific code out from LayoutBlock and
LayoutBlockFlow. More importantly, though, is that once we add optimizations
to skip subtrees during multicol layout, collecting this information during
layout isn't going to work.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1406973008

Cr-Commit-Position: refs/heads/master@{#358171}
sigbjornf
Remove unwanted eager finalization of some mediastream objects.
Adjust the use of EAGERLY_FINALIZE() for mediastream objects:

 - MediaStreamComponent will be eagerly finalized and notify its
   MediaStreamTrack observers. Consequently, MediaStreamTrack cannot
   and need not be eagerly finalized.
 - MediaStream no longer need to eagerly unregister as a client from
   its MediaStreamDescriptor member.

Not doing so results in mutual dependencies between finalizers run by
eagerly finalized objects, causing use-after-frees.

R=haraken
BUG=496535

Review URL: https://codereview.chromium.org/1421373007

Cr-Commit-Position: refs/heads/master@{#358062}
mostynb
ozone: evdev: Add missing errno.h #include in event_converter_evdev.cc
Review URL: https://codereview.chromium.org/1419813009

Cr-Commit-Position: refs/heads/master@{#358057}
mostynb
include what you use: errno.h in process_memory_dump.cc
Followup to https://codereview.chromium.org/1398163003 - include errno.h
since we use errno in process_memory_dump.cc.

BUG=542503

Review URL: https://codereview.chromium.org/1417743004

Cr-Commit-Position: refs/heads/master@{#358024}
fs
Replace open-coded toSVG<type> with DEFINE_SVG_PROPERTY_TYPE_CASTS
Also replace some includes of SVGAnimated*.h with SVG*.h where the
latter will suffice. (* = {Integer,Number,Property})
Relocate the DEFINE_SVG_PROPERTY_TYPE_CASTS macro to SVGProperty.h.

Review URL: https://codereview.chromium.org/1412123015

Cr-Commit-Position: refs/heads/master@{#357783}
sigbjornf
Upon load failure, remove sync script from pending queue.
If a script element is to be loaded synchronously and executed in order,
it's queued for execution before loading. Should that load fail, the
immediate execution of the script,

  https://html.spec.whatwg.org/#execute-the-script-block

should only result in an error event being dispatched.

Implementation-wise, along with signalling error, the failed script must also
be removed from the internal in-order pending execution queue. We're done with
(not) executing the script and failure to remove it will cause subsequent
processing of its pending queue to see the script as having failed
to load and re-dispatch an error event.

R=tkent
BUG=503077

Review URL: https://codereview.chromium.org/1424703007

Cr-Commit-Position: refs/heads/master@{#357778}
sigbjornf
Oilpan: fix build after r357748.
TBR=oilpan-reviews
BUG=465126
NOTRY=true

Review URL: https://codereview.chromium.org/1422463008

Cr-Commit-Position: refs/heads/master@{#357776}
davve
Clean out TestExpectations for SVG in <object> tests
The timeouts and fails should be addressed now by splitting tests and
slightly fuzzier matching.

BUG=392640

Review URL: https://codereview.chromium.org/1415573008

Cr-Commit-Position: refs/heads/master@{#357642}
sigbjornf
Overflow-proof the computation of stack region end.
Add asserts + be more careful about type conversions when
computing the stack limit pointer value.

R=haraken
BUG=none

Review URL: https://codereview.chromium.org/1425243004

Cr-Commit-Position: refs/heads/master@{#357569}
mstensho
Introduce LayoutBox::paginationBreakability().
The engine actually cares about three states of column / page breakability
inside an object:

1. Breakable. Look inside for possible break points.
2. Unbreakable. Breaking inside would pretty much guarantee ugly layout.
3. Preferable not to break (break-inside:avoid).

LayoutBox::isUnsplittableForPagination() returned true for #2, and false for #1
and #3.

The only one that cares about #3 at the moment is adjustForUnsplittableChild()
in LayoutBlockFlow, which handled #3 on its own after checking with
isUnsplittableForPagination(), but we're soon going to have to care about it at
other places too, so let's introduce a method that can tell us.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1426673005

Cr-Commit-Position: refs/heads/master@{#357559}
fs
Use a converter to resolve style for -webkit-filter and backdrop-filter
Gets rid of the custom builders with a simple refactor of the
FilterOperationResolver.

BUG=109224

Review URL: https://codereview.chromium.org/1407123011

Cr-Commit-Position: refs/heads/master@{#357540}
sigbjornf
Oilpan: add missing pointer initialization after r357529.
TBR=oilpan-reviews
BUG=542401
NOTRY=true

Review URL: https://codereview.chromium.org/1431683004

Cr-Commit-Position: refs/heads/master@{#357534}
mstensho
Always lay out the flow thread when the multicol container is laid out.
This makes it possible to put an auto-height multicol inside another
auto-height multicol. It goes like this: first we balance the inner multicol
without knowing the height of the outer one. When we know the height of the
inner one, we can balance the outer one, and re-lay out.
markForPaginationRelayoutIfNeeded() will make sure that the inner multicol
container is marked for layout in that pass, and here it is crucial that we
enter its flow thread too, since that's where the contents are (so that we
realize that the outer multicol is height-restricted, so that we need to insert
an additional row (fragmentainer group) for the inner one).

This change triggers an additional flow thread layout pass in some cases, which
exposed crbug.com/534751 in two layout tests, so I modified the tests somewhat
to avoid triggering the additional layout pass altogether.

Explanation for the extra layout pass: When initially laying out a document,
and the document doesn't specify whether scrollbars should be shown or not,
Blink assumes that there will be a vertical scrollbar. If we find out after
layout that there's no need for it, it is removed, followed by another layout
pass, because removing the scrollbar gave the viewport a new width.

When an object changes its width, all children will be marked for layout. This
also happens if a child's width is fixed (which admittedly really seems
unnecessary).

Example:
<!DOCTYPE html>
<html>
    <body>
        <div id="outer" style="width:100px;">
            <div id="inner"></div>

When the initial vertical scrollbar is removed, the viewport width changes, so
HTML and BODY need to be laid out again, since their widths are auto.
Additionally, we lay out #outer, because it's a child of something that got a
new width (even if the child has a fixed width). But at least we won't re-lay
out #inner, since its parent doesn't change its width.

The tests that had to be modified had a fixed-width multicol container child of
BODY, which got re-laid out when the initial scrollbar disappeared. With this
CL, its child flow thread would also be re-laid out, which would expose
crbug.com/534751 , since laying out a paginated table twice is one way of
triggering that bug.

BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1429903003

Cr-Commit-Position: refs/heads/master@{#357393}
philipj
Remove HTMLFrameElement.prototype.getSVGDocument()
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/_9iRam2UKBI/2sM9_G7HDQAJ

BUG=549323

Review URL: https://codereview.chromium.org/1424313004

Cr-Commit-Position: refs/heads/master@{#357368}
fs
Reduce footprint of FilterEffectBuilder::build
Since we know the resulting size of the sepia(...) and grayscale(...)
matrices, allocate the space for them up front, and then use
uncheckedAppend(...) to reduce the code bloat from regular append(...).
This strikes a balance between using float[20] (entirely unchecked but
less code) and what's currently there.

Move the setup of the matrices to helper functions to reduce the
"weight" (cognitive load) of these two cases in the switch somewhat.

Code size is reduced by ~1.35kB on x86-64/Linux.

Review URL: https://codereview.chromium.org/1406403008

Cr-Commit-Position: refs/heads/master@{#357365}
sigbjornf
Oilpan: fix build after r357332.
TBR=oilpan-reviews
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/1414703006

Cr-Commit-Position: refs/heads/master@{#357357}
davve
Split tests again because of timeouts on debug bots
This time down to 36 tests per file. Also add a meta tag to signal
that the tests may take longer time.

BUG=392640

Review URL: https://codereview.chromium.org/1431563003

Cr-Commit-Position: refs/heads/master@{#357344}
mstensho
Deduct pagination struts when calculating initial column height.
Even if height is auto, nested multicol sets a column height in the initial
layout pass (set to the remaining height in the outer multicol container; this
all takes place in resetColumnHeight()), which enables pagination in the first
layout pass, and may thus insert pagination struts. We need to exclude those
when calculating the initial balanced column height estimate. The reason why we
set this height before layout in this case, is that we need to figure out how
many fragmentainer groups (rows) we need.

In the future, we may also consider setting a height before layout for
non-nested auto-height multicol containers, as an optimiation, since that may
reduce the number of layout passes in some cases.

Cleaned up the code in MultiColumnFragmentainerGroup::resetColumnHeight(). No
behavioral changes there, and the TODO is adressed with this CL.

R=leviw@chromium.org
BUG=447718

Review URL: https://codereview.chromium.org/1420713003

Cr-Commit-Position: refs/heads/master@{#357338}
tsniatowski
Fix //tools/gn/example on Linux: missing current_os and related vars
The example GN project's BUILDCONIG.gn needs to set {target,current}_{os,cpu)
variables like the Chromium BUILDCONFIG file does. Otherwise some conditionals
don't work like they do in Chromium and the project doesn't link on Linux,
which is needlessly confusing.

To test, `gn gen out' in //tools/gn/example, and then `ninja -C out'.

R=brettw@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1429073002

Cr-Commit-Position: refs/heads/master@{#357329}
sigbjornf
Sync remaining allocation size on in-place backing store recycling.
When a heap's current allocation point can simply be moved after the tail
object allocation is either freed, expanded or shrunk, make sure the
snapshot'ed m_lastRemainingAllocationSize is then always adjusted at the
same time.

Not doing so risks later re-syncs of m_lastRemaininingAllocationSize to
be invoked on a "bigger" heap than last time, i.e.,
m_lastRemainingAllocationSize < m_remainingAllocationSize, which is an
unexpected state to be in. Simply avoid that state from ever being entered,
by synchronously updating m_lastRemainingAllocationSize.

setRemainingAllocationSize(size_t) handles this, along with updating the
overall heap allocation counts.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1424573003

Cr-Commit-Position: refs/heads/master@{#357292}
sigbjornf
Fix weak processing over cleared hash tables.
When a hash table of weak references is traced during the GC
marking phase, a weak callback is registered for processing after
that initial marking pass.

The hash table may be populated with entries at the time when
that weak callback is registered, but may end up being cleared
before the weak callback actually gets to run.

Account for that latter possibility by having the weak callback
being invoked first gracefully check if the backing table exists
before proceeding to process it.

R=haraken
BUG=549732
NOTRY=true

Review URL: https://codereview.chromium.org/1410373006

Cr-Commit-Position: refs/heads/master@{#357282}
mostynb
document COMPILER(GCC) and COMPILER(MSVC) a little better
Clang pretends to be gcc 4.4 by defining __GNUC__ and some related macros,
and therefore COMPILER(GCC) evaluates to 1 there.  To check for GCC
specifically, you need to check something like COMPILER(GCC) && !COMPILER(CLANG).

A similar situation happens with COMPILER(MSVC) in Clang when building for
windows (since Clang emulates MSVC there).

Review URL: https://codereview.chromium.org/1420613005

Cr-Commit-Position: refs/heads/master@{#357260}
tsniatowski
Fix Python imported modules depfile generation
Some Python scripts incorrectly reported no python module deps, for
example a manual run of build/android/gn/zip.py would create an empty
depfile (without even a build_utils.py entry).

GetPythonDependencies assumed that CHROMIUM_SRC is an absolute path,
turns out that depends on details of how build_utils.py is imported.
If it happened to be relative, all modules would be omitted from the
depfile as "system" modules, as they did not match CHROMIUM_SRC. Fix by
using DIR_SOURCE_ROOT which is absolute (and assert that it is).

R=cjhopman@chromium.org, agrieve@chromium.org
BUG=359249

Review URL: https://codereview.chromium.org/1412793012

Cr-Commit-Position: refs/heads/master@{#357246}
sigbjornf
Oilpan: insist on persisted plugin disposal upon clearing.
Follow up r355010 and arrange for persisted plugin widget disposal
when the plugin is completely detached and removed from the tree.

r355010 restricted disposal to not happen for persisted widgets
when re-attaching, but also ended up not disposing for the
fully-detached persistent plugin widget case.

Lacking those, widgets would end up being finalized without their
required dispose() having been called first.

R=haraken
BUG=544175

Review URL: https://codereview.chromium.org/1422503009

Cr-Commit-Position: refs/heads/master@{#357142}
davve
Remove stale comment
cachedImage->imageForLayoutObject() no longer returns
BitmapImages. The surrounding code is still correct since
cachedImage->imageForLayoutObject() may return a SVGImageForContainer
which does not propagate the correct filename extension.

NOTRY=true
BUG=128055

Review URL: https://codereview.chromium.org/1429803002

Cr-Commit-Position: refs/heads/master@{#357105}
tsniatowski
Run gn_unittests on Windows 7 bots
R=dpranke@chromium.org
BUG=549254

Review URL: https://codereview.chromium.org/1422333005

Cr-Commit-Position: refs/heads/master@{#357060}
sigbjornf
Oilpan: fix webkit unit tests following r356852.
TBR=oilpan-reviews
BUG=546729
NOTRY=true

Review URL: https://codereview.chromium.org/1428883002

Cr-Commit-Position: refs/heads/master@{#356958}
tsniatowski
Fix GN unittests on windows broken by abs-path change
Mixed up gen_dir and out_dir in one win-only unit test in a recent CL,
https://codereview.chromium.org/1420973003

R=brettw@chromium.org, andybons@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1408793007

Cr-Commit-Position: refs/heads/master@{#356945}
sigbjornf
Oilpan: fix build after r356804.
TBR=oilpan-reviews
BUG=530436
NOTRY=true

Review URL: https://codereview.chromium.org/1430703002

Cr-Commit-Position: refs/heads/master@{#356827}
davve
Split <object> tests further to reduce timeout risk
BUG=392640

Review URL: https://codereview.chromium.org/1423093005

Cr-Commit-Position: refs/heads/master@{#356822}
philipj
Remove the named item getters on TextTrackList and TextTrackCueList
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/fuNdIeOnmTo/kT-R9dnFDAAJ

BUG=535475
R=fs@opera.com

Review URL: https://codereview.chromium.org/1418133011

Cr-Commit-Position: refs/heads/master@{#356809}
mstensho
Require spanners to have the multicol container as their nearest block formatting context.
The editor's draft [1] suggests that a column-span:all object needs to be in
the same block formatting context, so disallow column-span for everything else.
MSIE does the same. Gecko doesn't support spanners.

While this simplifies the code and gives us less to worry about (and it
actually fixes bug 529737, although that wasn't my main motivation here),
another reason to make this change is that we'd get assertion failures if we
put a spanner inside a scrollable flex item inside a flexbox inside a multicol
inside another flexbox. The reason why the assertion failures happen is the
LayoutBlock::finishDelayUpdateScrollInfo() mechanism, which may jump to some
arbitrary block in the subtree and lay it out directly. While that is bad on
its own, the multicol implementation should now at least be immune to damage
caused by that.

Removed some old tests that are now invalid, because they expected spanners to
be created inside scrollable containers. This no longer works, because
non-visible overflow implies a new block formatting context.

[1] https://drafts.csswg.org/css-multicol/#column-span

BUG=529737
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1421423003

Cr-Commit-Position: refs/heads/master@{#356680}
sigbjornf
Sync Oilpan expectations for plugins/fullscreen-plugins-dont-reload.html
TBR=oilpan-reviews
BUG=544175
NOTRY=true

Review URL: https://codereview.chromium.org/1418613014

Cr-Commit-Position: refs/heads/master@{#356522}
sigbjornf
Precisely determine Windows thread stack size (reland)
The Thread Information Block (TIB)'s StackLimit records the end of
the committed area of the thread's stack reservation, hence it cannot be
used to determine the overall size of the reserved stack. Switch to
a VirtualQuery() lookup instead, but taking care to cache the result per
thread so as to avoid calling overhead.

R=haraken
BUG=546396

Review URL: https://codereview.chromium.org/1409243011

Cr-Commit-Position: refs/heads/master@{#356521}
davve
Disallow assigning a MediaSession after the resource has been selected
https://mediasession.spec.whatwg.org/#extensions-to-the-htmlmediaelement-interface

BUG=497735

Review URL: https://codereview.chromium.org/1420223002

Cr-Commit-Position: refs/heads/master@{#356299}
philipj
Move the Pointer Event extensions of GlobalEventHandlers to a new section
BUG=460722
R=rbyers@chromium.org

Review URL: https://codereview.chromium.org/1423973003

Cr-Commit-Position: refs/heads/master@{#356296}
sigbjornf
Precisely determine Windows thread stack size.
The Thread Information Block (TIB)'s StackLimit records the end of
the committed area of the thread's stack reservation, hence it cannot be
used to determine the overall size of the reserved stack. Switch to
a VirtualQuery() lookup instead, but taking care to cache the result per
thread so as to avoid calling overhead.

R=haraken
BUG=546396

Review URL: https://codereview.chromium.org/1409243011

Cr-Commit-Position: refs/heads/master@{#356287}
sigbjornf
Precisely determine Windows thread stack size.
The Thread Information Block (TIB)'s StackLimit records the end of
the committed area of the thread's stack reservation, hence it cannot be
used to determine the overall size of the reserved stack. Switch to
a VirtualQuery() lookup instead, but taking care to cache the result per
thread so as to avoid calling overhead.

R=haraken
BUG=546396

Review URL: https://codereview.chromium.org/1409243011

Cr-Commit-Position: refs/heads/master@{#356268}
mstensho
Even block flows with inline children must be examined when balancing columns.
Even if a block flow is marked as having only inline children, it may still
contain interesting floats that need to be paginated.

BUG=547024
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1421883002

Cr-Commit-Position: refs/heads/master@{#356262}
sigbjornf
Oilpan: fix build after r356253.
R=haraken
BUG=520496
NOTRY=true

Review URL: https://codereview.chromium.org/1423703006

Cr-Commit-Position: refs/heads/master@{#356258}
fs
Remove dead method SVGLength::blend
Likely dead since https://codereview.chromium.org/983103003

Review URL: https://codereview.chromium.org/1419423002

Cr-Commit-Position: refs/heads/master@{#356075}
fs
Remove SVGPathElement.pathSegList and related interfaces
This CL removes the SVGPathSegList collection of objects and interface:

  SVGPathSegList{,TearOff}
  SVGPathSeg*

and support classes such as SVGPathSegListBuilder and SVGPathSegListSource.

The SVGPathSegList class is renamed to SVGPath, and stripped of all it's
listiness - essentially reducing it to a SVGPathByteStream. SVGAnimatedPath
is updated to contain the new type.
A new specialization of SVGAnimatedProperty is added for properties that
don't have any associated tear-off type.

The SVGPathSeg.h header file which still contain various path segment
description data is renamed to SVGPathData.h.

All tests for SVGPathSeg* functionality are removed, interface tests are
updated to not include the removed interfaces and in one case the use of
the pathSegList is replaced with the string representation.

TBR=timvolodine@chromium.org
BUG=539385

Review URL: https://codereview.chromium.org/1416273002

Cr-Commit-Position: refs/heads/master@{#356063}
mstensho
Never paginate fixed-positioned objects.
They are supposed to be repeated on every page anyway. Not that we currently do
that, but there's still no need to paginate them. It can only do harm.

Added a flexbox test, which is what the bug report was about. This regressed
for flexbox (and other types of non-block-container blocks as well) with
https://codereview.chromium.org/1360753002 , but this has actually been broken
for ages for regular block containers, so I threw in a bonus test for that too.

BUG=535163
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1426443003

Cr-Commit-Position: refs/heads/master@{#356041}
rune
Remove unused m_src from FontFace class.
Review URL: https://codereview.chromium.org/1419883005

Cr-Commit-Position: refs/heads/master@{#356035}
sigbjornf
Sync test expectations following r355983.
TBR=oilpan-reviews
BUG=546559
NOTRY=true

Review URL: https://codereview.chromium.org/1426663002

Cr-Commit-Position: refs/heads/master@{#356019}
sigbjornf
Zero-initialize persistent heap vector inline backing buffers.
A persistent heap collection object is allocated off-heap,
along with its inlined buffer (if any.)

For heap-allocated backing buffers (inlined in a heap vector or
separate), the Oilpan allocator will provide a zero-initialized
chunk of memory to use. Consequently the invariant initially
holds that unused slots of the backing buffer are all zero initialized
-- something needed for precise tracing during GC marking

To have that invariant hold for the persistent heap vectors also,
we have to explicitly clear out the inline backing buffers on
(off-heap) allocation.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1410223006

Cr-Commit-Position: refs/heads/master@{#356014}
tsniatowski
Make sure abs-path gn labels have separate target_gen_dirs
Use gen/ABS_PATH/... for target_gen_dir of build files outside of the
source tree, to mimic obj/ABS_PATH that's used for object directories
for such build files.

Previously, all build files outside of the source tree would use
root_gen_dir (e.g. out/Default/gen) as target_gen_dir. This broke the
"target_gen_dir is unique between different BUILD.gn files" assumption,
causing strange behavior and "ninja: multiple targets generate ..."
warnings for users of absolute path BUILD.gn files outside of //.

BUG=445454
R=brettw@chromium.org

Review URL: https://codereview.chromium.org/1420973003

Cr-Commit-Position: refs/heads/master@{#356011}
sigbjornf
Oilpan: add missing RawPtr<> initialization following r355274.
TBR=oilpan-reviews
BUG=442163

Review URL: https://codereview.chromium.org/1423483006

Cr-Commit-Position: refs/heads/master@{#355983}
sigbjornf
Have NetworkStateNotifier keep untraced ExecutionContext observers.
NetworkStateNotifier keeps track of its observing ExecutionContexts;
following r355234 this is a persistent hash map of weak references
(with Oilpan.) As observers may live on any thread, the first thread
that registers would then create the persistent heap collection on its
heap. This is at odds with the lifetime of NetworkStateNotifier, and
as ExecutionContexts manually manage their observership, revert to using
a HashMap.

R=haraken
BUG=515524

Review URL: https://codereview.chromium.org/1409853007

Cr-Commit-Position: refs/heads/master@{#355970}
sigbjornf
Oilpan: fix build after r355906.
TBR=oilpan-reviews
BUG=475655
NOTRY=true

Review URL: https://codereview.chromium.org/1426553002

Cr-Commit-Position: refs/heads/master@{#355965}
mstensho
Bypass containing block size special-code for fixed-positioneds when printing.
Consulting FrameView during printing doesn't really provide reliable results,
since class might just know the size of what we have on the screen.

While the size of their containing block (i.e. the page) is now calculated
correctly when printing, note that fixed positioned objects are still not
repeated on every page as they should according to the spec; they are still
only printed on the first page. But at least with the correct size and
position now. :)

BUG=544797
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1411313004

Cr-Commit-Position: refs/heads/master@{#355893}
fs
Hoist some pre-condition checks out of SVGAngle/SVGEnumeration
This moves checking of values closer to the "DOM" part of the API.

Review URL: https://codereview.chromium.org/1412713004

Cr-Commit-Position: refs/heads/master@{#355862}
fs
Remove some dead code in SVG "mixins"
addSupportedAttributes() is no longer used (handled by the property
map). Ditto for SVGFitToViewBox::parseAttribute and
SVGTests::parseAttribute.
Also drop the Document& to SVGTests::isValid since it isn't used.

Review URL: https://codereview.chromium.org/1420263002

Cr-Commit-Position: refs/heads/master@{#355842}
mstensho
Manual rebaseline for r355760 https://codereview.chromium.org/1423643002
Re-mark some tests as crashing for Windows 10. Had to temporarily comment them
out to get the rebaselining working. Or at least so I think.

BUG=544794
TBR=leviw@chromium.org

Review URL: https://codereview.chromium.org/1419183002

Cr-Commit-Position: refs/heads/master@{#355772}
philipj
Clarify that a document().frame() access in HTMLMediaElement cannot be null
Access to document().frame() in HTMLMediaElement is always null-checked,
so use the existing frame variable to make it obvious here as well.

R=fs@opera.com

Review URL: https://codereview.chromium.org/1411883003

Cr-Commit-Position: refs/heads/master@{#355771}
davve
Introduce WebMediaSession
WebMediaSession is the API enabling web exposed MediaSession objects
to control platform implementations of media session related
functionality.

Implementation will begin with Android and other platforms will be
added later.

Re-land of https://codereview.chromium.org/1370453002/ with
https://code.google.com/p/chromium/issues/detail?id=546394 fixed.

BUG=497735, 546394

Review URL: https://codereview.chromium.org/1370453002

Cr-Commit-Position: refs/heads/master@{#355058}

Review URL: https://codereview.chromium.org/1415923003

Cr-Commit-Position: refs/heads/master@{#355766}
mstensho
Print absolutely positioned objects correctly when sized against the viewport.
Remove special code for printing from computeLogicalHeight() and
updateLogicalWidth() in LayoutView. The size of the containing block
established by the viewport should be equal to the size of the page, not the
size of the document.

Return the correct page size from LayoutView::layoutSize() instead of 0x0.
Special code is still needed here, because we cannot use FrameView to get the
page size (because the size of the FrameView corresponds to what we have on the
screen).

BUG=544794
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1423643002

Cr-Commit-Position: refs/heads/master@{#355760}
fs
Use PathSegmentData+SVGPath{Consumer,Source} in PathSVGInterpolation
Drive the generation of SVG paths using SVGPathParser, and use
SVGPathSource and SVGPathByteStreams to avoid using the SVGPathSeg*
interfaces which will be going away RSN.

BUG=539385

Review URL: https://codereview.chromium.org/1408143004

Cr-Commit-Position: refs/heads/master@{#355759}
sigbjornf
Oilpan: fix build after r355581.
TBR=oilpan-reviews
BUG=543685
NOTRY=true

Review URL: https://codereview.chromium.org/1421783002

Cr-Commit-Position: refs/heads/master@{#355645}
mstensho
Manual rebaseline for r355526 https://codereview.chromium.org/1413573004/
Re-mark some tests as crashing for Windows 10. Had to temporarily comment them
out to get the rebaselining working. Or at least so I think.

BUG=544786
TBR=leviw@chromium.org

Review URL: https://codereview.chromium.org/1418503007

Cr-Commit-Position: refs/heads/master@{#355616}
sigbjornf
Oilpan: fix build after r355578.
TBR=oilpan-reviews
BUG=447082
NOTRY=true

Review URL: https://codereview.chromium.org/1421553003

Cr-Commit-Position: refs/heads/master@{#355592}
mstensho
Once the flow thread needs layout, mark all column sets for layout as well.
We need this to make sure that overflow is updated. Laying out a column set is
very cheap anyway, since they never have children. Since we now do this, we can
remove a few setNeedsLayout calls scattered around the code.

BUG=540512
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1414193004

Cr-Commit-Position: refs/heads/master@{#355568}
bratell
Smaller initial DisplayItemList to use less memory.
The previous initial size of the DisplayItemList was very pessimistic
and used 10+ KB (64 * sizeof(BeginTransform3DDisplayItem)). On a page like
YouTube there were 50 of them in use so a total of half a MB.

Looking at usage patterns, 512 bytes seems to be enough in many cases
which would save most of that half MB (not all committed so the amount
of reduced RAM usage is in the 1-200 KB range).

BUG=538615

Review URL: https://codereview.chromium.org/1417533009

Cr-Commit-Position: refs/heads/master@{#355556}
mstensho
Set page height for printing tests.
Without this we'd fail to properly re-lay out the document when switching to
print layout, because LayoutView::pageLogicalHeight() would be 0, which
typically makes everyone believe that we're not paginated.

Added a layout tree dump test for this (found no other way of testing this).
Also have to rebaseline two existing tests, because the layout tree dump
changes. The pixel results are unaffected, though.

BUG=544786
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1413573004

Cr-Commit-Position: refs/heads/master@{#355526}
philipj
Measure usage of the HTMLFieldSetElement.elements element
This will likely be made an HTMLCollection in the spec:
https://github.com/whatwg/html/issues/200

Knowing the usage will give some clue about the risk of the change.

R=tkent@chromium.org

Review URL: https://codereview.chromium.org/1415873002

Cr-Commit-Position: refs/heads/master@{#355522}
davve
Revert of Introduce WebMediaSession (patchset #13 id:240001 of https://codereview.chromium.org/1370453002/ )
Reason for revert:
Tests leak under address sanitizer. See https://code.google.com/p/chromium/issues/detail?id=546394.

Original issue's description:
> Introduce WebMediaSession
>
> WebMediaSession is the API enabling web exposed MediaSession objects
> to control platform implementations of media session related
> functionality.
>
> Implementation will begin with Android and other platforms will be
> added later.
>
> BUG=497735
>
> Committed: https://crrev.com/9b97db48d95635e9c5d48676df8dc51c9e5eef2a
> Cr-Commit-Position: refs/heads/master@{#355058}

TBR=jochen@chromium.org,avayvod@chromium.org,mlamouri@chromium.org,philipj@opera.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=497735

Review URL: https://codereview.chromium.org/1412933005

Cr-Commit-Position: refs/heads/master@{#355503}
fs
Use getAttribute to sample 'd' attribute in interpolation-test.js
pathSegList is going away, so use getAttribute('d') instead.
Adjust some expectations - mostly for 'z' vs 'Z' (not possible to
discern after parsing.)

BUG=539385

Review URL: https://codereview.chromium.org/1417103003

Cr-Commit-Position: refs/heads/master@{#355476}
sigbjornf
Avoid image resource leaks in frame-related unit tests.
When ImageLoader issues a (successful) load, it will keep its associated
element alive until the load has finished, so as to guarantee that the
load will complete without DOM mutations destructing the element.

This keep-alive reference is at odds with tidy shutdowns from unit tests
that issue image resource loads in particular, as they will not have
completed upon shutdown if the load hasn't otherwise been triggered.
By default they won't be, eaving the associated element and its
ImageLoader referred-to resources as reportedly leaking.

To avoid such leaks, insist that image resources are eagerly loaded
from the network by WebViewHelpers, if needs be. Which means that all such
external resources are mocked & accounted for.

R=haraken, thakis
BUG=526423

Review URL: https://codereview.chromium.org/1415123002

Cr-Commit-Position: refs/heads/master@{#355318}
sigbjornf
Reset CORS status upon re-initiating fetch of a stylesheet.
When initiating a fetch of a potentially cross-origin stylesheet that's
already fetching, reset the is-following-CORS flag along with clearing
the loading resource.

R=haraken,mkwst
BUG=544690

Review URL: https://codereview.chromium.org/1413563005

Cr-Commit-Position: refs/heads/master@{#355306}
joleksy
Conditionally include ui_base dependency in version_info
Defining use_unofficial_version_number will allow controlling
the inclusion of ui_base dependency, indepentently of used branding.

BUG=

Review URL: https://codereview.chromium.org/1419633002

Cr-Commit-Position: refs/heads/master@{#355292}
sigbjornf
Oilpan: fix build after r355274.
TBR=oilpan-reviews
BUG=442163
NOTRY=true

Review URL: https://codereview.chromium.org/1418823002

Cr-Commit-Position: refs/heads/master@{#355287}
fs
Convert the path fuzzer test to a unit test
This salvages the interesting bits of svg/dom/fuzz-path-parser.html into the
SVGPathParserTest.Simple unit test.

BUG=539385

Review URL: https://codereview.chromium.org/1407133007

Cr-Commit-Position: refs/heads/master@{#355282}
philipj
Revert "Use DOMSettableTokenList for {HTMLAnchorElement, HTMLAreaElement}.ping."
This reverts the following CLs:
https://codereview.chromium.org/1377163002
https://codereview.chromium.org/1398993002
https://codereview.chromium.org/1396983003

BUG=498219, 543031, 545326

Review URL: https://codereview.chromium.org/1416043002

Cr-Commit-Position: refs/heads/master@{#355277}
philipj
Remove MediaController (already diabled by REF)
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/66zec0JPy-k/-89CRX4VBQAJ

It was put behind a disabled RuntimeEnabledFeature in 2014:
https://codereview.chromium.org/250553006

BUG=none

Review URL: https://codereview.chromium.org/1373423003

Cr-Commit-Position: refs/heads/master@{#355260}
mostynb
be more explicit about gconf and glib conditions in net/BUILD.gn
BUG=512899,516899

Review URL: https://codereview.chromium.org/1398473005

Cr-Commit-Position: refs/heads/master@{#355257}
the_jk
Fix gyp/gn with configuration_policy=0
Running gyp in chromium with configuration_policy set to 0 fails as
multiple targets that are behind condition of configuration_policy==1
are referenced without corresponding conditionals

BUG=530579

Review URL: https://codereview.chromium.org/1414583004

Cr-Commit-Position: refs/heads/master@{#355128}
fs
Use getAttribute in path animation tests
Use getAttribute('d') and exact string matching instead of using
animatedPathSegList. The base value checks are dropped. In some cases
relative close commands ('z') are replaced with absolute ones ('Z').

BUG=539385

Review URL: https://codereview.chromium.org/1417593003

Cr-Commit-Position: refs/heads/master@{#355119}
davve
Introduce WebMediaSession
WebMediaSession is the API enabling web exposed MediaSession objects
to control platform implementations of media session related
functionality.

Implementation will begin with Android and other platforms will be
added later.

BUG=497735

Review URL: https://codereview.chromium.org/1370453002

Cr-Commit-Position: refs/heads/master@{#355058}
sigbjornf
Plug RemoteFrame leak in WebFrameTest.SwapMainFrameWhileLoading.
R=haraken
BUG=526423

Review URL: https://codereview.chromium.org/1414193002

Cr-Commit-Position: refs/heads/master@{#355029}
fs
Add unit test for SVG path parsing
This converts svg/dom/path-parser.html into a roughly equivalent unit
test.
Widen the assert in the SVGPathStringSource constructor to allow "" but
not (null) Strings.
Also move the non-fuzzed tests from svg/dom/fuzz-path-parser.html.

BUG=539385

Review URL: https://codereview.chromium.org/1413953002

Cr-Commit-Position: refs/heads/master@{#355008}
mstensho
Need to reposition an out-of-flow object *before* re-paginating it.
https://codereview.chromium.org/1343163005 removed code that was actually
needed. Instead of simply reverting the necessary parts, I rewrote them.
The old code called updateLogicalHeight() before layout, when all it wanted to
do was set the logical top. This made me a bit uneasy, because that could in
theory prevent the height change from being detected during layout() (and
LayoutBlockFlow::layoutBlockFlow() would for instance fail to set
|relayoutChildren| before calling layoutPositionedObjects()). Furthermore, it
used to check if the child establishes a writing mode root, and update the
logical *width* instead of height in that case. That's unnecessary and
potentially harmful (preventing the width change from being detected during
layout()). If the child establishes a new writing mode, it becomes opaque as
far as pagination is concerned, so no need to handle this.

BUG=544783
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1415623002

Cr-Commit-Position: refs/heads/master@{#354815}
fs
Fix expected inheritance for SVGClipPathElement
SVGDefinitionElement -> SVGElement

https://drafts.fxtf.org/css-masking-1/#InterfaceSVGClipPathElement

TBR=pdr@chromium.org

Review URL: https://codereview.chromium.org/1413073002

Cr-Commit-Position: refs/heads/master@{#354770}
sigbjornf
Oilpan: always shrink tail-allocated backing storage (reland.)
When shrinking backing storage allocations, some care is taken not to
introduce excessive fragmentation and/or limit later expansion of the
same object. That logic does not need to apply if the backing store is
at the tail of the current heap chunk: unconditionally reset the
allocation point, if it is.

(Reland of r353321; it asserted on empty shrink attempts on 32-bit windows.)

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1393863004

Cr-Commit-Position: refs/heads/master@{#354474}
sigbjornf
Revert of [Oilpan] Fix wrong usage of HeapCountedSet<EventTarget*> (patchset #3 id:80001 of https://codereview.chromium.org/1401033002/ )
Reason for revert:
Broke a number of tests on all Oilpan bots,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Oilpan/builds/29326

Lazy sweeping of EventTargetSet related.

Original issue's description:
> Fix wrong usage of HeapCountedSet<EventTarget*>
>
> BUG=515524
>
> Committed: https://crrev.com/0ab9a39b2347bc686cb6c2a7464acfebe3d4bd10
> Cr-Commit-Position: refs/heads/master@{#353714}

TBR=oilpan-reviews@chromium.org,haraken@chromium.org,peria@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=515524

Review URL: https://codereview.chromium.org/1405513003

Cr-Commit-Position: refs/heads/master@{#353756}
sigbjornf
Allow cross-thread destruction of RTCStatsRequest objects.
libjingle threads may in some cases end up finalizing WebRTCStatsRequest
objects, deref'ing such objects last via LocalRTCStatsRequest.

To allow such cross-thread release of the underlying Blink object,
annotate WebRTCStatsRequest's private pointer as cross-thread destructible.

R=
BUG=541762

Review URL: https://codereview.chromium.org/1399903002

Cr-Commit-Position: refs/heads/master@{#353642}
fs
Always populate the node map in SVGFilterBuilder if one exists
Since the node map is essentially a "reverse DAG" we cannot have holes
in it, so always add the FilterEffects even we cannot provide the
LayoutObject -> FilterEffect mapping (like in the case of a non-attached
element.)

BUG=541593, 533457

Review URL: https://codereview.chromium.org/1393633007

Cr-Commit-Position: refs/heads/master@{#353620}
mstensho
Column balancing refactoring. Don't propagate data during layout.
The column balancing machinery needs the following to calculate an optimal
column height:

1. Flow thread height
2. Flow thread logical top position of all forced breaks
3. The total number of forced breaks
4. Minimum space shortage at any soft break

The first two are needed to estimate an initial column height. The last two are
needed if the initial column height estimate wasn't good enough and we need to
stretch it.

We used to propagate this information to the flow thread continuously during
layout. Then the flow thread, after layout, would use this information for
column balancing (either estimate an initial column height, or stretch columns
based on minimum space shortage) and then re-lay out. This was problematic,
because during layout, we sometimes go back, and re-lay out e.g. a block
because the initial logical top was wrong (due to complex margin collapsing).
This would confuse the column balancing machinery (forced breaks being reported
and counted twice, space shortage being incorrectly reported, and so on).

Instead, traverse the tree after flow thread layout, to collect the information
that we need. This fixes an existing corner-case bug, allows for future
optimizations.

There is still one thing that the flow thread needs to be notified about during
layout, if we have nested multicol: It needs to know where content is laid out
(especially if the content is in a new column), in order to tell if we need to
insert another fragmentainer group (i.e. column row). It would be nice to get
rid of this as well in the future, but we need it for now. Renamed the poorly
named setPageBreak() to the more call-back-like paginatedContentWasLaidOut().

The new class ColumnBalancer and its subclasses are now in charge of column
balancing. Moved / refactored relevant code into those classes.
Taken from LayoutMultiColumnFlowThread, LayoutMultiColumnSet,
MultiColumnFramentainerGroup, and even LayoutBlockFlow.

BUG=521964
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1399493002

Cr-Commit-Position: refs/heads/master@{#353463}
sigbjornf
Oilpan: always shrink tail-allocated backing storage.
When shrinking backing storage allocations, some care is taken not to
introduce excessive fragmentation and/or limit later expansion of the
same object. That logic does not need to apply if the backing store is
at the tail of the current heap chunk: unconditionally reset the
allocation point, if it is.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1393863004

Cr-Commit-Position: refs/heads/master@{#353321}
mpawlowski
Add dependency on gfx_vector_icons to autofill_core_browser
autofill_cc_infobar_delegate.cc which is built as part of
autofill_core_browser uses generated vector_icons.h, there
should be an explicit dependency otherwise builds succeed
randomly.

BUG=

Review URL: https://codereview.chromium.org/1394603003

Cr-Commit-Position: refs/heads/master@{#353305}
mstensho
A new LayoutState should never locate a containing flow thread on its own.
If the parent (m_next) LayoutState doesn't have a containing flow thread set,
and the child doesn't establish one, the child shouldn't have one either. This
is crucial when doing subtree layouts directly from a FrameView, skipping any
ancestor fragmentation contexts that might be there. Changing the contents of
an INPUT element triggers this.

The bottom line here is: If we really want to re-lay out parts of a multicol
container, we better pretend that we're not inside a fragmentation context at
all.

This is perfectly safe, as long as the object we're laying out is unsplittable
and hasn't changed its own dimensions (which is true when changing the value of
an INPUT element). We have been doing this for a long time, but there was a bug
hidden in there, that got more easily exposed by
https://codereview.chromium.org/1387553002 , where we disallow strut propagation
to flex boxes, and INPUT type="number" is implemented using flexbox.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1395753004

Cr-Commit-Position: refs/heads/master@{#353291}
fs
SVGFilterBuilder::getEffectById never return nullptr
Drop the dead null-check-and-return to avoid giving the impression that
it's actually a possible error path.

BUG=533457

Review URL: https://codereview.chromium.org/1383013002

Cr-Commit-Position: refs/heads/master@{#353282}
sigbjornf
Oilpan: fix build after r353269.
TBR=oilpan-reviews
BUG=539883
NOTRY=true

Review URL: https://codereview.chromium.org/1398103002

Cr-Commit-Position: refs/heads/master@{#353281}
sigbjornf
Oilpan: fix build after r353261, part 2.
HTMLAnchorElement needs to be a declared GC mixin.

TBR=oilpan-reviews
BUG=498219
NOTRY=true

Review URL: https://codereview.chromium.org/1396983003

Cr-Commit-Position: refs/heads/master@{#353275}
sigbjornf
Oilpan: fix build after r353261.
TBR=oilpan-reviews
BUG=498219
NOTRY=true

Review URL: https://codereview.chromium.org/1398993002

Cr-Commit-Position: refs/heads/master@{#353273}
philipj
Sync the DeviceOrientation and DeviceMotion interfaces with the spec
http://w3c.github.io/deviceorientation/spec-source-orientation.html

Ther are no changes to the generated code, as a nullable readonly
attribute is handled by bindings just like a non-nullable one.

BUG=460722
R=timvolodine@chromium.org

Review URL: https://codereview.chromium.org/1387453002

Cr-Commit-Position: refs/heads/master@{#353253}
davve
Crash fix for when running under the Android emulator
For unknown reasons some versions of the Android emulator returns NULL
when asked for GL_SHADING_LANGUAGE_VERSION. Avoid passing NULL to
std::string, which causes undefined behavior.

Review URL: https://codereview.chromium.org/1358873002

Cr-Commit-Position: refs/heads/master@{#353246}
fs
Split SVGFilterbuilder into "builder" and "node map" parts
This separates the longer lived state (the LayoutObject->FilterEffect
and FilterEffect dependents maps) from the state that's only used/valid
while building a (sub)filter-graph. The former is moved to the new
class SVGFilterGraphNodeMap while the latter remain in
SVGFilterBuilder. SVGFilterBuilder can thus be converted to something
that is allocated on the stack and only kept for the building
operation. FilterData is changed to the keep a SVGFilterGraphNodeMap
instead of a builder.
The graph-building code in ReferenceFilterBuilder::build and
LayoutSVGResourceFilter::buildPrimitives is consolidated into
SVGFilterBuilder::buildGraph, with the more "relaxed" behavior of the
former kept. This should only result in a change in behavior for the
case where externally referenced filters are used.

BUG=109224,533457

Review URL: https://codereview.chromium.org/1382163003

Cr-Commit-Position: refs/heads/master@{#353125}
philipj
Sync the RTCPeerConnection interface with the spec
https://w3c.github.io/webrtc-pc/#interface-definition
https://w3c.github.io/webrtc-pc/#legacy-interface-extensions

BUG=460722
R=tommi@chromium.org

Review URL: https://codereview.chromium.org/1375533002

Cr-Commit-Position: refs/heads/master@{#353053}
sigbjornf
Oilpan: tidy up some HeapVector<> uses.
Heap references should be wrapped up using Member:

  HeapVector<T*> => HeapVector<Member<T>>

R=haraken
BUG=515524

Review URL: https://codereview.chromium.org/1394193002

Cr-Commit-Position: refs/heads/master@{#353026}
mstensho
Factor out the actual break checking from apply{After,Before}Break().
We're soon going to call this from the column balancing code.

Moved inNormalFlow() to isForcedBreakAllowed(). The new function performs some
additional checks to make sure it's an in-flow block level element. That
assumption could safely be made from apply{After,Before}Break(), but other call
sites shouldn't have to worry about such things.

Removed FIXME pair for something that was already working.

R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1393673004

Cr-Commit-Position: refs/heads/master@{#353021}
sigbjornf
Revert of CC Animations: Enable external animation host for blink. (patchset #6 id:100001 of https://codereview.chromium.org/1308053006/ )
Reason for revert:
Breaks a number of tests across bots,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux/builds/55219

Confirmed locally that reverting addresses the instability.

Original issue's description:
> CC Animations: Enable external animation host for blink.
>
> Depends on blink layout tests:
> https://codereview.chromium.org/1360233004/
>
> BUG=394777
>
> Committed: https://crrev.com/399f035cbbb4726b1a5fb3729d569dedaab7919e
> Cr-Commit-Position: refs/heads/master@{#352989}

TBR=ajuma@chromium.org,vollick@chromium.org,piman@chromium.org,loyso@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=394777

Review URL: https://codereview.chromium.org/1398713002

Cr-Commit-Position: refs/heads/master@{#353020}
rune
Support deeply nested uncommonAttributeSelectors.
Selectors containing attribute selectors are collected to the
StyleResolver and matched against elements to check if they can share
style with other elements.

The function looking for attributes only went one level down for
functional pseudo classes, which means selectors like:

  :-webkit-any(:not([attr]))

were ignored and caused style to be incorrectly shared between elements.

R=leviw@chromium.org
BUG=540856

Review URL: https://codereview.chromium.org/1394663003

Cr-Commit-Position: refs/heads/master@{#353019}
sigbjornf
Oilpan: drop use of transition type for InvalidationSetVector.
Followup r352829 and remove transition type for InvalidationSetVector;
it unintentionally left it as a HeapVector with Oilpan enabled.

TBR=oilpan-reviews
BUG=

Review URL: https://codereview.chromium.org/1389403002

Cr-Commit-Position: refs/heads/master@{#352873}
sigbjornf
Do not keep InvalidationSets on the Oilpan heap.
An InvalidationSet keeps sets of names/strings and tend to have lifetimes
that track those of RuleFeatureSets and not be shared.

Hence it doesn't meet the bar for being on the Oilpan heap; for workloads
where invalidations happen frequently, having them on the heap just causes
unnecessary follow-on work in having to sweep out at some later GC.

Trivially tidy up StyleResolver construction as part of this CL also.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1389333003

Cr-Commit-Position: refs/heads/master@{#352829}
mstensho
Keep block pagination struts after layout, and store them before any type of break.
Any block-level object (block container, block-displayed image, for instance)
may now have a strut, so this is stored in the rare data section of LayoutBox.

Added layout tests for things that I nearly broke or wanted to make sure that I
didn't break, while working on this.

No behavioral changes are intended with this CL, and because struts aren't
web-exposed, I added a few "unit tests" for pagination struts.

This is a preparatory patch for refactoring the column balancing
implementation to do everything after layout, instead of during layout (will
fix bugs, get rid of the rather esoteric setPageBreak() calls scattered around,
and also make it easier to do optimizations in the future, instead of doing
almost unconditional deep layout passes when doing multicol or printing).

R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1375673004

Cr-Commit-Position: refs/heads/master@{#352804}
mpawlowski
Select dark colors for generating fallback icon if possible.
When trying to establish the background color for the fallback icon,
we select the dominant color of a site's favicon and clamp its luminosity
so that we don't end up with a very light background and white text.

If the favicon has a lot of white and a bit of blue, the algorithm
returns white which we clamp down to grey. Instead, we should have used
the blue. We can force the algorithm to return blue by specifying the
upper bound of the dominant color we'd like to receive.

We still need to clamp the result because the source image may actually
not have any dark colors, in which case the algorithm will ignore the
upper bound.

BUG=539771

Review URL: https://codereview.chromium.org/1382343002

Cr-Commit-Position: refs/heads/master@{#352798}
rune
setLoadFinishTime on ImageResource for ImageDocument.
The loadFinishTime was never set on ImageResource used for the generated
image element inside an ImageDocument. We discovered this checking for
that time stamp in an internal Opera project.

Set the finish time of the ImageResource to that of the document (which
is the actual image).

Review URL: https://codereview.chromium.org/1380163006

Cr-Commit-Position: refs/heads/master@{#352730}
fs
Fix SVGUseElement "instance tree loading" status check
SVGUseElement::instanceTreeIsLoading was not checking the loading status
of the immediate <use> targer (the |targetInstance| argument to the
method.) It also wasn't checking the correct element for loading status,
since correspondingUseElement() will return the containing (innermost)
shadow host - which is not the <use> that will carry the relevant
loading status.
Make sure to check the immediate target, and check the loading status of
any <use> elements encountered (instead of attempting to look at the
"corresponding <use>").
Also rewrite the checker method to use Traversal<...>::next instead of
being recursive, and simplify resourceIsStillLoading() some.

BUG=232901

Review URL: https://codereview.chromium.org/1388093002

Cr-Commit-Position: refs/heads/master@{#352645}
mstensho
Multicol: Add test that re-lays out a float and pushes it downwards at the same time.
The test passes, but the code seems somewhat brittle, so better make sure that
it keeps working.

Inline-level layout of floats is weird. LayoutBlockFlow::layoutInlineChildren()
lays out the float before its position is updated, and then marks the lines that
it thinks are affected as dirty (it may find the wrong lines here, but I haven't
been able to make anything fail because of it). For pagination this
additionally means that the pagination strut may be wrong (since the float's
position hasn't been updated). Luckily, we get an opportunity to lay out again
in insertFloatingObject() (still at the old position, though), and yet another
opportunity in positionNewFloats() (this time at the updated position).

R=jchaffraix@chromium.org,leviw@chromium.org,robhogan@gmail.com

Review URL: https://codereview.chromium.org/1375913003

Cr-Commit-Position: refs/heads/master@{#352587}
mstensho
LayoutBlockFlow: rename paginationStrut to paginationStrutPropagatedFromChild.
While lines (RootInlineBox) store and keep the pagination struts that get
applied in front of them, blocks don't. So using the same term (simply
paginationStrut) in blocks and lines wasn't really appropriate [*]. This
paginationStrutPropagatedFromChild thing is really something that's only needed
during layout (see if children want to move a block to the next page column
and re-lay out if necessary). Ideally it shouldn't be stored in the objects at
all, but finding a way to avoid it proved hard. Stowing it in LayoutState was
one idea, but it turned out to be too complicated.

[*] The plan is to also store proper pagination struts on blocks (because
column balancing will benefit from it). This is a preparatory patch for that.

Did some light clean-up on my way, most notably: don't add in the old and
possibly stale pagination strut when estimating a logical top position in a
subsequent layout pass. The strut had typically been set to 0 at this point
anyway, but if it hasn't this code could possibly cause some mischief. In other
words, the code was either useless or harmful.

R=leviw@chromium.org, jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1381993002 .

Cr-Commit-Position: refs/heads/master@{#352582}
tmoniuszko
Make cld2_table_size configurable in GN builds
BUG=

Review URL: https://codereview.chromium.org/1377333002

Cr-Commit-Position: refs/heads/master@{#352566}
sigbjornf
Remove unused LinkedStack.h include.
One of the few ones left in Blink, and not used.

R=haraken
BUG=none

Review URL: https://codereview.chromium.org/1385173002

Cr-Commit-Position: refs/heads/master@{#352561}
fs
Pass SkiaImageFilterBuilder& to FilterEffect::createImageFilter
The builder should never be null, so just make it a reference.

Drop the builder arguments on SVGFEImage::createImageFilterForLayoutObject
because it's unused, and make the LayoutObject& const while touching those
lines.

Make createImageFilter overrides private.

Review URL: https://codereview.chromium.org/1387573003

Cr-Commit-Position: refs/heads/master@{#352543}
mstensho
Consistently check if a block can handle pagination strut propagation.
https://codereview.chromium.org/1360753002 got it right for inline child
layout, but did nothing for block child layout.

BUG=329421
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1387553002

Cr-Commit-Position: refs/heads/master@{#352429}
ckulakowski
Make global variable g_testing_build_time lazily created.
It's a fix for compilation error:
../../../../chromium/src/chrome/browser/ssl/ssl_error_classification.cc:121:12: error: declaration requires a global constructor [-Werror,-Wglobal-constructors]
base::Time g_testing_build_time;

Review URL: https://codereview.chromium.org/1380483004

Cr-Commit-Position: refs/heads/master@{#352410}
mstensho
Remove unused LayoutState::clearPaginationInformation().
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1377573004

Cr-Commit-Position: refs/heads/master@{#352362}
fs
Remove lingering -webkit-svg-shadow tests
-webkit-svg-shadow support was removed in r154982 (tracked in issue
262857), but leaving these three tests behind (two of which would
trivially pass because they were ref tests.)

BUG=262857,223332

Review URL: https://codereview.chromium.org/1387823003

Cr-Commit-Position: refs/heads/master@{#352332}
rune
Missing clear() for pseudo invalidation sets.
Missing clear in RuleFeatureSet::clear caused rules removed from shadow
trees to still affect invalidation after removal.

R=sigbjornf@opera.com
BUG=538586

Review URL: https://codereview.chromium.org/1368313005

Cr-Commit-Position: refs/heads/master@{#352278}
sigbjornf
Re-enable blink_perf.dom on all platforms.
TBR=eakuefner,dtu
BUG=532093
CQ_EXTRA_TRYBOTS=tryserver.chromium.perf:linux_perf_bisect;tryserver.chromium.perf:mac_10_10_perf_bisect;tryserver.chromium.perf:win_perf_bisect;tryserver.chromium.perf:android_nexus5_perf_bisect

Review URL: https://codereview.chromium.org/1387783002

Cr-Commit-Position: refs/heads/master@{#352277}
sigbjornf
Oilpan: fix build after r352251.
TBR=oilpan-reviews
BUG=495801

Review URL: https://codereview.chromium.org/1387773002

Cr-Commit-Position: refs/heads/master@{#352272}
sigbjornf
Skip DOM/click_webkit_user_select_none.html performance test.
Running it is only supported by --browser=content-shell performance runs;
skip it always for the time being.

R=haraken
BUG=532903

Review URL: https://codereview.chromium.org/1388623002

Cr-Commit-Position: refs/heads/master@{#352270}
fs
Add test for crbug.com/231604
Derived from TC by:
  Tamas Czene <tczene@inf.u-szeged.hu>
in:
  https://bugs.webkit.org/show_bug.cgi?id=88654

BUG=231604

Review URL: https://codereview.chromium.org/1369923006

Cr-Commit-Position: refs/heads/master@{#352066}
sigbjornf
Oilpan: fix build after r351974.
TBR=oilpan-reviews
BUG=225420
NOTRY=true

Review URL: https://codereview.chromium.org/1372323004

Cr-Commit-Position: refs/heads/master@{#351990}
sigbjornf
Oilpan: fix build after r351868.
We do not have compiler support for traceable Oilpan heap references,
hence undo the Member<> to ref conversion that r351868 made.

TBR=oilpan-reviews
BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/1370143007

Cr-Commit-Position: refs/heads/master@{#351887}
tsniatowski
Fix unix file permissions in resource zips and jar files
https://codereview.chromium.org/1319623002 changed how zip files are
created in the python helper and (accidentally?) made it set 000 unix file
permissions for the archived files. Make it 644 so the zip files are not
suprising to work with on Linux if anyone needs to look at them manually.

BUG=523420
R=dpranke@chromium.org, agrieve@chromium.org,

Review URL: https://codereview.chromium.org/1384513002

Cr-Commit-Position: refs/heads/master@{#351843}
fs
Update error-handling for fe*Lighting and feTurbulence
Invalid parameters now produce transparent black rather than failing the
build step.
The new behavior matches Gecko for fe*Lighting but not for feTurbulence
(where they seem to allow negative baseFrequency values), so in the
latter case we're siding with the "Negative values are unsupported"
wording in the spec[1].

[1] https://drafts.fxtf.org/filters/#element-attrdef-feturbulence-basefrequency

BUG=533457

Review URL: https://codereview.chromium.org/1375793003

Cr-Commit-Position: refs/heads/master@{#351817}
sigbjornf
Allow cross-thread destruction of RTCSessionDescriptionRequest objects.
ligjingle may queue incoming CreateOffer/Answer session requests from
the browser process. Should the RTC session be shut down before those
requests have been processed & queue is drained, the libjingle thread
will destruct these requests as part the session shutdown. (See
associated bug for stack trace of when&how this happens.)

Embedded in those requests are references to Oilpan heap objects, by way
of Persistent<RTCSessionDescriptionRequest>. As Persistent<>s are thread
local, requiring that the thread that created & registered them is the
one that finalizes, the destruction performed by the libjingle thread
runs into trouble.

Hence, allow libjingle to destruct CreateSessionDescriptionRequests by
having WebRTCSessionDescriptionRequests refer to the Oilpan Blink object
by way of a CrossThreadPersistent<>. It imposes no same-thread restriction
wrt destruction.

R=haraken, tommi, philipj
BUG=537745

Review URL: https://codereview.chromium.org/1380023004

Cr-Commit-Position: refs/heads/master@{#351783}
philipj
Remove some obsolete FIXMEs for HTMLAllCollection
Made obsolete by https://github.com/whatwg/html/issues/210

BUG=460722
NOTRY=true
R=jl@opera.com

Review URL: https://codereview.chromium.org/1379633005

Cr-Commit-Position: refs/heads/master@{#351782}
sigbjornf
Retire GC lockout on initializing hash buckets.
Do not disallow GCs across initialization of hash table buckets, be they
from freshly allocated tables or reuse of deleted entries. It serves
no real purpose to disallow GCs for the reasons given in the code
(the key isn't stored separately), and if the bucket is a deleted entry
being initialized, we already run the risk of having GCs with those
in the table. Hence, disallowing it extra here serves no purpose.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1378273002

Cr-Commit-Position: refs/heads/master@{#351781}
rune
SubtreeStyleChange will propagate through <content>.
No need to mark outer shadow hosts for style recalc when adding style
elements with ::content rules because InsertionPoint::willRecalcStyle
makes sure that distributed nodes and their descendants are recalculated.

BUG=537480

Review URL: https://codereview.chromium.org/1380883002

Cr-Commit-Position: refs/heads/master@{#351741}
sigbjornf
Remove unused Allocator::{enter,leave}NoAllocationScope().
R=haraken
BUG=

Review URL: https://codereview.chromium.org/1381493006

Cr-Commit-Position: refs/heads/master@{#351740}
fs
Refine FilterEffect::createTransparentBlack
Use an image filter that will produce a region of pixels rather than one
that won't.
Fixes issue with feConvolveMatrix error handling with -webkit-filter.

BUG=533457

Review URL: https://codereview.chromium.org/1380733002

Cr-Commit-Position: refs/heads/master@{#351658}
philipj
Remove SVGSVGElement.pixelUnitToMillimeterX and friends
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/uJCmB7SzYNo/cBASMfJuBAAJ

BUG=537177
R=fs@opera.com, timvolodine@chromium.org

Review URL: https://codereview.chromium.org/1374233003

Cr-Commit-Position: refs/heads/master@{#351540}
philipj
Make Document.charset an alias of characterSet, as per spec
https://dom.spec.whatwg.org/#interface-document

Remove counters DocumentInputEncoding and DocumentCharset, they have
fulfilled their purpose as both have been specified as aliases based on
the data collected:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27435
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27436

BUG=438392
R=dominicc@chromium.org

Review URL: https://codereview.chromium.org/1365923002

Cr-Commit-Position: refs/heads/master@{#351508}
sigbjornf
On Document disposal, only dispose of script runner.
Reinstate the invariant that a Document always has a ScriptRunner
(m_scriptRunner), even after the document has been dispose()d.

The reason for disposing the Document's ScriptRunner is to clear
out back references that would otherwise cause the Document to
leak. Do just that, but don't destruct the now-empty ScriptRunner
object.

R=haraken
BUG=536796

Review URL: https://codereview.chromium.org/1380543002

Cr-Commit-Position: refs/heads/master@{#351385}
joleksy
Fix false negatives in system key events recognition
Cmd + <some other modifier> + (b|i) should be treated as a system key event.

This was already reviewed in https://codereview.chromium.org/1215633003/

now rebased to new project structure.

Review URL: https://codereview.chromium.org/1374933002

Cr-Commit-Position: refs/heads/master@{#351374}
sigbjornf
Oilpan: fix build after r351269.
R=haraken
BUG=439376

Review URL: https://codereview.chromium.org/1377813002

Cr-Commit-Position: refs/heads/master@{#351325}
fs
Move feConvolveMatrix error handling to FEConvolveMatrix
This moves the checking of error-conditions from
SVGFEConvolveMatrixElement::build to SkImageFilter build time
(FEConvolveMatrix::createImageFilter), with the change in behavior that
an feConvolveMatrix primitive that is "in error" now produces
transparent black rather than fail the chain (for 'filter' - is ignored
for '-webkit-filter'). This new behavior matches Gecko.
The 'order' vs. size('kernelMatrix') checking is also strengthed / made
more obvious by explicitly failing when overflowing the (positive) int
range. (And avoids depending on signed overflow.)
Also introduce a helper FilterEffect::createTransparentBlack and use in
FEConvolveMatrix and FEImage, and drop a bunch of unused accessor
methods on FEConvolveMatrix.

BUG=533457

Review URL: https://codereview.chromium.org/1376473002

Cr-Commit-Position: refs/heads/master@{#351139}
mostynb
add missing content_test_mojo_bindings gyp dep in content_tests.gypi
This should avoid possible build flakiness.

Found using this proposed ninja patch:
https://github.com/martine/ninja/pull/1031

BUG=536641

Review URL: https://codereview.chromium.org/1371073002

Cr-Commit-Position: refs/heads/master@{#351063}
sigbjornf
Reinstate memory pressure Oilpan GC check post V8 major GCs.
To handle workloads with high allocation rates, where the Oilpan heap
allocations only make up a small fraction compared to what's allocated
by either PartitionAlloc or V8, use V8's major GC notification as
a signal to check for the need to perform an "emergency" memory
pressure conservative GC. Otherwise there might not be enough Oilpan
allocations made to trigger out-of-line heap allocations which trigger
that same check. These GCs and workloads are rare, but reduces the
possibility of running into OOM conditions when Oilpan is faced with
those.

An example where it does show up is Dromaeo's dom-modify.html, which
has a subtest that heavily allocates Text nodes, each holding a longer
string. As each Text node is a small Oilpan heap object, not a lot of heap is
needed for the nodes, but PartitionAlloc's buffer partition size grows much
more sharply and risks signalling OOM. V8's RTS notices the memory pressure
and triggers extra GCs; reuse that signal in Oilpan.

Hence, bring back the check that https://codereview.chromium.org/1190513006/
added for checking this condition.

R=haraken
BUG=474470

Review URL: https://codereview.chromium.org/1369783002

Cr-Commit-Position: refs/heads/master@{#351044}
sigbjornf
Return early for vec.remove(position, 0).
If the item range being removed has no extent, no item is removed
from the vector. Return early, if so.

Style invalidation uses this Vector remove() operation upon restoring
state (RecursionCheckpoint), with the length being zero often.
Optimize its handling.

The performance of blink_perf.css.ClassInvalidation and
blink_perf.css.ClassDescendantSelector is improved 15-20% as a result
(without Oilpan, windows + linux64.)

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1370933002

Cr-Commit-Position: refs/heads/master@{#351029}
rune
No need to recalc style before StyleResolver::computeFont.
StyleResolver::computeFont does not rely on the computed style of any
elements in the document tree. The updateLayoutTree call was there to
avoid an assert due to an unnecessary composed tree traversal for a
parent node. That traversal was removed by [1], so the updateLayoutTree
call should no longer be needed.

This change gets rid of synchronous style recalcs when FontFaceSet.load()
is called.

[1] https://codereview.chromium.org/1367743002/

BUG=536625

Review URL: https://codereview.chromium.org/1372823002

Cr-Commit-Position: refs/heads/master@{#351025}
sigbjornf
Avoid creating duplicate Range objects when handling misspellings.
When iterating over the input text and marking its misspellings, avoid
creating duplicate Range objects from the check & paragraph EphemeralRanges
if they're identical.

This addresses a performance regression on trunk (non-Oilpan) for
blink_perf.dom.textarea-edit introduced by the EphemeralRange-switching
https://codereview.chromium.org/1331893002

R=haraken
BUG=530740

Review URL: https://codereview.chromium.org/1369713002

Cr-Commit-Position: refs/heads/master@{#351001}
sigbjornf
Speed up updating inner value of HTMLTextFormControlElements.
Upon setting the inner string value of an element like <textarea/>, we
append a solitary trailing <br> if the new value ends with a line
break character (for layout and content editable purposes.)

Upon replacing that string value with another, check if the shadowed
inner element being updated has such a trailing <br> element and remove
it first, before proceeding with setting the new value. Doing so enables
fast replacement of text nodes rather than invoking the general path of
replacing a set of siblings with a text node.

This is of most benefit with Oilpan enabled, as it reduces the heap
allocations made when handling this update operation. For a deep-loop
microbenchmark like blink_perf.DOM.textarea-dom, a 10% speedup is
observed (linux, windows).

Linux64-chrome numbers on textarea-dom:

- Oilpan enabled:
  + ToT: 14.6 runs/s
  + CL:  16.6 runs/s

- Oilpan disabled:
  + ToT: 16.5 runs/s
  + CL:  16.9 runs/s

R=tkent,haraken,esprehn
BUG=

Review URL: https://codereview.chromium.org/1355013002

Cr-Commit-Position: refs/heads/master@{#350989}
fs
Refine invalidation of filter clients in LayoutSVGResourceContainer
When an outermost <svg> had a non-filter-induced layer it would fall
into the layer-oriented code-path in
LayoutSVGResourceContainer::registerResource even if it didn't have a
'-webkit-filter' property. Because of this, the layout object would not
get invalidated (if it had a 'filter' property).
Refine the conditions involved to allow both properties to trigger
invalidations as needed. Also avoid the filter invalidation hack when
possible and take the opportunity to make good use of a for-range loop.

BUG=535800

Review URL: https://codereview.chromium.org/1364403003

Cr-Commit-Position: refs/heads/master@{#350900}
fs
Allow zero inputs for feMerge
An feMerge which doesn't have any inputs should simply produce no output
(rather than failing the filter chain.)
Both FEMerge (w/ minor tweak) and SkMergeImageFilter are able to cope with
this case.
Any single-input primitives that sources from the merge will also not
produce any output. This behavior actually matches Gecko, and the spec
is not very outspoken on the matter.

BUG=533457

Review URL: https://codereview.chromium.org/1368113002

Cr-Commit-Position: refs/heads/master@{#350884}
sigbjornf
Oilpan: fix build after r350813.
TBR=oilpan-reviews
BUG=510398
NOTRY=true

Review URL: https://codereview.chromium.org/1365503006

Cr-Commit-Position: refs/heads/master@{#350820}
sigbjornf
Oilpan: revert page navigation count GCing.
The inclusion of https://codereview.chromium.org/1353283002 as
part of r350775 was not intentional - back it out.

We want to land some variation of this now, but not in this form.

R=haraken
BUG=534524

Review URL: https://codereview.chromium.org/1369683003

Cr-Commit-Position: refs/heads/master@{#350806}
sigbjornf
Manage WebGLRenderingContextBase's weak refs manually without Oilpan.
WebGLRenderingContextBase keeps a set of registered on-heap WebGLContextObjects,
ensuring that these are detached if it is finalized first -- it being unsafe to
make any reverse access of the *Base object from those after that point. These
references must however be weak as the *Base object mustn't keep WebGL objects
alive if they're not otherwise used & referenced.

Without Oilpan enabled by default, *Base isn't on the heap, that set of
weak WebGLContextObject references must be managed manually rather than relying
on HeapHashSet<WeakMember<T>>. If we were to do so, a GC might identify a
WebGLContextObject as only being weakly referenced from the *Base object and
clear out the entry for it in the set. Should the *Base object then be finalized
and destructed before that WebGLContextObject is lazily swept, it would attempt
to access an already freed object. With sorry consequences.

To address, we keep an off-heap set of untraced raw WebGLContextObject pointers,
which are effectively weak. Like now/before, it is the responsibility of either
the WebGLContextObject to detach itself when finalized or have the *Base
object do that and detach the whole set.

R=kbr,haraken
BUG=534524

Review URL: https://codereview.chromium.org/1363243003

Cr-Commit-Position: refs/heads/master@{#350775}
tsniatowski
Move goma/ccache logic to //build/toolchain/gcc_toolchain.gni
Avoid logic duplication between linux/android/... toolchain definitions
that all did the same thing. This is helpful for further work with
compiler prefixes / wrappers, in particular for non-goma-users.

Some toolchains used the prefix on nm and objcopy calls, this was probably
wrong and no longer happens. The toolchains that used gcc_toolchain.gni
but did not manually setup goma/ccache opt out of the setting to avoid
large behavior changes.

BUG=

Review URL: https://codereview.chromium.org/1361403002

Cr-Commit-Position: refs/heads/master@{#350767}
jb
Pending scripts can cause disposed documents to leak.
The script runner of a document may still be holding pending scripts
when the document is disposed (e.g. due to navigation). The script
runner, and thus the pending scripts, is cleared in the destructor of
the document. However, the pending scripts keep a reference to the
script element they belong to. The script element in turn, keeps a
guard ref to the document, so the document will never be deleted.
Clearing the script runner in dispose clears the pending scripts and
breaks the reference cycle so that document can be deleted.

BUG=534844
R=sigbjornf@opera.com

Review URL: https://codereview.chromium.org/1368623003

Cr-Commit-Position: refs/heads/master@{#350664}
sigbjornf
Common up eager handling of sweeping.
Code tidying, no change in functionality.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1361073002

Cr-Commit-Position: refs/heads/master@{#350644}
fs
Tweak asserts for dominant-baseline in SVGTextLayoutEngineBaseline
The 'no-change' and 'reset-size' dominant-baseline value will consult
their parent to try and resolve a suitable value. If the parent has one
of these values, the process will continue up the ancestor chain.
When reaching the LayoutView however, we should encounter the initial
value ('auto') and the search will end.
Move the assertion for an existing parent down into the branches that
handle the values 'no-change' and 'reset-size'.
Also rewrap a comment and replace a FIXME with TODO.

BUG=534796

Review URL: https://codereview.chromium.org/1360083003

Cr-Commit-Position: refs/heads/master@{#350612}
fs
Make error-handling for feColorMatrix consistent
After/with https://codereview.chromium.org/1087283002, error-handling
for feColorMatrix will differ based on when the error occured (in
"initial" content, or through later script mutation; "initial" meaning
the state on first paint).
Align the two different code-paths by removing error-handling entirely
from one of them (SVGFEColorMatrixElement::build) building on the CL
mentioned above.

Also take this opportunity to align our error-handling behavior with
Gecko:
 * Excess 'values' for type='matrix' => use identity
 * Excess 'values' for type='saturate'/'huerotate' => use identity

The test svg/filterS/feColorMatrix-values.svg is updated to reflect the
above, and is converted to a ref-test while at it.
Tweak the DRT output for FEColorMatrix to only output 'values' if they
are valid and actually used.

BUG=534763, 533457
TBR=senorblanco@chromium.org,fmalita@chromium.org

Review URL: https://codereview.chromium.org/1366903002

Cr-Commit-Position: refs/heads/master@{#350607}
alexanderk
Extend unittest to test follow-module behavior of find_dependencies.py
Problem origin: https://crbug.com/527836
Fixed: https://codereview.chromium.org/1306953007

BUG=531562

Review URL: https://codereview.chromium.org/1347283006

Cr-Commit-Position: refs/heads/master@{#350582}
sigbjornf
blink_perf.dom.textarea-dom: vary text nodes added.
This benchmark is meant to measure the performance of a sequence of
text node appends to a <textarea/> element. Have that sequence consist
of varying strings rather than the exact same one. This is done so as to
have the measurement not be influenced by whatever reuse of text
node strings that the underlying allocator is able to provide if using
identical strings.

R=
BUG=

Review URL: https://codereview.chromium.org/1367923004

Cr-Commit-Position: refs/heads/master@{#350533}
philipj
Remove SVG hasExtension() methods
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/Ae_lmov16_o/Wa5XhHFoAAAJ

BUG=532405
R=fs@opera.com

Review URL: https://codereview.chromium.org/1359053004

Cr-Commit-Position: refs/heads/master@{#350512}
sigbjornf
Oilpan: exempt CSSBasicShapeValue from GC plugin checking.
The GC plugin isn't capable of determining that CSSValue's
traceAfterDispatch() method is safe for subtypes of CSSBasicShapeValue
and throws an error. Until the plugin or the method have been adjusted
into a form that passes the plugin's static checks, exempt the
class from the GC plugin's reach.

R=haraken
BUG=535448

Review URL: https://codereview.chromium.org/1365003002

Cr-Commit-Position: refs/heads/master@{#350508}
christiank
Allow task pools to reason about transparency.
This will allow task pools to select different formats depending on if a tile contains transparency or not.

BUG=434699
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Review URL: https://codereview.chromium.org/1351283003

Cr-Commit-Position: refs/heads/master@{#350495}
tsniatowski
Add ninja console pool support to GN
Allow GN actions to specify "console = true", which will translate into
a "pool = console" setting in the generated ninja files. The console
pool allows a ninja target to have unbuffered io, access to standard
input, and is limited to one target at a time.

R=brettw@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1358803002

Cr-Commit-Position: refs/heads/master@{#350321}
mstensho
Only block container children support pagination struts.
Removed partial support for pagination struts on table captions, since it
didn't work too well (caused inconsistent layout and also overlap with the
table section that followed). Instead, set a strut on the content inside the
caption (first line, for instance), just like we already do for table cells.

We had a check to avoid setting pagination struts on table cells, but there was
no similar check for table captions. Replaced the check with examining the
containing block. We may only set a pagination strut on a block if its
containing block is a block container (LayoutBlockFlow). This automatically
fixes similar issues with flexboxes and possible other layout modes too.

BUG=329421
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1360753002

git-svn-id: svn://svn.chromium.org/blink/trunk@202648 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Update handling of negative radius for feMorphology
Spec[1] states:

 "A negative or zero value disables the effect of the given filter
  primitive (i.e., the result is the filter input image)."

So change FEMorphology to clamp radii to non-negative and stop treating
as an error in SVGFEMorphologyElement::build.

[1] https://drafts.fxtf.org/filters/#element-attrdef-femorphology-radius

BUG=533457

Review URL: https://codereview.chromium.org/1344283004

git-svn-id: svn://svn.chromium.org/blink/trunk@202644 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Update handling of negative std.dev for feGaussianblur/feDropShadow
Spec[1] states:

 "A negative value or a value of zero disables the effect of the given
  filter primitive (i.e., the result is the filter input image)."

Update SVGFEGaussianBlurElement and SVGFEDropShadowElement to reflect
this, and update the references for the corresponding tests.

Drop accessors on FEDropShadow because they are unused.

[1] https://drafts.fxtf.org/filters/#element-attrdef-fegaussianblur-stddeviation

BUG=533457

Review URL: https://codereview.chromium.org/1350903009

git-svn-id: svn://svn.chromium.org/blink/trunk@202643 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Sync m_lastRemainingAllocationSize on promptly freeing objects.
A heap's m_lastRemainingAllocationSize field is used to limit updating
of heap allocated object size tracking. Upon promptly freeing objects,
make sure it is synchronized so as to it avoid deviating across multiple
such operations.

R=haraken
BUG=534423

Review URL: https://codereview.chromium.org/1360763002

git-svn-id: svn://svn.chromium.org/blink/trunk@202634 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Consider Layout tree cycles when resolving the <pattern> content element
When SVGPatternElement determines the attributes of a pattern, it will
not factor in any cycles brought upon it by the actual content elements.
The cycle solver however does this analysis when it is run on a
resource.
To bridge this DOM vs. Layout tree "gap", make sure to inspect the chain
of linked resources when determining the content element to use when
generating the pattern data.

BUG=104448

Review URL: https://codereview.chromium.org/1356053002

git-svn-id: svn://svn.chromium.org/blink/trunk@202631 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r202625.
TBR=oilpan-reviews
BUG=529640
NOTRY=true

Review URL: https://codereview.chromium.org/1358083002

git-svn-id: svn://svn.chromium.org/blink/trunk@202629 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Remove unused variable movedSectionLogicalTop from table layout code.
R=jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1351383006

git-svn-id: svn://svn.chromium.org/blink/trunk@202628 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
[Docs] Fix shell command formatting and line breaking
Review URL: https://codereview.chromium.org/1351233003

Cr-Commit-Position: refs/heads/master@{#350117}
fs
Remove kernelUnitLength plumbing
'kernelUnitLength' is not supported in Blink, and is deprecated in the
spec [1][2][3].
Rip out the plumbing and (FilterEffect) storage for it, since it's dead
code for practical purposes (see below though...)

The svg/dynamic-updates/SVGFEConvolveMatrixElement-*-kernelUnitLength-*
tests now actually show something because the kernelUnitLength of 0.05
no longer truncate to 0 and trigger an error. (0.05 should have been a
valid value previously too.)

The tests for negative kernelUnitLengths are dropped because they're no
longer of any use.

[1] https://drafts.fxtf.org/filters/#element-attrdef-feconvolvematrix-kernelunitlength
[2] https://drafts.fxtf.org/filters/#element-attrdef-fediffuselighting-kernelunitlength
[3] https://drafts.fxtf.org/filters/#element-attrdef-fespecularlighting-kernelunitlength
    (feSpecularLighting seems to be missing the Note, but it's the same
     as for feDiffuseLighting anyhow.)

BUG=231613

Review URL: https://codereview.chromium.org/1354923003

git-svn-id: svn://svn.chromium.org/blink/trunk@202601 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop virtual LightSource::create
Not used.

Review URL: https://codereview.chromium.org/1355713004

git-svn-id: svn://svn.chromium.org/blink/trunk@202593 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: like Vector<T>, restrict Deque<T> to certain part objects.
Impose the limitations put on Vector<T> on Deque<T> also. They're
both backed by a vector buffer where unused slots are zero'ed so as
to be safe when (conservatively) tracing the buffer contents or when
finalizing it.

In order to use a designated zero for cleared elements, certain
conditions have to be placed on the kinds of T we can allow when
T is a part object annotated with ALLOW_ONLY_INLINE_ALLOCATION().
Impose these statically by way of static_assert()s.

R=tkent,haraken
BUG=420515

Review URL: https://codereview.chromium.org/1051853003

git-svn-id: svn://svn.chromium.org/blink/trunk@202574 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r202549.
R=haraken
BUG=501896

Review URL: https://codereview.chromium.org/1357803002

git-svn-id: svn://svn.chromium.org/blink/trunk@202569 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
linux gn config should check use_gconf before looking for it with pkg-config
BUG=388412

Review URL: https://codereview.chromium.org/1355793003

Cr-Commit-Position: refs/heads/master@{#349790}
fs
Scale objectBoundingBox units for primitive dimensions w/ -webkit-filter
Minor mismatch with the other code-path (in SVGFilterPainter).
Drop the default argument value from the 4-ary Filter::create().

BUG=532938

Review URL: https://codereview.chromium.org/1346143005

git-svn-id: svn://svn.chromium.org/blink/trunk@202522 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Avoid stack overflow triggered by out-of-band layout of flexbox child.
Flexbox uses LayoutBlock::finishDelayUpdateScrollInfo(), which may jump to some
arbitrary block in the subtree and lay it out directly. This is bad, at least
for multicol, since it requires that a flow thread be entered have its children
laid out without skipping any parents in the chain.

LayoutMulticolFlowThread::skipColumnSpanner() was called on the wrong flow
thread, which resulted in m_lastSetWorkedOn pointing to a column set that was
part of an inner flow thread, and not the flow thread we called. That made
columnSetAtBlockOffset() return a column set from an inner flow thread, causing
an infinite recursion when walking upwards in the flow thread ancestry chain).

So the spanner was in the inner flow thread, but it was the outer flow thread
that got called. This happened because our LayoutState says that's the
innermost flow thread being laid out at the moment, because
finishDelayUpdateScrollInfo() just teleported and laid out a descendant of the
inner flow thread.

Luckily there's a safer way of obtaining the flow thread associated with a
spanner, so do that instead.

This is not a perfect fix. LayoutState still points to the wrong flow thread
(we just avoid asking it). The root cause remains (out-of-band layout), and
there may be other bugs caused by this. For multicol, we're still not in the
clear. Since we have a skipColumnSpanner() call without laying out the flow
thread, we'll get an assertion failure next time we lay out the flow thread,
because it will assert that there be no m_lastSetWorkedOn (but
skipColumnSpanner() has set that one while not laying out the flow thread).

But at least we're getting rid of the infinite recursion.

Since we now call skipColumnSpanner() on a LayoutMultiColumnFlowThread, instead
of on a LayoutFlowThread, we need to make that method public (private overrides
is just asking for trouble). And since this is the only caller, make it
non-virtual while at it. LayoutFlowThread no longer needs this.

BUG=526664
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1328923002

git-svn-id: svn://svn.chromium.org/blink/trunk@202519 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjorn
Add histogram for key exchange strength
BUG=525957

Review URL: https://codereview.chromium.org/1312363004

Cr-Commit-Position: refs/heads/master@{#349644}
sigbjorn
Expose OpenSSL's key_exchange_info in the content API
The key_exchange_info contains information about the strength of the SSL
key exchange. This information is useful for statistics, user information,
and making trust decisions for connections. This commit makes the information
available in the API.

BUG=525957

Review URL: https://codereview.chromium.org/1313363003

Cr-Commit-Position: refs/heads/master@{#349635}
fs
Merge SVGFilter into Filter
This brings the handling for bbox-relative coordinates into the base
class and drops the empty shell that remains.

BUG=109224

Review URL: https://codereview.chromium.org/1348973004

git-svn-id: svn://svn.chromium.org/blink/trunk@202465 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r202439.
TBR=oilpan-reviews
BUG=437696
NOTRY=true

Review URL: https://codereview.chromium.org/1349013003

git-svn-id: svn://svn.chromium.org/blink/trunk@202440 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r202421.
TBR=oilpan-reviews
BUG=492204
NOTRY=true

Review URL: https://codereview.chromium.org/1346413003

git-svn-id: svn://svn.chromium.org/blink/trunk@202432 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Increment style version for all style changes.
markAncestorsWithChildNeedsStyleRecalc incremented styleVersion on
Document, while markAncestorsWithChildNeedsStyleInvalidation did not.
That made us detect style changes differently depending on the type of
selectors which would be affected by a change - if we would schedule an
invalidation set, or set SubtreeStyleChange directly.

Instead increment style version on scheduleLayoutTreeUpdate.

R=ericwilligers@chromium.org,esprehn@chromium.org

Review URL: https://codereview.chromium.org/1333193004

git-svn-id: svn://svn.chromium.org/blink/trunk@202419 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tsniatowski
Fix //content/plugin ax_enums gn build flake (take 2)
Flake observerd with target_os="android" and enable_plugins=true,
probably can happen on other platforms as well.
//content/plugin/plugin_thread.cc ends up including the generated
ax_enums header so needs a dependency.

This is a retry of crrev.com/1343883003 with a direct ax_gen dep instead
of going via //content/public/common to avoid a dependency cycle in
component builds.

R=ananta@chromium.org, jam@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1344883002

Cr-Commit-Position: refs/heads/master@{#349228}
mostynb
gn help switches doc fixup
GN docs refer to "gn help" for common command-line switches in a couple
of places, but that only shows the top level help.  The reference
should of course be "gn help switches".

Review URL: https://codereview.chromium.org/1348633002

Cr-Commit-Position: refs/heads/master@{#349215}
mstensho
Remove special pagination code for floats and out-of-flow objects.
This got added years ago, to make something work, either for CSS regions or for
the old multicol implementation.

I see no need for this code, and it was getting in my way.

R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1343163005

git-svn-id: svn://svn.chromium.org/blink/trunk@202351 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Specify the source rect on the SourceGraphic
Instead of carrying the source rectangle of the filter input (the
'SourceGraphic') in the Filter, specify it in the input FilterEffect
(SourceGraphic).
This allows for getting rid of the sourceImageRect() method on Filter
and implementations (it's only actually non-empty for SVGFilter and
related code-paths.)

BUG=109224

Review URL: https://codereview.chromium.org/1338753003

git-svn-id: svn://svn.chromium.org/blink/trunk@202346 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Lazily instantiate Geolocation permission manager maps.
Delay creating the bidirectional maps needed to handle Geolocation
permission requests until actually used. To avoid instantiating a
pair of Persistent<> references when doing so, move the wrapper
private object to the Oilpan heap.

R=haraken,tkent
BUG=340522

Review URL: https://codereview.chromium.org/1339353002

git-svn-id: svn://svn.chromium.org/blink/trunk@202336 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
move zip template to a non-android-specific .gni file
The zip template really isn't android-specific, let's move it to its
own .gni file which doesn't assert(is_android).

Review URL: https://codereview.chromium.org/1345733002

Cr-Commit-Position: refs/heads/master@{#349016}
fs
Propagate resource-triggered repaints to text node children of <text>
When a paint server is modified, it is marked for layout and its clients
are marked for repaint. In the case of <text> (and <tspan> and other
text content elements), the text nodes (for which the actual painting is
performed) uses their parent (LayoutObject) to get the fill/stroke. This
means that if a repaint is requested for all clients of a resource, the
text nodes will not be notified.
Add and use a new paint invalidation reason for this case:
PaintInvalidationSVGResourceChange
Handle this reason in LayoutSVGText and LayoutSVGInline.
Generalize the ancestorHadPaintInvalidationForLocationChange
functionality, renaming it to forcedSubtreeInvalidationWithinContainer.

BUG=528159

Review URL: https://codereview.chromium.org/1331053002

git-svn-id: svn://svn.chromium.org/blink/trunk@202280 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tsniatowski
Fix //content/plugin ax_enums gn build flake
Flake observerd with target_os="android" and enable_plugins=true:
//content/plugin/plugin_thread.cc ends up including the generated
ax_enums header so make it depend on it.

BUG=

Review URL: https://codereview.chromium.org/1343883003

Cr-Commit-Position: refs/heads/master@{#348918}
fs
Don't import win32gui when it's not needed
If --parent-window=... isn't passed, then parent_window will be None,
and importing win32gui then is unnecessary.

Review URL: https://codereview.chromium.org/1335993002

Cr-Commit-Position: refs/heads/master@{#348914}
the_jk
Fix running gyp with configuration_policy=0
Running gyp in chromium with configuration_policy set to 0 fails as
multiple targets that are behind condition of configuration_policy==1
are referenced without corresponding conditionals

BUG=530579

Review URL: https://codereview.chromium.org/1334253002

Cr-Commit-Position: refs/heads/master@{#348903}
fs
Merge ReferenceFilter into Filter
The number of differences between the different subclasses of Filter is
decreasing. This brings in a sink and source reference into the
baseclass and makes use of that for users of the SVGFilter subclass too.
Instances of 'targetBoundingBox' is renamed to 'referenceBox' and the
absoluteFilterRegion() method is simplified.

BUG=109224

Review URL: https://codereview.chromium.org/1326183002

git-svn-id: svn://svn.chromium.org/blink/trunk@202273 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Document that navigator.appName is always "Netscape" (per spec)
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27796
https://html.spec.whatwg.org/#client-identification

BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1339683004

git-svn-id: svn://svn.chromium.org/blink/trunk@202268 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r202264.
TBR=oilpan-reviews
BUG=513568
NOTRY=true

Review URL: https://codereview.chromium.org/1339303002

git-svn-id: svn://svn.chromium.org/blink/trunk@202265 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Have a Page's MemoryPurgeController be a separate allocation also.
A Page keeps and owns a number of controllers, each being separately allocated.
Extend that to also apply to MemoryPurgeController; it is created on demand,
and no longer a part object.

R=haraken
BUG=520496

Review URL: https://codereview.chromium.org/1335373003

git-svn-id: svn://svn.chromium.org/blink/trunk@202261 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Floats' margins do not collapse with page or column boundaries.
When we push a float to the next page or column, push its top margin as well,
and do so consistently. In some cases we lost the margin, in some other cases
we got a double margin, and in yet some other cases we actually got it right.

There was code that asserted (in a comment) that having a pagination strut and
being unsplittable for pagination were mutually exclusive, but that's wrong. If
the first child (block / line) of a float doesn't fit in the current page or
column, we'll set a strut on the float. At the same time, the float may very
well be unsplittable for pagination. So, first pushing to the next page or
column because it's unsplittable, and THEN adding the strut will effectively
result in adding the pagination strut twice. This would be a problem both with
and without a top margin on the float.

R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1303993007

git-svn-id: svn://svn.chromium.org/blink/trunk@202212 bbb929c8-8fbe-4397-9dbb-9b2b20218538
alexanderk
Add module dir to sys.path in FindPythonDependencies
while loading modules using imp.load_source()

find_dependencies script was broken
after modifications done in tools/perf/run_benchmark
CL https://codereview.chromium.org/1280903003

BUG=527836

Review URL: https://codereview.chromium.org/1306953007

Cr-Commit-Position: refs/heads/master@{#348653}
fs
Compute outline mid-line in way that works with negative start-values
Since the expression (x1+x2)/2 will always "round" towards zero, if one
of the points (usually x1) is negative, the wrong "mid-line" will be
computed, and as a result part of the outline will shift right/down.
Instead compute the mid-line as x1+(x2-x1)/2 (or x1+thickness/2) i.e
perform the division on something that is known to be non-negative and
then offset from the starting point. (Similar reasoning for the other
dimension.)

BUG=529010

Review URL: https://codereview.chromium.org/1343773002

git-svn-id: svn://svn.chromium.org/blink/trunk@202205 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Conditionally update FontSelector on invalidation.
When invalidating a FontFallbackList to use a new FontSelector, check that
the new FontSelector really represents a change. Avoids needless
RefPtr/Persistent churn.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1341783003

git-svn-id: svn://svn.chromium.org/blink/trunk@202203 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Simplify SelfKeepAlive<T>'s representation.
Following r202197, a Persistent<> is only instantiated when assigned a
non-null pointer value. Consequently, SelfKeepAlive<>'s use of an OwnPtr<>
indirection to achieve the same is no longer needed.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1339043002

git-svn-id: svn://svn.chromium.org/blink/trunk@202202 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
No longer any need to delete the line box tree on our own.
The LayoutBlockFlow::moveChildrenTo() override takes of that for us.

BUG=327070
R=szager@chromium.org

Review URL: https://codereview.chromium.org/1311023003

git-svn-id: svn://svn.chromium.org/blink/trunk@202200 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Restrict registered PersistentNodes to non-empty ones.
It is not uncommon for Persistent<> members to be left as empty/null
upon construction, but possibly written to later during the object's
lifetime. Hence delaying the allocation and registeration of the
Persistent<>'s PersistentNode until it is initialized with a non-null
value avoids the alloc/free overhead for Persistent<>s that are never
initialized. And reduces the number of PersistentNode roots that the
GC has to iterate over.

By adopting that scheme here, the number of PersistentNodes allocated
when loading google.com is (approx) halved. Similar reductions consistently
seen elsewhere.

Dually, we also introduce the deallocation of the PersistentNode upon
updating the Persistent<> with nullptr. This is done so as to allow
a thread to cleanly shut down by first only clearing the persistents it
has allocated (and not require it to somehow separately destruct these
first -- that happens upon clearing.)


R=haraken
BUG=483380

Review URL: https://codereview.chromium.org/1338573003

git-svn-id: svn://svn.chromium.org/blink/trunk@202197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Explicitly include MacScrollTypes.h in view_messages.h
This header is currently included via WebScrollbarTheme.h (which is
needed for blink::ScrollerStyle). Explicitly including it makes the
dependency clearer.

Review URL: https://codereview.chromium.org/1339613002

Cr-Commit-Position: refs/heads/master@{#348601}
fs
Move safe_browsing include into FULL_SAFE_BROWSING guard
Review URL: https://codereview.chromium.org/1339663002

Cr-Commit-Position: refs/heads/master@{#348586}
sigbjornf
Add (back) assignment operator overloads over Persistent<> types.
Overloads aren't inherited, so add the required delegating operator=
overload implementation for (CrossThread)(Weak)Persistent<> types.

Without these, an assignment like

  V :: Persistent<T>
  X :: RawPtr<T>

  V = X;

will be desugared & compiled as

  V = Persistent<T>(X);  // where "=" is the copy constructor.

i.e., introducing (and allocating) a temporary Persistent<> for the RHS.

(This assignment shows up when initializing a WebPrivatePtr<T> over a GCed
type T, for instance.)

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1335303002

git-svn-id: svn://svn.chromium.org/blink/trunk@202191 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r202176.
R=haraken
BUG=437696
NOTRY=true

Review URL: https://codereview.chromium.org/1337383002

git-svn-id: svn://svn.chromium.org/blink/trunk@202186 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Multicol: Min-height should have no effect if content is taller and height is auto.
Calling computeLogicalHeight() before layout is somewhat problematic, since we
don't know the content/intrinsic height at that point. Specifying that height
as 0 would return the value of min-height (if specified) and make the multicol
code believe that height is constrained, and prevent columns from getting any
taller than that. In other words, min-height was more or less treated as
max-height in multicol.

Since we only want to know if we have a non-auto height that could constrain
the column heights, we can just skip computeLogicalHeight() if height is
indefinite.

BUG=65731
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1322513003

git-svn-id: svn://svn.chromium.org/blink/trunk@202162 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
unbreak no-webrtc builds
https://codereview.chromium.org/1330873002 broke builds with webrtc
disabled.

BUG=262211

Review URL: https://codereview.chromium.org/1340483002

Cr-Commit-Position: refs/heads/master@{#348435}
fs
Rename LayoutSVGTransformableContainer::m_lastTranslation
To m_additionalTranslation, since 'last' is ambiguous. The 'additional'
is from spec wording: "An additional transformation translate(x,y) ...".

Review URL: https://codereview.chromium.org/1337063002

git-svn-id: svn://svn.chromium.org/blink/trunk@202147 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Replace use Range::selectNodeContents() with EphemeralRange counterpart.
Switch to EphemeralRange::rangeOfContents() and avoid a Range allocation
in the process.

R=haraken
BUG=388681

Review URL: https://codereview.chromium.org/1337923002

git-svn-id: svn://svn.chromium.org/blink/trunk@202139 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Introduce Range::dispose() for prompt detachment from owner Document.
With Oilpan, Range objects become detached from their Document once GC
determines that the Range object is no longer referred to and can be
swept out, along with clearing out the object from the Document's weak
map. If GCs aren't otherwise being triggered regularly, this can in
some cases lead to unnecessary buildup of weakly held, but effectively
dead objects in that Document map. Something which slows down GC once
it eventually strikes.

To address, we introduce a dispose() method over Range so as to let code
handle the cases where it is known that the Range object is no longer
referenced & used and can be promptly detached from its Document. Less
GC overhead being the (desired) result.

R=yosin,haraken
BUG=388681

Review URL: https://codereview.chromium.org/1335573004

git-svn-id: svn://svn.chromium.org/blink/trunk@202138 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r202130.
The Blink GC plugin is syntactic, requiring GCed fields to literally
appear within the trace() method body. Once that don't are assumed not
to have been traced. Which prevents the use of an accessor, like r202130
introduced.

TBR=oilpan-reviews,yosin
BUG=513568
NOTRY=true

Review URL: https://codereview.chromium.org/1337933002

git-svn-id: svn://svn.chromium.org/blink/trunk@202137 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Include additional translation in getBBox for SVGUseElement
LayoutObject::objectBoundingBox() can't be used, because the additional
translation is included in the local-to-parent transform.

BUG=512081

Review URL: https://codereview.chromium.org/1310873004

git-svn-id: svn://svn.chromium.org/blink/trunk@202136 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Remove tautological comparison in CellSpan::ensureConsistency
Avoid a compilation warning when compiling with -Wtautological-compare
flag.

Review URL: https://codereview.chromium.org/1339633002

git-svn-id: svn://svn.chromium.org/blink/trunk@202135 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Avoid warnings in NetworkQualityEstimatorTest.TestCaching
Gets rid of the following compilation errors:
../../net/base/network_quality_estimator_unittest.cc:465:118: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression]
../../net/base/network_quality_estimator_unittest.cc:476:118: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression]

Review URL: https://codereview.chromium.org/1335943002

Cr-Commit-Position: refs/heads/master@{#348384}
ckulakowski
Guard usage of kEnableMediaRouter with ENABLE_MEDIA_ROUTER
Definition of kEnableMediaRouter is guarded with ENABLE_MEDIA_ROUTER.
All usages also should be guarded with this switch.

Review URL: https://codereview.chromium.org/1219063014

Cr-Commit-Position: refs/heads/master@{#348365}
fs
Check renderability of images in a (-webkit-)cross-fade before using
If the image fails to decode or otherwise trigger an error, we don't
want to render it, since it will render (or measure) the "broken image"
placeholder.

BUG=111512

Review URL: https://codereview.chromium.org/1334713002

git-svn-id: svn://svn.chromium.org/blink/trunk@202122 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Switch TextCheckingParagraph&Helper over to EphemeralRanges.
With the lighter EphemeralRange available, it is unnecessary to have
the SpellChecker utilities TextCheckingHelper and TextCheckingParagraph
continue to use Range objects. Switch over to EphemeralRange.

R=yosin
BUG=388681

Review URL: https://codereview.chromium.org/1331893002

git-svn-id: svn://svn.chromium.org/blink/trunk@202121 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Sync svg-d-interpolation.html expectations.
Following Blink r202067, this test no longer leaks.

R=haraken
BUG=529370
NOTRY=true

Review URL: https://codereview.chromium.org/1334163002

git-svn-id: svn://svn.chromium.org/blink/trunk@202119 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Introduce firstEphemeralRangeOf().
Provide an EphemeralRange counterpart to firstRangeOf() and make use of
it where possible.

R=
BUG=388681

Review URL: https://codereview.chromium.org/1332823002

git-svn-id: svn://svn.chromium.org/blink/trunk@202090 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Avoid a SVG property list-induced leak (Oilpan).
Address animations/svg-attribute-interpolation/svg-d-interpolation.html
leak.

R=haraken,kouhei
BUG=528275

Review URL: https://codereview.chromium.org/1328223002

git-svn-id: svn://svn.chromium.org/blink/trunk@202067 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Memory-infra: Change "objects_count" to "object_count" in category name.
TBR=thakis@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1334673004

Cr-Commit-Position: refs/heads/master@{#348166}
fs
Drop special-case handling of zero-length subpaths
Handled by Skia with https://codereview.chromium.org/1314213002

BUG=422974, 529845

Review URL: https://codereview.chromium.org/1328693002

git-svn-id: svn://svn.chromium.org/blink/trunk@202056 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Revert of set svg zero length to rebaseline (patchset #1 id:1 of https://codereview.chromium.org/1336543002/ )
Reason for revert:
Reverting this in favor of https://codereview.chromium.org/1328693002/ (less rebaselines needed)

Original issue's description:
> set svg zero length to rebaseline
> 
> The Skia change has been relanded to handle zero-length
> caps natively. Rebaseline the affected SVG tests.
> 
> R=fmalita@chromium.org
> BUG=529845
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=202052

TBR=fmalita@chromium.org,caryclark@chromium.org,caryclark@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=529845

Review URL: https://codereview.chromium.org/1333913002

git-svn-id: svn://svn.chromium.org/blink/trunk@202053 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Restrict visibility of internal TextCheckingParagraph predicates.
Reduce exposed interface slightly; no change in functionality.

R=
BUG=None

Review URL: https://codereview.chromium.org/1333813003

git-svn-id: svn://svn.chromium.org/blink/trunk@202050 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Generalize ScopedDisposal<T> to handle non-GC types.
Drop the restriction that ScopedDisposal<T> can only be used with
Oilpan GCed types + parameterize the template over the disposal method
to use (with dispose() being the default.)

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1332743002

git-svn-id: svn://svn.chromium.org/blink/trunk@202048 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Make gyp_flag_compare.py work on Windows
BUG=

Review URL: https://codereview.chromium.org/1319063004

Cr-Commit-Position: refs/heads/master@{#348113}
sigbjornf
Oilpan: fix build after r201994.
TBR=oilpan-reviews
BUG=488628
NOTRY=true

Review URL: https://codereview.chromium.org/1327193002

git-svn-id: svn://svn.chromium.org/blink/trunk@202004 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Update outer flow thread membership before changing multicolness.
This change is about being more strict about applying style changes in tree
order: first adjust the relationship to the ancestry, THEN adjust the children.

This order is important if a multicol container has a child out-of-flow
multicol container with a spanner, and this child is changed to become in-flow
at the same time as it ceases to be a multicol container, and instead becomes a
spanner. If we change it from multicol to spanner first (instead of making it
part of the outer multicol container first), the outer multicol container is
going to believe that it contains the inner spanner, and we'd end up with a
spanner inside another spanner, which isn't allowed.

#a - multicol
  #b - abspos multicol, changing it to static spanner
    #c - spanner (but it should become a regular block once #b becomes a spanner)

The effect of this fix is that we swap the ordering of notifying the flow thread
about descendant style changes (flowThreadDescendantStyleWillChange(),
flowThreadDescendantStyleDidChange()), compared to when handling style changes
locally on the object (styleWillChange(), styleDidChange()) takes place. More
specifically, we need to get to flowThreadDescendantStyleDidChange() first
(which registers or unregisters descendants in the flow thread - i.e. updates
the LayoutMultiColumnSet / LayoutMultiColumnSpanner placeholder structure), and
THEN to evacuateAndDestroy() (via LayoutBlockFlow::styleDidChange() and 
createOrDestroyMultiColumnFlowThreadIfNeeded()), instead of the other way around.
This way we register #b (now a spanner) in #a first. That will prevent #a from
seeing anything inside #b (spanners are rather opaque).

Since we're now notifying the flow thread from LayoutBox instead of
LayoutObject, we can change the style change notification methods to take
LayoutBox instead of any kind of LayoutObject. The flow thread only cares about
LayoutBox or better here anyway. This allows for some cleanup in the
notification methods, since we no longer need to worry about computed style
weirdness on text layout objects.

BUG=516532
R=eae@chromium.org,jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1320843005

git-svn-id: svn://svn.chromium.org/blink/trunk@201993 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop SVGElement::getBoundingBox
The two users can be trivially replaced with queries on the layout tree
instead.

Review URL: https://codereview.chromium.org/1317563010

git-svn-id: svn://svn.chromium.org/blink/trunk@201973 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
gn: fix documentation typo
s/currebt/current/

TBR=brettw

Review URL: https://codereview.chromium.org/1318963007

Cr-Commit-Position: refs/heads/master@{#347900}
rune
Schedule a BeginFrame when we stop deferring commits.
We do not scheduleVisualUpdate for setNeedsStyleRecalc when we have
pending stylesheets. If we setNeedsStyleRecalc while loading a stylesheet,
we won't necessarily trigger a BeginFrame when the stylesheet finishes
loading because subsequent setNeedsStyleRecalc call won't trigger those
either if the ascendants are already marked with childNeedsStyleRecalc
because we assume the visual update is already scheduled.

Schedule a BeginFrame from resumeTreeViewCommits to make sure deferred
visual updates are triggered.

BUG=384934

Review URL: https://codereview.chromium.org/1316403004

git-svn-id: svn://svn.chromium.org/blink/trunk@201933 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop getBBox() override on SVGPathElement
path().boundingRect() is exactly what objectBoundingBox() will return
for LayoutSVGPath, so the implementation from SVGGraphicElement can be
used.

Review URL: https://codereview.chromium.org/1315983012

git-svn-id: svn://svn.chromium.org/blink/trunk@201917 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Limit stack-allocated uses of CancellableTaskFactory(PassOwnPtr<Closure>).
Classes that keep a CancellableTaskFactory should create() these via the
provided factory method, which takes care of creating the task factory's
closure in a manner that doesn't cause an (Oilpan) leak.

Not using the factory method is convenient when testing, so accommodate
this by way of a protected CancellableTaskFactory<> constructor, and use
it in unit tests. The unit tests exercise functionality rather than direct
usage by Blink objects, so hiding the constructor is considered acceptable.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1320023009

git-svn-id: svn://svn.chromium.org/blink/trunk@201916 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201904.
TBR=oilpan-reviews,yosin
BUG=513568
NOTRY=true

Review URL: https://codereview.chromium.org/1303993005

git-svn-id: svn://svn.chromium.org/blink/trunk@201907 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201865.
TBR=oilpan-reviews,yosin
BUG=513568
NOTRY=true

Review URL: https://codereview.chromium.org/1323023004

git-svn-id: svn://svn.chromium.org/blink/trunk@201879 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Revert "Implement proposed shadow tree cascade order."
This reverts commit bb5572c1de7405160a32b80c6224477b13eaac14.

Conflicts:
	Source/core/css/resolver/StyleResolver.h

TBR=kochi@chromium.org
BUG=487125

Review URL: https://codereview.chromium.org/1332493002

git-svn-id: svn://svn.chromium.org/blink/trunk@201875 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Revert 201092 "Reland of moved unused CascadeOrder. (patchset #1..."
> Reland of moved unused CascadeOrder. (patchset #1 id:1 of https://codereview.chromium.org/1306693007/ )
> 
> Reason for revert:
> I don't think this contributes any of "too many opened files".
> (as is commented bay jianli
> https://code.google.com/p/chromium/issues/detail?id=524248#c7 )
> 
> Will revert and reland the original patch.
> 
> 
> 
> Original issue's description:
> > Revert of Removed unused CascadeOrder. (patchset #1 id:1 of https://codereview.chromium.org/1291873005/ )
> > 
> > Reason for revert:
> > Speculative revert for causing "Too many opened files in the system".
> > 
> > https://code.google.com/p/chromium/issues/detail?id=523598
> > 
> > 
> > Original issue's description:
> > > Removed unused CascadeOrder.
> > > 
> > > CascadeOrder is always ignoreCascadeOrder after [1] and can be removed.
> > > 
> > > [1] https://codereview.chromium.org/1298173004
> > > 
> > > BUG=487125
> > > 
> > > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201019
> > 
> > TBR=kochi@chromium.org,rune@opera.com
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=487125
> > 
> > Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201082
> 
> TBR=rune@opera.com,jianli@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=487125
> 
> Review URL: https://codereview.chromium.org/1313713005

TBR=kochi@chromium.org

Review URL: https://codereview.chromium.org/1331573002

git-svn-id: svn://svn.chromium.org/blink/trunk@201871 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
A block that establishes a new formatting context is pushed by floats.
Only block containers that don't establish new formatting contexts are
allowed to ignore (and thus potentially overlap with) floats.

This obviously also applies inside multicol, but we had a check that actively
prevented that. This was some residue from CSS regions support (shared
implementation with multicol), which had a much more sophisticated positioning
implementation, which we've removed ages ago.

BUG=528179
R=jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1325323002

git-svn-id: svn://svn.chromium.org/blink/trunk@201867 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Avoid duplicated code in LayoutBlockChild::layoutBlockChild().
Before laying out, we try to estimate and set the logical top of the child, but
it may turn out after one layout pass that the estimate was wrong, due to
margin collapsing, float clearance or pagination.

So sometimes we need to reposition and relayout once or even twice inside
layoutBlockChild(). This was done with slightly poorly duplicated code.
Refactor into positionAndLayoutOnceIfNeeded() (and
markDescendantsWithFloatsForLayoutIfNeeded()). One instance of this duplicated
code used to sit in adjustBlockChildForPagination(). Moved it into
layoutBlockChild(), to make it easier to understand what's going on (and to
give adjustBlockChildForPagination() one less thing to worry about - one
parameter removed). Renamed |result| to |newLogicalTop| in
adjustBlockChildForPagination(), and |logicalTopAfterClear| to |newLogicalTop|
in layoutBlockChild().

No behavioral changes were actually intended, but when unifying
almost-duplicated code, some changes are inevitable. Added some tests for
something that now works, and used to fail. In the subsequent layout passes we
forgot to check if the new position changed how we were affected by floats.

R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1315353005

git-svn-id: svn://svn.chromium.org/blink/trunk@201866 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
move gconf config inside use_gconf block
BUG=132847

Review URL: https://codereview.chromium.org/1328883002

Cr-Commit-Position: refs/heads/master@{#347440}
sigbjornf
Oilpan: tidy up NavigationScheduler.
Allocate this object separately and not as a part of a LocalFrame. The
main motivation for this is to play better with its use of a
CancellableTaskFactory following r201780.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1330653003

git-svn-id: svn://svn.chromium.org/blink/trunk@201794 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Improve CancellableTaskFactory handling and Oilpan usage.
If a CancellableTaskFactory is used by an Oilpan heap object, the
closure that the factory works with/over, cannot embed a reference
back to that object by way of an off-heap Persistent<> (WTF::Closure
is not on the heap.) If it does, such a reference will keep the heap
object alive, without it ever being released. Memory leaks are very likely.

This is too easy a slip-up to make with the current CancellableTaskFactory
constructor, so rephrase the constructor so as to make leaks no longer (easily)
possible. For Oilpan heap objects baked into the closure, the persistent reference
now held will be weak.

At the same time, take the opportunity to have this object no longer be a part object,
but a separate (off-heap) allocation. This lets us drop the ad-hoc ASan unpoisoning
support that was previously needed if CancellableTaskFactory was a part object
of an Oilpan heap object. Less magic.

R=haraken
BUG=

Review URL: https://codereview.chromium.org/1312843009

git-svn-id: svn://svn.chromium.org/blink/trunk@201787 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't transfer viewport to an invalid/dirty <use> instance
If an update is pending for a <use> shadow tree, the width/height
needn't be updated, since the update of the shadow tree will do it.
Make sure to clear the reference to the instance root when
invalidating the shadow tree.
Also split clearResourceReferences into a few different parts.

BUG=516051

Review URL: https://codereview.chromium.org/1323443003

git-svn-id: svn://svn.chromium.org/blink/trunk@201738 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201727.
TBR=oilpan-reviews
BUG=262211
NOTRY=true

Review URL: https://codereview.chromium.org/1329753003

git-svn-id: svn://svn.chromium.org/blink/trunk@201733 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Never move unbreakable blocks that are at the top of a column / page.
That's just going to leave a column / page blank, without fitting any content
better. If the block is too tall to fit in the current column / page, it's
going to be just as too tall for the next one as well.

BUG=526098
R=jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1318653004

git-svn-id: svn://svn.chromium.org/blink/trunk@201732 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove BarProp.visible TODO that has been fixed in the spec
NOTRY=true
R=fs@opera.com

Review URL: https://codereview.chromium.org/1328723004

git-svn-id: svn://svn.chromium.org/blink/trunk@201721 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix GC_PROFILING builds following r201671.
R=haraken
BUG=527054
NOTRY=true

Review URL: https://codereview.chromium.org/1308053007

git-svn-id: svn://svn.chromium.org/blink/trunk@201707 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201667.
TBR=oilpan-reviews
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/1314773009

git-svn-id: svn://svn.chromium.org/blink/trunk@201670 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201639.
TBR=oilpan-reviews
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/1312073003

git-svn-id: svn://svn.chromium.org/blink/trunk@201650 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Oilpan: fix build after r201639. (patchset #1 id:1 of https://codereview.chromium.org/1312073003/ )
Reason for revert:
Not complete, reverting to reland.

Original issue's description:
> Oilpan: fix build after r201639.
> 
> TBR=oilpan-reviews
> BUG=none
> NOTRY=true
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=201647

TBR=oilpan-reviews@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=none

Review URL: https://codereview.chromium.org/1319623006

git-svn-id: svn://svn.chromium.org/blink/trunk@201648 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201639.
TBR=oilpan-reviews
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/1312073003

git-svn-id: svn://svn.chromium.org/blink/trunk@201647 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Have uses of MockImageResourceClient leak less.
Turn this unit test helper into something more RAII-like to avoid
Resources not having their clients removed.

For the tests touched, addresses reported Resource leaks.

R=haraken
BUG=526423

Review URL: https://codereview.chromium.org/1327653004

git-svn-id: svn://svn.chromium.org/blink/trunk@201645 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201632.
R=haraken
BUG=523249
NOTRY=true

Review URL: https://codereview.chromium.org/1325983003

git-svn-id: svn://svn.chromium.org/blink/trunk@201636 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix Resource leak in ActivityLoggerTest unit tests.
Evict resources from the memory cache upon shutdown.

R=haraken
BUG=526423

Review URL: https://codereview.chromium.org/1309843011

git-svn-id: svn://svn.chromium.org/blink/trunk@201634 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201622.
TBR=oilpan-reviews
BUG=513568
NOTRY=true

Review URL: https://codereview.chromium.org/1310633005

git-svn-id: svn://svn.chromium.org/blink/trunk@201629 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Add inline style in the element's scope.
Style attribute declarations were added in a separate scope after all
other author origins. Instead add style attribute declarations right after
collecting matching rules from the element's scope. This means that we can
override values set on the style attribute from outer scopes, like we can
with values from inner scope's stylesheet.

Without this fix, you would get green on orange below:

<style>html /deep/ span { color: green; background-color: lime }</style>
<host>
  <host:root>
    <style>span { color:red }</style>
    <span style="background:orange">Green on orange?</span>
  </host:root>
</host>

With this change, we will get green on lime.

The regression (issue 526634) was not relying on this, but it would be
more complex code to fix the regression without fixing the style attribute
cascading order.

R=kochi@chromium.org,hayato@chromium.org
BUG=526634

Review URL: https://codereview.chromium.org/1322753006

git-svn-id: svn://svn.chromium.org/blink/trunk@201620 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Update the visibility of XHR-related interfaces to match spec
https://github.com/whatwg/xhr/issues/19

BUG=395931
R=dominicc@chromium.org

Review URL: https://codereview.chromium.org/1310543002

git-svn-id: svn://svn.chromium.org/blink/trunk@201597 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: update plugin handling to work over plugins persisted over reattach
Following Blink r201401, a plugin element's persisted plugin will be
cleared out upon the plugin element being removed from the tree or being
re-attached and there being no layout object. With Oilpan, this may
bring about disposal of the underlying plugin.

A disposed persisted plugin is consequently observable if subsequently
try to return the plugin wrapper object for the plugin element -- add
the required check so as to handle this properly.

R=haraken
BUG=526999

Review URL: https://codereview.chromium.org/1326603002

git-svn-id: svn://svn.chromium.org/blink/trunk@201572 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Sync OilpanExpectations.
Remove some now-unbound virtual slimmingpaint test entries along with
removing expectation for

 svg/as-background-image/animated-svg-animation-control.html

which was removed in r201021.

R=haraken
BUG=345655,370906,356658,356742,456357,522652
NOTRY=true

Review URL: https://codereview.chromium.org/1323963002

git-svn-id: svn://svn.chromium.org/blink/trunk@201550 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Clarify the TODO for FrameRequestCallback
BUG=460722

Review URL: https://codereview.chromium.org/1326523002

git-svn-id: svn://svn.chromium.org/blink/trunk@201540 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove a few IDL TODOs that have been fixed in the HTML spec
BUG=460722
R=domenic@chromium.org

Review URL: https://codereview.chromium.org/1308553005

git-svn-id: svn://svn.chromium.org/blink/trunk@201536 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
If javascript: returns no result, balance load progress notifications.
Upon executing a javascript: URL in an empty document, we take care to
notify that the load has started. Should the result of executing the
script code be no result and navigation, balance the progress notifications
by signalling completion also.

R=haraken
BUG=495495

Review URL: https://codereview.chromium.org/1158973004

git-svn-id: svn://svn.chromium.org/blink/trunk@201481 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix building with blink_gc_profiling:1
R=haraken
BUG=

Review URL: https://codereview.chromium.org/1321173002

git-svn-id: svn://svn.chromium.org/blink/trunk@201473 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Fix method name typo in PartitionAlloc.
Review URL: https://codereview.chromium.org/1320243003

git-svn-id: svn://svn.chromium.org/blink/trunk@201454 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201436, r201444.
TBR=oilpan-reviews
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/1317363003

git-svn-id: svn://svn.chromium.org/blink/trunk@201451 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Throw exceptions for charnum == getNumberOfChars in get{...}OfChar APIs
According to the spec [1], IndexSizeError should be thrown if:

"...the charnum is negative or if charnum is greater than or equal to
 the number of characters at this node."

This is what's implemented by IE, Gecko and Presto.

[1] http://www.w3.org/TR/SVG11/text.html#__svg__SVGTextContentElement__getStartPositionOfChar
    The current SVG2 draft has a different formulation:

     (https://svgwg.org/svg2-draft/text.html#__svg__SVGTextContentElement__getStartPositionOfChar)
     "If cluster is null, then then throw a DOMException with code
      INDEX_SIZE_ERR."

    but will have the same result.

BUG=391345

Review URL: https://codereview.chromium.org/1321783002

git-svn-id: svn://svn.chromium.org/blink/trunk@201411 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove redundant DocumentLoadTiming references.
Having ScriptedIdleTaskController and its auxillary object keep a reference
to a document's DocumentLoadTiming part object is unnecessary as the deadlines
do not have to be translated wrt a Document's baseline reference time.

R=sami, rmcilroy
BUG=

Review URL: https://codereview.chromium.org/1316323002

git-svn-id: svn://svn.chromium.org/blink/trunk@201338 bbb929c8-8fbe-4397-9dbb-9b2b20218538
alexanderk
Try to reset quota database which is suspected to be corrupted
If we are able to open quota database file but cannot create a table
then we suspect it to be corrupted and trying to reset.

BUG=508916

Review URL: https://codereview.chromium.org/1236583002

Cr-Commit-Position: refs/heads/master@{#345966}
fs
Don't drop type information returned from locateRenderSVGTextAncestor
LayoutSVGText::locateRenderSVGTextAncestor returns a LayoutSVGText*, so
widening it to LayoutObject only serves to lose information - for the
primary benefit of "interface hiding".
This in turn mean that some calls can be devirtualized.

Also restructure the methods themselves to avoid stating the predicate
twice (negated and not.)

Review URL: https://codereview.chromium.org/1308983006

git-svn-id: svn://svn.chromium.org/blink/trunk@201319 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Applying the "all" property needs to check all properties against the whitelist.
When applying any other property than "all", we already perform this whitelist
check, but applying "all" is a separate code path, and the checks were missing
there.

BUG=524682
R=rune@opera.com

Review URL: https://codereview.chromium.org/1304123006

git-svn-id: svn://svn.chromium.org/blink/trunk@201315 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Invalidate style from shadow host, not root, to apply :host rules.
This is a regression from r201058. We incorrectly marked the shadow root
node for style recalc instead of the host. Marking the host is necessary
to apply new :host rules.

R=esprehn@chromium.org
BUG=525280

Review URL: https://codereview.chromium.org/1311463004

git-svn-id: svn://svn.chromium.org/blink/trunk@201311 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Have resetInternalsObject() handle detached documents.
R=haraken
BUG=524261

Review URL: https://codereview.chromium.org/1309673004

git-svn-id: svn://svn.chromium.org/blink/trunk@201306 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: avoid using WeakPtr<> for heap residing objects.
GlobalFetch::ScopedFetcher instances are heap objects, so avoid using
WeakPtr<>s over those.

Also switch over to using WeakPtr* transition types where possible.

R=haraken
BUG=509911

Review URL: https://codereview.chromium.org/1320563003

git-svn-id: svn://svn.chromium.org/blink/trunk@201305 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Remove applyStatefulResource interface from SVGClipPainter
applyClippingToContext is equally "stateful", so the two entrypoints
does not seem warranted.
Fold applyClippingToContext into applyStatefulResource and then rename
it to prepareEffect (to match mask and filter). Similarly rename
postApplyStatefulResource to finishEffect.

Review URL: https://codereview.chromium.org/1308223003

git-svn-id: svn://svn.chromium.org/blink/trunk@201262 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Move painting code out of LayoutSVGResourceClipper
LayoutSVGResourceClipper::tryPathOnlyClipping contains the code to
emit the path - if one is successfully built. For the sake of layering,
push this out into the caller (SVGClipPainter) instead.

Also replace uses of clipperResource().isEmpty() with hasClipper(),
rename objectBoundingBox referenceBox (to better match the Masking spec
terminology) and rename the tryPathOnlyClipping to asPath.

Review URL: https://codereview.chromium.org/1308983007

git-svn-id: svn://svn.chromium.org/blink/trunk@201254 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
createPlainText(): avoid a 32k buffer allocation for empty ranges.
The pre-allocation of the StringBuilder is redundant if the range is
empty, hence avoid.

While here, simplify empty string builder testing also.

R=yosin
BUG=

Review URL: https://codereview.chromium.org/1317593003

git-svn-id: svn://svn.chromium.org/blink/trunk@201212 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't resolve rectangle as different unit if viewport is empty
SVGLengthContext::resolveRectangle would resolve oBB units as uSOU units
if the "viewport" provided was empty.
This would lead to incorrect rendering in certain cases - like with
filters on content with an empty bbox.

BUG=252696

Review URL: https://codereview.chromium.org/1313893003

git-svn-id: svn://svn.chromium.org/blink/trunk@201140 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tsniatowski
Fix typo in gn ccache support for linux:x86
BUG=

Review URL: https://codereview.chromium.org/1308403004

Cr-Commit-Position: refs/heads/master@{#345355}
fs
svg/custom/resource-client-removal.svg no longer flaky
Stabilized after https://codereview.chromium.org/1286093008

TBR=pdr@chromium.org
BUG=521856

Review URL: https://codereview.chromium.org/1317543002

git-svn-id: svn://svn.chromium.org/blink/trunk@201128 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Don't change the media controls visibility in MediaControls::reset()
reset() is called from a number of places with the expectation of
putting the controls into the state they would be if created anew.

One such place is via HTMLMediaElement::preDispatchEventHandler, where
the controls are reset when entering or exiting fullscreen. This has a
very strange side-effect, namely that dispatching a synthetic
webkitfullscreenchange event on a video will cause the media controls to
become visible.

It would be rather messy to write a layout test for this, and it would
be slow to run, so instead add unit tests to test this more directly.

R=fs@opera.com

Review URL: https://codereview.chromium.org/1319433003

git-svn-id: svn://svn.chromium.org/blink/trunk@201126 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop LayoutVTTCue::adjustForTopAndBottomMarginBorderAndPadding
This method only serves to break the cue layout computed by
SnapToLinesLayouter. If we want to factor in margin+border for cues (and
padding for the cue container), then factor that into the cue layout
algorithm instead.

BUG=301580

Review URL: https://codereview.chromium.org/1314613002

git-svn-id: svn://svn.chromium.org/blink/trunk@201119 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove TODO <video preload> case-sensitivity (invalid spec bug)
NOTRY=true
R=fs@opera.com

Review URL: https://codereview.chromium.org/1318443002

git-svn-id: svn://svn.chromium.org/blink/trunk@201108 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
svg/custom/js-late-pattern-and-object-creation.svg no longer flaky
Stabilized after https://codereview.chromium.org/1286093008

TBR=pdr@chromium.org
BUG=522649

Review URL: https://codereview.chromium.org/1310203004

git-svn-id: svn://svn.chromium.org/blink/trunk@201061 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r201058.
TBR=oilpan-reviews
BUG=522860
NOTRY=true

Review URL: https://codereview.chromium.org/1303953005

git-svn-id: svn://svn.chromium.org/blink/trunk@201060 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Should not ASSERT what we know will fail.
The input to the selector position and the rule position is known to
possibly overflow 12 and 18 bits respectively since the input comes from
unsigned positions into data structures known to keep more elements than
that. The selector and rule positions will be wrong regardlessly, unless
we make RuleData bigger.

Truncating the position to a max value instead of just letting it
overflow could be an option. It doesn't make sense for selector position
as trying to match any of the other selectors won't make any difference.

Truncating the rule position would make the cascading order correct when
comparing rules in the representable range with a rule outside the range,
while just letting it overflow starting from zero again will yield a
correct cascading order between two rules both outside of the
representable range.

Given that, I conclude to just remove the ASSERTs and not do anything
clever about values outside of the ranges.

BUG=519315
R=timloh@chromium.org

Review URL: https://codereview.chromium.org/1312703002

git-svn-id: svn://svn.chromium.org/blink/trunk@201059 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Fix crash when removing stylesheets from shadow tree.
The added sheets passed into StyleSheetInvalidationAnalysis may either be
added or removed. When they are removed style elements from a shadow tree,
the style element may no longer have a containingShadowRoot if the element
has already been removed. That caused a crash when the containingShadowRoot
was accessed without a nullptr check.

Instead of deducing the scope from the style element, pass the stylesheet
collection TreeScope to the analysis object. The m_scopingNodes, which is
probably a left-over from <style scoped> has been removed.

Now, the shadow tree root node, or outermost shadow host if ::content
rules makes that necessary, is always marked sub-tree dirty. The previous
code-path could trigger id/class invalidation of separate elements when
the stylesheet contents had multiple owner nodes, but that was most likely
wrong if it could ever happen.

BUG=522860

Review URL: https://codereview.chromium.org/1313443003

git-svn-id: svn://svn.chromium.org/blink/trunk@201058 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Sync some media/track test expectations.
Remove entries that were asserting prior to crbug.com/521520 being fixed.

R=haraken,keishi
BUG=521102,521861
NOTRY=true

Review URL: https://codereview.chromium.org/1311733002

git-svn-id: svn://svn.chromium.org/blink/trunk@201051 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Accurately update Document node counts on disposing shadow roots.
When cleaning out a ShadowRoot's child Nodes as part of its disposal,
the child Nodes will in some cases not have other references than the
shadow root. If so, the Node will be summarily deleted without being
notified of it being removed from its DOM tree first. By calling its
removedFrom().

As a Document need to maintain an accurate attached node count, arrange
for the otherwise-unreferenced Node's document to be decremented.

R=
BUG=521520

Review URL: https://codereview.chromium.org/1309083002

git-svn-id: svn://svn.chromium.org/blink/trunk@201044 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Remove tests svg/as-background-image/animated-svg-animation-control.html
This test has been flaky all along because the sequence of events it
tries to observe is not fully observable. There's still some coverage of
the reset-animation-when-no-longer-running case elsewhere.

BUG=522652

Review URL: https://codereview.chromium.org/1292703004

git-svn-id: svn://svn.chromium.org/blink/trunk@201021 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
make use of use_glib variable rather than is_linux when adding glib config
Review URL: https://codereview.chromium.org/1306473003

Cr-Commit-Position: refs/heads/master@{#344877}
rune
Removed unused CascadeOrder.
CascadeOrder is always ignoreCascadeOrder after [1] and can be removed.

[1] https://codereview.chromium.org/1298173004

BUG=487125

Review URL: https://codereview.chromium.org/1291873005

git-svn-id: svn://svn.chromium.org/blink/trunk@201019 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r200992.
TBR=oilpan-reviews
BUG=514651
NOTRY=true

Review URL: https://codereview.chromium.org/1309593003

git-svn-id: svn://svn.chromium.org/blink/trunk@201005 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Implement proposed shadow tree cascade order.
This CL implements the shadow tree cascade order proposed in [1].

Previously, in Blink, specificity would win over scope origin, even if the
scopes had an inner/outer scope relationship, and the order-of-appearance
was governed by the CascadeOrder type. Also, !important rules did not
apply in the reverse scope order, as the current spec says for inner/outer
scopes, and the proposal in [1] says apply between all shadow scopes.

What has been done is:

1. CascadeOrder is not used, as it represents order-of-appearance
   (Removal of CascadeOrder is not done here to make the CL smaller. Will
   be removed in a follow-up CL).

2. When collecting rules, sort after each scope instead of just after UA
   and Author since we had:

   UA important
   Author important
   Author
   UA

   and now we have (with A(n) appearing before A(n+1) in the tree-of-trees
   order):

   UA important
   Author scope A(n) important
   ...
   Author scope A(1) important
   Author scope A(1)
   ...
   Author scope A(n)
   UA

   The applyProperties code is hot, and I have made performance runs for
   the micro-benchmarks in Layout and CSS without consistent regressions.

3. Since the cascading order between scopes are just the inner/outer
   relationship in the composed tree (direction decided by !important),
   which is the same as the tree-of-trees order of the shadow trees,
   we can just traverse the DocumentOrderedList of scopes in the reverse
   order instead of doing calculation tricks for CascadeOrder values.

   Because of this, TreeBoundaryCrossingRules is now reduced to a
   DocumentOrderedList of scoping nodes, so the TreeBoundaryCrossingRules
   class is removed.

[1] https://lists.w3.org/Archives/Public/www-style/2015Jun/0303.html

BUG=452542, 455148, 487125

NOTRY=true

Review URL: https://codereview.chromium.org/1298173004

git-svn-id: svn://svn.chromium.org/blink/trunk@200994 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Sync snap-to-lines VTT cue layout steps with spec
 * Sync step documentation ('line position' -> 'line' and similar.)
 * Remove remnants of 'best position' and re-number steps.
 * Implement new cue dodging logic.

BUG=301580

Review URL: https://codereview.chromium.org/1306833003

git-svn-id: svn://svn.chromium.org/blink/trunk@200987 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop unused showingTrackWithSameKind declaration from HTMLMediaElement
Review URL: https://codereview.chromium.org/1304183003

git-svn-id: svn://svn.chromium.org/blink/trunk@200985 bbb929c8-8fbe-4397-9dbb-9b2b20218538
joleksy
Allow default font size changing on Linux.
Currently base rendering font size on Linux is hardcoded to 16.0 with no possibility of changing it. This patch add such possibility in RendererPreferences.

Webkit part: https://codereview.chromium.org/570243002/

BUG=

Review URL: https://codereview.chromium.org/549303004

Cr-Commit-Position: refs/heads/master@{#344746}
sigbjornf
Keep TextMetrics on the Oilpan heap always.
R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1297383003

git-svn-id: svn://svn.chromium.org/blink/trunk@200969 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
CompositorWorker is now always on the heap.
Consequently, update its IDL attribute to [GarbageCollected] and adjust
the return type of its constructor.

R=haraken
BUG=522949

Review URL: https://codereview.chromium.org/1309463002

git-svn-id: svn://svn.chromium.org/blink/trunk@200964 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have PromiseTracker callback keep a WeakPersistent<>.
For the v8 callback objects that PromiseTrackers create, insist on using
a WeakPersistent<> back reference to the PromiseTracker when Oilpan
is enabled.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1301253002

git-svn-id: svn://svn.chromium.org/blink/trunk@200963 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Keep auxilliary media objects on the heap always.
Fully transition MediaError, MediaKeyError and TimeRanges to Oilpan.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1306613002

git-svn-id: svn://svn.chromium.org/blink/trunk@200962 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r200912.
TBR=oilpan-reviews
BUG=492204
NOTRY=true

Review URL: https://codereview.chromium.org/1298253004

git-svn-id: svn://svn.chromium.org/blink/trunk@200925 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
make use of media_use_ffmpeg in BUILD.gn
Review URL: https://codereview.chromium.org/1297583004

Cr-Commit-Position: refs/heads/master@{#344525}
fs
Replace setTimeout() with runAfterLayoutAndPaint() in a few tests
This is in line with the FIXMEs in these tests, and hopefully end up
curing some flakyness. Fingers crossed.

BUG=522649, 521856

Review URL: https://codereview.chromium.org/1286093008

git-svn-id: svn://svn.chromium.org/blink/trunk@200903 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
use more specific variables in net/BUILD.gn
Review URL: https://codereview.chromium.org/1290383005

Cr-Commit-Position: refs/heads/master@{#344492}
davve
Refactor code for calculating background image geometry
Extract BoxPainter::calculateBackgroundImageGeometry implementation
and related functions to the BackgroundImageGeometry class. This
enables shrinking the API surface of BackgroundImageGeometry and eases
further code health improvements.

BUG=521481

Review URL: https://codereview.chromium.org/1300103003

git-svn-id: svn://svn.chromium.org/blink/trunk@200850 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Avoid floating point when calculating the actual column count.
It's too inaccurate.

BUG=502407
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1285273004

git-svn-id: svn://svn.chromium.org/blink/trunk@200848 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Store SVGResourcesCache inline in SVGDocumentExtensions
Indirections--

BUG=521334

Review URL: https://codereview.chromium.org/1296353004

git-svn-id: svn://svn.chromium.org/blink/trunk@200845 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't register excessive pending SVG resources
When an SVG resource was destroyed, it would notify the
SVGResourcesCache, which would walk the entire cache, notify the layout
object and add a "pending" entry for the id referring to the
corresponding element.
This would mean that every layout object which had any kind of resource
would get a "pending" reference from every id to itself - regardless of
if it ever referred to a resource with the given id. In the particular
test, this resulted in a fairly large (ever-growing) "pending" element
sets because there was persistent resource references in the document.

Fix by only adding "pending" entries for the current clients of the
resource that's being destroyed.
SVGResourcesCache::resourceDestroyed is removed in favor of new method
detachAllClients() in LayoutSVGResourceContainer. The part that
unregistered the resource itself as a client is removed in favor of the
pre-existing call to clientDestroyed() already existing in
LayoutSVGModelObject::willBeDestroyed (delegated to from the resource.)
SVGResources::resourceDestroyed is changed to not call
removeAllClientsFromCache() on the resource being passed - this is
instead done once after having cleared the references in all the
clients.

With this change, the "cycle time" of the test in the bug changes from
linearly increasing to constant.

BUG=521334

Review URL: https://codereview.chromium.org/1302713003

git-svn-id: svn://svn.chromium.org/blink/trunk@200840 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Recalculate intrinsic widths in the old containing block chain when going out of flow.
When an object goes out of flow, it no longer contributes to the intrinisic
widths of its parents. We need to mark them for recalculation while we can
still walk that ancestry chain, i.e. before applying the style change.

BUG=521819
R=esprehn@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1294063005

git-svn-id: svn://svn.chromium.org/blink/trunk@200836 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
libgtk2ui should only add the cups config if use_cups is true
The cups gn config is defined inside a use_cups block,
therefore other targets should only try to add this config
inside another use_cups block.

Review URL: https://codereview.chromium.org/1296043003

Cr-Commit-Position: refs/heads/master@{#344268}
mostynb
pkg-config.py should use --libs instead of --libs-only-l --libs-only-L
When specifying both --libs-only-l and --libs-only-L to
pkg-config, the results from the latter are not included.
This feels like a bug in pkg-config, reported upstream:
https://bugs.freedesktop.org/show_bug.cgi?id=91689

Our pkg-config.py wrapper can use --libs instead of the
flags mentioned above- this includes flags from both but
maybe also some additional flags (eg -rdynamic).

BUG=522564

Review URL: https://codereview.chromium.org/1291803008

Cr-Commit-Position: refs/heads/master@{#344260}
christiank
Add glCompressedCopySubTextureCHROMIUM
This CL adds a GPU command for copying sub regions of compressed textures.
The implementation is based on glCopySubTextureCHROMIUM.

BUG=434699

Review URL: https://codereview.chromium.org/1272153004

Cr-Commit-Position: refs/heads/master@{#344220}
fs
Random clean up of SVGResourcesCache
 * Fix up some comments.

 * Rename resourcesCacheFromLayoutObject to resourcesCache; let it take
   a Document& instead (to reflect the wider "scope" it has), and make it
   return a SVGResourceCache& since the cache will always be present if
   SVGDocumentExtensions are.

 * Drop redundant qualification.

BUG=521334

Review URL: https://codereview.chromium.org/1288903003

git-svn-id: svn://svn.chromium.org/blink/trunk@200826 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Handle LocalFrame being nestedly detached by subframe.
As part of detaching a LocalFrame, its subframes are also detached. Should the
detachment of those subframes trigger a nested detach of the LocalFrame that
initiated their detachment, the LocalFrame being returned to after having
detached the subframes could well be in a detached state. The detach steps that
followed (FrameLoader operations) weren't prepared for being in a detached state
(following r199143) and failed.

And the FrameLoader shouldn't have to gracefully handle being used in a detached
state, so add an is-detached check to the LocalFrame's detach steps before continuing.
Leaving early if so.

R=dcheng,japhet
BUG=520014

Review URL: https://codereview.chromium.org/1290053003

git-svn-id: svn://svn.chromium.org/blink/trunk@200820 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Prepare for multiple !important author ranges.
This CL is split out from [1] where we support multiple author origins in
terms of shadow dom scopes. The vector of MatchedProperties contains
matched declarations from all origins in the order in which they should
be applied. For !important declarations, they are applied in the same
order within the same origin, but the order of the origins are different
as the cascading order is:

  - UA important
  - Author important
  - Author
  - UA

We used to have two ranges, one for UA and one for author to accomplish
this. However, with the normal/!important cascading order for
declarations from different shadow doms, we need multiple author ranges:

  - UA important
  - Author important scope n
  ...
  - Author important scope 1
  - Author scope 1
  ...
  - Author scope n
  - UA

We introduce an ImportantAuthorRangeIterator to iterate through the
author ranges and add iterator-style iteration for each range through the
MatchedPropertiesRange class.

As the applyMatchedProperties code is hot, I've run the blink_perf.css
tests locally. Some improved by 2-4%, some became worse by similar
percentages.

[1] https://codereview.chromium.org/1224673002/

BUG=487125
TEST=fast/css

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200697

Review URL: https://codereview.chromium.org/1282243002

git-svn-id: svn://svn.chromium.org/blink/trunk@200818 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
gn build: check use_udev before depending on udev
Review URL: https://codereview.chromium.org/1295303006

Cr-Commit-Position: refs/heads/master@{#344047}
mostynb
use_udev is more accurate than is_linux for udev gn deps
TBR=keybuk

Review URL: https://codereview.chromium.org/1295353002

Cr-Commit-Position: refs/heads/master@{#344046}
sigbjornf
Oilpan: fix build after r200730.
TBR=oilpan-reviews
BUG=382542
NOTRY=true

Review URL: https://codereview.chromium.org/1290593004

git-svn-id: svn://svn.chromium.org/blink/trunk@200733 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Use background positioning origin for repeating backgrounds
When support for 4-value syntax for background-position was added,
only the non-repeating case was actually tested and render support for
the non-top-left anchor points were missing.

This patch adds render support and a simple test for the three anchor
positions that wasn't supported before for repeated/tiled
backgrounds.

BUG=488707,521481

Review URL: https://codereview.chromium.org/1287293002

git-svn-id: svn://svn.chromium.org/blink/trunk@200718 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mmaliszkiewicz
Allow enable_hangout_services_extension overriding in gn build
BUG=

Review URL: https://codereview.chromium.org/1299543005

Cr-Commit-Position: refs/heads/master@{#343871}
davve
Mark BackgroundImageGeometry as stack allocated
BUG=521481

Review URL: https://codereview.chromium.org/1297913003

git-svn-id: svn://svn.chromium.org/blink/trunk@200715 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Prepare for multiple !important author ranges.
This CL is split out from [1] where we support multiple author origins in
terms of shadow dom scopes. The vector of MatchedProperties contains
matched declarations from all origins in the order in which they should
be applied. For !important declarations, they are applied in the same
order within the same origin, but the order of the origins are different
as the cascading order is:

  - UA important
  - Author important
  - Author
  - UA

We used to have two ranges, one for UA and one for author to accomplish
this. However, with the normal/!important cascading order for
declarations from different shadow doms, we need multiple author ranges:

  - UA important
  - Author important scope n
  ...
  - Author important scope 1
  - Author scope 1
  ...
  - Author scope n
  - UA

We introduce an ImportantAuthorRangeIterator to iterate through the
author ranges and add iterator-style iteration for each range through the
MatchedPropertiesRange class.

As the applyMatchedProperties code is hot, I've run the blink_perf.css
tests locally. Some improved by 2-4%, some became worse by similar
percentages.

[1] https://codereview.chromium.org/1224673002/

BUG=487125
TEST=fast/css

Review URL: https://codereview.chromium.org/1282243002

git-svn-id: svn://svn.chromium.org/blink/trunk@200697 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
valueForLength() cannot do anything with min-intrinsic.
Length::intrinsic() doesn't return true for min-intrinsic. isLegacyIntrinsic()
does. But use isIntrinsicOrAuto() to catch both intrinsic, legacy-intrinsic and
auto values, since that seems to be a rather popular way of doing things.
Nobody seems to call isLegacyIntrinsic() directly. Regarding auto values here,
it doesn't really matter whether we call valueForLength() or not, since they'll
resolve to 0 anyway.

BUG=521526
R=leviw@chromium.org,robhogan@gmail.com

Review URL: https://codereview.chromium.org/1292163005

git-svn-id: svn://svn.chromium.org/blink/trunk@200695 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Remove unused parameter to BackgroundImageGeometry::setHasNonLocalGeometry()
BUG=521481

Review URL: https://codereview.chromium.org/1298653003

git-svn-id: svn://svn.chromium.org/blink/trunk@200642 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Initial support for nested multicol layout.
Nested column balancing doesn't work yet. Also no support for mapping visual
points to flow thread points (which is used by a few operations, but not by the
most common ones, like painting and hit-testing).

There are other corner-cases to sort out, too.

Still no support for printing multicol documents, but that's the ultimate goal
of this work.

BUG=447718
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1292163002

git-svn-id: svn://svn.chromium.org/blink/trunk@200639 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Move some members of the Selection interface out of the non-standard section
BUG=391673
R=yoichio@chromium.org

Review URL: https://codereview.chromium.org/1283233003

git-svn-id: svn://svn.chromium.org/blink/trunk@200638 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Make LayoutBoxModelObject const when passed to calculateBackgroundImageGeometry
BUG=521481

Review URL: https://codereview.chromium.org/1298553004

git-svn-id: svn://svn.chromium.org/blink/trunk@200637 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Conditionally bail out earlier in Heap::reportMemoryUsageForTracing()
R=haraken
BUG=474470

Review URL: https://codereview.chromium.org/1301463002

git-svn-id: svn://svn.chromium.org/blink/trunk@200608 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Add missing getTraceCategoryEnabledFlag() override.
For the Platform object used by ResourceTest, add required
override of getTraceCategoryEnabledFlag(). Needed following
the addition GC tracing in Blink r200146.

R=haraken
BUG=521230

Review URL: https://codereview.chromium.org/1292983003

git-svn-id: svn://svn.chromium.org/blink/trunk@200606 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Remove unnecessary declaration
All test elements already have the equivalent 'background-repeat:
no-repeat' declaration.

BUG=488707

Review URL: https://codereview.chromium.org/1290913003

git-svn-id: svn://svn.chromium.org/blink/trunk@200542 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't require a valid reference scope for a <use> shadow tree update
When determining if a URL-string was pointing to an internal or external
resource, the null-string was considered external because it does not
start w/ '#' and Document::completeURL will explicitly return a null KURL
in that case. The latter means that the comparison against the document
URL will fail - i.e. the "URL" will be considered to be external.
Due to this, no attempt to rebuild the shadow-tree will be made, leaving
it in an inconsistent state.
Fix by dropping the check for a valid referenceScope in
scheduleShadowTreeRecreation
(in favor of the check in buildPendingResource).
This also fixes the case where a local reference is replaced by an
invalid remote reference (like one lacking a fragment identifier). This
would previously fail to update because it too had a null "reference"
scope.
Also convert callers of SVGURIReference::isExternalURIReference to call
isStructurallyExternal instead. This lends a bit of consistency to the
definition of "local" used in SVGUseElement. It also means that the null
'href' case is considered to be a local reference (which has no practical
consequence, but makes the handling of null be similar to the handling of
the empty string - with the exception of base URL handling.)

BUG=516051

Review URL: https://codereview.chromium.org/1287243003

git-svn-id: svn://svn.chromium.org/blink/trunk@200537 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't update the active cue set in detached Documents
After (or during) detaching the document, it makes very little sense to
keep updating the timeline and the set of active cues. Instead just punt
and ignore. Most importantly, this avoids trying to dispatch events to
Nodes (HTMLTrackElements precisely) during the disposal of the Document.
Remove the similar check in CueTimeline::endIgnoringUpdateRequests,
that was originally added for WK bug 105606 [1] which fixed a similar
issue, since the check in updateActiveCues should cover the relevant
part of that too.

[1] https://bugs.webkit.org/show_bug.cgi?id=105606

BUG=516298

Review URL: https://codereview.chromium.org/1282903003

git-svn-id: svn://svn.chromium.org/blink/trunk@200507 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Better handle reentrancy into DocumentLoader::dataReceived(). (patchset #10 id:180001 of https://codereview.chromium.org/1263363005/ )
Reason for revert:
ASan bots are reporting a handful of UAFs,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/builds/19837

Original issue's description:
> Better handle reentrancy into DocumentLoader::dataReceived().
> 
> dataReceived() can be called reentrantly if it triggers a nested message
> loop when detaching a Document or parsing script for the new Document.
> Since dataReceived() isn't safe for reentrancy, any nested invocations
> queue the received data to be processed by the top-level invocation of
> dataReceived().
> 
> BUG=515876
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200436

TBR=japhet@chromium.org,kouhei@chromium.org,morrita@chromium.org,dcheng@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=515876

Review URL: https://codereview.chromium.org/1295553002

git-svn-id: svn://svn.chromium.org/blink/trunk@200487 bbb929c8-8fbe-4397-9dbb-9b2b20218538
haavardm
Add a info flag set when certs fails to conform to the CT policy.
This is useful for clients that only wants to show CT
info if the certificate is not CT compliant.

BUG=None

Review URL: https://codereview.chromium.org/1287023003

Cr-Commit-Position: refs/heads/master@{#343170}
mstensho
Clean up PageBoundaryRule enum.
Replace the {Include,Exclude}PageBoundary values with
AssociateWith{Former,Latter}Page, since it was rather confusing what was meant
by "include" or "exclude" in most situations. Also remove default
PageBoundaryRule values from method declarations taking this enum as a
parameter, since there's really no natural default value, and each caller
should be aware of what it's asking for.

Realizing what's actually going on here allowed for some cleanup in
nextPageLogicalTop().

Also made the enum public, since there are public methods taking it as a
parameter.

No behavioral changes intended.

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1287113002

git-svn-id: svn://svn.chromium.org/blink/trunk@200438 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Remove effective zoom from font metrics before length calculations
Since https://codereview.chromium.org/308123010 and
https://codereview.chromium.org/323053002, the effectiveZoom is
included in the style's font. This patch adds missing code to
SVGLengthContext to remove the effective zoom before computing ex
(x-height) and ch (zero-width) units.

BUG=519133

Review URL: https://codereview.chromium.org/1283463003

git-svn-id: svn://svn.chromium.org/blink/trunk@200393 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Fix a few typos in the IPC message macros documentation
BUG=none
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1284593004

Cr-Commit-Position: refs/heads/master@{#342990}
mstensho
Move code for locating the containing flow thread out of LayoutObject.
BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1286693003

git-svn-id: svn://svn.chromium.org/blink/trunk@200345 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Auto-height table cells must stop percentage resolution of child heights.
This also needs to apply when a table cell is anonymous. The spec only mentions
*blocks* when it comes to skipping anonymous objects for resolving percentages
[1]. No mention of table cells anywhere.

[1] http://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#anonymous-block-level

BUG=518210
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1289463002

git-svn-id: svn://svn.chromium.org/blink/trunk@200337 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Add toLayoutMultiColumnFlowThread().
BUG=447718
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1282923004

git-svn-id: svn://svn.chromium.org/blink/trunk@200336 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Handle Performance object creation on loader-less Documents.
Speculatively fix reported null crasher in Performance ctor,
checking if Document has a DocumentLoader before accessing.
Should this object be created while its frame is being detached
(see bug stack trace), this can potentially happen.

R=haraken,ksakamoto
BUG=518775

Review URL: https://codereview.chromium.org/1287513003

git-svn-id: svn://svn.chromium.org/blink/trunk@200307 bbb929c8-8fbe-4397-9dbb-9b2b20218538
alexanderk
Convert octane test score to float first
to prevent fails on slow devices

BUG=508907
CQ_EXTRA_TRYBOTS=tryserver.chromium.perf:linux_perf_bisect;tryserver.chromium.perf:mac_perf_bisect;tryserver.chromium.perf:win_perf_bisect

Review URL: https://codereview.chromium.org/1230063007

Cr-Commit-Position: refs/heads/master@{#342772}
mstensho
Prepare height calculation methods in LayoutFlowThread for nested multicol.
Rename pageLogicalHeight() in LayoutMultiColumnSet to
pageLogicalHeightForOffset(), so that it matches the naming of
pageRemainingLogicalHeightForOffset().

Move the innards to LayoutMultiColumnSet. And some 0 -> LayoutUnit() cleanup.

Had to adjust some call sites because of this and introduce
isPageLogicalHeightKnown().

No behavioral changes intended for now.

R=jchaffraix@chromium.org,leviw@chromium.org
BUG=447718

Review URL: https://codereview.chromium.org/1282353002

git-svn-id: svn://svn.chromium.org/blink/trunk@200272 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
A line that doesn't fit in a column shouldn't pull preceding floats to the next column.
Require that a line box be flush with the content edge of the block if it is to
pull its parent block to the next column.

Also cleaned up the surrounding code and documented it. It had a rather complex
if-expression not really suitable for human consumption as it was, and adding
even more to it would have been just evil. No other behavioral changes
intended, apart from the actual bugfix.

BUG=516296
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1277613004

git-svn-id: svn://svn.chromium.org/blink/trunk@200269 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Make LayoutFlowThread::fragmentsBoundingBox() faster.
It used to let collectLayerFragments() handle the job, with an infinite dirty
rectangle. This forced us to collect all columns, when we really only needed to
know the bounding boxes of the first and the last columns in each fragmentainer
group.

This gives a major speed-up in the Layout/multicol/tall-content-short-columns-*
tests. It will also make it possible to submit a fix for bug 502407 and write a
test for it that doesn't time out.

R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1265933002

git-svn-id: svn://svn.chromium.org/blink/trunk@200264 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
GC plugin: consider references equal to raw pointers.
Unmanaged raw pointers to managed(GC) classes aren't safe across GCs,
hence fields with raw pointer types to such GCed classes are identified
and reported as errors or warnings.

Extend that checking to also apply to reference pointer types.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1274403002

Cr-Commit-Position: refs/heads/master@{#342615}
sigbjornf
Oilpan: tidy up some inter-stack object references.
Add uses of STACK_ALLOCATED() so as to allow these objects to safely
keep references to other stack allocated objects.

For other heap allocated objects that keep references to GCed objects,
convert these into appropriate Member<> refs.

R=haraken, philipj@opera.com
BUG=509911

Review URL: https://codereview.chromium.org/1278103002

git-svn-id: svn://svn.chromium.org/blink/trunk@200242 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Elements whose contents start with an astral Unicode symbol disappear when CSS `::first-letter` is … (patchset #9 id:160001 of https://codereview.chromium.org/1133853006/ )
Reason for revert:
ASan picking up a number of UAF failures due to this one,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/builds/19782

Original issue's description:
> Elements whose contents start with an astral Unicode symbol disappear when CSS `::first-letter` is applied to them.
> 
> This CL is inspired by http://trac.webkit.org/changeset/172513
> written by Myles C. Maxfield.
> The previous code assumed that all "characters" are exactly 1 16-bit code unit wide.
> Instead, use numCharactersInGraphemeClusters().
> 
> For blink, we add countCharactersAndGraphemesInCluster to bring a similar
> functionality to blink. This api is based on countGraphemesInCluster and improved
> to figure out the number of characters and grapheme at the same time in the given clusters.
> 
> BUG=401945
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200227

TBR=leviw@chromium.org,eae@chromium.org,esprehn@chromium.org,drott@chromium.org,shivamidow@gmail.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=401945

Review URL: https://codereview.chromium.org/1277803004

git-svn-id: svn://svn.chromium.org/blink/trunk@200228 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Upon load failure, remove sync script from execution queue. (patchset #4 id:60001 of https://codereview.chromium.org/1263743002/ )
Reason for revert:
Crashes due to a release assert added here are being reported in https://code.google.com/p/chromium/issues/detail?id=517970 . Better revert this until that can be looked into more closely.

Original issue's description:
> Upon load failure, remove sync script from execution queue.
> 
> If a script element is to be loaded synchronously and executed in order,
> it's queued for execution before loading. Should that load fail, the
> immediate execution of the script,
> 
>   https://html.spec.whatwg.org/#execute-the-script-block
> 
> should only result in an error event being dispatched.
> 
> Implementation-wise, along with signalling error, the failed script must also
> be removed from the internal in-order execution queue. We're done with
> (not) executing the script and failure to remove it will cause subsequent
> processing of the script execution queue to see the script as having failed
> to load and re-dispatch an error event.
> 
> [This is a reland of r199656, which wrongly updated&removed scripts from the
> in-order queue.]
> 
> R=haraken
> BUG=503077
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200045

TBR=haraken@chromium.org,tkent@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=503077

Review URL: https://codereview.chromium.org/1277273002

git-svn-id: svn://svn.chromium.org/blink/trunk@200186 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: catch some self-referential leaks (main thread.)
Track the number of SelfKeepAlive<>s that are currently active on
the main thread, so as to be able to detect if any remains on
shutdown. A clear indication of a leak, if so.

Also add some debugging support for detecting thread shutdown
leaks due to Persistent<>s not being released; see
PersistentRegion::dumpLivePersistents() and ThreadState::cleanup().

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1275863002

git-svn-id: svn://svn.chromium.org/blink/trunk@200174 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: turn EventHandlerRegistry::m_frameHost into a traced reference.
R=haraken
BUG=509911

Review URL: https://codereview.chromium.org/1280043002

git-svn-id: svn://svn.chromium.org/blink/trunk@200171 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: convert DOMWindowIndexedDatabase::m_window to a Member<>.
R=haraken
BUG=509911

Review URL: https://codereview.chromium.org/1277653006

git-svn-id: svn://svn.chromium.org/blink/trunk@200170 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: mark StylePropertySet::PropertyReference as stack allocated.
Annotate this object as stack allocated + turn its StylePropertySet
reference into a Member.

R=haraken
BUG=509911

Review URL: https://codereview.chromium.org/1276243002

git-svn-id: svn://svn.chromium.org/blink/trunk@200169 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
mention MPL tri-licensed code in our copy of zlib
Review URL: https://codereview.chromium.org/1279843003

Cr-Commit-Position: refs/heads/master@{#342346}
mostynb
mention MPL tri-licensed code in our copy of libpng
Review URL: https://codereview.chromium.org/1274513004

Cr-Commit-Position: refs/heads/master@{#342345}
sigbjornf
Oilpan: have ResourceFetcher use a prefinalizer.
The changes in r200133 unsafely allows access to other heap objects during
the finalization of ResourceFetcher. Perform the clearing of preload
resources using a prefinalizing action instead.

R=haraken
BUG=509911

Review URL: https://codereview.chromium.org/1270343003

git-svn-id: svn://svn.chromium.org/blink/trunk@200165 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: tidy StylePropertySerializer's handling of GCed objects.
Add the required annotations + correctly represent and trace embedded
StylePropertySet references.

R=haraken
BUG=509911

Review URL: https://codereview.chromium.org/1278143002

git-svn-id: svn://svn.chromium.org/blink/trunk@200164 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: catch some self-referential leaks (main thread.)
Track the number of SelfKeepAlive<>s that are currently active on
the main thread, so as to be able to detect if any remains on
shutdown. A clear indication of a leak, if so.

Also add some debugging support for detecting thread shutdown
leaks due to Persistent<>s not being released; see
PersistentRegion::dumpLivePersistents() and ThreadState::cleanup().

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1275863002

git-svn-id: svn://svn.chromium.org/blink/trunk@200163 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix WebRemoteFrame leak in DetachRemoteFrame unit test.
TBR=haraken
BUG=none

Review URL: https://codereview.chromium.org/1282443002

git-svn-id: svn://svn.chromium.org/blink/trunk@200160 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
GC plugin: consider references equal to raw pointers.
Unmanaged raw pointers to managed(GC) classes aren't safe across GCs,
hence fields with raw pointer types to such GCed classes are identified
and reported as errors or warnings.

Extend that checking to also apply to reference pointer types.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1274403002

Cr-Commit-Position: refs/heads/master@{#342320}
sigbjornf
Oilpan: handle MediaControls like the GCed object it is.
R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1274273003

git-svn-id: svn://svn.chromium.org/blink/trunk@200148 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix WebRemoteFrame leak in WebFrameSwapTest.SwapParentShouldDetachChildren
R=haraken
BUG=none

Review URL: https://codereview.chromium.org/1274283002

git-svn-id: svn://svn.chromium.org/blink/trunk@200144 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
convince gcc that cpu_used et al are always initialized
Without this, gcc thinks that min_quantizer, max_quantizer and cpu_used
are used uninitialized and emits a warning which is promoted to an error.

BUG=455409
TBR=bbudge

Review URL: https://codereview.chromium.org/1276633004

Cr-Commit-Position: refs/heads/master@{#342214}
mostynb
mention NPL/MPL source files in our libjpeg licences
Review URL: https://codereview.chromium.org/1272633005

Cr-Commit-Position: refs/heads/master@{#342151}
sigbjornf
Oilpan: fix build after r200105.
TBR=oilpan-reviews
BUG=514755
NOTRY=true

Review URL: https://codereview.chromium.org/1277483005

git-svn-id: svn://svn.chromium.org/blink/trunk@200107 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Deflake http/tests/misc/script-sync-slow-scripts-onerror.html
R=
BUG=503077

Review URL: https://codereview.chromium.org/1279743003

git-svn-id: svn://svn.chromium.org/blink/trunk@200106 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix WebLocalFrame leaks in unit tests.
Not calling close() on locally created WebLocalFrames will keep
the objects alive on shutdown. Add the required calls to
WebViewTest.ClientTapHandlingNullWebViewClient and
ParameterizedWebFrameTest.CreateLocalChildWithPreviousSibling.

R=haraken
BUG=none

Review URL: https://codereview.chromium.org/1273023002

git-svn-id: svn://svn.chromium.org/blink/trunk@200103 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have WebRemoteFrameImpl use SelfKeepAlive<>.
Canonicalize WebRemoteFrameImpl's self-referential persistent as
a SelfKeepAlive<>.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1276513002

git-svn-id: svn://svn.chromium.org/blink/trunk@200048 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
CrossThreadPersistent invalidation: add missing orphaned check.
The main thread may well be detached before other Oilpan-attached threads.
Its orphaned heap pages must consequently be checked for when doing later
invalidation of thread-local CrossThreadPersistent<>s.

R=haraken
BUG=517031

Review URL: https://codereview.chromium.org/1271243003

git-svn-id: svn://svn.chromium.org/blink/trunk@200046 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Upon load failure, remove sync script from execution queue.
If a script element is to be loaded synchronously and executed in order,
it's queued for execution before loading. Should that load fail, the
immediate execution of the script,

  https://html.spec.whatwg.org/#execute-the-script-block

should only result in an error event being dispatched.

Implementation-wise, along with signalling error, the failed script must also
be removed from the internal in-order execution queue. We're done with
(not) executing the script and failure to remove it will cause subsequent
processing of the script execution queue to see the script as having failed
to load and re-dispatch an error event.

[This is a reland of r199656, which wrongly updated&removed scripts from the
in-order queue.]

R=haraken
BUG=503077

Review URL: https://codereview.chromium.org/1263743002

git-svn-id: svn://svn.chromium.org/blink/trunk@200045 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have CSSImageGeneratorValue use SelfKeepAlive<>.
Canonicalize CSSImageGeneratorValue's self-referential persistent as
a SelfKeepAlive<>.

R=haraken
BUG=366546

Review URL: https://codereview.chromium.org/1261253004

git-svn-id: svn://svn.chromium.org/blink/trunk@200044 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have WebLocalFrameImpl use SelfKeepAlive<>.
Canonicalize WebLocalFrameImpl's self-referential persistent as
a SelfKeepAlive<>.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1268103003

git-svn-id: svn://svn.chromium.org/blink/trunk@200038 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Switch SuspendableScriptExecutor over to using SelfKeepAlive<>.
Have this Oilpan-hosted object keep itself alive using SelfKeepAlive<>,
moving it onto the Oilpan heap by default in the process.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1258653003

git-svn-id: svn://svn.chromium.org/blink/trunk@200036 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Disallow relayout roots inside multicol.
It's just too complicated to figure out if it's safe to let a descendant of a
multicol container be a relayout root, so disallow it.

BUG=515260
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1271513004

git-svn-id: svn://svn.chromium.org/blink/trunk@200034 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: lazily create SelfKeepAlive<>'s persistent reference.
To reduce overhead of having to register a Persistent<> that may
only have a non-null reference for a shorter interval, instantiate
the Persistent<> on assignment. And clear it out completely when
the SelfKeepAlive<> is cleared.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1263313003

git-svn-id: svn://svn.chromium.org/blink/trunk@200028 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Gracefully handle XMLDocumentParser being detached by mutation events.
Should a mutation event handler run while flushing out parser-buffered text,
we could end up in a detached state, something the implementation wasn't
prepared for.

Firm up exitText() usage, and rename it as updateLeafTextNode(). Also attempt
to make enterText() more descriptive as createLeafTextNodeIfNeeded().

R=haraken,tkent,kouhei
BUG=516290

Review URL: https://codereview.chromium.org/1267283002

git-svn-id: svn://svn.chromium.org/blink/trunk@200026 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Drop [TreatNullAs=NullString] for Document.designMode
Because Document::setDesignMode ignores everything except "yes" and "no"
this change is not observable.

BUG=460722

Review URL: https://codereview.chromium.org/1263043005

git-svn-id: svn://svn.chromium.org/blink/trunk@199988 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove unnecessary ENABLE(OILPAN) usage.
R=yutak
BUG=513729

Review URL: https://codereview.chromium.org/1268853009

git-svn-id: svn://svn.chromium.org/blink/trunk@199962 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Have ScriptPromiseResolver on the Oilpan heap always.
R=yhirano,haraken,jochen
BUG=340522

Review URL: https://codereview.chromium.org/1233173002

git-svn-id: svn://svn.chromium.org/blink/trunk@199953 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Include overflow when setting the logical flowthread bottom on the last column set.
The logical height of the flow thread may be shorter than the start flowthread
offset of the last column set, if there's overflowing content. We used to have
expandToEncompassFlowThreadOverflow() to correct this, but let's include
overflow right away, instead of setting the bottom offset twice (first
incorrectly, then correctly).

This avoids an assertion failure (in this case the assertion was harmless,
though).

BUG=512362
R=dsinclair@chromium.org,jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1266553002

git-svn-id: svn://svn.chromium.org/blink/trunk@199952 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Need to check for positional rules on parent with style change.
A local style change on the parent inhibited checks for positional rule
changes on children with an early return. Removed that early return.

R=dstockwell@chromium.org
BUG=510732

Review URL: https://codereview.chromium.org/1264573004

git-svn-id: svn://svn.chromium.org/blink/trunk@199950 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove HasInlinedTraceMethod<T>.
Follow up r193615's retirement of ENABLE(INLINE_TRACE) and remove the
now-unused HasInlinedTraceMethod<T> template.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1270043002

git-svn-id: svn://svn.chromium.org/blink/trunk@199942 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Invalidate cross-thread persistents on heap termination.
When a thread is detached from Oilpan and its ThreadState is
finalized, arrange for any CrossThreadPersistent<>s pointing
into one of its heaps to be cleared out. Not doing so risks
dangling pointers to be followed upon GC or by anyone else
still keeping these CrossThreadPersistent<>s alive.

The only operation that other threads are allowed over
CrossThreadPersistent<> (CTP) once the ThreadState has been
destructed, is to destruct the CTP.

R=haraken
BUG=515432

Review URL: https://codereview.chromium.org/1265103003

git-svn-id: svn://svn.chromium.org/blink/trunk@199891 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Reliably cancel in-progress CryptoResult(Impl) upon shutdown.
Move CryptoResult to the Oilpan heap and in order to support such
Oilpan-hosted CryptoResults mainly, also separate out the signalling
of crypto operation cancellation.

CryptoResults are wrapped up (WebCryptoResult) and passed to the
embedder's webcrypto layer upon initiating a crypto operation.
Should the Blink thread that initiated that operation be shut
down (before that crypto operation completes, possibly), it will
go through its shutdown steps, including notifying CryptoResults
that it is stopping. At which point the implementation has to
effectively cancel the ongoing crypto operation.

The Oilpan heaps belonging to the thread shutting down cannot be
reliably used to communicate cancellation status, as they're about
to be detached and destructed also. Hence, we keep a separate
off-heap cancellation object that can live beyond the Blink thread
that initiated it. And can be used by the webcrypto layer to 
safely query for cancellation status after the Blink thread has
been shut down entirely.

As webcrypto operations are handled on separate threads, the
cancellation object references can be safely accessed from any
thread, including handling their eventual destruction. The same goes
for the Oilpan-hosted CryptoResult -- external references (by way
of WebPrivatePtr<>) can be held and destructed from any thread.

R=haraken,eroman,tkent
BUG=440450

Review URL: https://codereview.chromium.org/1228373006

git-svn-id: svn://svn.chromium.org/blink/trunk@199878 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Tidy up ActiveDOMObject destructor.
R=haraken
BUG=462949

Review URL: https://codereview.chromium.org/1266443003

git-svn-id: svn://svn.chromium.org/blink/trunk@199845 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Upon load failure, remove sync script from execution queue. (patchset #3 id:40001 of https://codereview.chromium.org/1263743002/)
Reason for revert:
Speculatively reverting to see if it addresses the recent crashes being reported via http://crbug.com/515419

Original issue's description:
> Upon load failure, remove sync script from execution queue.
> 
> If a script element is to be loaded synchronously and executed in order,
> it's queued for execution before loading. Should that load fail, the
> immediate execution of the script,
> 
>   https://html.spec.whatwg.org/#execute-the-script-block
> 
> should only result in an error event being dispatched.
> 
> Implementation-wise, along with signalling error, the failed script must also
> be removed from the internal in-order execution queue. We're done with
> (not) executing the script and failure to remove it will cause subsequent
> processing of the script execution queue to see the script as having failed
> to load and re-dispatch an error event.
> 
> R=haraken
> BUG=503077
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=199656

TBR=haraken@chromium.org,tkent@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=503077

Review URL: https://codereview.chromium.org/1271443002

git-svn-id: svn://svn.chromium.org/blink/trunk@199788 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
fix typo in DelegatedFrameHost::SwapDelegatedFrame arg name
BUG=503594
TBR=wjmaclean

Review URL: https://codereview.chromium.org/1263923003

Cr-Commit-Position: refs/heads/master@{#341204}
sigbjornf
Remove unused CallbackStack::swap() method.
R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1262993002

git-svn-id: svn://svn.chromium.org/blink/trunk@199739 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Unify code paths for fixed and absolutely positioned objects in accumulateOffsetTowardsAncestor().
Deleted most of the code specific to handling of fixed-positioned objects, and
have fixed-positioned objects use the code for absolutely positioned objects
instead. One piece needs to be kept, though: If the container of a fixed
positioned object is the viewport, we need to make sure that we call
LayoutObject::localToAbsolute() to calculate the correct position, since
DeprecatedPaintLayer::location() doesn't handle fixed-positioning properly.

This gets rid of an assertion failure that would trigger when we had a multicol
with a transform with a fixedpos.

BUG=496929
R=chrishtr@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1268493002

git-svn-id: svn://svn.chromium.org/blink/trunk@199725 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Eagerly finalize V8AbstractEventListeners.
The listener's wrapper needs to be promptly cleared so as to prevent
untidy accesses to a poisoned heap by v8's GC if the listener is instead
lazily swept & finalized.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1263953002

git-svn-id: svn://svn.chromium.org/blink/trunk@199721 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
collectLayerFragments() expects a dirty rect relative to the multicol container.
It was actually relative to the flow thread (see call site at
DeprecatedPaintLayer::collectFragments()), but it's documented as "relative to
the multicol container" in MultiColumnFragmentainerGroup::collectLayerFragments().
So make it relative to the multicol container, then.

There was no layout test to catch this fundamental RTL issue, so I added one.

BUG=511655
R=dsinclair@chromium.org,jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1259943002

git-svn-id: svn://svn.chromium.org/blink/trunk@199697 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Get rid of subtract-one-whole-pixel hack.
Rectangles in Blink are endpoint-exclusive. There's a hack in the multicol code
to work around this (when mapping from block positions to column indices), but
it's not corner-case-proof. It both causes rendering errors and a recently
added assertion to fail. Fixed this.

R=dsinclair@chromium.org,jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1258883003

git-svn-id: svn://svn.chromium.org/blink/trunk@199683 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Refactor BeforeInstallPromptEvent to use ScriptPromiseProperty (patchset #11 id:250001 of https://codereview.chromium.org/1247283004/)
Reason for revert:
Causes app_banner/app-banner-event-prompt.html failure,

  http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=app_banner%2Fapp-banner-event-prompt.html

Original issue's description:
> Refactor BeforeInstallPromptEvent to use ScriptPromiseProperty
> 
> This stops the event holding a ScriptPromise as a member, which may 
> lead to a memory leak. Instead, ScriptPromiseProperty members are held
> as members in the event. A WebCallbacks subclass is used to store a
> pointer to the necessary ScriptPromiseProperty in the associated event,
> with the interface exposed to Chromium. When a banner event is resolved,
> the WebCallbacks implementation in modules/app_banner looks up the 
> ScriptPromiseProperty and resolves its promise. This also makes
> resolving the prompt promise simpler as well, as it occurs entirely in the
> event.
> 
> This CL also removes the app-banner-event-prompt.html test from 
> LeakExpectations, and fixes some bugs in the test relating to promise
> resolution.
> 
> BUG=504675
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=199472

TBR=mlamouri@chromium.org,yhirano@chromium.org,dominickn@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=504675

Review URL: https://codereview.chromium.org/1257823003

git-svn-id: svn://svn.chromium.org/blink/trunk@199666 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Perform initial GC to improve inspector/search test stability.
With Oilpan, inspector tests enumerating resources are susceptible to
"GC lag", including resources that have yet to be GCed and swept out.

To ensure a stable baseline for the tests, perform an initial,
flushing GC.

R=haraken
BUG=513393

Review URL: https://codereview.chromium.org/1254293008

git-svn-id: svn://svn.chromium.org/blink/trunk@199665 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Upon load failure, remove sync script from execution queue.
If a script element is to be loaded synchronously and executed in order,
it's queued for execution before loading. Should that load fail, the
immediate execution of the script,

  https://html.spec.whatwg.org/#execute-the-script-block

should only result in an error event being dispatched.

Implementation-wise, along with signalling error, the failed script must also
be removed from the internal in-order execution queue. We're done with
(not) executing the script and failure to remove it will cause subsequent
processing of the script execution queue to see the script as having failed
to load and re-dispatch an error event.

R=haraken
BUG=503077

Review URL: https://codereview.chromium.org/1263743002

git-svn-id: svn://svn.chromium.org/blink/trunk@199656 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
export the entire HTMLResourcePreloader class in shared_library builds
After https://codereview.chromium.org/1112833004/ landed, libblink_web.so
fails to link in some configurations, giving this error:

obj/third_party/WebKit/Source/core/html/parser/blink_web.HTMLResourcePreloaderTest.o:HTMLResourcePreloaderTest.cpp:function blink::HTMLResourcePreloaderTest::test(blink::PreconnectTestCase): error: undefined reference to 'vtable for blink::HTMLResourcePreloader'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function

The blink::HTMLResourcePreloader vtable exists in lib/libwebcore_shared.so
but only as a local symbol, because I assume that the HTMLResourcePreloader
class has some un-exported virtual methods in these configuration.  So we
should be able to solve this by exporting the entire HTMLResourcePreloader
class.

Review URL: https://codereview.chromium.org/1266533002

git-svn-id: svn://svn.chromium.org/blink/trunk@199651 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Add assertion/crash test for flexbox with relpos with scrollable with abspos.
This test (attached to bug 498969) used to assert, but got fixed by accident by
the fix for bug 498770. Better add the test, in case it should regress.

BUG=498969
R=cbiesinger@chromium.org

Review URL: https://codereview.chromium.org/1261463005

git-svn-id: svn://svn.chromium.org/blink/trunk@199646 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Simplify MultiColumnFragmentainerGroup::collectLayerFragments().
No need to do so much stuff on our own in there, when we already have methods
that can do it for us.

This is just clean-up; no behavioral changes intended.

R=dsinclair@chromium.org,jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1252863005

git-svn-id: svn://svn.chromium.org/blink/trunk@199595 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Simplify ownership of a ThreadState's interruptors.
Have ThreadState assume ownership of interruptors registered with
addInterruptor(). That simplifies the handling on the caller side,
allowing them to register-and-forget rather than each having to
manually unregister & destruct their interruptor before shutting down.
(Not that this last step wasn't needed previously either, as ThreadState
would have destructed the interruptors upon its destruction.)

(ThreadState::removeInterruptor() is retained should it prove useful, but
currently unused.)

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1257723002

git-svn-id: svn://svn.chromium.org/blink/trunk@199487 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
use_x11==1 is a better condition for xdisplaycheck dep
The previous condition was incorrect when building for
embedded linux without using the ozone porting layer.
use_x11==1 is used everywhere else for the xdisplaycheck
depdendency, let's do the same here.

Review URL: https://codereview.chromium.org/1256793002

Cr-Commit-Position: refs/heads/master@{#340376}
mostynb
stray c++11 ud suffix fixes for tcmalloc files
Followup to https://codereview.chromium.org/21157004 - here are a few
more warnings that we can silence.

BUG=263960

Review URL: https://codereview.chromium.org/1253873003

Cr-Commit-Position: refs/heads/master@{#340357}
mostynb
use_x11 is better than is_linux for xdisplaycheck dep in mandoline gn build
Review URL: https://codereview.chromium.org/1255843002

Cr-Commit-Position: refs/heads/master@{#340340}
alexanderk
Prevent URLRequestRedirectJob from doing async execution
when request is already canceled and job is killed.

BUG=508900,503306

Review URL: https://codereview.chromium.org/1232113002

Cr-Commit-Position: refs/heads/master@{#340298}
bratell
Revert of Precompile more in Blink in Windows for faster compilations (patchset #1 id:1 of https://codereview.chromium.org/1227953008/)
Reason for revert:
A chromium build bot broke with bad headers again. (see bug)

The pch file does not seem to be recompiled when it should be.

BUG=511945


Original issue's description:
> Precompile more in Blink in Windows for faster compilations
>  
> One reason Blink is slow to compile is that there is a lot of code
> included in every compilation unit since everything depends on either
> LayoutObject.h or Document.h and those in turn include huge portions
> of the rest of Blink.
> 
> By precompiling LayoutObject.h and Document.h the compilation of core and
> modules in Blink can be 4 times faster (4 minutes instead of
> 19 minutes on my computer).
> 
> The downside is that it will introduce Document.h and LayoutObject.h
> also in compilation units that didn't expect it, for instance
> XPathGrammer.y that suddenly will have both blink::Path and
> blink::XPath::Path in scope (and blink::Filter / blink::XPath::Filter)
> 
> Note that distributed compilation system disables precompiled headers
> globally so this will *not* make trybots faster.
> 
> This is a new attempt at this change after bug 511945 scared us into
> reverting it. We still do not know the exact cause of 511945 but we
> are making another attempt with this.
> 
> BUG=495697
> R=thakis@chromium.org,sigbjornf@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=199168

TBR=brucedawson@chromium.org,jam@chromium.org,scottmg@chromium.org,thakis@chromium.org,sigbjornf@opera.com,tasak@google.com,haraken@chromium.org,philipj@opera.com
BUG=495697

Review URL: https://codereview.chromium.org/1259563002

git-svn-id: svn://svn.chromium.org/blink/trunk@199436 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Sync menulist-appearance-basic.html (Oilpan) expectations.
fast/forms/select/menulist-appearance-basic.html is no longer too
slow in Debug builds.

TBR=oilpan-reviews
BUG=397425
NOTRY=true

Review URL: https://codereview.chromium.org/1257673002

git-svn-id: svn://svn.chromium.org/blink/trunk@199435 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Add ExecuteJavaScriptForTest and make all tests use it (patchset #15 id:270001 of https://codereview.chromium.org/1123783002/)
Reason for revert:
Speculatively reverting to address failures,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux/builds/51422

Original issue's description:
> Add ExecuteJavaScriptForTest and make all tests use it
>
> Additionally, restrict the URLs that ExecuteJavaScript can be invoked on
> to chrome-controlled URLs.
>
> R=jam@chromium.org
> BUG=507809
>
> Committed: https://crrev.com/904f14ebdc3bdb8e893df0a3211d09de42d5619c
> Cr-Commit-Position: refs/heads/master@{#340231}

TBR=jam@chromium.org,mdjones@chromium.org,torne@chromium.org,jochen@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=507809

Review URL: https://codereview.chromium.org/1257603003

Cr-Commit-Position: refs/heads/master@{#340241}
sigbjornf
Make ContentDecryptionModuleResult cross-thread destructible.
So as to handle cross-thread uses of the corresponding
WebContentDecryptionModuleResult (WCDMResult), have WCDMResult
keep a cross-thread persistent (CrossThreadPersistent<>) by
way of its WebPrivatePtr<> reference.

CrossThreadPersistent<> can be destructed on a thread other than
the Oilpan thread creating it; the thread does not have to be
attached to Oilpan.

To control if WebPrivatePtr<> should use a cross-thread persistent
or not, it is now parameterized over an enum controlling which.
The default is to use same-thread persistents. If

  WebPrivatePtr<T, AllowCrossThreadDestruction>

is for a ref-counted T, T must derive from ThreadSafeRefCounted<T>. 

R=jrummell,xhwang,haraken,tkent
BUG=509588

Review URL: https://codereview.chromium.org/1249913002

git-svn-id: svn://svn.chromium.org/blink/trunk@199421 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: reinstate nullptr initialization following r199382.
TBR=oilpan-reviews
BUG=510918
NOTRY=true

Review URL: https://codereview.chromium.org/1249333003

git-svn-id: svn://svn.chromium.org/blink/trunk@199393 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r199375.
TBR=oilpan-reviews
BUG=350571
NOTRY=true

Review URL: https://codereview.chromium.org/1248353002

git-svn-id: svn://svn.chromium.org/blink/trunk@199378 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Make video.webkitSupportsFullscreen an alias of document.fullscreenEnabled
The removed checks both originate from the earliest revision of this
code, for ChromeClient::supportsFullscreenForNode() and
MediaPlayer::supportsFullscren() calls respectively:
http://trac.webkit.org/changeset/49136

Both were conservatively left in later cleanup:
https://codereview.chromium.org/13851023
https://codereview.chromium.org/139943006

Fullscreen requests in detached documents will instead fail silently in
Fullscreen::requestFullscreen() due to the document()->isActive() check.

As for the webMediaPlayer() check, this will change the value of
video.webkitSupportsFullscreen before a video is loaded, as seen in
LayoutTests/media/video-prefixed-fullscreen.html. However, at worst
this ought to cause custom fullscreen buttons to be shown too early,
just as they would if using one of the other fullscreen APIs without
checking that the video is ready to play.

Overall risk ought to be low given the low usage of these APIs:
https://www.chromestatus.com/metrics/feature/timeline/popularity/166
https://www.chromestatus.com/metrics/feature/timeline/popularity/168
https://www.chromestatus.com/metrics/feature/timeline/popularity/170

BUG=496637

Review URL: https://codereview.chromium.org/1240573005

git-svn-id: svn://svn.chromium.org/blink/trunk@199362 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Update documentation of Performance.timing/navigation
The specs have now been updated:
https://github.com/w3c/navigation-timing/issues/22
https://github.com/w3c/navigation-timing/issues/28
https://github.com/w3c/navigation-timing/issues/29

BUG=460722
R=ksakamoto@chromium.org

Review URL: https://codereview.chromium.org/1245343003

git-svn-id: svn://svn.chromium.org/blink/trunk@199361 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Make FileSystemDirURLRequestJobTest locale-invulnerable
The format of the date in directory listing entry depends on the current
locale. In some countries (for example Poland) DD.mm.YYYY format is used.
base::Time::FromString() internally uses PR_ParseTimeString() from NSPR
library which doesn't support this format (date with dots as separators).
Use icu::DateFormat instead which is able to parse such kind of date
format.

BUG=

Review URL: https://codereview.chromium.org/1246463002

Cr-Commit-Position: refs/heads/master@{#340050}
sigbjornf
Oilpan: fix build after r199317.
TBR=oilpan-reviews
BUG=510483
NOTRY=true

Review URL: https://codereview.chromium.org/1252523003

git-svn-id: svn://svn.chromium.org/blink/trunk@199325 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
use sh instead of bash in ProcessUtilTest on linux
These unit tests don't seem to really depend on bash, by using sh
instead of bash we can run these on more embedded linux targets.

Review URL: https://codereview.chromium.org/1249973002

Cr-Commit-Position: refs/heads/master@{#339901}
sigbjornf
Oilpan: fix build after r199293.
TBR=oilpan-reviews
BUG=509911
NOTRY=true

Review URL: https://codereview.chromium.org/1244363002

git-svn-id: svn://svn.chromium.org/blink/trunk@199306 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mharanczyk
Avoid creating PasswordsPrivateDelegate when shutting down.
BUG=485227

Review URL: https://codereview.chromium.org/1228813006

Cr-Commit-Position: refs/heads/master@{#339855}
philipj
Remove the allowfullscreen exemption for the video-specific fullscreen API (reland)
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/3NukIuOaU4c/Boab2WxzhBYJ

Prompted by a question from Ali Alabbas (Microsoft) on blink-dev:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/f-V2GWatXkA/nvdHJ3xihMkJ

Feedback from Vimeo on blink-dev asking for more time:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/3NukIuOaU4c/MPyuWoDaz8AJ

New plan for removing the allowfullscreen exemption:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/3NukIuOaU4c/LWeJeKYvf1MJ

The video.webkitSupportsFullscreen change will be made separately:
https://codereview.chromium.org/1240573005

BUG=496637

Review URL: https://codereview.chromium.org/1237133002

git-svn-id: svn://svn.chromium.org/blink/trunk@199225 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Stop calling configureTextTrackDisplay() in clearMediaPlayer()
In the test case, the call chain is:
HTMLMediaElement::didMoveToNewDocument() -> userCancelledLoad() ->
clearMediaPlayer() -> configureTextTrackDisplay() ->
updateTextTrackDisplay() -> ensureTextTrackContainer()

ensureTextTrackContainer() will create the text track container if it
did not exist, triggering the assert in the EventDispatchForbiddenScope
set up by ContainerNode::appendChild().

In the test case, the order of setting TextTrack.mode and appending
the HTMLTrackElement matters, which is at the root of the problem. If
the text track container had been created, then there wouldn't have
been any attempt to create it when moving to a new document.
Unfortunately, the logic largely matches what the spec says:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28973

Instead of fixing the assymetry, just remove the
configureTextTrackDisplay() call and depend on the
cueTimeline().updateActiveCues(0) call in userCancelledLoad() instead.
This should suffice, because from the point of view of text track
rendering, the current time is all that matters.

The VisibilityChangeAssumption enum was introduced in order to avoid
unnecessary work in configureTextTrackDisplay():
https://codereview.chromium.org/22645014

This depends on a recent change to decouple VTTCue from VTTCueBox and
LayoutVTTCue, without which the configureTextTrackDisplay() call was
needed to avoid use-after-free of those VTTCue* pointers:
https://codereview.chromium.org/1240433007

BUG=489998

Review URL: https://codereview.chromium.org/1233313008

git-svn-id: svn://svn.chromium.org/blink/trunk@199210 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't resolve extended color keywords during parsing
Previously we were keeping the "basic" named colors (color keywords)
unresolved (as identifiers), while resolving the "extended" named
colors.
This CL makes us keep the "extended" colors as well, and resolve them
during style resolving instead (of during parsing.)
Because we now no longer expect to resolve named colors in the
fast-path, we can drop that part of CSSParserFastPaths::parseColor.

The new behavior matches Gecko and IE.

BUG=505410

Review URL: https://codereview.chromium.org/1232593004

git-svn-id: svn://svn.chromium.org/blink/trunk@199209 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Use gold when compiling 32 bit binaries on an x64 machine.
gold can't normally be used on 32 bit machines because it uses too
much memory, but if the 32-bit binary that is being created is being
created on an x64 machine with sysroot, then it's possible.

BUG=511201
R=dpranke@chromium.org,thakis@chromium.org

Review URL: https://codereview.chromium.org/1234943009

Cr-Commit-Position: refs/heads/master@{#339514}
bratell
Precompile more in Blink in Windows for faster compilations
 
One reason Blink is slow to compile is that there is a lot of code
included in every compilation unit since everything depends on either
LayoutObject.h or Document.h and those in turn include huge portions
of the rest of Blink.

By precompiling LayoutObject.h and Document.h the compilation of core and
modules in Blink can be 4 times faster (4 minutes instead of
19 minutes on my computer).

The downside is that it will introduce Document.h and LayoutObject.h
also in compilation units that didn't expect it, for instance
XPathGrammer.y that suddenly will have both blink::Path and
blink::XPath::Path in scope (and blink::Filter / blink::XPath::Filter)

Note that distributed compilation system disables precompiled headers
globally so this will *not* make trybots faster.

This is a new attempt at this change after bug 511945 scared us into
reverting it. We still do not know the exact cause of 511945 but we
are making another attempt with this.

BUG=495697
R=thakis@chromium.org,sigbjornf@chromium.org

Review URL: https://codereview.chromium.org/1227953008

git-svn-id: svn://svn.chromium.org/blink/trunk@199168 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: remove unnecessary ENABLE(OILPAN) protections of trace() calls.
For modules/, minimize the use of ENABLE(OILPAN) in trace implementations.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1240223003

git-svn-id: svn://svn.chromium.org/blink/trunk@199164 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Separate VTTCue from VTTCueBox and LayoutVTTCue
Both VTTCueBox and LayoutVTTCue had a VTTCue member, which made for
tricky lifetime considerations, in particular the VTTCue destructor
was removing the VTTCueBox from the DOM, so that the stale VTTCue*
pointers would never be accessed.

Instead, let VTTCue provide VTTCueBox with the information it needs,
which will in turn provide it to LayoutVTTCue. Stale information
should not be a problem, as all relevant changes to VTTCue will call
cueDidChange(), whichs ends up removing and re-inserting the cue.

Refactoring only, no web-observable changes are intended.

BUG=511174, 509911
R=fs@opera.com

Review URL: https://codereview.chromium.org/1240433007

git-svn-id: svn://svn.chromium.org/blink/trunk@199160 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix webkit unit tests following r199143.
Need to promptly detach the local frame created in
FrameFetchContextCachePolicyTest.MainResource.

TBR=oilpan-reviews
BUG=505048
NOTRY=true

Review URL: https://codereview.chromium.org/1245513003

git-svn-id: svn://svn.chromium.org/blink/trunk@199155 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Canvas.toDataURL to use SkBitmap::readPixels to avoid uninitialized memory (patchset #4 id:60001 of https://codereview.chromium.org/1234083003/)
Reason for revert:
ASan bots are failing on toDataURL() tests,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/builds/19488
 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20Oilpan%20ASAN/builds/2978

Original issue's description:
> Canvas.toDataURL to use SkBitmap::readPixels to avoid uninitialized memory
> 
> This change refactors toDataURL to make it read the canvas data into
> a pre-initialized buffer to avoid accessing unitialized memory in cases
> where a GPU readback fails silently.
> 
> BUG=504690
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=199131

TBR=senorblanco@chromium.org,junov@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=504690

Review URL: https://codereview.chromium.org/1236173005

git-svn-id: svn://svn.chromium.org/blink/trunk@199154 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Stop propagating text decorations on outermost SVG roots
Outermost SVG roots should be consider atomic inline-level, and hence
text decorations should not propagate into them from the outside.

BUG=406966

Review URL: https://codereview.chromium.org/1241463003

git-svn-id: svn://svn.chromium.org/blink/trunk@199132 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Intersect with the dirty rect before deciding which columns to examine for collection.
When collecting layer fragments (to paint, hit-test, etc.) for multicol, we
should limit the number of columns to examine. There may be very many columns
(or pages), and processing them isn't for free. We already had code in place to
narrow down the column interval by intersecting with the bounding box of the
content, but in many cases we can narrow it down further (by a lot, in fact) by
intersecting with the dirty rect as well. So let's do that.

We used to intersect with the dirty rect as part of examining each column (i.e.
inside the column loop). Now we do it up-front instead, to decide which columns
are worth examining at all. So remove the dirty rect intersection check from
the column loop. Also remove a bounding box intersection check from the loop,
since we already do that up-front to set the column interval to examine. It
just seemed useless to do it again inside the loop.

This gives a major speed-up in the Layout/multicol/tall-content-short-columns*
performance tests.

R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1237623010

git-svn-id: svn://svn.chromium.org/blink/trunk@199107 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop WebCoreInterpolationQualityToSkFilterQuality
Except for GraphicsContextState, this function is only used in one
location - SVGPaintContext. In that one instance it's hard-wired to 'low',
so make that even more obvious.
Move the function from SkiaUtils.h to GraphicsContextState.cpp and rename.

Review URL: https://codereview.chromium.org/1236363003

git-svn-id: svn://svn.chromium.org/blink/trunk@199092 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Revert of Precompile more in Blink in Windows for faster compilations (patchset #9 id:160001 of https://codereview.chromium.org/1167523007/)
Reason for revert:
Strange errors in http://build.chromium.org/p/chromium.fyi/builders/Chromium%20Builder indicating that old versions of headers are used by the compiler. Possibly a stale cached pch file.

Original issue's description:
> Precompile more in Blink in Windows for faster compilations
> 
> One reason Blink is slow to compile is that there is a lot of code
> included in every compilation unit since everything depends on either
> LayoutObject.h or Document.h and those in turn include huge portions
> of the rest of Blink.
> 
> By precompiling LayoutObject.h and Document.h the compilation of core and
> modules in Blink can be 4 times faster (4 minutes instead of
> 19 minutes on my computer).
> 
> The downside is that it will introduce Document.h and LayoutObject.h
> also in compilation units that didn't expect it, for instance
> XPathGrammer.y that suddenly will have both blink::Path and
> blink::XPath::Path in scope (and blink::Filter / blink::XPath::Filter)
> 
> Note that distributed compilation system disables precompiled headers
> globally so this will *not* make trybots faster.
> 
> BUG=495697
> R=thakis@chromium.org
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198859

TBR=brucedawson@chromium.org,jam@chromium.org,scottmg@chromium.org,thakis@chromium.org,sigbjornf@opera.com,tasak@google.com,haraken@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=495697

Review URL: https://codereview.chromium.org/1234393002

git-svn-id: svn://svn.chromium.org/blink/trunk@199036 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Add 'printing' flag to PaintInfo
This adds a new paint flag - PaintInfo::printing() - to be preferred
before Document::printing() (and GC::printing()) during paint.
These flags should always have the same value.
The users of GC::printing() were the "PDF URL rect" code, SVG text
painting (to disable shadows) and TextPainter.
In the last case, the check can be dropped entirely because
TextPainter::*PaintingStyle explicitly clears |Style::shadow| if
|isPrinting| is true.
Rearrange code in PrintContextTest::printSinglePage to better reflect
the flow of actual printing.

BUG=424655

Review URL: https://codereview.chromium.org/1236183003

git-svn-id: svn://svn.chromium.org/blink/trunk@199034 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Work around unreliable metadata for HLS in WebMediaPlayerAndroid
There are two bugs involved, both specific to HLS:
 1. MediaPlayer.getDuration() returning 0 as opposed to -1.
 2. The MediaPlayer.OnVideoSizeChangedListener callback being called
    with width and height zero and later with a non-zero size.

Logging statements were used to test for the bugs on
http://www.aljazeera.com/watch_now/ with some different devices:
 * Huawei P6-U06, Android 4.2.2: both bugs
 * Samsung Galaxy S Duos 2, Android 4.2.2: duration bug
 * HTC One, Android 4.3: both bugs
 * Sony Xperia CP C5303, Android 4.3: both bugs
 * Samsung Galaxy S III, Android 4.3: duration bug
 * Samsung Galaxy S4, Android 4.4.2: duration bug
 * Samsung Galaxy Young 2, Android 4.4.2: duration bug
 * Samsung Galaxy Grand Prime, Android 4.4.4: duration bug
 * Sony Xperia Z2, Android 5.0.2: duration bug
 * Samsung Galaxy S4, CyanogenMod 12.1, Android 5.1.1: duration bug

In summary, the duration bug affects every device tested, while the
video size bug seems to affect some but not all devices running
Android 4.3 and older.

Avoid the need for a local duration variable in OnMediaMetadataChanged
by passing its argument by value, which is already the case for all
other OnMediaMetadataChanged methods in the code base.

BUG=501213, 509972
R=qinmin@chromium.org

Review URL: https://codereview.chromium.org/1241923003

Cr-Commit-Position: refs/heads/master@{#339019}
sebastianl
Don't zoom in TextFinder if autosizing is disabled
On android devices the zoom-level is always being reset if
the viewed page doesn't use/need text autosizing. Therefore,
only zoom to content if autosizing is set.

BUG=

Review URL: https://codereview.chromium.org/1231673007

git-svn-id: svn://svn.chromium.org/blink/trunk@199027 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Move parsing of "keyword only" SVG properties to CSSParserFastPaths
Transfers responsibility for the following properties:

  alignment-baseline
  buffered-rendering
  clip-rule
  color-interpolation
  color-interpolation-filters
  color-rendering
  dominant-baseline
  fill-rule
  mask-type
  shape-rendering
  stroke-linecap
  stroke-linejoin
  text-anchor
  vector-effect
  writing-mode

from CSSPropertyParser::parseSVGValue to CSSParserFastPaths.

Review URL: https://codereview.chromium.org/1213613013

git-svn-id: svn://svn.chromium.org/blink/trunk@199023 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Allow parsing SVG <paint> and <color> properties in the color fast-path
The following properties:

  fill
  flood-color
  lighting-color
  stop-color
  stroke

Will all accept a single <color> as a valid value. This means they can
be handled by the <color> parsing fast-path, which reduces the parsing
cost for these properties which often appear as presentation attributes.

Review URL: https://codereview.chromium.org/1221303013

git-svn-id: svn://svn.chromium.org/blink/trunk@199022 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Align color keyword handling in CSSParserFastPaths with CSSPropertyParser
Previously there has been some discrepancies between
CSSParserFastPaths::parseColor and CSSPropertyParser::parseColor with
regards which color keywords they accept, and whether they do so in
quirks mode or not. Use the same sequence of isColorKeyword and
isValueAllowedInMode in both places to try to prevent that happening
(again.)

BUG=505410

Review URL: https://codereview.chromium.org/1235943002

git-svn-id: svn://svn.chromium.org/blink/trunk@199021 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Update documentation of WindowPerformance and WorkerGlobalScopePerformance
The specs have now been updated:
https://github.com/w3c/hr-time/issues/9
https://github.com/w3c/hr-time/issues/10

BUG=460722
NOTRY=true
R=ksakamoto@chromium.org

Review URL: https://codereview.chromium.org/1239823002

git-svn-id: svn://svn.chromium.org/blink/trunk@199015 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Make sure that no column rows get negative flow thread portion heights.
BUG=510390
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1241703005

git-svn-id: svn://svn.chromium.org/blink/trunk@198970 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove the :-webkit-full-screen-document pseudo class
It is virtually unused in the wild, according to use counter data:
https://www.chromestatus.com/metrics/feature/timeline/popularity/627

Nothing similar exists in the spec or is likely to ever be added.

BUG=402378

Review URL: https://codereview.chromium.org/1233503003

git-svn-id: svn://svn.chromium.org/blink/trunk@198966 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Multicol performance tests for tall content (so that we get (very) many columns).
This is currently horribly slow. Discovered while working on bug 502407
(assertion failure). It seems impossible to write a test for that issue
that doesn't run into the performance problems illustrated by these tests,
so we have to land some performance improvements before fixing the actual
assertion. 

R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1239783002

git-svn-id: svn://svn.chromium.org/blink/trunk@198956 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Measure usage of HTMLMediaElement preload states
Refactoring into a preloadType() is necessary in order to count cases
where the preload attribute is never set, i.e. the missing value default
case. Also, it's nice to have less state in HTMLMediaElement.

BUG=73609, 310450

Review URL: https://codereview.chromium.org/1227403004

git-svn-id: svn://svn.chromium.org/blink/trunk@198955 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add a comment about counter availability in M45 branch
R=jochen@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/1235963004

git-svn-id: svn://svn.chromium.org/blink/trunk@198954 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
May need to insert or remove column sets when out-of-flow objects get their containing block changed.
Out-of-flow descendants may become or cease to be a part of a multicol
container due to changes on an ancestor. An ancestor may become or cease to be
a containing block for out-of-flow descendants.

Transforms also establish containing blocks for absolutely and fixed positioned
descendants, so we need to check for that too.

BUG=509463
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1229983004

git-svn-id: svn://svn.chromium.org/blink/trunk@198940 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Only coerce interpolation mode returned from computeInterpolationQuality
This makes the interpolation mode remain as InterpolationNone if the
'printing' flag is set, which is in line with the documentation for said
flag.

This behavior was added in: 
  http://trac.webkit.org/changeset/117187
which did not mention the printing case.

This is a first step towards separating "per context" and "per image"
interpolation settings/adaption.

BUG=492794

Review URL: https://codereview.chromium.org/1237083004

git-svn-id: svn://svn.chromium.org/blink/trunk@198934 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Use LayoutObject to locate the flow thread.
No need for (poorly) duplicated efforts in DeprecatedPaintLayer.

Cleaned up the code a little while I was here. One of the transform checks was
getting in the way, so I removed them both. They did nothing useful anyway.
The flow thread (i.e. pagination layer) itself can never be transformed.

Also removed the fast-path completely, since most layers don't use it.

When all this was gone, it became obvious that we should just fold
updatePagination() into updatePaginationRecursive().

What really went wrong here was that we failed to re-establish the layers when
evacuating a flow thread (which happens when a multicol container ceases to be
one), so we just kept what we had, and the flow thread got deleted without any
of the decendant layers noticing (so that we were pointing to dead enclosing
pagination layers). There's code in LayoutBoxModelObject::moveChildTo() that
normally handles such things (notifications that involve re-establishing the
layers), but only for LayoutInline and LayoutBlock. In this case we were
dealing with a LayoutSVGRoot, which is LayoutReplaced. There could be other
problems with SVG with layers inside because of this, but in this bug, the
correct fix is to just disallow pagination-awareness inside SVG, which
LayoutObject::locateFlowThreadContainingBlock() already does for us, if we but
just bother to invoke it.

BUG=507992
R=chrishtr@chromium.org

Review URL: https://codereview.chromium.org/1235133004

git-svn-id: svn://svn.chromium.org/blink/trunk@198891 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r198872.
TBR=oilpan-reviews
BUG=510036
NOTRY=true

Review URL: https://codereview.chromium.org/1234793003

git-svn-id: svn://svn.chromium.org/blink/trunk@198887 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Don't paginate lines that are taller than the column / page.
This is a partial revert of https://codereview.chromium.org/1221803003

I still believe what that patch did was correct, but it broke printing of Google Docs.

BUG=507972
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1236163002

git-svn-id: svn://svn.chromium.org/blink/trunk@198866 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Precompile more in Blink in Windows for faster compilations
One reason Blink is slow to compile is that there is a lot of code
included in every compilation unit since everything depends on either
LayoutObject.h or Document.h and those in turn include huge portions
of the rest of Blink.

By precompiling LayoutObject.h and Document.h the compilation of core and
modules in Blink can be 4 times faster (4 minutes instead of
19 minutes on my computer).

The downside is that it will introduce Document.h and LayoutObject.h
also in compilation units that didn't expect it, for instance
XPathGrammer.y that suddenly will have both blink::Path and
blink::XPath::Path in scope (and blink::Filter / blink::XPath::Filter)

Note that distributed compilation system disables precompiled headers
globally so this will *not* make trybots faster.

BUG=495697
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/1167523007

git-svn-id: svn://svn.chromium.org/blink/trunk@198859 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Robustify window.internals.textSurroundingNode().
R=hajimehoshi	
BUG=509860

Review URL: https://codereview.chromium.org/1237093003

git-svn-id: svn://svn.chromium.org/blink/trunk@198856 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Allocate XMLHttpRequest on the eagerly finalized heap.
With XMLHttpRequest now being on the heap with !ENABLE(OILPAN), we need
to arrange for this ActiveDOMObject to be allocated as an eagerly
finalized object.

R=haraken
BUG=509841

Review URL: https://codereview.chromium.org/1237063002

git-svn-id: svn://svn.chromium.org/blink/trunk@198853 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Refresh Frame(Loader) detach() related comments.
Update comments not to refer the older detachFromParent().

R=haraken,dcheng
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/1231273003

git-svn-id: svn://svn.chromium.org/blink/trunk@198804 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r198789.
TBR=oilpan-reviews
BUG=439376
NOTRY=true

Review URL: https://codereview.chromium.org/1237633003

git-svn-id: svn://svn.chromium.org/blink/trunk@198803 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r198788.
R=haraken
BUG=439376
NOTRY=true

Review URL: https://codereview.chromium.org/1232423002

git-svn-id: svn://svn.chromium.org/blink/trunk@198802 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: simplify ImageLoaderClient handling.
Simplify the unregistration of ImageLoaderClient objects. The weak client
references are removed as clients as part of weak processing or
when running the ImageLoader's prefinalizer.

R=haraken
BUG=383742

Review URL: https://codereview.chromium.org/1224323003

git-svn-id: svn://svn.chromium.org/blink/trunk@198790 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Don't cache MemoryInfo instance on ConsoleMemory object.
Round out r197581 and do same on console.memory

R=yurys,haraken
BUG=501270

Review URL: https://codereview.chromium.org/1230203003

git-svn-id: svn://svn.chromium.org/blink/trunk@198785 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Only allow the -webkit-text color keyword in quirks/UA-sheet mode
This color keyword is mainly used to implement the 'quirk-inherit'
special value for 'color' on <table> in quirks mode [1].
Currently this keyword is treated differently for different properties,
but for the most common properties, the "only in quirks mode" rule is
applied. It's also marked as "QuirksOrUASheet" in CSSValueKeywords.in.
Extend the "only in quirks mode" rule to apply to all <color>
properties.

The test fast/css/webkit-text-display-none.html is converted to run in
quirks mode. It worked previously because setting inline style would use
the fast-path color parser which was inconsistent with the non-fast-path
color parser in accepting '-webkit-text' in standards mode.

[1] https://quirks.spec.whatwg.org/#the-tables-inherit-color-from-body-quirk

BUG=505410

Review URL: https://codereview.chromium.org/1216523006

git-svn-id: svn://svn.chromium.org/blink/trunk@198770 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Return early in automaticTrackSelectionForUpdatedUserPreference()
If there are no text tracks, nothing in the method does anything,
except updateTextTrackDisplay() which will create the text track
container which is not needed yet.

BUG=457850

Review URL: https://codereview.chromium.org/1228293003

git-svn-id: svn://svn.chromium.org/blink/trunk@198767 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Gracefully handle track-less elements on updating track selection.
The media element may not have text tracks.

Follow up on r198661.

R=haraken
BUG=457850

Review URL: https://codereview.chromium.org/1224083013

git-svn-id: svn://svn.chromium.org/blink/trunk@198754 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: switch ImageLoader to be prefinalized.
If an ImageLoader for an SVGImage ends up being swept out along with a
FrameView (a ScrollableArea), the former may circuitously end up accessing
the latter via its destructor. Having both be eagerly finalized, or
prefinalized, doesn't guarantee a correct destruction order.

Hence, to address, arrange for the ImageLoader to be finalized/disposed of
first by way of a prefinalizing action.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1226373008

git-svn-id: svn://svn.chromium.org/blink/trunk@198753 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove unused ExtraData support on exported mediastream objects.
The Blink exported interfaces RTCSessionDescriptionRequest, RTCVoidRequest,
and MediaStreamTrackSourcesRequest provide a facility to the embedder of
allowing 'ExtraData' to be associated and attached to object instances.

The embedder does not make use of this functionality for these mediastream objects,
so retire the unused ExtraData support. This simplifies the implementation of these
exported objects, in particular as regards to when they must be finalized as Blink
objects.

R=
BUG=

Review URL: https://codereview.chromium.org/1233793002

git-svn-id: svn://svn.chromium.org/blink/trunk@198741 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: tidy HeapTest.VectorDestructors
R=haraken
BUG=none

Review URL: https://codereview.chromium.org/1227413003

git-svn-id: svn://svn.chromium.org/blink/trunk@198738 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix build following r198658.
Reintroduce the use of ASSERT_UNUSED() in
CharacterIterator{Algorithm}:range() that r198658 dropped. It is needed.

TBR=oilpan-reviews,yosin@chromium.org
BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/1227413004

git-svn-id: svn://svn.chromium.org/blink/trunk@198737 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r198661.
TBR=oilpan-reviews
BUG=457850
NOTRY=true

Review URL: https://codereview.chromium.org/1228363004

git-svn-id: svn://svn.chromium.org/blink/trunk@198736 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Update histograms.xml
Used tools/metrics/histograms/update_use_counter_feature_enum.py

R=asvitkine@chromium.org

Review URL: https://codereview.chromium.org/1233493006

Cr-Commit-Position: refs/heads/master@{#338291}
philipj
Remove the (already disabled) OverflowChangedEvent runtime flag
The functionality was disabled for M43:
https://codereview.chromium.org/959643002

M43 reached the stable channel for Windows, Mac and Linux on May 19
and for Android on May 27, and there have been no issues reported.

BUG=460822

Review URL: https://codereview.chromium.org/1230013003

git-svn-id: svn://svn.chromium.org/blink/trunk@198689 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Prevent overflowing content from affecting multicol layout.
Don't let visual overflow (caused by outlines, text-shadow, text overflowing
its line box, and other things) affect layout. Note that this CL does exchange
one problem for another, but it should be better to have stable and predictable
(and correct) layout, than hacking line positions and column heights to make
the overflow fit in the same column as the line box.

This fixes a problem with links in multicol lists on wikipedia jumping back and
forth between columns.

What we're really lacking (after this CL, more than ever) is to be able to
paint column overflow correctly in the block direction. Fixing that would be
the right thing to do long-term, but it's going to require substantial amounts
of work (and probably a great deal of multicol awareness in the painting and
hit-testing code).

Removed the fast/multicol/split-in-top-margin.html test, since the behavior it
tested is what we remove in this CL.

calculateMinimumPageHeight() could be simplified because of this change,
including removal of (now) redundant parameters.

BUG=439820
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1224973002

git-svn-id: svn://svn.chromium.org/blink/trunk@198683 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync core/timing/ interfaces with their specs, or lack thereof
The only changes to the generated code are ordering and the added use
counters.

[Measure] does not mean that we should try to remove it, in cases where
usage is high we can use that data to ask for spec changes.

BUG=460722

Review URL: https://codereview.chromium.org/1219673003

git-svn-id: svn://svn.chromium.org/blink/trunk@198682 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Add missing base/memory/scoped_ptr.h include to base/prefs/writeable_pref_store.h
BUG=

Review URL: https://codereview.chromium.org/1227323002

Cr-Commit-Position: refs/heads/master@{#338281}
philipj
Add counters for add/removeEventListener() called with one argument
This was attempted previously but only worked for no arguments:
https://codereview.chromium.org/815503002
https://codereview.chromium.org/928103002

The enum values are added in their original positions in UseCounter.h,
as they were always unreachable and thus not polluted by anything else.

The reason was that there is no generated impl-> call with one
argument, as EventListener has special handling in the bindings
generator such that it's effectively treated as having a default null
argument.

Give all the arguments default values in the IDL so that there is only
one impl-> call in the generated code, with the prologue and epilogue
immediately before and after it. This makes it more clear that the
prologue will always be called, and makes this purely a bindings bug.

The removed FIXMEs in EventTarget.cpp were wrong, it should be
possible to pass null for the listener argument and per spec that
should do nothing.

Rather than extending support for [Conditional] here, remove it for
[Custom=CallEpilogue] as it's actually never used there, nor tested.

BUG=353484

Review URL: https://codereview.chromium.org/1233483002

git-svn-id: svn://svn.chromium.org/blink/trunk@198681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fold CSSParser::colorFromRGBColorString into only user
Said method is very special flower, used by the SMIL animation code to
put color values into SVGColorProperty.
Since it's essentially a one-off (and supporting a deprecated class part
of a deprecated whole) fold it into it's only user and rid the CSSParser
of this burden, ehm, flower.

Review URL: https://codereview.chromium.org/1224223003

git-svn-id: svn://svn.chromium.org/blink/trunk@198672 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add a use counter for HTMLFrameElement.getSVGDocument()
Review URL: https://codereview.chromium.org/1219463004

git-svn-id: svn://svn.chromium.org/blink/trunk@198616 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Update inclusion of GraphicsContextStateSaver.h
Not needed in a bunch of places due to other refactoring work.
Pushed down from PaintInfo.h into a number of places.

Opportunity targets were fired upon.

With this it's only being included in core/paint/ and platform/.

BUG=424655

Review URL: https://codereview.chromium.org/1230643006

git-svn-id: svn://svn.chromium.org/blink/trunk@198615 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop GraphicsContext::AccessMode
Unused. Missed when dropping layerBitmap(AccessMode ...) in
https://codereview.chromium.org/182183004

BUG=424655

Review URL: https://codereview.chromium.org/1229693007

git-svn-id: svn://svn.chromium.org/blink/trunk@198610 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Measure usage of Document.createTouch()
This is for the same reason as the init*Event() methods, to know if
making all the arguments non-optional is likely safe or not:
https://codereview.chromium.org/1215893006

Also remove the webkit prefixes on the arguments, as the corresponding
attribute are now unprefixed on the Touch interface.

BUG=460722
R=rbyers@chromium.org

Review URL: https://codereview.chromium.org/1227833002

git-svn-id: svn://svn.chromium.org/blink/trunk@198595 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ckulakowski
Added missing include in media_capture_devices_dispatcher.cc
Introduced by https://codereview.chromium.org/1095393004. Profile is still used in this file and missing include causes compilation error in our product.

Review URL: https://codereview.chromium.org/1221283005

Cr-Commit-Position: refs/heads/master@{#337992}
mstensho
Remove unnecessary LayoutUnit -> float -> LayoutUnit conversions.
R=szager@chromium.org

Review URL: https://codereview.chromium.org/1228633002

git-svn-id: svn://svn.chromium.org/blink/trunk@198573 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
LayoutFlowThread parameter to adjustLinePositionForPagination() is now unused.
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1215343004

git-svn-id: svn://svn.chromium.org/blink/trunk@198535 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Performance tests for lots of lines of text inside multicol.
One test with column balancing and one without.

R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1227003002

git-svn-id: svn://svn.chromium.org/blink/trunk@198497 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ohrn
Add -bootclasspath argument to javac.
This silences the warning "bootstrap class path not set in conjunction
with -source 1.7" when building with OpenJDK 1.8.

The multiple_proguards test was removed as javac will now catch the use
of host packages that do not exist on Android.

BUG=

Review URL: https://codereview.chromium.org/1213433007

Cr-Commit-Position: refs/heads/master@{#337805}
the_jk
Make it possible to change libc++ library files used for android
Useful for specifying specific or modified libc++ library files instead of
always using the one in android_ndk_root.

Review URL: https://codereview.chromium.org/1215713006

Cr-Commit-Position: refs/heads/master@{#337797}
sigbjorn
Don't autofill credit cards on non-secure pages
Instead of checking for scheme only when suggesting credit card autofills,
ensure that the page is secure.

Also add missing tests for storing credit cards (even when submitted on
http).

Review URL: https://codereview.chromium.org/1136473006

Cr-Commit-Position: refs/heads/master@{#337796}
philipj
Sync the Presentation API interfaces with the spec again
Speedily fixed in https://github.com/w3c/presentation-api/pull/144

The [SameObject] attribute does not change the generated code.

BUG=460722
R=mfoltz@chromium.org

Review URL: https://codereview.chromium.org/1226633007

git-svn-id: svn://svn.chromium.org/blink/trunk@198426 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Behave more normally for content taller than the fragmentainer it's in.
Refusing to break just because content happens to be taller than the multicol
container is just weird, and it's getting in the way for fixing bug 439820.

If we had behaved the same way for line layout, we'd refuse to wrap to the next
line if we encountered a word that was wider than the container (in addition to
being too wide at the current inline position on the line). If the text to lay
out is "abc def ghijklmnopqr stu" and the container has room for 10 characters,
we'd lay out like this:

+----------+
|abc def ghijklmnopqr
|stu       |
+----------+

instead of this (the correct way):

+----------+
|abc def   |
|ghijklmnopqr
|stu       |
+----------+

The usefulness of the hasUniformPageLogicalHeight thing vanished into thin air
in the process (calling pageLogicalHeightForOffset() isn't that expesive).
Having one bit in LayoutFlowThread specifying if column heights are uniform was
just bogus anyway, since column sets are typically separated by column
spanners, and if the heights of the set preceding and following a spanner
differ, why should adjustLinePositionForPagination() care? This was a relic
from the CSS regions days, thought to also be useful for multicol. But it
isn't.

R=dsinclair@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1221803003

git-svn-id: svn://svn.chromium.org/blink/trunk@198415 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the Presentation API interfaces with the spec
https://w3c.github.io/presentation-api/

Spec issues found in the process:
https://github.com/w3c/presentation-api/issues/137
https://github.com/w3c/presentation-api/issues/138
https://github.com/w3c/presentation-api/issues/139
https://github.com/w3c/presentation-api/issues/140
https://github.com/w3c/presentation-api/issues/141

BUG=460722

Review URL: https://codereview.chromium.org/1209423005

git-svn-id: svn://svn.chromium.org/blink/trunk@198408 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Fix the indentation of MouseEvent.pageX/Y
BUG=503274
NOTRY=true

Review URL: https://codereview.chromium.org/1214723004

git-svn-id: svn://svn.chromium.org/blink/trunk@198398 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the EventSource interface with the spec
This change is not observable, obviously.

BUG=460722

Review URL: https://codereview.chromium.org/1215463008

git-svn-id: svn://svn.chromium.org/blink/trunk@198373 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the ImageBitmapFactories interface with the spec
There are no changes to the generated code.

BUG=460722

Review URL: https://codereview.chromium.org/1225843002

git-svn-id: svn://svn.chromium.org/blink/trunk@198372 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Annotate the CloseEvent interfaces with spec link
WebSocket already has a spec link. The idea is that each IDL file has
one spec link, which should make it easier to write a tool to compare
our IDL to the spec's IDL.

BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1220363003

git-svn-id: svn://svn.chromium.org/blink/trunk@198369 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add UseCounters for init*Event methods that aren't already measured
These methods systematically have "[Default=Undefined] optional"
arguments where the spec (if any) has non-optional arguments. Usage of
most of these is likely low, so just measure them all to see where the
change can be made without further investigation.

Also change a few argument names that were not per their specs.

BUG=460722

Review URL: https://codereview.chromium.org/1215893006

git-svn-id: svn://svn.chromium.org/blink/trunk@198345 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Add stub for assigning media session to media elements
Introduces a partial IDL interface for HTMLMediaElement containing an
optional media session attribute implemented as a supplement to media
elements.

BUG=497735

Review URL: https://codereview.chromium.org/1217743003

git-svn-id: svn://svn.chromium.org/blink/trunk@198272 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Define default but still private MediaSession constructor
BUG=497735

Review URL: https://codereview.chromium.org/1221953003

git-svn-id: svn://svn.chromium.org/blink/trunk@198271 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Disentangle filter content recording state from FilterData
In circumstances where an image is being painted, and said image is part
of the source graphics for a filter - and the image is animated and
needs to catch up - the FilterData for the filter can be destroyed while
the source graphic is being recorded.
While arguably this shouldn't happen at all, make sure that at least the
GC we're currently painting on isn't destroyed by moving it to a
separate structure housed by SVGPaintContext.

BUG=505444

Review URL: https://codereview.chromium.org/1220053003

git-svn-id: svn://svn.chromium.org/blink/trunk@198266 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Allow 'currentcolor' for -webkit-tap-highlight-color in non-quirks mode
Seems like a fairly artificial limit (== oversight) since it will be
resolved during style resolution already (for the quirks mode case).

This moves this property one step closer to being just a "plain" <color>.

BUG=505410

Review URL: https://codereview.chromium.org/1221093003

git-svn-id: svn://svn.chromium.org/blink/trunk@198265 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Cleanups to viewport-handling and image invalidation in LayoutSVGImage
Split updateImageViewport into its two (now independent except for the
bbox, so ordering matters still) parts, naming them updateBoundingBox
and updateImageContainerSize.
Stop updating the bbox in imageChanged since updateImageContainerSize
will update the container size of the referenced image regardless.
Also drop the (explicit) SVGResource::removeClientFromCache call from
imageChanged, because markForLayoutAndParentResourceInvalidation is
called just after it, and will do what's required already.

BUG=505444

Review URL: https://codereview.chromium.org/1219493005

git-svn-id: svn://svn.chromium.org/blink/trunk@198241 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Simplify paint rect calculations in LayoutReplaced::shouldPaint
Compute a paint rectangle based on visualOverflowRect() once, and then
reuse that where needed to avoid calling said method 4 times.

BUG=506432

Review URL: https://codereview.chromium.org/1212213004

git-svn-id: svn://svn.chromium.org/blink/trunk@198240 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Copy line dashes when copying/assigning CanvasRenderingContext2DState
BUG=505912

Review URL: https://codereview.chromium.org/1224443003

git-svn-id: svn://svn.chromium.org/blink/trunk@198227 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Semi-evil multicol performance test.
It contains some deeply nested tables, and currently it also triggers 3 layout
passes, while 2 should in theory be enough. For each layout pass we currently
also do a deep layout (thanks to markForPaginationRelayoutIfNeeded() pretty
much always marking everything for layout). That should be improved as part of
fixing bug 487026.

R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1216053009

git-svn-id: svn://svn.chromium.org/blink/trunk@198221 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Always enable Oilpan for EventSource.
This puts EventSource objects on the Oilpan heap by default.

Doing so necessitated the removal of WTF_MAKE_FAST_ALLOCATED() for
ThreadableLoaderClient; done here, along with moving that annotation to
its derived classes where possible.

R=haraken
BUG=497595

Review URL: https://codereview.chromium.org/1179733009

git-svn-id: svn://svn.chromium.org/blink/trunk@198217 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Avoid using floating point when not needed.
Caused inaccuracies which made us think that we had one column more than we
actually had, which in turn triggered an assertion failure.

BUG=504158
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1216223004

git-svn-id: svn://svn.chromium.org/blink/trunk@198213 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Update LayoutObject::name() documentation
Now that crbug.com/463967 is done, LayoutObject::name() no longer
returns the decorated name. Update the documentation to match.

BUG=463967

Review URL: https://codereview.chromium.org/1219723008

git-svn-id: svn://svn.chromium.org/blink/trunk@198212 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r198203.
TBR=oilpan-reviews
BUG=427652
NOTRY=true

Review URL: https://codereview.chromium.org/1226463005

git-svn-id: svn://svn.chromium.org/blink/trunk@198206 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync XML-related interfaces with their specs, or lack thereof
The inResult arguments in XPathEvaluator and XPathExpression are called
just result in the spec, but that conflicts with other variables in the
generated code, so leave that as it is.

BUG=460722

Review URL: https://codereview.chromium.org/1222503003

git-svn-id: svn://svn.chromium.org/blink/trunk@198201 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Unify handling of <color> for SVG/non-SVG properties
Stop resolving system colors and "basic" named colors at parse time, and
instead resolve them when resolving style.
Implementation-wise this means getting rid of
CSSPropertyParser::parseSVGColor in favor of parseColor, and similarly
get rid of convertSVGColor in favor of convertColor on the style
resolver side.

Changes behavior for "basic" color names and system colors (as well as
some proprietary/internal keywords). New behavior matches Gecko.

BUG=370830,505410

Review URL: https://codereview.chromium.org/1219153003

git-svn-id: svn://svn.chromium.org/blink/trunk@198199 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync part of the MouseEvent interface with CSSOM View
http://dev.w3.org/csswg/cssom-view/#extensions-to-the-mouseevent-interface

BUG=460722

Review URL: https://codereview.chromium.org/1214923005

git-svn-id: svn://svn.chromium.org/blink/trunk@198147 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: disconnected scrollbars must be externally observable as such.
Followup the Scrollbar and ScrollableArea Oilpan changes in r198064, and
have explicit disconnects of Scrollbars from their ScrollableAreas be
observable via the Scrollbar afterwards.

The assumption made in r198064 that no one wanted to observe Scrollbars
in that detached/disconnected state, doesn't hold. SelectorChecker and
AXScrollbar are two examples.

R=haraken
BUG=504655

Review URL: https://codereview.chromium.org/1215063006

git-svn-id: svn://svn.chromium.org/blink/trunk@198144 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop pattern-related state from GraphicsContext(State)
One trivial use of setFillPattern() in GeneratedImage converted to use
an SkPaint directly. As a bonus, this conversion also allows dropping a
state-saver.

BUG=424655

Review URL: https://codereview.chromium.org/1213723006

git-svn-id: svn://svn.chromium.org/blink/trunk@198142 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r198129.
TBR=oilpan-reviews
BUG=505861
NOTRY=true

Review URL: https://codereview.chromium.org/1214553003

git-svn-id: svn://svn.chromium.org/blink/trunk@198133 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Add missing initialization of RawPtr<> local var in r197835.
Only insertCSSOMRuleInMediaRule()'s missing initialization is problematic.
Initialize the other occurrences here for consistency, aligning with
the convention we try to adhere to (but do not have tool support for
catching the failure to do so..)

R=pfeldman
BUG=178410

Review URL: https://codereview.chromium.org/1213233016

git-svn-id: svn://svn.chromium.org/blink/trunk@198128 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Cannot rely on auto-positioned absolutely positioned descendants being marked for layout.
Instead, figure out if such descendants need layout as part of
layoutPositionedObjects().

One test is for the actual facebook regression; the others demonstrate that we
have now fixed older regressions, or even things that have never worked.

BUG=505386
R=leviw@chromium.org,rhogan@gmail.com

Review URL: https://codereview.chromium.org/1217833007

git-svn-id: svn://svn.chromium.org/blink/trunk@198101 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Always enable lazy sweeping.
This turns on lazy sweeping for enable_oilpan=0.

Lazy/incremental sweeping reduces GC pause times by having the
garbage collector perform its marking and processing of live
objects together with a minimal amount of sweeping of finalizable
objects before returning. The remaining heap regions to be swept
up and finalized are then handled incrementally as part of
heap allocation requests. Amortizing that sweeping cost rather
than taking a longer GC "stop the world" pause in one go.

Lazy sweeping is enabled with Oilpan always on (enable_oilpan=1);
this extends it to also be for the Oilpan GCs that run on trunk
(where enable_oilpan=0).

R=haraken
BUG=480837

Review URL: https://codereview.chromium.org/1219613002

git-svn-id: svn://svn.chromium.org/blink/trunk@198095 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Add ASan lazy sweep annotations to allow Persistent<> creation.
Destructors are allowed to allocate, including the creation of
Persistent<>s and linking them into the root set.

That might end up touching other objects that are in the process of
being swept and are poisoned. Benign, add annotations.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1215153002

git-svn-id: svn://svn.chromium.org/blink/trunk@198081 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: implement StyleRuleList without an extra wrapper.
Wrapping up a possibly-shared heap object behind a wrapper doesn't make
sense with Oilpan, so do not provide it.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/992903002

git-svn-id: svn://svn.chromium.org/blink/trunk@198068 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: improve ScrollableArea handling.
Have all ScrollableArea objects reside on the Oilpan heap,
making ScrollableArea be a GC mixin.

Without it, some ScrollableAreas (FrameView) were on the heap
whereas others (*Viewport) weren't, making for unpredictable
and incorrect finalization as the lifetimes were skewed.

Additionally, simplify Scrollbar's unregistration with its
ScrollableArea (and its ScrollAnimator). The Oilpan-specific
RefPtr<ScrollAnimator> that Scrollbar kept, no longer served
a purpose, hence removed. As a result, ScrollAnimator can again
be fully owned by ScrollableAreas & no longer be RefCounted<>.

R=haraken
BUG=504655

Review URL: https://codereview.chromium.org/1215973002

git-svn-id: svn://svn.chromium.org/blink/trunk@198064 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Dissect and clean up instances of color parsing in CSSPropertyParser
This moves all instances of color parsing (mostly <color> parsing
even) into their separate methods. The new methods (except parseSVGColor)
are formulated using parseColor(). parseColor() itself is combined with
the "most common" color parsing case by folding the keyword case into it.
The new methods are structured as first checking for keywords that they
handle differently from the generic <color> case.
The <quirky-color> determination is moved into a function of its own.
The parsing of <color> for shadow is cleaned up.

Behavioral changes:
 * Accept '-internal-*' in all cases (for UA-sheets).
 * Keep 'grey' as a keyword in all cases.
 * Accept '-webkit-focus-ring-color' in quirks mode and UA-sheets in all
   cases.
 * Keep keywords for fallback colors to 'fill' and 'stroke.

The intention of the change is to make the differences visible, and try
to eliminate the remaining differences in follow-up CLs.

BUG=505410

Review URL: https://codereview.chromium.org/1219463003

git-svn-id: svn://svn.chromium.org/blink/trunk@198062 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r198049.
Move the script-exposed MediaSession to the heap.

TBR=oilpan-reviews
BUG=497735
NOTRY=true

Review URL: https://codereview.chromium.org/1211973007

git-svn-id: svn://svn.chromium.org/blink/trunk@198054 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Only check for on-heap Member<T>s iff T is in scope.
As Member<T>::checkPointer() uses IsGarbageCollectedMixin<T>,
T's definition must be in scope for it to be precise.

Adjust condition accordingly.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1217083002

git-svn-id: svn://svn.chromium.org/blink/trunk@198050 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Add MediaSession runtime flag along with stub MediaSession object
Implementation of the MediaSession specification will happen behind
the runtime flag 'MediaSession'.

Add a virtual testsuite for running tests with MediaSession flag. This
way we don't have to have the flag enabled when running LayoutTests in
general, only when running MediaSession tests.

Intent to implement:

https://groups.google.com/a/chromium.org/d/msg/blink-dev/dLWDxYgxzQ8/vXt0ntWFNBwJ

BUG=497735

Review URL: https://codereview.chromium.org/1206283002

git-svn-id: svn://svn.chromium.org/blink/trunk@198049 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Need to update first-line when font finish loading.
Another regression from baseLayoutStyle implementation where operator==
is not affected by the loading/loaded state of web fonts. To get a re-
layout and re-rendering when a web font loading state changes, we need to
check for the loading state. In this case, there was a missing check for
::first-line pseudo style.

Also, moved the code which marks for re-layout with accompanying FIXME
into LayoutObject.

BUG=501564,504864
TEST=fast/text/ellipsis-platform-font-change.html

Review URL: https://codereview.chromium.org/1209253006

git-svn-id: svn://svn.chromium.org/blink/trunk@198048 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Don't change the height of a layout object while not laying it out.
The old flexbox implementation did that. This still used to work halfheartedly
by accident until the fix for bug 498770, though, because we used to mark
out-of-flow positioned children in updateBlockChildDirtyBitsBeforeLayout(). But
it never worked for anything other than direct children. Added one test for the
recent regression (out-of-flow child) and one test that has probably never
passed, until now (out-of-flow grandchild).

We need to be inside layout() when setting the height of an object, or we won't
be able to detect any changes and thus fail to relayout positioned descendants
that may be affected.

BUG=504239
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1213843002

git-svn-id: svn://svn.chromium.org/blink/trunk@198017 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have FrameFetchContext keep a DocumentLoader member.
With DocumentLoader now being on the heap, keep a strong
back reference to the loader.

R=haraken
BUG=393516

Review URL: https://codereview.chromium.org/1220713004

git-svn-id: svn://svn.chromium.org/blink/trunk@198015 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Fix typo in big object fix for Windows.
There is no such thing as VCCompilerTool so gyp did nothing but warn
a thousand times. VCCLCompilerTool on the other hand will actually
do something.

BUG=500674
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1218803002

Cr-Commit-Position: refs/heads/master@{#336579}
philipj
Run flaky TextTrackList tests for tracking purposes
BUG=503852
R=wangxianzhu

Review URL: https://codereview.chromium.org/1217753002

git-svn-id: svn://svn.chromium.org/blink/trunk@197998 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: support observer retirement during lifetime notifications.
While transitioning Blink to Oilpan, there will be LifecycleNotifier<>s
not on the Oilpan heap, but with some of their LifecycleObserver<>s being
on the heap.

Should a GC strike while such a notifier iterates over its observer set,
dead observers may remove themselves (eagerly) while being finalized
during that GC. This will mutate the notifier set, which isn't currently
assumed nor supported.

There's no need to support this when fully transitioned, Oilpan will
handle GCs across such iterations gracefully, but in the meantime we will
have to support this by snapshot'ing the observer set and explicitly
checking for liveness. Like already done over ContextLifecycleNotifier,
where such dynamic unregistrations are supported.

Notice that this issue isn't tied to lazy sweeping; indeed, lazy sweeping
without eager finalization of lifecycle observers will potentially make this
bug rarer.

R=haraken
BUG=480837

Review URL: https://codereview.chromium.org/1214963002

git-svn-id: svn://svn.chromium.org/blink/trunk@197990 bbb929c8-8fbe-4397-9dbb-9b2b20218538
haavardm
Ignore certificate transparency by default.
Current behavior is to remove the EV flag if the ct enforcer is not
set by the embedder. This somewhat unexpectedly removes EV for all
servers, if the embedder has not taken explicit actions to turn
on CT.

CT should either be ignored when policy enforcer is not present,
or there should be asserts warning about the missing EV-white
list. This patch chooses the first option as CT is not yet a
security requirement, and I don't think it's correct to demand
CT support quite yet.

Note that this change has no effect on Chrome's default behavior.

BUG=NONE

Review URL: https://codereview.chromium.org/1211423002

Cr-Commit-Position: refs/heads/master@{#336539}
sigbjornf
Oilpan: fix build after r197963.
TBR=oilpan-reviews
BUG=437696
NOTRY=true

Review URL: https://codereview.chromium.org/1217683004

git-svn-id: svn://svn.chromium.org/blink/trunk@197965 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197958.
TBR=oilpan-reviews
BUG=427652
NOTRY=true

Review URL: https://codereview.chromium.org/1214103002

git-svn-id: svn://svn.chromium.org/blink/trunk@197962 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197938.
TBR=oilpan-reviews
BUG=501642
NOTRY=true

Review URL: https://codereview.chromium.org/1215843002

git-svn-id: svn://svn.chromium.org/blink/trunk@197939 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197920
TBR=oilpan-reviews
BUG=503227
NOTRY=true

Review URL: https://codereview.chromium.org/1217463003

git-svn-id: svn://svn.chromium.org/blink/trunk@197925 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Work around flaky TextTrackList tests that will be stable with Oilpan
This test calls document.createElement('video').textTracks and has no
reference to the video element. The TextTrackList doesn't keep its
owner HTMLMediaElement alive, so if the owner is garbage collected,
TextTrackList::executionContext() returns null. That in turn makes
EventTarget::dispatchEvent() do nothing, and thus the assert_true(ran)
fails because the event handler was in fact never run.

The owner is a RawPtrWillBeMember<HTMLMediaElement>, so this problem
will not occur with Oilpan, and does not seem worth addressing
pre-Oilpan unless there's evidence of this happening in the wild.

BUG=503852

Review URL: https://codereview.chromium.org/1213813002

git-svn-id: svn://svn.chromium.org/blink/trunk@197907 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: make XHR progress event throttling finalization safe.
Move the XHR event throttling object to the heap. It is a timer object,
hence it must be eagerly finalized so as to prevent unsafe accesses
should it instead be lazy sweepable.

Part objects cannot be eagerly finalized on their own, hence this is
accomplished by moving the object to the heap. For simplicity, we keep
it as a separate heap object non-Oilpan also.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1200413004

git-svn-id: svn://svn.chromium.org/blink/trunk@197904 bbb929c8-8fbe-4397-9dbb-9b2b20218538
landell
Make sure dispatchFailLoad is triggered by stopLoading
Calling ResourceFetcher::stopFetching before
DocumentLoader::cancelMainResourceLoad may trigger a
dispatchDidFinishLoad instead of the expected dispatchFailLoad. This
patch reverts to the former ordering of the calls, which solves the
problem.

BUG=501248

Review URL: https://codereview.chromium.org/1205703006

git-svn-id: svn://svn.chromium.org/blink/trunk@197901 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Fix string representation of TestInput
Review URL: https://codereview.chromium.org/1210743004

git-svn-id: svn://svn.chromium.org/blink/trunk@197898 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Have enclosingPositionedAncestor() detect whether it walked past a certain ancestor.
This is similar to what LayoutObject::container() does.

This simplifies the code in accumulateOffsetTowardsAncestor(), which previously
had to duplicate what enclosingPositionedAncestor() did.

Also cleaned up the other call site of enclosingPositionedAncestor(). No need
to call the method twice there.

No behavioral changes intended; this is just clean-up.

R=chrishtr@chromium.org

Review URL: https://codereview.chromium.org/1199673003

git-svn-id: svn://svn.chromium.org/blink/trunk@197846 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197830.
TBR=oilpan-reviews
BUG=501896
NOTRY=true

Review URL: https://codereview.chromium.org/1207333002

git-svn-id: svn://svn.chromium.org/blink/trunk@197844 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Add isMultiColumnContainer() for convenience and readability.
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1210803002

git-svn-id: svn://svn.chromium.org/blink/trunk@197828 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: add missing ASan no-sanitize declaration following r197814.
TBR=oilpan-reviews
BUG=498229
NOTRY=true

Review URL: https://codereview.chromium.org/1211883002

git-svn-id: svn://svn.chromium.org/blink/trunk@197826 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ingemara
Retrieve resources from media and supports query rules while serializing
Traverse rules behind media and supports queries while serializing (and gathering resources
referenced from) stylesheets. Resources from non-matching queries will be
skipped as they haven't been fetched.

BUG=503919

Review URL: https://codereview.chromium.org/1203873004

git-svn-id: svn://svn.chromium.org/blink/trunk@197813 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197804.
TBR=oilpan-reviews
BUG=504035
NOTRY=true

Review URL: https://codereview.chromium.org/1204233003

git-svn-id: svn://svn.chromium.org/blink/trunk@197810 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197805.
TBR=oilpan-reviews
BUG=496033
NOTRY=true

Review URL: https://codereview.chromium.org/1205343002

git-svn-id: svn://svn.chromium.org/blink/trunk@197809 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197794.
TBR=oilpan-reviews
BUG=426458
NOTRY=true

Review URL: https://codereview.chromium.org/1209873002

git-svn-id: svn://svn.chromium.org/blink/trunk@197806 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Rewrite nine piece image painting code
Introduce a NinePieceImageGrid class responsible for computing the
nine piece image drawing information. The NinePieceImageGrid is
oblivious to painting details and only operates on the border image
properties (through NinePieceImage), image size and border image area.

Functionally, it shouldn't introduce any significant changes and
nothing web exposed should change at all.

Since computing drawing information is now self-contained, supply unit
tests for verifying it does the correct thing in the common and not so
common cases.

BUG=496033

Review URL: https://codereview.chromium.org/1180053009

git-svn-id: svn://svn.chromium.org/blink/trunk@197805 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Retire http/tests/xmlhttprequest/event-listener-gc.html test expectation.
TBR=hayato
BUG=503842
NOTRY=true

Review URL: https://codereview.chromium.org/1205293002

git-svn-id: svn://svn.chromium.org/blink/trunk@197803 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Remove LayoutFlowThread::maxLogicalHeight().
Use LayoutUnit::max() like everyone else, to avoid errors when approaching
"infinity". We fooled ourselves into thinking that we had two pages (because
column height was clamped to LayoutUnit::max()/2, while the block height was
clamped to LayoutUnit::max()), when we really only had one.

We use saturated arithmetic in LayoutUnit & co anyway, so there's no reason to
be afraid of integer overflow.

BUG=502407
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1209693002

git-svn-id: svn://svn.chromium.org/blink/trunk@197771 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Table cells, rows, sections or column (groups) don't support margins.
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1211523002

git-svn-id: svn://svn.chromium.org/blink/trunk@197770 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Oilpan: promptly finalize XMLHttpRequestProgressEventThrottle. (patchset #1 id:1 of https://codereview.chromium.org/1205843003/)
Reason for revert:
This is not well-formed as-is; XMLHttpRequestProgressEventThrottle is a part object & cannot be eagerly finalized on its own.

Original issue's description:
> Oilpan: promptly finalize XMLHttpRequestProgressEventThrottle.
> 
> This timer object needs to promptly stop, otherwise we run the risk
> of timers firing while the object is in non-valid state waiting to be
> finalized by an ongoing lazy sweep.
> 
> R=haraken
> BUG=491488
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197736

TBR=oilpan-reviews@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=491488

Review URL: https://codereview.chromium.org/1211593002

git-svn-id: svn://svn.chromium.org/blink/trunk@197749 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: promptly finalize XMLHttpRequestProgressEventThrottle.
This timer object needs to promptly stop, otherwise we run the risk
of timers firing while the object is in non-valid state waiting to be
finalized by an ongoing lazy sweep.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1205843003

git-svn-id: svn://svn.chromium.org/blink/trunk@197736 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Keep effectiveZoom finite
Through repeated application, it's quite possible to get the effective
zoom to overflow, resulting in Infinity in ComputedStyle.
This is a very uncommon case in reality (outside fuzzers), but make
sure to clamp the effective zoom value to a finite range to avoid the
simplest cases of Infinity havoc-wrecking.

BUG=490757,502997

Review URL: https://codereview.chromium.org/1193203003

git-svn-id: svn://svn.chromium.org/blink/trunk@197734 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197716.
TBR=oilpan-reviews
BUG=501896
NOTRY=true

Review URL: https://codereview.chromium.org/1206803002

git-svn-id: svn://svn.chromium.org/blink/trunk@197729 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197705, pt 2.
Missing tracing caught by the awesome clang GC plugin.

R=haraken
BUG=450238
NOTRY=true

Review URL: https://codereview.chromium.org/1206723004

git-svn-id: svn://svn.chromium.org/blink/trunk@197725 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Unflake http/tests/xmlhttprequest/event-listener-gc.html
Using a zero-timeout and timer task to set up the test condition is not
as precise as we would like. Rephrase to use an immediate message
dispatch instead.

R=
BUG=503842

Review URL: https://codereview.chromium.org/1201393003

git-svn-id: svn://svn.chromium.org/blink/trunk@197724 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197705.
TBR=oilpan-reviews
BUG=450238
NOTRY=true

Review URL: https://codereview.chromium.org/1207673002

git-svn-id: svn://svn.chromium.org/blink/trunk@197720 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ingemara
Move LayoutTest Linux distribution detection to PlatformInfo
Also introduce a custom Apache configuration for Arch Linux, which differs
slightly from the Debian configuration.

BUG=502972

Review URL: https://codereview.chromium.org/1201873002

git-svn-id: svn://svn.chromium.org/blink/trunk@197714 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Prevent scientific notation in LayoutUnit gdb prettyprinter.
Prevent this by increasing precision on the %g format specifier. Now we can see
full values like 33554431.984375px, instead of having them crippled like
3.35544e+07px.

R=cbiesinger@chromium.org,dpranke@chromium.org

Review URL: https://codereview.chromium.org/1202773002

git-svn-id: svn://svn.chromium.org/blink/trunk@197682 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: enable appcache + move DocumentLoader to the heap.
DocumentLoader belongs on the heap. References to it
are kept by an object that is on the heap (FrameLoader),
and DocumentLoader itself has heap references.

Along with moving DocumentLoader, have the two appcache
objects (ApplicationCache and ApplicationCacheHost) be
under Oilpan's control always.

R=haraken
BUG=340522,497595

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197576

Review URL: https://codereview.chromium.org/1194003004

git-svn-id: svn://svn.chromium.org/blink/trunk@197664 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: promptly finalize remaining SuspendableTimers.
DOMWindowEventQueue and PostMessageTimer also need to promptly
stop their timer upon being deemed garbage.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1205573002

git-svn-id: svn://svn.chromium.org/blink/trunk@197659 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Deflake fast/html/imports/import-expando-gc.html
If a minor GC fails to identify the wrapper for the import document as
reachable, it'll be collected. Make sure that this will not happen by way
of a 'global' root.

R=haraken
BUG=503583
NOTRY=true

Review URL: https://codereview.chromium.org/1200643004

git-svn-id: svn://svn.chromium.org/blink/trunk@197655 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: make custom element microtask dispatching lazy sweep savvy.
When microtask tasks are dispatched, the objects they work over might
be in the process of finalizing. Check before initiating the dispatch.

R=haraken
BUG=502855

Review URL: https://codereview.chromium.org/1206503003

git-svn-id: svn://svn.chromium.org/blink/trunk@197646 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: make SuspendableScriptExecutor safe.
This ActiveDOMObject was missing two pieces:

 - remove itself as an Observer upon completion.
 - promptly stop itself as a timer upon finalization.

R=haraken
BUG=502858

Review URL: https://codereview.chromium.org/1197163003

git-svn-id: svn://svn.chromium.org/blink/trunk@197644 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Get rid of old flow thread comments and asserts in accumulateOffsetTowardsAncestor().
R=chrishtr@chromium.org

Review URL: https://codereview.chromium.org/1198273003.

git-svn-id: svn://svn.chromium.org/blink/trunk@197641 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: eagerly finalize SVGFEImageElement as an ImageResourceClient.
R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1197283006

git-svn-id: svn://svn.chromium.org/blink/trunk@197638 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: eagerly finalize CSSCrossfadeValue.
R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1201983003

git-svn-id: svn://svn.chromium.org/blink/trunk@197633 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have media element prefinalizer handle all finalization.
It is unsafe to access a to-be-finalized object, which is a
possibility for media elements with lazy sweeping enabled.
The access in that case being made by the embedder media
player updating and notifying the media element.

Prevent that from happening by promptly/eagerly releasing
the player object.

With prefinalizers now being able to allocate, extend r197339 and
finalize the media player and perform the other Oilpan finalization
steps during media element prefinalization.

R=haraken
BUG=502863

Review URL: https://codereview.chromium.org/1193383002

git-svn-id: svn://svn.chromium.org/blink/trunk@197628 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Apply outline-offset on all edges (not just top/left)
In InlinePainter::paintOutlineForLine, the "outline rectangles" are
formed by expanding and shifting by outline-offset. This however only
result in an offset of the outline on the top and left sides.
Rewrite the code to use an inflate() operation instead, so that all
four edges are affected by the offset.
The spec describes the effect of the 'outline-offset' property as:

  "If the computed value of outline-offset is anything other than 0,
   then the outline is outset from the border edge by that amount."
  "Negative values must cause the outline to shrink into the border
   box."

(http://dev.w3.org/csswg/css-ui-3/#outline-offset)

This is also what ObjectPainter::paintOutline does.

This makes us match Gecko more closely rendering-wise.

TEST=fast/inline/outline-offset.html (S.P. strict cull rect)
BUG=495368

Review URL: https://codereview.chromium.org/1201753003

git-svn-id: svn://svn.chromium.org/blink/trunk@197589 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: enable appcache + move DocumentLoader to the heap.
DocumentLoader belongs on the heap. References to it
are kept by an object that is on the heap (FrameLoader),
and DocumentLoader itself has heap references.

Along with moving DocumentLoader, have the two appcache
objects (ApplicationCache and ApplicationCacheHost) be
under Oilpan's control always.

R=haraken
BUG=340522,497595

Review URL: https://codereview.chromium.org/1194003004

git-svn-id: svn://svn.chromium.org/blink/trunk@197576 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197563.
TBR=oilpan-reviews
BUG=275851
NOTRY=true

Review URL: https://codereview.chromium.org/1195963005

git-svn-id: svn://svn.chromium.org/blink/trunk@197571 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Measure the impact of a propsed change to createAttribute()
There is a proposal to lowercase name in HTML documents:
https://bugzilla.mozilla.org/show_bug.cgi?id=1165851#c34

The counter in Document::createAttribute will catch any case where the
change would be observable, providing an upper limit to the risk.

The counter in Element::setAttributeNode is a reasonable proxy for the
case which is most likely problematic, namely trying to set a camelCase
Attr created by an HTML document on a non-HTML element, likely SVG, as
suggested by Boris Zbarsky:
https://bugzilla.mozilla.org/show_bug.cgi?id=1175031#c5

(The source of the Attr object need not be createAttribute, but extra
bookkeeping to determine that would either increase sizeof(Attr) or
require a new NodeFlags entry, so don't do that for now.)

BUG=502301

Review URL: https://codereview.chromium.org/1195583002

git-svn-id: svn://svn.chromium.org/blink/trunk@197549 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove unused FS callback partial specializations.
Retire unused transition type specializations of scheduleCallback() and
handleEventOrScheduleCallback().

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1194093002

git-svn-id: svn://svn.chromium.org/blink/trunk@197530 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: keep StashedPortCollection always on the heap.
Have StashedPortCollection derive from RefCountedGarbageCollected, allowing
this EventTarget to reside on the heap irrespective of ENABLE(OILPAN).

R=haraken
BUG=497595

Review URL: https://codereview.chromium.org/1197763002

git-svn-id: svn://svn.chromium.org/blink/trunk@197529 bbb929c8-8fbe-4397-9dbb-9b2b20218538
landell
Use single and correct URL to flot library homepage
BUG=501810

Review URL: https://codereview.chromium.org/1191103002

Cr-Commit-Position: refs/heads/master@{#335378}
sigbjornf
Have ScreenOrientationController use a timer for async event dispatch again
Essentially revert r193927's switch to using a task to queue handling of
change event dispatch for ScreenOrientationController. Queuing a task
via the execution context / Document is unsafe for this controller object
as its lifetime is that of its frame. Should the frame be detached and
finalized while the Document remains alive, the queued task risks accessing
a freed ScreenOrientationController upon running.

Go back to using a one-shot timer; as these are now task based, the
original motivation for r193927 has additionally fallen away (wean Blink
off from using one-shot shared timers.)

R=mlamouri
BUG=501888

Review URL: https://codereview.chromium.org/1190293002

git-svn-id: svn://svn.chromium.org/blink/trunk@197466 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
ifdef out ProcessUtilTest.CloneFlags on linux with old kernel headers
This allows the rest of base_unittests to build/run on such
systems.

BUG=312380

Review URL: https://codereview.chromium.org/1189683004

Cr-Commit-Position: refs/heads/master@{#335123}
sigbjornf
Move paint invalidation up into HTMLMediaElement::clearMediaPlayer().
To avoid (Oilpan) finalization order issues, reposition r197301's paint
invalidation of media elements. Instead of triggering it as part of the
destruction of the media element's media player client object, have the
media element handle it on its own while initiating the destruction of
the media player (and more) in clearMediaPlayer(). A simpler arrangement.

R=haraken,chrishtr
BUG=497614

Review URL: https://codereview.chromium.org/1186853004

git-svn-id: svn://svn.chromium.org/blink/trunk@197395 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Avoid stretching the parent of a column spanner.
We used to stretch the parent of a spanner, so that it would take up all
remaining space in the last column, to make sure that column content after the
spanner wouldn't bleed into the column preceding the spanner.

This stretching (a kludge, really) was problematic, especially if the parent
had fixed height, which would override the stretching. This would lead to
broken layout, and even assertion failures.

Instead, deal with the fact that the last column may be shorter than the
others. We don't want this for paged overflow, though, or it'd be impossible to
scroll the last page completely into view.

BUG=499706
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1181483005

git-svn-id: svn://svn.chromium.org/blink/trunk@197392 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Make mapLocalToContainer() work properly for content that follows a column spanner.
mapLocalToContainer() uses offsetFromContainer(), which uses columnOffset()
(which calls flowThreadTranslationAtOffset()), which didn't always return the
correct translation relatively to the flow thread.

This also improves the fix for bug 479155.
MultiColumnFragmentainerGroup::flowThreadTranslationAtOffset() needs to return
a translation relative to the flow thread, and the code we had basically just
happened to work by accident (flipping a flow thread portion rectangle for
writing mode around a column set is just bogus, since a column set isn't
sized in the flow thread coordinate space). This solution would cause problems
with the upcoming fix for bug 499706, because then the last column may be
shorter than the others (because it's not completely filled).

BUG=501772
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1190153002

git-svn-id: svn://svn.chromium.org/blink/trunk@197373 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: add prefinalizer for HTMLMediaElement.
A prefinalizer is needed for the media element for the case where it is
finalized in the same GC as its execution context (Document.) The
interaction between the media element and the Document to synchronize
load event handling can only safely be done prior to either is swept
out and finalized.

R=
BUG=500352

Review URL: https://codereview.chromium.org/1184373006

git-svn-id: svn://svn.chromium.org/blink/trunk@197339 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jmanko
Add missing null-check in OverscrollControllerAndroid::Animate()
Without it, there's a crash when running with
disable-overscroll-edge-effect switch.

BUG=501472

Review URL: https://codereview.chromium.org/1195453003

Cr-Commit-Position: refs/heads/master@{#334897}
philipj
Measure usage of FormData.append(name, blob, filename)
As requested by Anne van Kesteren:
https://bugzilla.mozilla.org/show_bug.cgi?id=1162658#c47

Per spec the blob argument cannot be null, but in Blink it can without
[TypeChecking=Interface], for FormData.append(name, null, filename).
(With no filename argument it is instead taken as the USVString "null".)
This is almost certainly safe to fix, but it's easy to measure here.

BUG=498790

Review URL: https://codereview.chromium.org/1174973003

git-svn-id: svn://svn.chromium.org/blink/trunk@197268 bbb929c8-8fbe-4397-9dbb-9b2b20218538
landell
Reland: Window.postMessage() to self can cause document leaks
When a script does Window.postMessage() a PostMessageTimer object is
stored in the LocalDOMWindow until the message has been delivered, or
until it is cleared in the destructor of LocalDOMWindow. When a
LocalDOMWindow is reset the remaining messages will not be
delivered. Any PostMessageTimer objects alive at that point will be kept
until the LocalDOMWindow is destroyed. Unfortunately, the
PostMessageTimer objects keeps a reference to the source window. If both
the source and destination window of the message is the same, the
PostMessageTimer can keep that LocalDOMWindow from getting destroyed.

Removing the PostMessageTimers when stop() is invoked fixes the problem.

BUG=500821,499692

Review URL: https://codereview.chromium.org/1186093003

git-svn-id: svn://svn.chromium.org/blink/trunk@197252 bbb929c8-8fbe-4397-9dbb-9b2b20218538
christiank
Add glCopyCompressedTextureCHROMIUM
This CL adds a GPU command for copying compressed textures. It's
based on glCopyTextureCHROMIUM, but modified for use on
compressed textures. It only supports GLImage-based copying.

BUG=434699

Review URL: https://codereview.chromium.org/1119723003

Cr-Commit-Position: refs/heads/master@{#334810}
sigbjornf
Oilpan: adjust GC policy under memory pressure (only.)
When notified of a v8 major GC, check if we're under memory pressure and
overdue an Oilpan GC & urgently. If so, force a conservative GC right
away.

This addresses dom-modify.html OOM troubles on win32, in particular. It
runs into the allocation pattern where the Oilpan allocator is able to
handle a tight loop just allocating Text nodes by bump allocating each
such node. Each Text node has a large external string allocation however,
which leads to a steep ramp-upin overall allocation amounts to the point
where it might OOM as no Oilpan GCs will run. v8 will however notice the
increasing memory pressure and schedule major GCs of its own.

Oilpan is notified after each v8 major GC, so use that opportunity to
check for memory pressure & force an Oilpan GC right away.

R=haraken
BUG=474470

Review URL: https://codereview.chromium.org/1190513006

git-svn-id: svn://svn.chromium.org/blink/trunk@197245 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mharanczyk
Change root bounds in RenderWidgetHostViewAuraTest.ParentMovementUpdatesScreenRect
test to avoid initializing portrait mode static primary rotation and cause test
failures on memory waterfall.

It turns out that on normal run each test is run separately, but on
memory waterfall they are run in such a way  (in one process in bulk?)
that if previous test sets up some static values they are preserved
for all consecutive tests, creating hidden dependency between them.
In this case values of primary portrait and landscape angles that are in
RenderWidgetHostViewBase::GetOrientationTypeForDesktop are preserved
between tests and primary_portrait_angle was set up to unexpected value (0)
by test I've added, which broke RenderWidgetHostViewBaseTest.OrientationTypeForDesktop
which expected to set those up by itself and test it.

BUG=499914, 500011

Review URL: https://codereview.chromium.org/1186843002

Cr-Commit-Position: refs/heads/master@{#334792}
sigbjornf
Oilpan: tidy up after r197233.
TBR=oilpan-reviews
BUG=398920
NOTRY=true

Review URL: https://codereview.chromium.org/1176183003

git-svn-id: svn://svn.chromium.org/blink/trunk@197241 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Promptly finalize CacheStorage's embedder object.
The lifetime of the global object's CacheStorage is that of the global
object, so when it is destructed/finalized, the CacheStorage must
release its embedder object at the same. This so as to prevent the
embedder calling into Blink after it has shut down or when it is in
the process of finalizing and lazily sweeping out its Oilpan heap.

R=haraken,jsbell@chromium.org
BUG=500355

Review URL: https://codereview.chromium.org/1183373006

git-svn-id: svn://svn.chromium.org/blink/trunk@197236 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Avoid resetting rule features when removing style-less shadow.
We reset the global rule features when removing a shadow root from the
tree. There is no reason to do that if the scope does not contain style,
so we'll skip the reset when there is no ScopedStyleResolver.

In particular, this can be the case for UA shadow roots. For the case
where the scope contains style, this will be fixed by componentized style
resolving.

What occurs in issue 499349 is:

1. Remove a form child which is an input with a UA shadow root.
2. Removing the root causes rule features to be reset globally.
3. Removing an input child of a form requires a validity check.
4. The validity check schedules an invalidation for :valid etc.
5. Scheduling invalidation sets require an up-to-date rule feature set
   which includes invalidation sets, so the rule features are collected.

1-5 is repeated for each removed input. The global feature collection in
step 5 is the expensive part here.

R=tkent@chromium.org,esprehn@chromium.org
BUG=499349

Review URL: https://codereview.chromium.org/1185423004

git-svn-id: svn://svn.chromium.org/blink/trunk@197204 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
No need for both isLayoutBoxModelObject() and isBoxModelObject().
They answer the exact same question.
Deleted one and kept the most popular one (isBoxModelObject()).

R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1187033004

git-svn-id: svn://svn.chromium.org/blink/trunk@197197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Empty LayoutObject::pushMappingToContainer(). Assert that not reached.
This code seems unreachable.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/1183393003

git-svn-id: svn://svn.chromium.org/blink/trunk@197194 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Return ints from border{Before,After,Start,End}Width
The users of these functions in LayoutBoxModelObject already returns
ints and the functions they wrap also returns int.

BUG=496033

Review URL: https://codereview.chromium.org/1183163002

git-svn-id: svn://svn.chromium.org/blink/trunk@197161 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Return int from outlineWidth() and outlineSize()
The underlying storage is an int and it's usually used together with
plain ints.

BUG=496033

Review URL: https://codereview.chromium.org/1185753005

git-svn-id: svn://svn.chromium.org/blink/trunk@197159 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197129.
TBR=oilpan-reviews
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/1186823005

git-svn-id: svn://svn.chromium.org/blink/trunk@197136 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
replace VLOG with DVLOG in content/browser/loader/resource_loader.cc
VLOG() has a high overhead due to pattern matching. One of the major culprits
is in content/browser/loader/resource_loader.cc

BUG=489818,489441
R=sque,mmenke

Review URL: https://codereview.chromium.org/1174173013

Cr-Commit-Position: refs/heads/master@{#334388}
sigbjornf
Revert of Oilpan: adjust GC policy under memory pressure. (patchset #4 id:60001 of https://codereview.chromium.org/1174123002/)
Reason for revert:
Plausible candidate for regressing v8 GC totals on v8.top_25_smooth somewhat,

 https://code.google.com/p/chromium/issues/detail?id=499822

Original issue's description:
> Oilpan: adjust GC policy under memory pressure.
> 
> When notified of a v8 major GC, check if we're under memory pressure and
> overdue an Oilpan GC & urgently. If so, force a conservative GC right
> away.
> 
> This addresses dom-modify.html OOM troubles on win32, in particular. It
> runs into the allocation pattern where the Oilpan allocator is able to
> handle a tight loop just allocating Text nodes by bump allocating each
> such node. Each Text node has a large external string allocation however,
> which leads to a steep ramp-upin overall allocation amounts to the point
> where it might OOM as no Oilpan GCs will run. v8 will however notice the
> increasing memory pressure and schedule major GCs of its own.
> 
> Oilpan is notified after each v8 major GC, so use that opportunity to
> check for memory pressure & force an Oilpan GC right away.
> 
> R=haraken
> BUG=420515
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=196953

TBR=haraken@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=420515

Review URL: https://codereview.chromium.org/1191483002

git-svn-id: svn://svn.chromium.org/blink/trunk@197114 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Use plain int for borders widths when possible
Chromium coding style (not overridden by Blink's in this case)
states:

  Do not use unsigned types to mean "this value should never be < 0".

The BorderValue width storage is currently 26 bits wide so it's easily
contained in a plain int.

No functional change expected.

BUG=496033

Review URL: https://codereview.chromium.org/1182053003

git-svn-id: svn://svn.chromium.org/blink/trunk@197111 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync worker interfaces with the HTML spec
Also include ApplicationCache because of the SharedWorker connection.

There are no changes to the generated code other than order.

BUG=460722

Review URL: https://codereview.chromium.org/1185043005

git-svn-id: svn://svn.chromium.org/blink/trunk@197103 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Remove redundant enable_media_router assignment
It's declared in declare_args() section already.

BUG=

Review URL: https://codereview.chromium.org/1186503002

Cr-Commit-Position: refs/heads/master@{#334363}
sigbjornf
Introduce (Heap)Vector trait covering zero'ed memory for unused slots.
When a slot/index in a heap vector's backing storage is marked as unused,
its value must be cleared out. This so as to prevent later GC tracing or
finalization of the backing storage from incorrectly interpreting those
bits. The heap vector handles such unused slots by zero-ing out the block
of memory it maps to; if that zero'ed block of memory doesn't represent
a valid instance of a class type, it cannot be used in heap vectors.

Introduce a vector trait controlling if a memset()-zero'ed slot represents
a valid value for the Oilpan GC infrastructure to interpret when tracing
and finalizing that value. It is needed for the class types where the
default constructor maps to a representation that isn't all zero, but
that zero'ed representation is still valid for the Oilpan GC to interpret.

R=haraken,tkent
BUG=420515

Review URL: https://codereview.chromium.org/1180383002

git-svn-id: svn://svn.chromium.org/blink/trunk@197100 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r197063, move HitTestCache to the heap.
Follow up r197063 and make HitTestCache compatible with Oilpan.

R=haraken
BUG=398920

Review URL: https://codereview.chromium.org/1185923002

git-svn-id: svn://svn.chromium.org/blink/trunk@197095 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove WebMediaPlayerClient::requestFullscreen()
This was used for a while and then removed again:
https://codereview.chromium.org/41123002
https://codereview.chromium.org/1021723003

BUG=496627

Review URL: https://codereview.chromium.org/1157253010

git-svn-id: svn://svn.chromium.org/blink/trunk@197089 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add <stdarg.h> include required for va_start/va_end in GCC
https://codereview.chromium.org/1181713004 removed some base/port.h
includes, which in turn includes <stdarg.h>. This include is needed
to compile with GCC, at least on some systems.

BUG=138542

Review URL: https://codereview.chromium.org/1185683002

git-svn-id: svn://svn.chromium.org/blink/trunk@197088 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Add out-of-flow descendants of spanners to their containing blocks in time.
A column spanner isn't laid out as a normal child in the flow thread, since the
flow thread isn't a containing block for spanners. However, out-of-flow
descendants of a spanner may have their containing blocks somewhere outside the
spanner but inside the flow thread, and those have to be laid out as part of
flow thread layout (layoutPositionedObjects() on their containing block).

Therefore we have to add such out-of-flow objects to their respective
containing blocks when skipping spanners, or they'll never get laid out.

We also have to bail from updateBlockChildDirtyBitsBeforeLayout() for
out-of-flow objects, so that they don't get marked when laying out the spanner.
They may already have been laid out at that point (as part of flow thread
layout), in which case we'll never get back to laying them out again if marked
(since we're way past that point in the tree). In any case, it's a pretty
useless thing to mark out-of-flow objects for layout here, since we by doing
that would kind of be assuming that the out-of-flow child has its parent as its
containing block (which may be true, by all means, but not something that
should be taken for granted).

Added a reftest that would assert and probably fail visually too without this
fix.

BUG=498770
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1181693004

git-svn-id: svn://svn.chromium.org/blink/trunk@197071 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Measure SVGSVGElement.useCurrentView/currentView
By request from Olli Pettay on #whatwg

Review URL: https://codereview.chromium.org/1180903005

git-svn-id: svn://svn.chromium.org/blink/trunk@197070 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add <stdarg.h> include required for va_start/va_end in GCC
https://codereview.chromium.org/1181713004 removed some base/port.h
includes, which in turn includes <stdarg.h>. This include is needed
to compile with GCC, at least on some systems.

BUG=138542
NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1177213003

Cr-Commit-Position: refs/heads/master@{#334260}
rogerj
Fix leak of PlatformHandleDispatchers in Mojo IPC
PassWrappedPlatformHandle does not close the MojoHandle.
The destructor of ScopedHandleBase will however close it.
The problem with this code was that it called release()
on the ScopedHandle, preventing the destructor from being
called, and thus also the MojoHandle from being closed.

This leaves the PlatformHandleDispatcher associated with
the MojoHandle alive in mojo::system::Core::handle_table_

By calling reset() instead the MojoHandle is closed, and
the leak is fixed.

R=morrita@chromium.org, viettrungluu@chromium.org, agl@chromium.org

BUG=None

Review URL: https://codereview.chromium.org/1174423002

Cr-Commit-Position: refs/heads/master@{#334197}
sigbjornf
Oilpan: fix build after r197039.
CSSFontSelectorClient now needs to a GC mixin.

TBR=oilpan-reviews
BUG=481515
NOTRY=true

Review URL: https://codereview.chromium.org/1186543002

git-svn-id: svn://svn.chromium.org/blink/trunk@197044 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Document and measure the TextEvent interface and the textinput event
BUG=460722

Review URL: https://codereview.chromium.org/1184493002

git-svn-id: svn://svn.chromium.org/blink/trunk@197042 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Correct fast/multicol/vertical-rl/image-inside-nested-blocks-with-border.html
We have a float at the beginning of the second column. The test wanted the
float to have its left edge flush with the left edge of the multicol container,
but this is vertical-rl writing mode, so it will instead have its right edge
flush with the right edge of the multicol container, since that's where columns
start in the block progression direction. So the test "failed" and was stored
as such in the expectation file. But both the layout engine and the behavior of
getBoundingClientRect were correct all along.

Corrected the test, and removed a bunch of boilerplate and turned it into
something using js-test.js instead. In order to be consistent, I also cleaned
up the vertical-lr and horiontal-tb (default) variants in the same way as well.

R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1173313003

git-svn-id: svn://svn.chromium.org/blink/trunk@197040 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: eagerly finalize MIDIAccess.
MIDIAccess' MIDIAccessor is registered as a callable client of the
embedder's WebMIDIAccessor. It is unsafe to access that client interface
during lazy sweeping, as it might access heap objects that have
been finalized.

Consequently, mark MIDIAccess as eagerly finalized, making it release
its MIDIAccessor before the mutator is allowed heap access after
a GC.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1179143002

git-svn-id: svn://svn.chromium.org/blink/trunk@197038 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: add missing transition type on stack allocated StyleSheetHandler.
R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1185603002

git-svn-id: svn://svn.chromium.org/blink/trunk@197032 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync audio/video/text track-related interfaces with the specs
There are no changes to the generated code other than order and the
added use counters.

BUG=460722

Review URL: https://codereview.chromium.org/1178333002

git-svn-id: svn://svn.chromium.org/blink/trunk@197031 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
GC plugin: enable plugin on anonymous namespaces.
R=haraken
BUG=499738

Review URL: https://codereview.chromium.org/1173333003

Cr-Commit-Position: refs/heads/master@{#334141}
jl
Make arguments to window.{move,resize}{To,By} non-optional
When missing these arguments used to default to "the current value" so
calling the functions without arguments was a no-op. This is not
compatible with other implementations.

In Firefox (35), the arguments are not optional, so calling the functions
with fewer than two arguments throws a TypeError.

In IE (11), the arguments are optional with zero default value.

This patch aligns with Firefox's behavior, and also simplifies the
implementation by not dealing with missing arguments.

BUG=453421

Review URL: https://codereview.chromium.org/886463010

git-svn-id: svn://svn.chromium.org/blink/trunk@197024 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mharanczyk
Correct ENABLE_MEDIA_ROUTER defines to fix compilation without it.
Review URL: https://codereview.chromium.org/1177973005

Cr-Commit-Position: refs/heads/master@{#334134}
philipj
Remove unused code calling WebMediaPlayerClient::requestFullscreen()
This was used for a while and then removed again:
https://codereview.chromium.org/41123002
https://codereview.chromium.org/1021723003

BUG=496627

Review URL: https://codereview.chromium.org/1156273006

Cr-Commit-Position: refs/heads/master@{#334132}
philipj
Sync some HTML interfaces with the spec
There are no changes to the generated code other than naming (ImageData)
and order (MediaController).

BUG=460722

Review URL: https://codereview.chromium.org/1178223004

git-svn-id: svn://svn.chromium.org/blink/trunk@197008 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Use ComputedStyle::outlineOutset in ObjectPainter::outlineBounds
De-dupes one more instance of the outline outset logic.

Review URL: https://codereview.chromium.org/1180713006

git-svn-id: svn://svn.chromium.org/blink/trunk@196965 bbb929c8-8fbe-4397-9dbb-9b2b20218538
wmaslowski
Add possibility to define data callback to BitmapFetcher
BUG=479715

Review URL: https://codereview.chromium.org/1097383005

Cr-Commit-Position: refs/heads/master@{#333962}
mstensho
When looking for adjacent content inside multicols, don't consider inner multicols.
When walking the tree backwards for a suitable object, we need to check that we
didn't end up inside an inner multicol container. Walking forwards is more
trivial (no changes there), but added an assertion that we haven't entered an
inner multicol just in case anyway.

Also added some assertions which will fail if
nextInPreOrderAfterChildrenSkippingOutOfFlow() or
previousInPreOrderSkippingOutOfFlow() misbehave.

Need to check with shouldSkipInsertedOrRemovedChild() before calling those two
functions now, since they are not meant to be called on children that are to be
skipped (especially important for column sets and spanner placeholders, which
should always be skipped).

BUG=498431, 498630
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1180613005

git-svn-id: svn://svn.chromium.org/blink/trunk@196957 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: adjust GC policy under memory pressure.
When notified of a v8 major GC, check if we're under memory pressure and
overdue an Oilpan GC & urgently. If so, force a conservative GC right
away.

This addresses dom-modify.html OOM troubles on win32, in particular. It
runs into the allocation pattern where the Oilpan allocator is able to
handle a tight loop just allocating Text nodes by bump allocating each
such node. Each Text node has a large external string allocation however,
which leads to a steep ramp-upin overall allocation amounts to the point
where it might OOM as no Oilpan GCs will run. v8 will however notice the
increasing memory pressure and schedule major GCs of its own.

Oilpan is notified after each v8 major GC, so use that opportunity to
check for memory pressure & force an Oilpan GC right away.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1174123002

git-svn-id: svn://svn.chromium.org/blink/trunk@196953 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Tidy up CompositorWorkerManager unit tests.
Allow WorkerGlobalScopes to be created without a non-null WorkerClients;
the creation context for the new worker may not offer any 'clients',
hence supplying none (rather than an empty one) is simpler. It also
avoids creating a cross-thread heap object with Oilpan enabled.

To solidify the CompositorWorkerManagerTest's WorkerObjectProxy handling,
provide a test implementation of WorkerObjectProxy which do not forward
any of the notifications out of the worker context, but ignores. All
that is needed for these tests.

R=haraken,kinuko
BUG=436932

Review URL: https://codereview.chromium.org/1164753004

git-svn-id: svn://svn.chromium.org/blink/trunk@196949 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the IDL interfaces in core/frame/ with their many specs
There are no changes to the generated code, other than order, naming and
default argument handling in History.go(), which is unobservable.

The location-stringify.html test depends on the order of the interface
members, so update that to match.

BUG=460722

Review URL: https://codereview.chromium.org/1180653003

git-svn-id: svn://svn.chromium.org/blink/trunk@196947 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Make createAttributeNS's qualifiedName argument non-nullable
Before this change, document.createAttributeNS("foo", null) would throw
"Failed to execute 'createAttributeNS' on 'Document': The qualified name
provided is empty." because the null string was treated as empty.

After this change, document.createAttributeNS("foo", null) will create
an Attr object with localName "null", which matches Firefox and IE.

Usage of this API is extremely low, making the risk equally so:
https://www.chromestatus.com/metrics/feature/timeline/popularity/112

BUG=460722

Review URL: https://codereview.chromium.org/1164123003

git-svn-id: svn://svn.chromium.org/blink/trunk@196940 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r196924.
Return type mismatch uncovered by that CL, not the cause.

TBR=oilpan-reviews
BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/1176993006

git-svn-id: svn://svn.chromium.org/blink/trunk@196931 bbb929c8-8fbe-4397-9dbb-9b2b20218538
landell
Window.postMessage() to self can cause document leaks
When a script does Window.postMessage() a PostMessageTimer object is
stored in the LocalDOMWindow until the message has been delivered, or
until it is cleared in the destructor of LocalDOMWindow. When a
LocalDOMWindow is reset the remaining messages will not be
delivered. Any PostMessageTimer objects alive at that point will be
kept until the LocalDOMWindow is destroyed. Unfortunately, the
PostMessageTimer objects keeps a reference to the source window. If
both the source and destination window of the message is the same, the
PostMessageTimer can keep that LocalDOMWindow from getting destroyed.

Removing the PostMessageTimers when stop() is invoked fixes the problem.

BUG=

Review URL: https://codereview.chromium.org/1148133005

git-svn-id: svn://svn.chromium.org/blink/trunk@196930 bbb929c8-8fbe-4397-9dbb-9b2b20218538
haavardm
Use net's response header parser for parsing multipart headers.
BUG=493379

Review URL: https://codereview.chromium.org/1166953002

Cr-Commit-Position: refs/heads/master@{#333909}
philipj
Document the tracking bugs of some IDL FIXMEs
NOTRY=true

Review URL: https://codereview.chromium.org/1175783002

git-svn-id: svn://svn.chromium.org/blink/trunk@196902 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: revert back to a prefinalizer for LocalDOMWindow.
As LocalDOMWindow may end up being accessed by eagerly finalized objects
from their destructors, fall back to using a prefinalizer for it so as
to avoid illegal, cross-object access amongst eagerly finalized objects.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1166163003

git-svn-id: svn://svn.chromium.org/blink/trunk@196890 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Use visual overflow rect as cull rect for table-cell box-decorations
The TableCellPainter::paintRect helper defines a border rect, so can't
be used as the cull rect. Use the visual overflow rect instead.

TEST=fast/box-shadow/basic-shadows.html (S.P. strict cull rect)
BUG=498549

Review URL: https://codereview.chromium.org/1178553002

git-svn-id: svn://svn.chromium.org/blink/trunk@196887 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Add helper for computing outset for 'outline'
De-duplicates code from InlinePainter and SVGLayoutSupport.

Review URL: https://codereview.chromium.org/1165393005

git-svn-id: svn://svn.chromium.org/blink/trunk@196880 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mharanczyk
Report new screen position to renderer when ancestor window moves.
This change is related to https://codereview.chromium.org/1062273002/.
Without it renderer can draw controls (dropdowns, etc.) out of place,
because it will have outdated screen coordinates.

BUG=469857, 468669

Review URL: https://codereview.chromium.org/1143323009

Cr-Commit-Position: refs/heads/master@{#333749}
mstensho
Mark column sets as invalid and kill the interval tree when column sets are removed.
This makes the multicol code more fault-tolerant.

If there are bugs somewhere in the engine that cause us to miss layout of
objects marked for layout, the multicol code could return dead objects from the
column set interval tree. Better just delete the interval tree right away when
column sets are removed, instead of keeping dead objects around. The tree will
be rebuilt during layout.

To clarify: This CL doesn't really fix bug 498664, but at least we won't crash
because of accessing dead objects anymore (only assert in
LayoutObject::assertLaidOut() and other places, like before).

BUG=498664
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1163423007

git-svn-id: svn://svn.chromium.org/blink/trunk@196876 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix unit tests bugs unmasked by r196836.
R=haraken
BUG=498604
NOTRY=true

Review URL: https://codereview.chromium.org/1168103003

git-svn-id: svn://svn.chromium.org/blink/trunk@196851 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: correctly define transition macro for eager finalization.
EAGERLY_FINALIZE_WILL_BE_REMOVED() needs to provide eager finalization
outside of ENABLE(OILPAN), but only if lazy sweeping is enabled.

R=haraken
BUG=420522

Review URL: https://codereview.chromium.org/1170273002

git-svn-id: svn://svn.chromium.org/blink/trunk@196848 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Add //content:browser dependency on //ppapi:host
content::BrowserPpapiHostImpl references ppapi::host::PpapiHost but dependency in missing in gn.

BUG=

Review URL: https://codereview.chromium.org/1173583002

Cr-Commit-Position: refs/heads/master@{#333699}
mostynb
remove unneeded xdisplaycheck dep in base_unittests_run
This previous CL added an xdisplaycheck dep to base_unittests_run, but
base_unittests does not appear to depend on any X libraries as far as I
can tell:
https://codereview.chromium.org/388843004

Let's see if we can remove this dependency.

Review URL: https://codereview.chromium.org/1171073002

Cr-Commit-Position: refs/heads/master@{#333566}
philipj
Deprecate the allowfullscreen exemption for <video>
BUG=496637

Review URL: https://codereview.chromium.org/1165013002

git-svn-id: svn://svn.chromium.org/blink/trunk@196797 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Need deeper layout passes inside flexboxes when fragmenting (pagination, multicol).
When the fragmentainer (page / column) boundaries have changed, we need to go
deep when laying out. Objects otherwise not marked for layout may still need
layout.

We already do this for regular blocks and when inside tables, but it was
missing for flexbox. Adding this both improves rendering of multicol with
flexbox and gets rid of an assertion failure.

BUG=497981
R=cbiesinger@chromium.org,dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1167323003

git-svn-id: svn://svn.chromium.org/blink/trunk@196795 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
increase crypto_unittest key sizes to satisfy NSS 3.19.1
NSS version 3.19.1 added minimum key size constraints to avoid the Logjam attack:

> The minimum size of keys that NSS will generate has been raised:
>    The minimum modulus size for RSA keys is now 512 bits
>    The minimum modulus size for DSA keys is now 1023 bits
>    The minimum modulus size for Diffie-Hellman keys is now 1023 bits

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_3.19.1_release_notes

https://bugzilla.mozilla.org/show_bug.cgi?id=1138554

BUG=490240

Review URL: https://codereview.chromium.org/1148193006

Cr-Commit-Position: refs/heads/master@{#333554}
mostynb
remove crypto_unittests_run's uneeded xdisplaycheck dep
The crypto_unittests_run target has an incomplete and
unnecessary dependency on xdisplaycheck- let's remove
this dependency.

Review URL: https://codereview.chromium.org/1168393007

Cr-Commit-Position: refs/heads/master@{#333546}
mostynb
add missing zlib dep after CL 1148633007
This previous CL included our patched version of zlib.h, but forgot to add
the dependency in gyp/gn, making it possible to compile with the locally
patched version and link with a system version (which will fail due to
unresolved MOZ_Z_* symbols):
https://codereview.chromium.org/1148633007

BUG=466769

Review URL: https://codereview.chromium.org/1174503002

Cr-Commit-Position: refs/heads/master@{#333510}
mstensho
Have LayoutObject::decoratedName() decorate for multicol spanners.
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1171673002

git-svn-id: svn://svn.chromium.org/blink/trunk@196763 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r196753.
TBR=oilpan-reviews
BUG=490713
NOTRY=true

Review URL: https://codereview.chromium.org/1172613003

git-svn-id: svn://svn.chromium.org/blink/trunk@196758 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Use the container() chain when locating the containing flow thread.
Using containingBlock() caused us to miss relatively positioned inlines (that
serve as containing blocks for absolutely positioned descendants), and, more
dangerously (this bug), we'd miss absolutely positioned non-LayoutBlock
ancestors, causing us to find the ancestral flow thread, even though we were
not contained by it. This would in turn make us assume that the multicol
container had column content, which in turn would make us just blindly assume
that there was a column set object there.

A video element establishes a shadow DOM, and if the video was absolutely
positioned, the elements in there would erroneously find the flow thread,
because we skipped the absolutely positioned ancestral video, because it is
not a LayoutBlock.

While bug 496421 is listed as one of the bugs fixed here, it should be pointed
out that the fix is rather speculative in that regard, since since it's fixing
different but rather related crash than the one in the original report. The
crash was triggered by the same TC, though.

BUG=496421,497524,497435
R=dsinclair@chromium.org,esprehn@chromium.org

Review URL: https://codereview.chromium.org/1156303012

git-svn-id: svn://svn.chromium.org/blink/trunk@196745 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mathiash
Don't allow text selection to start on a HTMLMediaElement
BUG=449146

Review URL: https://codereview.chromium.org/838003005

git-svn-id: svn://svn.chromium.org/blink/trunk@196741 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Improve outline bounds estimation in InlinePainter
Use LayoutInline::linesVisualOverflowBoundingBox to get bounds that
includes the outline of the inline.

TEST=fast/css/focus-ring-outline-color.html (S.P. strict cull rect)
BUG=495368

Review URL: https://codereview.chromium.org/1163913002

git-svn-id: svn://svn.chromium.org/blink/trunk@196722 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: constrain run-time verification of eager finalization.
Do not verify eager finalization of a class outside of ENABLE(OILPAN),
as some of the classes marked as eagerly finalizing will not be on the
Oilpan heap with !ENABLE(OILPAN).

R=
BUG=491488

Review URL: https://codereview.chromium.org/1167263002

git-svn-id: svn://svn.chromium.org/blink/trunk@196718 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Don't let anonymous boxes impede percentage resolution on children.
We already had code in place to do this for certain anonymous box types, most
prominently multicol flow threads. But no type of anonymous box should really
mess up percentage resolution on children. It's just wrong, and in this case it
even caused assertion failures, because anonymous ruby run boxes could end up
being marked as percentage height parents. Since what child belongs inside what
ruby run may change depending on where the ruby texts are inserted, and we have
no code to adjust the percentage height map when percentage height children get
moved from one ruby run to another (and so far there's nothing that suggests
that we really need it either), let's just avoid the whole problem by skipping
ruby runs when resolving percentage heights - with the bonus effect that
percentage-height children of ruby elements actually get rendered properly.

Some cleanup was natural at the same time, since we now bail early for
any type of anonymous box in skipContainingBlockForPercentHeightCalculation().

BUG=490722
R=leviw@chromium.org

Review URL: https://codereview.chromium.org/1171703002

git-svn-id: svn://svn.chromium.org/blink/trunk@196713 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fix cull rect computation for SVG{Container,Image,Shape}Painter outlines
TEST=svg/custom/transformed-outlines.svg (S.P. strict cull rect)
BUG=495368

Review URL: https://codereview.chromium.org/1160643004

git-svn-id: svn://svn.chromium.org/blink/trunk@196704 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't double-inflate visual overflow rect for LayoutInlines
linesVisualOverflowBoundingBox() already includes overflow from outlines
for the line (flow) boxes. Inflating with the outline again in
LayoutInline::clippedOverflowRect would mean doing it twice, and yield a
larger paint invalidation rect than required.

BUG=495368

Review URL: https://codereview.chromium.org/1164533005

git-svn-id: svn://svn.chromium.org/blink/trunk@196697 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Be sure to skip objects inside out-of-flow subtrees.
When walking the tree backwards, looking for something in-flow, we may end up
in an out-flow-subtree, so we cannot just examine the positioning scheme on the
object itself.

BUG=497710
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1149923009

git-svn-id: svn://svn.chromium.org/blink/trunk@196685 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Apply vector-effect transform to path geometry - not stroke geometry
When drawing line caps for zero-length subpaths, the path-derived
geometry is the position of the linecap, and not the generated shape.
Hence the non-scaling-stroke transform should be applied to the position
where the line cap shape should be drawn, and no the shape itself.
This also means that we can simplify the code, by calling drawRect/Oval
directly instead of going through a Path object.

BUG=497498

Review URL: https://codereview.chromium.org/1143313007

git-svn-id: svn://svn.chromium.org/blink/trunk@196684 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
An object may become a column spanner or cease to be one even if column-span doesn't change.
If something with column-span:all becomes floated or out-of-flow
positioned, it ceases to be a spanner. And conversely, if something
with column-span:all is floated or out-of-flow positioned, and later
on becomes non-floated in-flow, it becomes a spanner.

Since we need to cope with such situations, there's no point in
forcing a layout object reattach when the value of column-span
changes, so removed that check.

BUG=497195
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1162253006

git-svn-id: svn://svn.chromium.org/blink/trunk@196679 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Make Timer and CancellableTaskFactory embeddeable in lazily swept objects.
As CancellableTaskFactory is a part object, it might be part of an
object that's on the Oilpan heap. TimerBase's task factory being the
main example.

With ASan and Oilpan, heap objects will be poisoned prior to the Oilpan
GC sweep stage. Hence, should a cancellable task be attempted run while
the owning object is poisoned, poisoned memory will be accessed. Allow
such accesses by explicitly unpoisoning the object first. This is
considered acceptable as the memory region is within a larger object
that still is poisoned, hence ASan will continue to be effective.

For Timer, reposition its is-alive check over the object so as to make
it compatible with the timer tasks that now are run.

R=haraken
BUG=482388

Review URL: https://codereview.chromium.org/1171463006

git-svn-id: svn://svn.chromium.org/blink/trunk@196674 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Shorten flowThreadDescendantWasInserted() and flowThreadDescendantWillBeRemoved().
Offload work to createAndInsertSpannerPlaceholder() and destroySpannerPlaceholder().

No functional changes; just cleanup.

R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1152723010

git-svn-id: svn://svn.chromium.org/blink/trunk@196672 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Force display:none for audio elements with no controls attribute
In label-contains-other-interactive-content.html there is an audio
element which is clicked twice, first without the controls attribute and
then again after adding it.

When there is no controls attribute the element doesn't have a layout
object, so that amounted to clicking at (0,0). Due to the bug addressed
here, adding the controls attribute also didn't cause the layout object
to be created when it should, so the second click was also at (0,0).

These two clicks add up to a double click, triggering a selection in the
page. This is the cause of the test failure in a seemingly unrelated
change: https://codereview.chromium.org/838003005/

Change label-contains-other-interactive-content.html to not (fail to)
click on the audio element with no controls attribute, as it's far from
obvious that clickElement(element) will click (0,0) instead.

BUG=497120

Review URL: https://codereview.chromium.org/1166743004

git-svn-id: svn://svn.chromium.org/blink/trunk@196671 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Revert of Remove the allowfullscreen exemption for the video-specific fullscreen API (patchset #4 id:60001 of https://codereview.chromium.org/1058783006/)
Feedback from Vimeo on blink-dev asking for more time:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/3NukIuOaU4c/MPyuWoDaz8AJ

New plan for removing the allowfullscreen exemption:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/3NukIuOaU4c/LWeJeKYvf1MJ

Original issue's description:
> Remove the allowfullscreen exemption for the video-specific fullscreen API
> 
> Intent to Remove:
> https://groups.google.com/a/chromium.org/d/msg/blink-dev/3NukIuOaU4c/Boab2WxzhBYJ
> 
> Prompted by a question from Ali Alabbas (Microsoft) on blink-dev:
> https://groups.google.com/a/chromium.org/d/msg/blink-dev/f-V2GWatXkA/nvdHJ3xihMkJ
> 
> TEST=LayoutTests/media/video-controls-fullscreen-iframe.html
> 
> This test ensures that the allowfullscreen attribute is still not
> required for <video controls>, even though it is for the API call.
> 
> BUG=346236
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194106

R=falken@chromium.org
BUG=496637

Review URL: https://codereview.chromium.org/1159593006

git-svn-id: svn://svn.chromium.org/blink/trunk@196661 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
GC Plugin: test destructor access of part object.
R=haraken
BUG=496496

Review URL: https://codereview.chromium.org/1160963003

Cr-Commit-Position: refs/heads/master@{#333244}
philipj
Remove [TreatNullAs=NullString] from Document.domain
Even before this change, setting document.domain=null would fail, but
because it was treated as an empty string, where now it is "null".

BUG=460722

Review URL: https://codereview.chromium.org/1162933003

git-svn-id: svn://svn.chromium.org/blink/trunk@196635 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Document the tracking bugs of some IDL FIXMEs and TODOs
Also remove the invalid spec bug link for ProcessingInstruction.

Review URL: https://codereview.chromium.org/1164133003

git-svn-id: svn://svn.chromium.org/blink/trunk@196630 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Check Member<T> validity for stack allocated objects.
For Member<T> in a stack allocated object, make the Blink GC plugin
verify that T is a GC allocated object.

R=haraken
BUG=495398

Review URL: https://codereview.chromium.org/1167123002

Cr-Commit-Position: refs/heads/master@{#333217}
sigbjornf
Revert of compositor-worker: Share a thread and an isolate for compositor workers. (patchset #13 id:300001 of https://codereview.chromium.org/1158443008/)
Reason for revert:
Fails to compile on "WebKit Win x64 Builder",

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20x64%20Builder/builds/49353

Original issue's description:
> compositor-worker: Share a thread and an isolate for compositor workers.
> 
> Notable changes:
> 
> . WorkerThread: Move thread initialization/shutdown into virtual methods, so
>   that CompositorWorkerThread can override the behaviour to allow multiple
>   compositor workers to safely share the same thread.
> . CompositorWorkerManager: Responsible for managing the WebThreadSupportingGC
>   and v8::Isolate for the compositor workers. It essentially keeps a ref-count
>   for the thread and isolate and decides when to shutdown/initialize a thread
>   or isolate.
> 
> BUG=436932
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=196625

TBR=kinuko@chromium.org,haraken@chromium.org,sadrul@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=436932

Review URL: https://codereview.chromium.org/1166923003

git-svn-id: svn://svn.chromium.org/blink/trunk@196626 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove the redundant HTMLDocument.compatMode
Since Document.compatMode is defined identically and the implementation
is in Document::compatMode(), the only consequence of this is that the
compatMode attribute goes away from the HTMLDocument prototype.

BUG=460722

Review URL: https://codereview.chromium.org/1164533007

git-svn-id: svn://svn.chromium.org/blink/trunk@196624 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync Document.readyState with the HTML spec
https://html.spec.whatwg.org/#the-document-object

The only change to the generated code is in the case
Document::readyState() returns a null string, but that case is already
guarded with an ASSERT_NOT_REACHED() in the implementation.

BUG=460722

Review URL: https://codereview.chromium.org/1163923006

git-svn-id: svn://svn.chromium.org/blink/trunk@196622 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add use counters to determine the fate of DOMStringList
BUG=460726

Review URL: https://codereview.chromium.org/1162203003

git-svn-id: svn://svn.chromium.org/blink/trunk@196604 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Make the DOMStringMap deleter return type void
This doesn't change the generated code.

BUG=462920

Review URL: https://codereview.chromium.org/1161433006

git-svn-id: svn://svn.chromium.org/blink/trunk@196602 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Eliminate SVGTextChunkBuilder::m_textBoxTransformations
Nothing touches SVGTextFragment::lengthAdjustTransform between the calls
to processTextChunks() and finalizeTransformMatrices(), so the scaling
transform can be applied directly during the former, and the latter can
be removed along with the HashMap it uses.
Also change some fragment loops to for-range style.

BUG=486669

Review URL: https://codereview.chromium.org/1148323008

git-svn-id: svn://svn.chromium.org/blink/trunk@196601 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't paint a border after the last frame on any axis in a frameset
A border would be painted after the last frame on any axis in a frameset.
This border would usually not be visible since it was clipped out by
the view (or a frame, if in a nested frameset).
Also hoist the check for non-zero border thickness, since if it's zero
the loops won't do anything useful.

BUG=496322

Review URL: https://codereview.chromium.org/1155093004

git-svn-id: svn://svn.chromium.org/blink/trunk@196600 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add use counters to determine the fate of DOMError
This covers all ways to get or use a DOMError except the
StorageErrorCallback used in modules/quota. If those callbacks actually
look DOMError, that would be seen on the name/message counters.

BUG=460725

Review URL: https://codereview.chromium.org/1151023004

git-svn-id: svn://svn.chromium.org/blink/trunk@196597 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fix painting bounds calculations for ellipsis
Change the paint bounds computation, to base it on logical bounds and
then apply a logical -> physical transform. Include the selection rect
if needed.

TEST=fast/css/text-overflow-ellipsis-vertical-select.html (S.P. strict cull)
BUG=496318

Review URL: https://codereview.chromium.org/1153333005

git-svn-id: svn://svn.chromium.org/blink/trunk@196592 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Include 'outline' in LayoutSVGBlock::visualOverflowRect
LayoutSVGBlock doesn't maintain overflow via LayoutBox::m_overflow, but
rather overrides LayoutBox::visualOverflowRect.
Instead of doing that, add visual effect overflow during layout of
LayoutSVGText and stop overriding said method.
This will include outsets for border-image (which doesn't apply
to any of <text> or <foreignObject>) too in the unlikely event it's
specified.

TEST=svg/text/text-outline-2.html (S.P. strict cull rect)
BUG=495368

Review URL: https://codereview.chromium.org/1158323005

git-svn-id: svn://svn.chromium.org/blink/trunk@196591 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r196583.
TBR=oilpan-reviews
BUG=466631
NOTRY=true

Review URL: https://codereview.chromium.org/1152733010

git-svn-id: svn://svn.chromium.org/blink/trunk@196585 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the AnimationEvent and TransitionEvent interfaces with the specs
http://dev.w3.org/csswg/css-animations/#interface-animationevent
http://dev.w3.org/csswg/css-transitions/#transition-events

With the default values in the AnimationEventInit dictionary, it's no
longer necessary to check them in the C++ constructor.

BUG=460722

Review URL: https://codereview.chromium.org/1158233004

git-svn-id: svn://svn.chromium.org/blink/trunk@196582 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the File API interfaces with the spec
https://w3c.github.io/FileAPI/

The only changes to the generated code are due to the encoding->label
rename and [Measure], and neither is observable.

BUG=460722

Review URL: https://codereview.chromium.org/1153543012

git-svn-id: svn://svn.chromium.org/blink/trunk@196577 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: avoid creating a cyclic reference to InjectedScriptHost.
Follow up r196524 and keep a raw back pointer to InjectedScriptHost
instead of a Persistent, as that will create a cycle by way of the
v8 heap.

InjectedScriptHost will outlive the WeakCallbackData that keeps the
back reference, so safe. InjectedScriptHost is also slated for removal
from the Oilpan heap.

R=haraken
BUG=46631

Review URL: https://codereview.chromium.org/1167873003

git-svn-id: svn://svn.chromium.org/blink/trunk@196572 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Remove dummy WebSettings::setRegionBasedColumnsEnabled().
It had to linger until the Chromium side had stopped calling it.

BUG=350853
R=jochen@chromium.org

Review URL: https://codereview.chromium.org/1167753004

git-svn-id: svn://svn.chromium.org/blink/trunk@196571 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fold and remove SVGTextChunk
Being the keeper of only some flags and a float, this class no longer
provide much in terms of value. Folding it up into it's users,
SVGText{,Path}ChunkBuilder gives less, and more straight-forward code.
This can also be considered a first step towards untying 'textLength'
from the chunk structure.

BUG=486669

Review URL: https://codereview.chromium.org/1160613004

git-svn-id: svn://svn.chromium.org/blink/trunk@196567 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add TODOs to remove AnimationPlayerEvent and AnimationPlayerEventInit
This was overlooked in https://codereview.chromium.org/1092203002

BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1162173002

git-svn-id: svn://svn.chromium.org/blink/trunk@196566 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
[S.P.] Include selection rect in list marker cull rect when needed
TEST=fast/backgrounds/selection-background-color-of-image-list-style.html
TEST=fast/lists/markers-in-selection.html
BUG=496318

Review URL: https://codereview.chromium.org/1159033010

git-svn-id: svn://svn.chromium.org/blink/trunk@196565 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't create layout objects for pre-wrap text nodes in SVG
SVGTextMetricsBuilder only knows how to handle 'white-space: pre' with
regards to whitespace preservation, meaning it will collapse the spaces
in the node, and hence not generate any SVGTextMetrics for it.
Filter this case out to avoid even creating the text layout object in
the first place.

Fix salvaged from https://codereview.chromium.org/755613002/, with prior
work by Peter Molnar (pmolnar.u-szeged@partner.samsung.com) and
Zoltan Herczeg (zherczeg.u-szeged@partner.samsung.com). Test simplified
and extended to cover all white-space values.

BUG=416833,495969

Review URL: https://codereview.chromium.org/1166653005

git-svn-id: svn://svn.chromium.org/blink/trunk@196558 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add use counters to determine the fate of the disabled attribute
Review URL: https://codereview.chromium.org/1159203004

git-svn-id: svn://svn.chromium.org/blink/trunk@196541 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync various event interfaces with their specs
There are no changes to the generated code other than the
canBubble->bubbles argument renaming.

BUG=460722

Review URL: https://codereview.chromium.org/1149963004

git-svn-id: svn://svn.chromium.org/blink/trunk@196525 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r196513.
TBR=oilpan-reviews
BUG=466631
NOTRY=true

Review URL: https://codereview.chromium.org/1171463003

git-svn-id: svn://svn.chromium.org/blink/trunk@196524 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the SecurityPolicyViolationEvent interface with the spec
http://w3c.github.io/webappsec/specs/content-security-policy/#securitypolicyviolationevent-interface

BUG=460722

Review URL: https://codereview.chromium.org/1157923004

git-svn-id: svn://svn.chromium.org/blink/trunk@196517 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Remove some old fun related to the old multicol implementation.
BUG=408123
R=dsinclair@chromium.org,jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1168613004

git-svn-id: svn://svn.chromium.org/blink/trunk@196512 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Remove block continuation support.
This was only needed by the old multicol implementation, which is now gone.

BUG=408123
R=dsinclair@chromium.org,jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1164723004

git-svn-id: svn://svn.chromium.org/blink/trunk@196511 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Document the tracking bugs of some straight-forward IDL bugs
Review URL: https://codereview.chromium.org/1154913004

git-svn-id: svn://svn.chromium.org/blink/trunk@196509 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Ignore style changes on text node flowthread descendants.
Text nodes inherit every property from their parent, including non-inheritable
ones! If the parent DOM node is the multicol container, and its 'position' goes
from 'static' to 'absolute', so will any text node child, as far as
ComputedStyle is concerned. If the multicol container only contains a text node
child, we'd incorrectly think that the multicol container started to only
contain an out-of-flow child, so that the column set could be removed.

Also don't notify the flowthread about descendant style changes if the
descendant in question is the flow thread (Calling flowThreadContainingBlock()
on the flow thread returns the flow thread). There's currently no way any harm
could be done if the flow tread were indeed treated as a descendant of itself
here, but it's just wrong and bad.

BUG=491409
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1149333003

git-svn-id: svn://svn.chromium.org/blink/trunk@196508 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Notify the counter code about layout object removals BEFORE removing.
This makes it possible to mark relevant objects for layout. Cannot mark
unrooted subtrees for layout.

Additionally, only notify when told to do so by the caller. Renamed the method
to layoutObjectSubtreeWillBeDetached(), inspired by its
layoutObjectSubtreeAttached() counterpart.

For the sake of consistency, also only call layoutObjectSubtreeAttached() when
actually told to notify.

BUG=492490
R=dsinclair@chromium.org,eae@chromium.org

Review URL: https://codereview.chromium.org/1143323011

git-svn-id: svn://svn.chromium.org/blink/trunk@196505 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: safely finalize DOMTimers.
DOMTimer objects need to be eagerly finalized so as to prevent timer events
from firing at a DOMTimer that's about to be lazily swept. If allowed, that
might result in accessing an already finalized m_action member.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1160123004

git-svn-id: svn://svn.chromium.org/blink/trunk@196504 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Rename LifecycleObserver<T>::dispose() as clearContext()
Have the name of this helper match what it does; dispose() is too generic.
Observer instances only need to clear out their context and rarely, so
tighten up the visibility accordingly.

R=haraken
BUG=none

Review URL: https://codereview.chromium.org/1160253006

git-svn-id: svn://svn.chromium.org/blink/trunk@196502 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: provide eager 'operator new' overload for ServiceWorker.
ServiceWorker needs to overload 'operator new' in order to have its
instances be allocated on the eagerly swept heap.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1156303010

git-svn-id: svn://svn.chromium.org/blink/trunk@196496 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync event interfaces with the UI Events spec
https://w3c.github.io/uievents/

There are no changes to the generated code other than the order of
things, naming and the added use counter.

BUG=460722

Review URL: https://codereview.chromium.org/1159113007

git-svn-id: svn://svn.chromium.org/blink/trunk@196493 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Handle border-image with fill and zero-width borders
Before this patch we require at least one border dimension (top, left,
bottom, right) to be non-zero to trigger the border painting.

This misses the case when we have a zero width border all around but a
border image and border-image-slice: <numbers> fill. The center part
of the border-image should be painted, regardless of the
border-widths.

See https://bugs.webkit.org/show_bug.cgi?id=142650 and related commit.
It's not an exact port but this patch is heavily inspired by
​sabouhallawa's fix.

BUG=493088

Review URL: https://codereview.chromium.org/1159773005

git-svn-id: svn://svn.chromium.org/blink/trunk@196489 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r196479.
TBR=oilpan-reviews
BUG=495922
NOTRY=true

Review URL: https://codereview.chromium.org/1165553010

git-svn-id: svn://svn.chromium.org/blink/trunk@196487 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fix paint invalidation for SVG with outline-offset
The paint invalidation code did not factor in the outline-offset,
leading to too small repaint rectangles.
Use ComputedStyle::outlineSize() when inflating the paint invalidation
rect instead. If the outline-style is 'auto', then use the
GC::focusRingOutsetExtent function - this leads to smaller paint inv.
rects where this applies (like in tests svg/repaint/focus-element.html
and svg/custom/focus-ring.svg).

BUG=495666

Review URL: https://codereview.chromium.org/1157843008

git-svn-id: svn://svn.chromium.org/blink/trunk@196484 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: prefer eager finalization over prefinalizers.
Eagerly finalized objects have the ability to access other
heap objects in their destructors, provided they're not
other eagerly finalized objects. With that partial
ordering on finalization in place, we can recast our current
uses of "prefinalizer" actions to use eager finalization
instead.

Performing that switch simplifies, avoiding the overhead of
prefinalizers of having to separately provide a finalization
method (separate from the destructor.)

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1148383012

git-svn-id: svn://svn.chromium.org/blink/trunk@196483 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Eagerly sweep MediaKeySession objects.
MediaKeySession owns an instance of the WebContentDecryptionModuleSession
bridge object, which allows for bidirectional access with the
embedder-side object.

With Oilpan GC's lazy sweeping in effect, we need to tear down that
bridge as soon as the MediaKeySession object has been deemed to be garbage,
and slated for sweeping. Otherwise the embedder may attempt to access the
MediaKeySession's client interface methods while MediaKeySession is waiting
to be lazily swept, and potentially touching other heap objects that
MediaKeySession refers to which might have been independently swept
and finalized.

That is, the GC finalization order isn't fixed and deterministic. With
lazy sweeping, that lack of order is observable not just to the objects
that are on the heap, but also external, non-heap objects. Like the
embedder side object in this case.

Arrange for that eager finalization to happen by annotating MediaKeySession
as eagerly swept.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1159583002

git-svn-id: svn://svn.chromium.org/blink/trunk@196480 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Remove the old multicol implementation.
Remove the RegionBasedColumns runtime flag. It has been enabled for everyone
for some time now, meaning that the old multicol implementation hasn't been
available since.

This CL mainly removes the ColumnInfo class and the LayoutObject::hasColumns()
method, and everything that depended on those.

BUG=408123
R=dsinclair@chromium.org,jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1158183006

git-svn-id: svn://svn.chromium.org/blink/trunk@196477 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: eagerly sweep some mediasource and mediastream objects.
The following objects provide a 'client' notification interface to
bridge objects that they themselves own or refer to:

 - SourceBuffer (WebSourceBuffer, WebSourceBufferClient)
 - MediaStream (MediaStreamDescriptor, MediaStreamDescriptorClient)
 - MediaStreamTrack (MediaStreamSource, MediaStreamSource::Observer)
 - RTCDTMFSender (WebRTCDTMFSenderHandler, WebRTCDTMFSenderHandlerClient)
 - RTCDataChannel (WebRTCDataChannelHandler, WebRTCDataChannelHandlerClient)
 - RTCPeerConnection (WebRTCPeerConnectionHandler,
                      WebRTCPeerConnectionHandlerClient)

The name of the bridge object and client given in parens. The bridge
objects allow the embedder to notify the 'client'.

To make these safe wrt Oilpan lazy sweeping (see associated bug for details
on why this is required), add annotations to the class declarations for
the objects affected.

While some of these objects are ActiveDOMObjects and will in most cases
be explicitly stopped as part of detachment, where their overridden stop()
methods will in some cases clear out the client (or bridge) object, this
is a delicate dependency. Insisting on eager sweeping & finalization
makes their embedder detachment safe, regardless.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1149293003

git-svn-id: svn://svn.chromium.org/blink/trunk@196469 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Never cast Attr to ContainerNode based on nodeType ATTRIBUTE_NODE
In https://codereview.chromium.org/1158433004 Attr began inheriting from
Node instead of ContainerNode, but there remained cases where
toContainerNode() was called for Attr.

All instances of toContainerNode() and other casts to ContainerNode were
inspected and only these two were found to be problematic, although some
instances in core/editing are non-obvious.

Because textContent is an alias of value in Attr.idl, web content
setting attr.textContent directly will not take the Node code path in
question. However, it is possible with some effort:

var attr = document.createAttribute("name");
Object.getOwnPropertyDescriptor(Node.prototype, "textContent").set.call(attr, "value");

This will now do nothing, and the equivalent code with the getter would
already return null before this change. This is strange, but most
closely resembles the spec, which doesn't handle Attr in the textContent
setter because per spec it isn't a Node at all:
https://dom.spec.whatwg.org/#dom-node-textcontent

No calls to Node::textContent() or Node::setTextContent() where the Node
could be an Attr were found, other than V8Node.cp in generated bindings.

BUG=305105, 494043
TEST=Source/core/dom/AttrTest.cpp (also tests nodeValue)

Review URL: https://codereview.chromium.org/1148003007

git-svn-id: svn://svn.chromium.org/blink/trunk@196452 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Add missing declaration to create_card_unmask_prompt_view.h
BUG=

Review URL: https://codereview.chromium.org/1155583009

Cr-Commit-Position: refs/heads/master@{#332732}
sigbjornf
Oilpan: eagerly finalize WebGLRenderingContext objects.
To simplify the destruction of WebGLRenderingContextBase-derived objects
along with their WebGLContextObjects, insist that the rendering context
is finalized first. It may then detach itself from the context objects,
before their finalizers are later run.

Such a finalization ordering avoids the need for the ref-counted
WebGLSharedWebGraphics3D abstraction which supported arbitrary
finalization orders.

R=haraken
BUG=482838

Review URL: https://codereview.chromium.org/1151163002

git-svn-id: svn://svn.chromium.org/blink/trunk@196437 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r196422.
TBR=oilpan-reviews
BUG=466631
NOTRY=true

Review URL: https://codereview.chromium.org/1156463003

git-svn-id: svn://svn.chromium.org/blink/trunk@196426 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't iterate past the end of the metrics list
This check was lost in https://codereview.chromium.org/1160623002.
In some cases (unpaired surrogates), the metrics list will not cover the
full range of characters in the text node. Make sure to terminate the
iteration when that happens.

BUG=495969,486669

Review URL: https://codereview.chromium.org/1150383003

git-svn-id: svn://svn.chromium.org/blink/trunk@196408 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: add assert to verify eager finalization.
A class annotated with EAGERLY_FINALIZE() is dependent on having
an 'operator new' overload that takes eagerness correctly into
account. The use of a EAGERLY_FINALIZE() declaration does not
guarantee this, so add an assert to catch classes not correctly
handled.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1166793002

git-svn-id: svn://svn.chromium.org/blink/trunk@196404 bbb929c8-8fbe-4397-9dbb-9b2b20218538
kolczyk
Fix for DCHECK failure at startup of gin_shell.
It was introduced by rewriting code to use SingeThreadTaskRunner
instead of MessageLoopProxy.

Reproduces with gin_unittests too.

BUG=

Review URL: https://codereview.chromium.org/1153473009

Cr-Commit-Position: refs/heads/master@{#332597}
fs
Drop fillRule state from GraphicsContext
There was only a few trivial (local) uses of this state field left. Since
the same state is carried in the Path (SkPath) object itself, make use of
that instead.

BUG=424655

Review URL: https://codereview.chromium.org/1147343003

git-svn-id: svn://svn.chromium.org/blink/trunk@196340 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: consistently allow allocation during finalization.
Remove poisonHeap() assert from r196232, which insisted that the
to-be-swept heap must not have had any allocations made against it.

We do currently allow allocations in destructors, including for eagerly
finalized objects, so the assert removal aligns with that.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1154413005

git-svn-id: svn://svn.chromium.org/blink/trunk@196324 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Made matchedResult method const.
R=mstensho@opera.com

Review URL: https://codereview.chromium.org/1155673004

git-svn-id: svn://svn.chromium.org/blink/trunk@196320 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Move NinePieceImage painting to a separate class
While doing as little changes as possible, move NinePieceImage
painting code out of BoxPainter into a separate class. This is in
preparation for the possibility of splitting the function into smaller
parts. The function currently has roughly 36 local variables and is
quite hard to understand and change.

BUG=492485

Review URL: https://codereview.chromium.org/1164573003

git-svn-id: svn://svn.chromium.org/blink/trunk@196301 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
When cancelling an animation, add missing timeline-detach check.
If the animation timeline becomes unreferenced and is destructed,
it detaches from its associated animations. Check that timeline
detach status should cancel() be called on an animation.

R=loyso,dstockwell
BUG=491847

Review URL: https://codereview.chromium.org/1154423006

git-svn-id: svn://svn.chromium.org/blink/trunk@196299 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't auto-wrap <svg:text>
Even if an explicit 'white-space' property overrides the presentation
attribute style (from 'xml:space'), auto-wrap should still be disabled
(until "wrappable text" a'la SVG2 has been implemented.)

BUG=492596

Review URL: https://codereview.chromium.org/1159623007

git-svn-id: svn://svn.chromium.org/blink/trunk@196298 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Add support for module-definition files to gn
BUG=

Review URL: https://codereview.chromium.org/1160773002

Cr-Commit-Position: refs/heads/master@{#332355}
philipj
Sync the ClipboardEvent interface with the spec
https://w3c.github.io/clipboard-apis

BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1147383006

git-svn-id: svn://svn.chromium.org/blink/trunk@196290 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Drop the MouseEventButtonsAttribute runtime flag
It reached stable in M43 and is unlikely to be reverted now.

BUG=276941

Review URL: https://codereview.chromium.org/1161373002

git-svn-id: svn://svn.chromium.org/blink/trunk@196271 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Handle SVGLength resolving in an inactive document gracefully
If the element associated with the SVGLength is in an inactive document,
there'll be no layout, so computedStyleForLengthResolving() will be able
to exit the loop without finding a ComputedStyle to return.

BUG=493977

Review URL: https://codereview.chromium.org/1166683003

git-svn-id: svn://svn.chromium.org/blink/trunk@196269 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Out-of-flow objects inside multicol may not establish column sets.
Do a better job at ignoring out-of-flow objects that are not contained by
anything inside the multicol container. Previously we only made sure to skip
such objects at one specific location in flowThreadDescendantWasInserted(), but
this is really needed all over the place, so added utility functions for it.

Added an assertion mapDescendantToColumnSet() to catch such situations earlier
in the future.

BUG=492897
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1163603002

git-svn-id: svn://svn.chromium.org/blink/trunk@196234 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: introduce eager finalization.
Extend the capabilities of eager finalization and the eagerly swept heap.
Objects allocated on that heap are now allowed to have destructors that
can (but are not encouraged) to access other heap objects, provided the
objects are not other eagerly finalized objects. (Few objects are thought
to require eager finalization, so this is assumed not to limit their
use and usefulness.)

The clang Oilpan/GC plugin needs to be extended to allow such destructors,
and catch out any/some attempts to access other eagerly finalized objects
from destructors (https://codereview.chromium.org/1158623002/)

To additionally enforce finalizer correctness, ASan heap poisoning during
sweeps is also strengthened: all payloads on the eagerly swept heap are
poisoned so as to catch out illegal inter-heap references while the sweep
is underway. Once the eager sweep has completed, access to the live objects
is allowed, while all unmarked objects in other heaps are poisoned.

With the above in place, existing "prefinalizer" usage can be recast to
be eagerly finalized instead. This will be handled in a followup CL.

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1157933002

git-svn-id: svn://svn.chromium.org/blink/trunk@196232 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop SVGTextChunk::m_boxes
Since text chunks are now processed as they are formed, the m_boxes in
SVGTextChunk is of little use, and just means an additional copy is
needed. Drop it and use the range passed into handleTextChunk directly
instead.
This requires moving SVGTextChunk::calculateLength to
SVGTextChunkBuilder.cpp, so do that and put it in a helper class.
Also changing from passing <vector,startIndex,endIndex> to just passing
two (vector) iterators describing the start and end in the vector.
In SVGTextChunkBuilder::handleTextChunk, drop a redundant test
(!boxCount), and move the code that recalculates the chunk extent after
applying spacing adjustments for 'textLength' up into the relevant
branch.

BUG=486669

Review URL: https://codereview.chromium.org/1162653002

git-svn-id: svn://svn.chromium.org/blink/trunk@196229 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the XHR-related interfaces with the spec
No observable changes are intended.

The change to open() results in big changes to the generated code, but
it should not be possible to observe the difference; the 2-argument form
still treats async as true, and passing undefined for either username or
password will still be converted to nullptr and then a null string.

For both open() and send(), handing the default argument values in
bindings allows the C++ code to be slightly simpler.

Dropping [TreatReturnedNullStringAs=Undefined] for
getAllResponseHeaders() makes no difference as
XMLHttpRequest::getAllResponseHeaders() will never return a null string.
Even when there are no headers, the untouched StringBuilder object will
return an empty string from toString(), not a null string.

The generated code now handles missing ProgressEventInit members, so the
ProgressEvent constructor doesn't need to.

BUG=460722

Review URL: https://codereview.chromium.org/1167563002

git-svn-id: svn://svn.chromium.org/blink/trunk@196221 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the Selection interface with the spec
http://w3c.github.io/selection-api/#idl-def-Selection

There are no changes to the generated code other than order and the
allowPartial -> allowPartialContainment renaming.

BUG=460722

Review URL: https://codereview.chromium.org/1159303003

git-svn-id: svn://svn.chromium.org/blink/trunk@196219 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the URL interfaces with the spec
https://url.spec.whatwg.org/#api

[NoInterfaceObject, Exposed=(Window,Worker)] is not a mistake in the
spec: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28538

There are no changes to the generated code.

BUG=460722

Review URL: https://codereview.chromium.org/1162783003

git-svn-id: svn://svn.chromium.org/blink/trunk@196217 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the CSS Font Loading interfaces with the spec
http://dev.w3.org/csswg/css-font-loading/

There are no changes to the generated code, other than order.

BUG=460722

Review URL: https://codereview.chromium.org/1100873004

git-svn-id: svn://svn.chromium.org/blink/trunk@196215 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync some event interfaces with the HTML spec
There are no changes to the generated code other than order and the use
counter.

BUG=460722

Review URL: https://codereview.chromium.org/1167623002

git-svn-id: svn://svn.chromium.org/blink/trunk@196213 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Document the proposal and spec bug for ApplicationCacheErrorEvent
BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1156173006

git-svn-id: svn://svn.chromium.org/blink/trunk@196195 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: simplify away StoppingOtherThreads pseudo GCState.
ThreadState now keeps track of whether or not GCs are forbidden; use that
to prevent nested GCs from kicking in rather than the temporary
StoppingOtherThreads GCState previously used.

R=haraken
BUG=482838

Review URL: https://codereview.chromium.org/1145423009

git-svn-id: svn://svn.chromium.org/blink/trunk@196193 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Mark WebGLRenderingContext as having lost context upon init failure.
r196077 added a good test verifying the handling of attempted WebGL context
creation when that fails to create an underlying drawing buffer. This
exposed an Oilpan-specific lifetime issue for the WebGLRenderingContext
object that fails to properly initialize. With Oilpan, that garbage
collected & partially initialized object will not be synchronously deleted,
but be finalized instead when the next GC strikes.

The WebGLRenderingContext object is an ActiveDOMObject attached to its
execution context, so should it be stopped before that GC strikes, it
will be forcibly removed from its (graphics system) context as part
of stopping. The partially constructed object is not prepared for that,
with failing consequences.

To avoid, if the creation of a drawing buffer fails, we explicitly mark
the object as having lost its context.

R=bajones,kbr,haraken
BUG=474665

Review URL: https://codereview.chromium.org/1153233005

git-svn-id: svn://svn.chromium.org/blink/trunk@196188 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove the virtual ThemePainter::paintMediaCastButton()
It appears to be an indirection without purpose.

ThemePainterMac does not inherit from ThemePainterDefault, so on Mac the
default implementation of painting nothing was used. If cast was made to
work for Mac the button would fail to paint, so rebaseline the tests.

BUG=493880

Review URL: https://codereview.chromium.org/1158323004

git-svn-id: svn://svn.chromium.org/blink/trunk@196174 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
The span of a table-column or table-column-group should never be 0.
We used to set span to 0 if the element type wasn't COL/COLGROUP and computed
style had been set and display type was table-column-group. This seems to stem
from a merge from some LABYRINTH_KDE_3_MERGE branch back in March 2002. Not
sure if it made sense back then, but it certainly doesn't now.

BUG=493352
R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1146183005

git-svn-id: svn://svn.chromium.org/blink/trunk@196166 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Don't eat margins when column height isn't yet known.
We ended up thinking that a margin would cross a column boundary, and this even
before the column height was known. When margins cross column boundaries, we
should indeed eat the part of it that doesn't fit in the first column. But when
we don't even know the column height, eating the margin is just nonsense, and
besides it confuses the column balancer. When we only have margins and borders,
and no actual content, no space shortage is reported to the balancer, so we
depend on getting it right in the first balancing pass.

Introduce isPageLogicalHeightKnown(). Since blocks that contain spanners
typically live in multiple column sets, columnSetAtBlockOffset() also needs to
be able to search backwards for the right set for the given offset within the
block. The set currently being worked on may be the one after the spanner,
while we may be interested in the logical top of the block, which is in the
column set before the spanner.

General note: Using LayoutState::pageLogicalHeight() in multicol is bad, since
the columns don't necessarily all have the same height. There's still more
cleaning up to do here.

BUG=493349
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1163583006

git-svn-id: svn://svn.chromium.org/blink/trunk@196161 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Track if textLength spacing is in effect while walking the line box tree
Instead of calling parentDefinesTextLength() in
layoutTextOnLineOrPath(), keep a flag updated as we traverse the line
box tree. This eliminates the walk up the ancestor-chain, but more
importantly it avoids checking this for each text box.
To make this easier, layoutCharactersInTextBoxes() is moved from
SVGRootInlineBox to SVGTextLayoutEngine. This allows simplifying
SVGTextLayoutEngine::beginTextPathLayout a bit to make it more
independent.
Gives roughly a 1% speedup on separate-x.svg from the bug, when run
through PerfTestRunner.measurePageLoadTime.

BUG=486669

Review URL: https://codereview.chromium.org/1158033006

git-svn-id: svn://svn.chromium.org/blink/trunk@196158 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Make IPC::Channel buffers stack based and secure against growth
Auxiliary IPC::Channel buffers have been permanently allocated
even though their use is very temporary. This moves those to
the stack instead to reflect their temporary nature and also
adds an assert to catch accidental out-of-control growth of
the buffer as happened recently.

BUG=484154
R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/1120343002

Cr-Commit-Position: refs/heads/master@{#331956}
bratell
Shrinking CSSParserToken for lower CSS parsing memory usage.
For 64-bit this shrinks CSSParserToken from 32 to 24 bytes. For 32-bit
this shrinks CSSParserToken from 24 to 20 bytes.

On typical sites (gmail, arstechnica) there are 300 KB stylesheets
which makes us preallocate room for 100,000 CSSParserTokens.
Allocation savings will then be 800 KB on 64-bit and 400 KB on
32-bit.

It does not cause any noticable performance change in any direction
on a workstation. Memory starved devices *might* benefit.

R=timloh@chromium.org
BUG=490185

Review URL: https://codereview.chromium.org/1161963002

git-svn-id: svn://svn.chromium.org/blink/trunk@196134 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove Attr child nodes (making Attr a Node, not a ContainerNode)
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/4Hg0l42QHH0/H59LyoiJlI4J

Rationale for some of the non-obvious test changes:

LayoutTests/dom/html/level1/core/hc_attrsetvalue2.html:
LayoutTests/dom/xhtml/level1/core/hc_attrsetvalue2.xhtml:

  Removing the child node aspects makes these tests equivalent to
  hc_attrsetvalue1, so they were removed.

LayoutTests/dom/html/level1/core/hc_elementnormalize2.html:
LayoutTests/dom/xhtml/level1/core/hc_elementnormalize2.xhtml:

  These test that Element.normalize() also normalizes the Element's
  Attr's children, so with no children there's nothing left to test.

LayoutTests/fast/dom/Element/normalize-crash.html:

  http://trac.webkit.org/changeset/59109

  The crash was in Element::normalizeAttributes(), which is removed.

LayoutTests/fast/dom/Element/normalize-crash2.html:

  https://code.google.com/p/chromium/issues/detail?id=394026

  The crash was in Element::normalizeAttributes(), which is removed.

LayoutTests/fast/dom/insertedIntoDocument-child.html:
LayoutTests/fast/dom/insertedIntoDocument-sibling.html:

  http://trac.webkit.org/changeset/81611

  Even before this change, the DOMNodeRemoved event listener was not
  actually run in these tests.

LayoutTests/fast/dom/normalize-attributes-mutation-event-crash.html:

  http://trac.webkit.org/changeset/137341

  The crash was in Element::normalizeAttributes(), which is removed.

LayoutTests/fast/storage/storage-detached-iframe.html:

  Already damaged by the replaceWholeText() removal in r185541, nothing
  useful of the subtest remains when removing the firstChild bits.

BUG=305105

Review URL: https://codereview.chromium.org/1158433004

git-svn-id: svn://svn.chromium.org/blink/trunk@196128 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r196078.
TBR=oilpan-reviews
BUG=434450
NOTRY=true

Review URL: https://codereview.chromium.org/1162033003

git-svn-id: svn://svn.chromium.org/blink/trunk@196084 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Use begin/end istead of first/last for rule ranges.
MatchResult used -1 for empty ranges of matched properties. Use begin/end
instead where begin == end means we have an empty range.

As requested in https://codereview.chromium.org/1155393002/

R=timloh@chromium.org

Review URL: https://codereview.chromium.org/1162583002

git-svn-id: svn://svn.chromium.org/blink/trunk@196065 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Oilpan: Implement a GC to take a heap snapshot (patchset #7 id:120001 of https://codereview.chromium.org/1159773004/)
Reason for revert:
ThreadedWeakness unit test is failing on various bots,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%2032/builds/36384
 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Android%20%28Nexus4%29/builds/32383

Original issue's description:
> Oilpan: Implement a GC to take a heap snapshot
> 
> This CL implements Heap::collectGarbage(gcType = TakeSnapshot), which is intended
> to be used to take a heap snapshot when onMemoryDump is requested etc.
> 
> The GC is expected to be as side-effect-free as possible. Thus the GC behaves as follows:
> 
> 1) Run a marking task.
> 2) Take a heap snapshot (The actual implementation will come in a follow-up CL).
> 3) Clear all marks on marked objects. No sweeping task runs.
> 
> More contexts:
> https://codereview.chromium.org/1149673002/
> https://groups.google.com/a/chromium.org/d/topic/oilpan-reviews/6LhByzmVt6Q/discussion
> 
> BUG=490087
> TEST=HeapTest.ThreadedWeakness
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195982
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=196059

TBR=oilpan-reviews@chromium.org,keishi@chromium.org,primiano@chromium.org,ssid@chromium.org,haraken@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=490087

Review URL: https://codereview.chromium.org/1143243006

git-svn-id: svn://svn.chromium.org/blink/trunk@196063 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Remove --enable-region-based-columns command line flag.
Region based columns (aka. the new multicol implementation) now gets enabled
via an entry in RunTimeEnabledFeatures in Blink.

BUG=350853
R=jochen@chromium.org,mkwst@chromium.org

Review URL: https://codereview.chromium.org/1150663003

Cr-Commit-Position: refs/heads/master@{#331767}
fs
Avoid resetting the metrics-list/character offset for each text box
SVGTextLayoutEngine::layoutTextOnLineOrPath needs to keep track of the
SVGTextMetrics corresponding to each glyph it layouts. To do this, the
members m_visual{Character,MetricsList}Offset are used. However, this
state is reset for each invocation, which means that finding the
starting metrics entry can yield O(N^2) behavior. For text nodes with
many (logically consecutive) text boxes, this can become noticeable.
Introduce a helper SVGTextMetricsIterator - replacing the m_visual*
members - and let it persist across calls to layoutTextOnLineOrPath.
This speeds up the case of many logically consecutive text boxes.

Using the PerfTestRunner.measurePageLoadTime harness with
separate-x.svg from the bug give the following results locally:

       Before:     After:
avg    101.5 ms -> 93.1 ms
median 101.1 ms -> 93.1 ms
stdev    2.8 ms ->  2.3 ms

BUG=486669

Review URL: https://codereview.chromium.org/1160623002

git-svn-id: svn://svn.chromium.org/blink/trunk@196054 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Rearrange MediaControls members to match DOM structure
This matches the order of MediaControls::initializeControls(), making it
more obvious where to add members.

BUG=448795

Review URL: https://codereview.chromium.org/1153383002

git-svn-id: svn://svn.chromium.org/blink/trunk@196053 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Perform SVG text chunk processing on-the-fly
Instead of building a vector of chunks, and then process that vector,
process the chunks as they are formed. The chunks themselves are
independent units, so this is reasonably straight-forward. The main
change is that instead of creating and adding an SVGTextChunk to a
vector, the data used to create the chunk is passed to a handler
method. Because of how <textPath> is handled, this handler currently
needs to be a virtual method. Because of that, a SVGTextChunkBuilder
is subclassed to SVGTextPathChunkBuilder for the text-on-path
processing.

Using the PerfTestRunner.measurePageLoadTime harness with
separate-x.svg from the bug give the following results locally:

       Before:     After:
avg    100.5 ms -> 89.5 ms
median 100.5 ms -> 88.7 ms
stdev    2.1 ms ->  3.2 ms

BUG=486669

Review URL: https://codereview.chromium.org/1155293005

git-svn-id: svn://svn.chromium.org/blink/trunk@196040 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix nested parking of threads while setting up a garbage collection.
When a thread requests a GC, it first enters a safe point to indicate
that it is prepared to garbage collect. After that it tries to interrupt/
notify the other threads to also enter safe points and waits around for
them to enter that state. While waiting, it will block other threads from
attempting to similarly park threads.

But, should another thread trigger a GC while the parking thread is
waiting, it will first enter a safe point, but then proceed to try to
park the other threads. Which it will be blocked from making progress on
due to the above lock being taken by the initial thread requesting thread
parking. By initially entering a safe point though, the first thread may
indirectly reach the desired condition of all threads being parked. Which
means it can safely proceed with the GC _along_ with releasing the lock
for other threads to attempt to park thread. The second parking thread
will then do so, but be blocked waiting for all the threads to park. The
thread that has proceeded to initiate a GC will not do so, so after the
max parking time has passed, the second thread will signal that it failed
to park the other threads, and try to abort its attempted GC.

As part of that abort/cancellation step, it will attempt to reset its
GCState back to what it was when the GC attempt was initiated. That
GCState may have changed behind the thread's back -- the initial thread
has proceeded with a GC, and will as part of that change the GCState of
each attached thread. Hence, GC cancellation needs to check that the
GCState it is trying to reset from is the expected one. If it isn't,
that is a sign that another thread has initiated a GC and it should
just quietly return. Which means waiting for it to be allowed to leave
its safe point..and at that point perform the thread-specific parts of
the GC.

R=haraken
BUG=487952

Review URL: https://codereview.chromium.org/1158243004

git-svn-id: svn://svn.chromium.org/blink/trunk@196037 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Refactor matched rule ranges.
For matched CSS rules we need to know where the UA rules end and the
author rules begin. This CL simplifies this by having a single index for
the last UA rule. -1 means there are no UA rules, otherwise it's the
index of the last UA rule in the array. Convenience methods are added to
return the first/last rule indices for UA and author rules.

The rule ranges used to be updated for every added rule. Now, just update
the last UA rule index when sorting and transferring UA rules. That means
we don't have to pass the ranges as parameters anymore.

R=timloh@chromium.org,esprehn@chromium.org

Review URL: https://codereview.chromium.org/1155393002

git-svn-id: svn://svn.chromium.org/blink/trunk@196036 bbb929c8-8fbe-4397-9dbb-9b2b20218538
wdzierzanowski
Extract re-usable InitializeMediaFoundation()
Allow media::InitializeMediaFoundation() to be used by any Media
Foundation client code.  This benefits existing Chromium code as well as any
Chromium-based browser that adds its own code calling out to Media Foundation.

There are two side effects for DXVAVideoDecodeAccelerator:

  - MFStartup() and MFShutdown() are now called once during the lifetime of the
    GPU process rather than per each accelerator instance.

  - MFStartup() is now called with the MFSTARTUP_LITE flag, which according to
    MSDN doesn't initialize the sockets library.

TEST=media_unittests

Committed: https://crrev.com/c0ab75a86447bc23d45ff7086b2375e2cd83c205
Cr-Commit-Position: refs/heads/master@{#331446}

Review URL: https://codereview.chromium.org/1149203002

Cr-Commit-Position: refs/heads/master@{#331623}
fs
Remove SVGTextLayoutEngine::m_pathLayoutBoxes
Line boxes are added to this vector, and finalizeTransformMatrices()
iterates through it. The latter will however never do anything for
these line boxes, because layoutTextBoxes() is the only thing that adds
boxes to the map that will cause finalizeTransformMatrices() to have an
effect.

BUG=486669

Review URL: https://codereview.chromium.org/1157253002

git-svn-id: svn://svn.chromium.org/blink/trunk@195997 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Add early-out in SVGTextChunkBuilder::finalizeTransformMatrices()
This function will only do something when textLength is being applied.
If that's not the case, there'll just a lot of iteration and hash-
lookups for no good.
Not huge win performance-wise (in the noise), but a fairly simple and
obvious thing to do.

BUG=486669

Review URL: https://codereview.chromium.org/1161803002

git-svn-id: svn://svn.chromium.org/blink/trunk@195983 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Rearrange the XHR interfaces to match the spec order
https://xhr.spec.whatwg.org/#interface-xmlhttprequest

To make reviewing easier, this commit only changes the order of lines
and adds comments. Actual spec sync will be done separately.

The order of the generated code changes, but there are no actual
changes.

BUG=460722

Review URL: https://codereview.chromium.org/1155313002

git-svn-id: svn://svn.chromium.org/blink/trunk@195976 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync SVG interfaces with the specs
Add use counters for some things that are gone from the specs.

BUG=460722

Review URL: https://codereview.chromium.org/1153763008

git-svn-id: svn://svn.chromium.org/blink/trunk@195970 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Move SVGTextChunkBuilder out of SVGTextLayoutEngine
This member of SVGTextLayoutEngine has a very narrow scope in which it
is used. The data produced into it is in practice consumed within the
very same method. Hence move it out of class scope and into function
scope.
Also take the opportunity to move finalizeTransformMatrices() to
SVGTextChunkBuilder as well, since it essentially applies data from
the latter.

Also drop the debug code within DUMP_TEXT_FRAGMENTS.

BUG=486669

Review URL: https://codereview.chromium.org/1156053002

git-svn-id: svn://svn.chromium.org/blink/trunk@195969 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mharanczyk
Synthesize proper keyIdentifier for devtools protocol key events.
When bug 472077 moved devtools protocol key handling to browser one part
of code that sythesized keyIdentifier was lost (it was prevoiusly
handled in InspectorInputClient::dispatchKeyEvent and removed in
https://codereview.chromium.org/1063653002/patch/40001/50004). Restore
that functionality else sending some key events (like enter) is not
handled correctly.

BUG=

Review URL: https://codereview.chromium.org/1148803002

Cr-Commit-Position: refs/heads/master@{#331546}
wdzierzanowski
Extract re-usable InitializeMediaFoundation()
Allow media::InitializeMediaFoundation() to be used by any Media
Foundation client code.  This benefits existing Chromium code as well as any
Chromium-based browser that adds its own code calling out to Media Foundation.

There are two side effects for DXVAVideoDecodeAccelerator:

  - MFStartup() and MFShutdown() are now called once during the lifetime of the
    GPU process rather than per each accelerator instance.

  - MFStartup() is now called with the MFSTARTUP_LITE flag, which according to
    MSDN doesn't initialize the sockets library.

TEST=media_unittests

Review URL: https://codereview.chromium.org/1149203002

Cr-Commit-Position: refs/heads/master@{#331446}
mstensho
Remove old multicol tests that were only run with the old implementation.
These were DRT tests that were never converted to better kinds of tests,
because they were either superfluous, invalid or depended on bugs in the old
multicol implementation. There are (almost) no DRT test baselines for the new
implementation, and I'd like to keep it that way.

BUG=408123
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1143153006

git-svn-id: svn://svn.chromium.org/blink/trunk@195925 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Make test proxy Platform objects provide currentThread().
For the benefit of the Oilpan GC and it needing to post tasks, have
these two test Platform objects provide a delegating currentThread()
implementation.

R=haraken,skyostil
BUG=

Review URL: https://codereview.chromium.org/1052103004

git-svn-id: svn://svn.chromium.org/blink/trunk@195923 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Enable RegionBasedColumns runtime flag for stable.
This ships the new multicol implementation.

Removed the virtual/stable multicol testsuites, since the old multicol
implementation is no longer testable (and will be removed from the code
shortly).

BUG=334335,408123
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1152423003

git-svn-id: svn://svn.chromium.org/blink/trunk@195913 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop unused argument from one of the SVGTextMetrics constructors
Review URL: https://codereview.chromium.org/1155683005

git-svn-id: svn://svn.chromium.org/blink/trunk@195911 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ingemara
qcms: Silence __force_align_arg_pointer__ warning on Armv8
BUG=490016

Review URL: https://codereview.chromium.org/1142203002

Cr-Commit-Position: refs/heads/master@{#331349}
sigbjornf
Extend destructor checks to account for eagerly finalized class types.
Classes annotated as being eagerly finalized are allowed to touch other
heap objects in their destructors, provided these are not also eagerly
finalized. Extend the CheckFinalizerVisitor implementation to take that
into account

R=haraken
BUG=491488

Review URL: https://codereview.chromium.org/1158623002

Cr-Commit-Position: refs/heads/master@{#331331}
sigbjornf
Oilpan: rename EAGERLY_SWEEP() as EAGERLY_FINALIZED().
Renamed to make its purpose clearer; classes are to be annotated as
eagerly finalized when they either need to promptly release ownership of
non-heap objects, or when their destructors have an unavoidable need to
access other heap objects. Both kinds are considered very rare, but more
accurate control of finalization timing is sometimes needed & vital.

Also introduce a transition time version of the macro,
EAGERLY_FINALIZED_WILL_BE_REMOVED() for the places where eager finalization
is needed non-Oilpan once lazy sweeping is enabled. That class annotation
will be removed once the class is always on the heap.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1150863003

git-svn-id: svn://svn.chromium.org/blink/trunk@195887 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Add a runtime flag for the column-fill property.
Decouple column-fill support from the RegionBasedColumns flag.

The new multicol implementation is about to ship. All other multicol
properties are -webkit- prefixed, except for column-fill. Allowing
such a mix would very likely confuse authors, so better hide
column-fill away until we can unprefix all other multicol properties.

If column-fill isn't supported, the layout engine will behave as if it
were set to 'auto', which means that a multicol container with a
specified height won't have its columns balanced.

Discussed here:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/hhecvWUBJvg/nq4X3s8Jmk4J

R=jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1145093002

git-svn-id: svn://svn.chromium.org/blink/trunk@195873 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the BarProp interface with the spec
https://html.spec.whatwg.org/#barprop

BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1157893002

git-svn-id: svn://svn.chromium.org/blink/trunk@195871 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the Screen interface with CSSOM View
http://dev.w3.org/csswg/cssom-view/#the-screen-interface

It seems unlikely that availLeft and availTop could be removed, but
measure them to know for sure.

BUG=460722

Review URL: https://codereview.chromium.org/1145233006

git-svn-id: svn://svn.chromium.org/blink/trunk@195868 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Only notify the flowthread about style changes on actual descendants.
Calling flowThreadContainingBlock() on the flow thread itself returns the flow
thread, but the flow thread obviouly isn't a true descendant of itself, so
let's avoid calling flowThreadDescendantStyleWillChange() and
flowThreadDescendantStyleDidChange() then. There's currently no way any harm
could be done if the flow tread were indeed treated as a descendant of itself
here, but it's just wrong and bad.

R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1155023002

git-svn-id: svn://svn.chromium.org/blink/trunk@195863 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add a counter for CSSKeyframesRule's anonymous indexed getter
This getter makes no sense, as there's no length attribute.

BUG=none

Review URL: https://codereview.chromium.org/1152993002

git-svn-id: svn://svn.chromium.org/blink/trunk@195853 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Make CharacterData.substringData() and ProcessingInstruction.target not nullable
This changes the generated code from v8SetReturnValueStringOrNull(...)
to v8SetReturnValueString(...), but none of these can return a null
string internally, so the difference should never be observable.

BUG=460722

Review URL: https://codereview.chromium.org/1151203002

git-svn-id: svn://svn.chromium.org/blink/trunk@195802 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Adjust FrameFetchContext clearing logic when clearing HTMLImportsController
Have the clearing of a Document's HTMLImportsController only clear its
FrameFetchContext if there's no DocumentLoader attached. If a loader is
attached, it is possibly shared amongst multiple Documents and it is
responsible for clearing the fetch context.

This mirrors the condition used during detach().

R=dcheng
BUG=491051

Review URL: https://codereview.chromium.org/1156663003

git-svn-id: svn://svn.chromium.org/blink/trunk@195801 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove CSSKeyframesRule.insertRule()
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/wW7w8Hro78s/JDULF2oM9iIJ

BUG=470400

Review URL: https://codereview.chromium.org/1153493002

git-svn-id: svn://svn.chromium.org/blink/trunk@195797 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Make Attr.value/nodeValue/textContent not nullable
https://dom.spec.whatwg.org/#interface-attr

The [TreatNullAs=EmptyString] addition has been proposed:
https://github.com/whatwg/dom/pull/36

An ad-hoc test for the behavior of setting these to null:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3528

Firefox Nightly:
attr.value=null => getAttribute()=="null"
attr.nodeValue=null => getAttribute()==""
attr.textContent=null => getAttribute()==""

IE11 and Edge:
attr.value=null => getAttribute()=="null"
attr.nodeValue=null => getAttribute()==""
attr.textContent=null => getAttribute()==""

Safari 8:
attr.value=null => getAttribute()==null
attr.nodeValue=null => getAttribute()==null
attr.textContent=null => getAttribute()==""

Blink before this change:
attr.value=null => getAttribute()==null
attr.nodeValue=null => getAttribute()==null
attr.textContent=null => getAttribute()==null

Blink after this change:
attr.value=null => getAttribute()=="null"
attr.nodeValue=null => getAttribute()==""
attr.textContent=null => getAttribute()==""

Note that in the getAttribute()==null cases in WebKit and Blink,
hasAttribute() will still return true, which is very strange.

This change brings Blink into alignment with Firefox and IE, so the
risk of breakage ought to be very low.

The update-attribute-node-null-value-no-crash.html test serves no
purpose when Attr.value cannot be null, so it is removed.

BUG=460722

Review URL: https://codereview.chromium.org/1146393003

git-svn-id: svn://svn.chromium.org/blink/trunk@195785 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Oilpan: Unpoison orphaned large objects before zapping (patchset #3 id:40001 of https://codereview.chromium.org/1154733002/)
Reason for revert:
Broke ASAN compilation,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/builds/18648

Original issue's description:
> Oilpan: Unpoison orphaned large objects before zapping
> 
> To zap orphaned large objects, we need to unpoison the area.
> Otherwise ASan detects the error, although it seems there has been
> no orphaned large objects so far (by accident).
> 
> We're already doing that for orphaned normal pages.
> 
> This CL also adds a couple of ASSERTs that would be helpful.
> 
> BUG=420515
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195782

TBR=oilpan-reviews@chromium.org,keishi@chromium.org,haraken@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=420515

Review URL: https://codereview.chromium.org/1146393004

git-svn-id: svn://svn.chromium.org/blink/trunk@195783 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fix ordering of recorders in SVGPaintContext
The compositing recorder should go out of scope ("end") before the
(float) clip recorder to match the order in which they should be applied.

BUG=490363

Review URL: https://codereview.chromium.org/1149043003

git-svn-id: svn://svn.chromium.org/blink/trunk@195777 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Remove dead code from CanvasStyle
CanvasStyle::applyFill/StrokeColor are no longer used.

BUG=453113

Review URL: https://codereview.chromium.org/1152513003

git-svn-id: svn://svn.chromium.org/blink/trunk@195774 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: insist on eager sweeping for some objects.
To prepare for enabling lazy sweeping, non-Oilpan - add EAGERLY_SWEEP()
annotations for LifecycleObserver and DOMWindowProperty.

The former is a template, so extend range of EAGERLY_SWEEP() macros
to handle that also, along with ways to handle ambiguity.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1146353002

git-svn-id: svn://svn.chromium.org/blink/trunk@195772 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: complete current sweep before preparing for new GC.
If collectGarbage() is called while sweeping is in progress, complete
the sweeping before recording what GCState to revert back to should
we fail to get the other threads to stop at a safe point.

Otherwise we risk reverting back to a sweeping state that has been
completed & advanced past.

R=haraken
BUG=487952

Review URL: https://codereview.chromium.org/1153533002

git-svn-id: svn://svn.chromium.org/blink/trunk@195758 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Removed unused operator== for MatchRanges.
Not in use after r195675.

R=timloh@chromium.org

Review URL: https://codereview.chromium.org/1146013003

git-svn-id: svn://svn.chromium.org/blink/trunk@195757 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Make Attr.localName/name and Element.localName/tagName not nullable
This changes the generated code from v8SetReturnValueStringOrNull(...)
to v8SetReturnValueString(...), but there is no way to create an element
or attribute with an empty/null name, so the difference should never be
observable.

BUG=460722

Review URL: https://codereview.chromium.org/1145233003

git-svn-id: svn://svn.chromium.org/blink/trunk@195726 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Cleanup: Get rid of LayoutBlock::offsetFromLogicalTopOfFirstPage().
Fold its contents into LayoutBox::offsetFromLogicalTopOfFirstPage() and make
that one non-virtual. Some non-blocks (e.g. table rows and sections) do
establish layout states, so we cannot just unconditionally jump to the
containing block.

Currently offsetFromLogicalTopOfFirstPage() is never called on non-blocks (in
other words, the LayoutBox implementation of the method just sat there doing
nothing but contribute to the binary size), which explains why we had no bugs
because of this. I expect that non-blocks will call this method in the near
future, though.

R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1154493002

git-svn-id: svn://svn.chromium.org/blink/trunk@195709 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Changing out-of-flow-ness on a multicol child may affect the need for column sets.
If a sole out-of-flow child becomes in-flow, we have to insert a column set,
since we suddenly have column content.

Conversely, if a sole in-flow child becomes out-of-flow, we have to remove the
column set, since there's no column content anymore.

BUG=486993
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1148173003

git-svn-id: svn://svn.chromium.org/blink/trunk@195693 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Cleanup includes after DOMImplementation::hasFeature neutering
Unused after https://codereview.chromium.org/1108293002

R=philipj@opera.com
BUG=429536

Review URL: https://codereview.chromium.org/1148633004

git-svn-id: svn://svn.chromium.org/blink/trunk@195690 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Make ensureDefaultStyleSheetForElement parameter const reference.
R=mstensho@opera.com

Review URL: https://codereview.chromium.org/1150823004

git-svn-id: svn://svn.chromium.org/blink/trunk@195689 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
std::bitset solution for GL Query cache.
This uses even less memory (a few hundred bytes) by sacrificing some
worst case performance (in the order of a microsecond per query) and
maintainability.

Estimated memory savings will be 9-12 KB. (3 KB per QuerySyncManager).

BUG=485536
R=reveman@chromium.org,jbauman@chromium.org

Review URL: https://codereview.chromium.org/1129253006

Cr-Commit-Position: refs/heads/master@{#330933}
sigbjornf
Oilpan: ASan-exempt Heap::willObjectBeLazilySwept().
It will return true if its argument is an object that will be swept, hence
an exemption wrt ASan checks for poisoining is very much in order.

Also include some Timer-related leftovers not caught by r195656.

R=haraken
BUG=482838

Review URL: https://codereview.chromium.org/1150563005

git-svn-id: svn://svn.chromium.org/blink/trunk@195679 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Revamp asynchronous (load) event dispatching for SVG elements
Refactor asynchronous event dispatching for SVG elements to use
EventSender instead of the home-grown mechanism. This eliminates the
need for one timer (96 bytes on 64-bit targets) per <use> and <style>
element.

In SVGStyleElement, align with HTMLStyleElement, by adding an
implementation of Node::notifyLoadedSheetAndAllCriticalSubresources(),
replacing SVGStyleElement::sendSVGErrorEventAsynchronously().

The call in SVGUseElement::insertedInto is dropped, because it would
never cause an event to be dispatched (an event will only be dispatched
when the <use> is "structurally external"). There's a slight change in
behavior for SVGUseElement, since the event is now always dispatched,
regardless of existence of handlers.

Drop sendSVGLoadEventIfPossibleAsynchronously(), svgLoadEventTimer()
and svgLoadEventTimerFired() from SVGElement because they are now
unused.

Review URL: https://codereview.chromium.org/1150623003

git-svn-id: svn://svn.chromium.org/blink/trunk@195678 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Move AddressSanitizer.h to wtf/
ASan (no) annotation helper macros are useful outside of Oilpan, including
WTF, hence move it to there.

R=haraken,tkent

Review URL: https://codereview.chromium.org/1145073002

git-svn-id: svn://svn.chromium.org/blink/trunk@195676 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
No need to store ranges in MatchedPropertiesCache.
There was no need to store the UA/author rule ranges from the MatchResult
as those will be equal if the arrays of matched properties are equal.

R=esprehn@chromium.org,timloh@chromium.org,dstockwell@chromium.org

Review URL: https://codereview.chromium.org/1148023002

git-svn-id: svn://svn.chromium.org/blink/trunk@195675 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: more lazy sweep ASan exemptions.
Annotate the Timer methods called upon by sharedTimerFiredInternal()
as exempted by ASan checks also.

TBR=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1148943003

git-svn-id: svn://svn.chromium.org/blink/trunk@195656 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Shrinking EventPath to improve memory usage and performance
In bug 325460 EventPath was changed to have fewer allocations at the cost
of higher memory usage to improve performance. This is a followup that
adds one more allocation for lower memory usage and even higher (3-5%) 
Event dispatching performance.

The EventPath memory usage becomes an issue because even though there is,
most of the time, only one active Event. Due to slowness or garbage collection
delays there can actually be dozens or hundreds of Event objects in memory. In
those cases spending 1-2 KB per EventPath ends up consuming 100-200 KB memory.

The patch changes the EventPath builder to gather the path on the stack and
then building a perfectly sized EventPath. It seems to save about 1200 bytes per
event in my adhoc testing (typical event path depth is about 10-12) and
performance tests report:

Events/EventsDispatching  3.2% faster
Events/EventsDispatchingInDeeplyNestedShadowTrees  3.2% faster
Events/EventsDispatchingInShadowTrees  5.5% faster
(Confirmed through multiple runs)

Real world memory usage saving depends on the number of live Event objects. That
will vary.

R=hayato@chromium.org,sigbjornf@opera.com,rbyers@chromium.org,esprehn@chromium.org

BUG=487656,325460

Review URL: https://codereview.chromium.org/1136953011

git-svn-id: svn://svn.chromium.org/blink/trunk@195651 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Move m_pageLogicalOffset from LayoutBlock to LayoutBoxRareData.
This is about as rare as all the other pagination things, and, furthermore, in
the future, we're going to need this piece of information in other LayoutBox
derived classes than LayoutBlock, such as e.g. LayoutTableRow.

R=jchaffraix@chromium.org,leviw@chromium.org

Review URL: https://codereview.chromium.org/1148833002

git-svn-id: svn://svn.chromium.org/blink/trunk@195642 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Make Touch.radiusX/Y float and make Touch.webkit* aliases in the IDL
BUG=460099

Review URL: https://codereview.chromium.org/1149563003

git-svn-id: svn://svn.chromium.org/blink/trunk@195637 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
[S.P.] Expand cull-rect for text boxes with selection bounds
Highlights for selection/composition and document markers are painted
together with actual text, so the cull rect needs to have the bounds
from these included.

TEST=editing/selection/extend-by-character-002.html
BUG=486825

Review URL: https://codereview.chromium.org/1141403003

git-svn-id: svn://svn.chromium.org/blink/trunk@195632 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
[SP] Fix cull rect for fieldset painting
|paintRect| is shifted down/left and shrunk, so the dimension would be
too small.

TEST=fast/forms/fieldset-align.html
BUG=487281

Review URL: https://codereview.chromium.org/1151573002

git-svn-id: svn://svn.chromium.org/blink/trunk@195630 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Allow timer heap updates on firing shared timer.
Follow up the ASan exemptions from r195613 and allow timer heap updates
while servicing the shared timer callback. The Timer implementation of
fired() already checks that no access of near-dead objects is done.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1146903003

git-svn-id: svn://svn.chromium.org/blink/trunk@195620 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: support eager finalization/sweeping.
To accommodate objects that must be finalized promptly, add a designated
heap for these. If lazy sweeping is enabled, that heap will be swept
eagerly and not delayed until (say) an out-of-line allocation trigger
the sweep. If lazy sweeping is disabled, the eagerly swept heap will be
processed just like any other.

Prompt finalization is needed for objects that can be accessed through
"off-heap" references, like direct access from the embedder or through
a timer, or some other non-Oilpan object in Blink(*). References that have
been considered safe by carefully working through finalization order and
other lifetime dependencies. If such 'safe' lifetime dependencies rely on
the finalization of other heap objects, they cannot be assumed to hold
iff lazy sweeping is enabled. That's because all dead objects are then
not finalized synchronously, as observed by the rest of Blink, leading
to the possibility that 'off-heap' access of a heap object might
access an object that has yet to be finalized (but is known to be
dead), or that some of the heap objects it refers to may have
finalized by now. Regardless of exact state, an object that shouldn't
be accessed in this near-dead state by another party. Hence the
introduction of eagerly swept heaps -- all objects residing there
that have been deemed unreachable by the marking phase are eagerly
swept & finalized before the GC returns. Class hierarchies
are marked as eagerly swept by using the WILL_BE_EAGERLY_SWEPT(Class)
macro.

A very relevant follow-on question here is if we can reliably identify
objects that must be eagerly swept.

* - while the goal is to remove or otherwise bring all such off-heap
references under control within Blink, they currently exist. But
not profusely many, but more than we would like to while we're in
in a transition state where Oilpan isn't always enabled.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1138663002

git-svn-id: svn://svn.chromium.org/blink/trunk@195618 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove the Document.charset setter (making it readonly)
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/vr1RANmrniU/oWAoayNP74QJ

HTMLFormControlElementTest and HTMLSelectElementTest don't actually need
to call Document::setCharset(), as they use APIs where the text has
already been decoded from UTF-8.

BUG=438392

Review URL: https://codereview.chromium.org/1145773003

git-svn-id: svn://svn.chromium.org/blink/trunk@195617 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: disable VectorDestructorsWithVtable unit test with ASan.
Testing behavior of inline capacity vectors when contiguous container
support is enabled, is not worthwhile as they're disabled.
(cf Vector.h:INLINE_CAPACITY.)

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1148793002

git-svn-id: svn://svn.chromium.org/blink/trunk@195615 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Various ASan exemptions to allow Oilpan pre-sweep poisoning of unmarkeds.
Heap objects must not access other dead objects while finalizing.
To help catch out those that do, the Oilpan GC can now poison 
unmarked, to-be-swept objects. To be able to make use of that
with ASan enabled, a couple of benign accesses that run afoul
of that strict check are still needed & must be allowed to
make this feasible.

Here provided together -- the ones related to Timer stopping &
removal from the timer heap aren't something we'd typically want
to impose one the Blink codebase in general, but beside the
goal of better ASan coverage, the timer heap will soon be removed
and the need for these should fall away.

(Reland of r195609, non-Oilpan compilation issue addressed.)

R=haraken,tkent,yutak
BUG=420515

Review URL: https://codereview.chromium.org/1120943002

git-svn-id: svn://svn.chromium.org/blink/trunk@195613 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Various ASan exemptions to allow Oilpan pre-sweep poisoning of unmarkeds. (patchset #6 id:100001 of https://codereview.chromium.org/1120943002/)
Reason for revert:
Broke non-Oilpan ASAN compilation,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/builds/18615

Original issue's description:
> Various ASan exemptions to allow Oilpan pre-sweep poisoning of unmarkeds.
> 
> Heap objects must not access other dead objects while finalizing.
> To help catch out those that do, the Oilpan GC can now poison 
> unmarked, to-be-swept objects. To be able to make use of that
> with ASan enabled, a couple of benign accesses that run afoul
> of that strict check are still needed & must be allowed to
> make this feasible.
> 
> Here provided together -- the ones related to Timer stopping &
> removal from the timer heap aren't something we'd typically want
> to impose one the Blink codebase in general, but beside the
> goal of better ASan coverage, the timer heap will soon be removed
> and the need for these should fall away.
> 
> R=haraken,tkent,yutak
> BUG=420515
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195609

TBR=haraken@chromium.org,yutak@chromium.org,tkent@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=420515

Review URL: https://codereview.chromium.org/1144933004

git-svn-id: svn://svn.chromium.org/blink/trunk@195611 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r195600.
VisibleSelection finalization not needed with Oilpan.

TBR=oilpan-reviews
BUG=275851
NOTRY=true

Review URL: https://codereview.chromium.org/1150603002

git-svn-id: svn://svn.chromium.org/blink/trunk@195610 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Various ASan exemptions to allow Oilpan pre-sweep poisoning of unmarkeds.
Heap objects must not access other dead objects while finalizing.
To help catch out those that do, the Oilpan GC can now poison 
unmarked, to-be-swept objects. To be able to make use of that
with ASan enabled, a couple of benign accesses that run afoul
of that strict check are still needed & must be allowed to
make this feasible.

Here provided together -- the ones related to Timer stopping &
removal from the timer heap aren't something we'd typically want
to impose one the Blink codebase in general, but beside the
goal of better ASan coverage, the timer heap will soon be removed
and the need for these should fall away.

R=haraken,tkent,yutak
BUG=420515

Review URL: https://codereview.chromium.org/1120943002

git-svn-id: svn://svn.chromium.org/blink/trunk@195609 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Make right-most compound check explicit.
We set SelectorCheckingContext::elementStyle to null to indicate that we
were not in the rightmost compound selector. Use a flag in the context
instead to make it clearer what we mean.

An alternative would be to have a method inRightmostCompound() on the
context instead that checks the elementStyle for nullptr.

R=esprehn@chromium.org,timloh@chromium.org

Review URL: https://codereview.chromium.org/1133743004

git-svn-id: svn://svn.chromium.org/blink/trunk@195606 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't dispatch two 'load' events for external SVGScriptElement loads
If inserting an <svg:script> reference an external source via script,
ScriptLoaded would dispatch 'load' and then SVGScriptElement would
do the same. Drop the latter one.
Since this makes SVGScriptElement no longer use
SVGElement::sendSVGLoadEventIfPossibleAsynchronously(), drop the
svgLoadEventTimer() override and associated timer.

Review URL: https://codereview.chromium.org/1141683003

git-svn-id: svn://svn.chromium.org/blink/trunk@195604 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add a comment about counter availability in M44 branch
R=jochen@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/1127293006

git-svn-id: svn://svn.chromium.org/blink/trunk@195603 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove the deprecation messages for hspace/vspace attributes on table
The functionality itself was removed in time for M42:
https://codereview.chromium.org/690993003

Three milestones (M42-M44) of warnings after removal is enough.

BUG=277080

Review URL: https://codereview.chromium.org/1146493003

git-svn-id: svn://svn.chromium.org/blink/trunk@195601 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Drop the document.charset part of fast/encoding/external-script-charset.xhtml
Simplify to only test the inheritance, but use the koi8-r for the XHTML
document to ensure that it's not just the default encoding being used to
decode the script.

The bots cannot apply this patch because of the encoding of
LayoutTests/fast/encoding/external-script-charset-koi-8.js.

BUG=438392
R=pdr@chromium.org

Review URL: https://codereview.chromium.org/1144913002

git-svn-id: svn://svn.chromium.org/blink/trunk@195595 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Inline SVGTextLayoutAttributes::emptyValue
This function just returns a simple float - inlining it allows the
compiler to generate more efficient code (and smaller - ~.5k) code
since the relatively high overhead call can be eliminated.
Take the opportunity to change the "empty value" into NaN (instead of
"max() - 1"), with corresponding semantic changes required by that.

BUG=486669

Review URL: https://codereview.chromium.org/1129333004

git-svn-id: svn://svn.chromium.org/blink/trunk@195555 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r195535.
TBR=oilpan-reviews
BUG=483108
NOTRY=true

Review URL: https://codereview.chromium.org/1140343003

git-svn-id: svn://svn.chromium.org/blink/trunk@195543 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Disable multicol when printing.
Until crbug.com/99358 is fixed, we cannot really print multicol properly.

The old multicol implementation has code (in C++) to prevent multicol when
printing, but since the new implementation creates a different layout tree
structure for multicol, it's going to be quite some work to remove multicol
containers when switching the document to printing. So let's do it in CSS
instead.

R=rune@opera.com,dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1141943002

git-svn-id: svn://svn.chromium.org/blink/trunk@195531 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Setting -webkit-column-count to auto is the same as not setting it.
In ComputedStyle, column-count is represented by two members, one integer
specifying the count, and one bool specifying whether it's auto or not. If
column-count is auto, the integer is ignored, but if the integer changes, it's
still detected as a style change (even if auto is set to true), and we'll mark
for layout for no good reason. Make sure that setting column-count to auto also
resets the integer to its initial value, to avoid this problem.

This bug was discovered while working on
https://codereview.chromium.org/1141943002/ (disable multicol when printing).
When changing from not specifying column-count to setting it to auto triggers
relayout, some printing tests started to fail (but that's really just because
the current expectation files rely on crbug.com/489615 ).

R=rune@opera.com

Review URL: https://codereview.chromium.org/1145773002

git-svn-id: svn://svn.chromium.org/blink/trunk@195524 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Common up the determination of navigation policy.
Share the (little bit of) logic that determines the WebNavigationPolicy
to use when navigating to new content, including when creating a new
window to hold it.

R=mkwst,jochen
BUG=none

Review URL: https://codereview.chromium.org/1140463003

git-svn-id: svn://svn.chromium.org/blink/trunk@195521 bbb929c8-8fbe-4397-9dbb-9b2b20218538
christiank
Update GL_CHROMIUM_image with support for compressed formats.
This CL enables creation of compressed images using the
GL_CHROMIUM_image extension.

BUG=434699

Review URL: https://codereview.chromium.org/1128933006

Cr-Commit-Position: refs/heads/master@{#330489}
mstensho
Remove special handling of ::before and ::after on RUBY elements.
Special handling of ::before and ::after in RUBY was introduced in
https://bugs.webkit.org/show_bug.cgi?id=41040 , followed by some crash fixes,
most notably https://bugs.webkit.org/show_bug.cgi?id=55930 (which is what
caused this issue - crbug.com/484438 )

No spec requires such special handling, and neither IE nor Firefox does it, and
it just complicates the code.

Just treat them as they were a first or last DOM child of the RUBY parent.
That's how ::before and ::after normally works. This means that now ::before
and ::after will be part of, or even establish, ruby runs.

Added a test for the crasher.

Also rewrote three tests as reftests, since the expectations started to fail
anyway. One test was invalid (ruby-beforeafter.html), since it required special
handling of ::before and ::after, while the two others just got different
rendering due to this change.

BUG=484438
R=leviw@chromium.org,ojan@chromium.org

Review URL: https://codereview.chromium.org/1124313004

git-svn-id: svn://svn.chromium.org/blink/trunk@195506 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop SVGElement::synchronizeRequired* and synchronizeSystemLanguage
Empty, never called and never overridden.

Review URL: https://codereview.chromium.org/1141433004

git-svn-id: svn://svn.chromium.org/blink/trunk@195473 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the SVGSVGElement interface with the spec
Add use counters for the bits that have been removed from SVG 2.

The referenceElement arguments are not nullable in the spec, but that
seems to be a spec problem: https://github.com/w3c/svgwg/issues/16

BUG=460722, 313655

Review URL: https://codereview.chromium.org/1140343002

git-svn-id: svn://svn.chromium.org/blink/trunk@195466 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop ImageLoader::sourceURI
With xml:base removed, SVGImageLoader::sourceURI can be simplified,
making it the same as the HTMLImageLoader implementation. Fold into
the only caller (ImageLoader::imageSourceToKURL) and remove the
extension point.

BUG=341854

Review URL: https://codereview.chromium.org/1141323002

git-svn-id: svn://svn.chromium.org/blink/trunk@195465 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Maintain child dependent ComputedStyle flags if propagation stops.
There are two non-inherited flags in ComputedStyle which may be set as a
result of calculating the computed style of one of its descendants. Those
are the empty state flag, and the explicit inheritance flag. r190990
optimized propagation of inherited properties, but the mentioned flags
were not properly set if the propagation stopped at an element which had
children that would set these flags.

If a child-dependent flag is set in the old style, and there is no need
to inherit properties, and no children which needs a style recalc, copy
the flags from the old to the new ComputedStyle.

If there is no need to inherit properties, but some child needs a style
recalc, return Inherit to re-compute the child-dependent flags from its
children.

R=timloh@chromium.org,esprehn@chromium.org
BUG=487216

Review URL: https://codereview.chromium.org/1133263003

git-svn-id: svn://svn.chromium.org/blink/trunk@195462 bbb929c8-8fbe-4397-9dbb-9b2b20218538
christiank
glBindTexImage2DCHROMIUM should retain pixel format.
glBindTexImage2DCHROMIUM and glReleaseTexImage2DCHROMIUM will force the
texture format in the level info to GL_RGBA regardless of the internal
format used by the GLImage.

This CL address this by adding a GetFormat function to GLImage that
glBindTexImage2DCHROMIUM and glReleaseTexImage2DCHROMIUM will use when
updating the level info.

BUG=

Review URL: https://codereview.chromium.org/1140683002

Cr-Commit-Position: refs/heads/master@{#330336}
bratell
More compact representation of the GL Query cache.
The only thing we need to know per QuerySync block is its
index in the block sequence. Everything else can be
calculated from that if we just store a few numbers in
the Bucket objects.

Total memory reduction is 92%.

This is alt #2 in bug 485536.

BUG=485536

Review URL: https://codereview.chromium.org/1131913004

Cr-Commit-Position: refs/heads/master@{#330334}
philipj
Remove xml:base support
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/ZvArHAXyAHM/ftybb0waCKYJ

BUG=341854

Review URL: https://codereview.chromium.org/1137753004

git-svn-id: svn://svn.chromium.org/blink/trunk@195443 bbb929c8-8fbe-4397-9dbb-9b2b20218538
wdzierzanowski
Don't initialize decryptor on CDM creation failure
PpapiDecryptor::Create() must not proceed with decryptor initialization
if the CDM wrapper could not be created.
PpapiDecryptor::PpapiDecryptor() asserts the CDM wrapper is valid and
InitializeCdm() uses it unconditionally.

BUG=488363
TEST=EME tests pass

Review URL: https://codereview.chromium.org/1128693004

Cr-Commit-Position: refs/heads/master@{#330150}
rune
Forced style invalidation when clearing resolver no longer needed.
When the StyleInvalidator was stored on the RuleFeatureSet, we had to
invalidate with pending invalidations before clearing the RuleFeatureSets
as part of clearing the StyleResolver. After the StyleInvalidator was
moved to StyleEngine, this is no longer necessary as invalidation sets
are reference counted and can be used by the invalidator after their
stylesheets are nuked.

TEST=fast/css/invalidation/style-update-with-added-stylesheet.html

R=chrishtr@chromium.org,esprehn@chromium.org
BUG=401359

Review URL: https://codereview.chromium.org/1131793008

git-svn-id: svn://svn.chromium.org/blink/trunk@195407 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r195398.
TBR=oilpan-reviews
BUG=470036
NOTRY=true

Review URL: https://codereview.chromium.org/1135203007

git-svn-id: svn://svn.chromium.org/blink/trunk@195399 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r195375.
TBR=oilpan-reviews
BUG=441552
NOTRY=true

Review URL: https://codereview.chromium.org/1133353003

git-svn-id: svn://svn.chromium.org/blink/trunk@195396 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
MemoryCache::resourceForURL(): add argument validation.
If querying the cache for the resource mapping of an empty or invalid
URLs, return no resource, mirror the behavior of getEntryForResource().

R=japhet
BUG=431640

Review URL: https://codereview.chromium.org/1142523002

git-svn-id: svn://svn.chromium.org/blink/trunk@195366 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: move NavigationScheduler's redirect actions onto the heap.
As NavigationScheduler is attached to a LocalFrame, arrange for its
ScheduledNavigation actions to be on the Oilpan heap also, so that
any of its traceable references are accurately accounted for.

R=peria,haraken
BUG=340522

Review URL: https://codereview.chromium.org/1133303007

git-svn-id: svn://svn.chromium.org/blink/trunk@195342 bbb929c8-8fbe-4397-9dbb-9b2b20218538
landell
Return EOS when selected_range_ is NULL in SourceBufferStream
Fixes the issue where an OnSetDuration call truncates the selected_range_ and resets the
next_buffer_position. kEndOfStream is now returned instead of kNeedBuffer from
GetNextBufferInternal when selected_ranges_ is NULL.

BUG=484992

Review URL: https://codereview.chromium.org/1119163005

Cr-Commit-Position: refs/heads/master@{#329753}
sigbjornf
Oilpan: add release assert to catch nested GCs.
Sanity check that collectGarbage() isn't called while already GCing.

R=haraken
BUG=480852

Review URL: https://codereview.chromium.org/1141543002

git-svn-id: svn://svn.chromium.org/blink/trunk@195310 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove unused UseCounter features
These are the reviews in which the enum values became unused:

AnimationConstructorKeyframeListEffectDoubleTiming and
ElementAnimateKeyframeListEffect*Timing:
https://codereview.chromium.org/947923002

AudioContextCreateStereoPanner (never used):
https://codereview.chromium.org/799403007

DevToolsConsoleTimeline:
https://codereview.chromium.org/750983003

DOMImplementationHasFeature*:
https://codereview.chromium.org/1108293002

FontFaceSetReady:
https://codereview.chromium.org/816923002

MixedContentPrivateIPInPublicWebsiteActive/Passive:
https://codereview.chromium.org/842783002

ServiceWorkerClientsGetAll:
https://codereview.chromium.org/1056973003

TimelineStart:
https://codereview.chromium.org/1113173003

Review URL: https://codereview.chromium.org/1141733002

git-svn-id: svn://svn.chromium.org/blink/trunk@195305 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop assert for degenerate cases in FloatRoundedRect::radiusCenterRect()
This method is only used by BoxClipper, to provide a conservative
estimate of a rectangle enclosed by the rounded (inner) rectangle.
Since it's unproblematic to provide a conservative estimate for the
"degenerate" cases [1], do that instead of asserting.
Reformulate the implementation using FloatRectOutsets. The only
functional change is that there no longer is an implicit conversion
from float to int.

[1] As defined by isRenderable().

BUG=458505, 477826

Review URL: https://codereview.chromium.org/1136083002

git-svn-id: svn://svn.chromium.org/blink/trunk@195299 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Apply bleed-avoidance insets _after_ constraining the border
When shrinking the background to avoid bleeding artifacts, apply the
inset after computing and constraining the (outer) border. If the
shrinking inset is applied before constraining, the shape of the border
will differ in some (extreme) cases. It's also more consistent with
how 'double' style borders are handled.
This allows dropping the optional FloatRectOutsets argument from
ComputedStyle::getRoundedBorderFor() and
BoxPainter::getBackgroundRoundedRect().

BUG=473119,445598

Review URL: https://codereview.chromium.org/1137513003

git-svn-id: svn://svn.chromium.org/blink/trunk@195263 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Determine maximum distinguishing argument index runtime, if needed
If an overloaded method is partially runtime enabled such that its
"longest" overload(s) might be disabled, we need to determine the
maximum distinguishing argument index runtime, to avoid using an index
for which all actual overloads are disabled, since that would typically
cause us to incorrectly reject the call as not matching any overload.

The implementation is largely a copy of the existing and very similar
runtime determination of the correct Function.length value.

While we're at it, drop the overloads['minarg'] value, which was just a
less accurate variant of overloads['length'] used in a few places where
it didn't really matter anyway.

BUG=486249

Review URL: https://codereview.chromium.org/1132243004

git-svn-id: svn://svn.chromium.org/blink/trunk@195251 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
A GL Query cache of 1024 items is enough (was 4096).
Since each QuerySyncManager has its own cache, even a moderate
cache size expands to several hundred KB of memory usage. This makes
it slightly smaller to save some of that memory. It is believed
to be unlikely that the cache has to be big anyway.

In ad-hoc testing I've only seen 20 queries in total (unclear how
many of them were in parallel).

(This is alt #1 in bug 485536)

BUG=485536
R=reveman@chromium.org

Review URL: https://codereview.chromium.org/1138463003

Cr-Commit-Position: refs/heads/master@{#329383}
fs
Test for constrained background bleed
TBR=fmalita@chromium.org
BUG=445598

Review URL: https://codereview.chromium.org/1134183002

git-svn-id: svn://svn.chromium.org/blink/trunk@195233 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mpawlowski
Don't create a sync node when updating an URL that wasn't typed.
TypedUrlChangeProcessor is a HistoryService observer and gets notified
about changes to all addresses, not just typed ones. This means that
when HistoryService::SetPageTitle() is called for a non-typed URL,
TypedUrlChangeProcessor::OnURLsModified() will be triggered and,
consequently, TypedUrlChangeProcessor::CreateOrUpdateSyncNode().
As the name suggests, if the modified node was not previously present
(because it was filtered out by ShouldSyncVisit() in OnURLVisited()),
it would be created.
End effect was that *all* URLs that had their title updated (which means
every page that has a <title> tag) were synced, even if they were not typed.

The solution is to return early in CreateOrUpdateSyncNode() if we detect
that the URL in question has no typed visits.

(Caused by https://codereview.chromium.org/1087773002/)

BUG=

Review URL: https://codereview.chromium.org/1126633005

Cr-Commit-Position: refs/heads/master@{#329370}
sigbjornf
Oilpan: fix build after r195182.
TBR=oilpan-reviews
BUG=463143
NOTRY=true

Review URL: https://codereview.chromium.org/1139783002

git-svn-id: svn://svn.chromium.org/blink/trunk@195194 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Make idl_type.is_wrapper_type false for callback interfaces
Callback interface types (when used as method arguments) have special
pre-conversion error handling, and special conversion code, and making
idl_type.is_wrapper_type false disables the normal interface type
error handling that is generated after the conversion (by checking for
null) when [TypeChecking=Interface].

Other effects of making idl_type.is_wrapper_type false for callback
interfaces are:

- Callback interface types can no longer be used as arguments to methods
  implemented in private script. Reverting this effect would be trivial.

- If a callback interface type argument is the distinguishing argument
  for an overloaded method, we stop generating code that doesn't compile
  and instead generate no code at all for that method overload.

BUG=462561

Review URL: https://codereview.chromium.org/1134073002

git-svn-id: svn://svn.chromium.org/blink/trunk@195181 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Avoid division-by-zero in SVGLengthContext::convertValueFromUserUnits
If the viewport is valid but empty, we could end up dividing by zero,
which could produce either Infinity or NaN.
This could end up triggering an assert when creating a
CSSPrimitiveValue for the SVGLength in question.

TEST=http/tests/cache/smil-usecounter-in-cached-image.html
BUG=485973

Review URL: https://codereview.chromium.org/1133783003

git-svn-id: svn://svn.chromium.org/blink/trunk@195174 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Prevent SVG children from participating in an ancestor multicol context.
foreignObjects and their children must never see an ancestor flow thread, and
we need to convince all parts of the code that they are not "paginated".

BUG=486000
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1131283004

git-svn-id: svn://svn.chromium.org/blink/trunk@195164 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: keep ImageData on the heap by default.
R=haraken, junov
BUG=479467

Review URL: https://codereview.chromium.org/1084313004

git-svn-id: svn://svn.chromium.org/blink/trunk@195152 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Add support for new-ish V8 use counters (patchset #2 id:20001 of https://codereview.chromium.org/1135753002/)
Reason for revert:
The v8 use counters now being handled are reported over an Isolate for which callingExecutionContext() fails --

  https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Mac_Oilpan__dbg_/9995/layout-test-results/results.html

(first build on Mac Oilpan(dbg) with the new crashes.)

Original issue's description:
> Add support for new-ish V8 use counters
> 
> R=jochen@chromium.org
> BUG=
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195119

TBR=jochen@chromium.org,erikcorry@chromium.org,erik.corry@gmail.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review URL: https://codereview.chromium.org/1131413002

git-svn-id: svn://svn.chromium.org/blink/trunk@195151 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r195134.
TBR=oilpan-reviews
BUG=466631
NOTRY=true

Review URL: https://codereview.chromium.org/1131263009

git-svn-id: svn://svn.chromium.org/blink/trunk@195142 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Clean up nth-index calculation in SelectorChecker.
Use a 1-based index consistently to avoid +/-1 adjustments and rename
countElement*Before/After to nth*Index since that is what it is used for.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/1135503004

git-svn-id: svn://svn.chromium.org/blink/trunk@195113 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fixup reference for svg/animations/viewspec-checkaspectparams.html
Use the expected 'viewBox' and 'preserveAspectRatio' instead, and
modify the <rect> to match what's in the resources/ svg-file.
Drop a redundant semicolon from the view-spec (this is not a parsing
test).

BUG=235256

Review URL: https://codereview.chromium.org/1131233002

git-svn-id: svn://svn.chromium.org/blink/trunk@195110 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Don't conflate intrinsic width and height with logical width and height
This is wrong in vertical writing mode and shouldn't be necessary. The
intrinsic dimensions are propagated from attributes to properties in
SVGSVGElement::collectStyleForPresentationAttribute().

BUG=484425

Review URL: https://codereview.chromium.org/1128893002

git-svn-id: svn://svn.chromium.org/blink/trunk@195104 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Oilpan: Enable lazy sweeping on non-oilpan builds (patchset #2 id:20001 of https://codereview.chromium.org/1055193004/)
Reason for revert:
The use of lazy sweeping appears to be behind this ASan regression,

 https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux_ASAN/18437/layout-test-results/http/tests/serviceworker/fetch-canvas-tainting-crash-log.txt

i.e., it risks lifecycle notification touching already finalized & freed objects.

Original issue's description:
> Oilpan: Enable lazy sweeping on non-oilpan builds
> 
> Currently lazy sweeping is enabled only on oilpan builds. Since the lazy sweeping has been stable on the oilpan builds for >3 months, I think it's now safe to enable it on non-oilpan builds as well.
> 
> BUG=480837
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194808
> 
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=195022

TBR=oilpan-reviews@chromium.org,haraken@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=480837

Review URL: https://codereview.chromium.org/1133563004

git-svn-id: svn://svn.chromium.org/blink/trunk@195067 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Return vertical writing mode aware intrinsic information for SVG
Values returned from computeIntrinsicRatioInformation are assumed to
be logical, i.e. they should take writing mode into consideration.

BUG=484425

Review URL: https://codereview.chromium.org/1128093002

git-svn-id: svn://svn.chromium.org/blink/trunk@195059 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: remove explicit conversion of getNamedItems()' result, not needed.
Following r189132, there is no ambiguity in implicitly converting the
RawPtr<StaticElementList> in adopt()'s result. Retire the explicit
conversion and FIXME.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1130113003

git-svn-id: svn://svn.chromium.org/blink/trunk@195052 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Add tests for SVG sizing inside vertical writing mode
BUG=484425

Review URL: https://codereview.chromium.org/1129763002

git-svn-id: svn://svn.chromium.org/blink/trunk@195041 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Support type selector for camel-cased SVG elements in HTML.
In HTML documents, type selectors are case-insensitive for HTML elements,
but case sensitive for SVG elements [1]. We store the lower case version
of the type selector. For SVG elements, the tag name is normalized to
the camel-case version during parsing. That means we would never match
SVG tag names containing upper-case letters in HTML documents.

This CL matches SVG tag names case-insensitively in HTML documents. That
is not correct according to spec, but at least makes it possible to use
type selectors for SVG elements in HTML documents.

Since the tag name for SVG elements are still stored camelCased, we need
to lower the localName() before using it collecting tag rules from rule
sets or collecting tag name hashes for the the bloom filter.

[1] https://html.spec.whatwg.org/multipage/scripting.html#selectors

BUG=237435

Review URL: https://codereview.chromium.org/1099963003

git-svn-id: svn://svn.chromium.org/blink/trunk@195038 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: switch some leftover raw references over to traced Member<>s.
R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1130793002

git-svn-id: svn://svn.chromium.org/blink/trunk@195035 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194987.
TBR=oilpan-reviews
BUGS=484953
NOTRY=true

Review URL: https://codereview.chromium.org/1123353003

git-svn-id: svn://svn.chromium.org/blink/trunk@194989 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Make v8_utilities.py not depend on v8_types.py
This is useful since v8_types.py depends on v8_utilities.py, indirectly.
Thus, if v8_utilities.py imports v8_types like it currently does, it is
not possible to import v8_utilities unless v8_types has been imported
first.

All v8_utilities.py actually used from v8_types.py was a helper function
that returns a string with 'V8' prepended. I think we can afford to
duplicate this functionality.

Review URL: https://codereview.chromium.org/1129803002

git-svn-id: svn://svn.chromium.org/blink/trunk@194981 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
Remove ed+blinkwatch@opera.com from watchlist.
TBR=pdr

Review URL: https://codereview.chromium.org/1123223002

git-svn-id: svn://svn.chromium.org/blink/trunk@194979 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Avoid extra copy of CSS data.
operator+ will always create new string buffers and that is a bit
unnecessary if one of the strings that are concatenated is empty.

By switching from operator+ to String::append TextResource::decodedText()
can avoid a copy almost always since the flush string will almost always
be empty.

BUG=484713
R=mkwst@chromium.org

Review URL: https://codereview.chromium.org/1122103005

git-svn-id: svn://svn.chromium.org/blink/trunk@194975 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Rename findSetLayoutObjects() to mapDescendantToColumnSet()
It got renamed from findSetRendering() to findSetLayoutObjects() during the
render -> layout rename. findSetLayoutObjects() isn't a meaningful name. Then
again, findSetRendering() wasn't a great name either (it meant "find the column
set that renders (paints, hit-tests, etc.) the specified layoutObject", but
that probably wasn't too clear). So let's try with mapDescendantToColumnSet(),
which more accurately describes what the method does.

R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1124133002

git-svn-id: svn://svn.chromium.org/blink/trunk@194974 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Gracefully handle backdoor cancellations of synchronous resource fetches.
When fetching a resource synchronously (via XHR, say), messages can be
handled & dispatched while that fetch is ongoing. These may in the general
case bring about the cancellation of the resource being synchronously
fetched. Be prepared for that eventuality when the (failing) synchronous
fetch returns.

R=jochen
BUG=484101

Review URL: https://codereview.chromium.org/1129743002

git-svn-id: svn://svn.chromium.org/blink/trunk@194973 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: handle thread-local weak tracing slightly better.
The implementation of marking is marking-thread centric, recording a
thread stack limit that the tracing through the object graph cannot
exceed. If it does, the implementation will use the explicit mark
stack instead of trying to eagerly trace the object, if unmarked.

Tracing will in the general case also happen on a per-thread basis,
when handling the weak pointer callbacks after the initial marking
phase has completed. Using the marking thread's stack limit to determine
eagerness or not of a trace call when that weak tracing runs doesn't
make much sense.

To address, eager tracing is not enabled whilst processing the
per-thread weak pointer callbacks. As the amount of tracing is rather
moderate for this stage, there are no performance concerns with
disabling this optimization.

R=haraken
BUG=420515
TEST=HeapTest.ThreadedStrongification

Review URL: https://codereview.chromium.org/1125613002

git-svn-id: svn://svn.chromium.org/blink/trunk@194970 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Adding missing profile.h include to extensions code.
external_pref_loader.cc uses profile.h so it needs to include it and
not rely on some other random code to include it. Fixes compilation
problems in certain configurations.

Review URL: https://codereview.chromium.org/1126543003

Cr-Commit-Position: refs/heads/master@{#328511}
bratell
Add build dependency: ui/app_list uses ui/base/ime
The code in ui/app_list/views/search_box_view.cc was importing
ui/base/ime/text_input_flags.h, which was violating a dependency,
resulting in a compile problem for a downstream project. Fixed by
allowing this dependency.

R=sadrul@chromium.org,mgiuca@chromium.org

Review URL: https://codereview.chromium.org/1127603002

Cr-Commit-Position: refs/heads/master@{#328506}
mstensho
Cleanup: Remove LayoutRegion.
Move what was in use by the derived class LayoutMultiColumnSet into said
derived class, and delete the rest (such as setIsValid() / isValid(),
which are remnants from the region days).

R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1122323002

git-svn-id: svn://svn.chromium.org/blink/trunk@194965 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: address ScrollableArea-induced build breakage from r194957.
ScrollableArea is not an Oilpan allocated mixin currently, so in order
to support the assumption of RootFrameViewport that all ScrollableAreas
are allocated the same way, pull PinchViewport off the Oilpan heap
(PinchViewport being the only ScrollableArea that was Oilpan controlled.)

This is not ideal, but a shorter term measure to unbreak Oilpan builds.
Making ScrollableArea a GC mixin would be the longer term solution, but
that's not a straightforward task.

TBR=oilpan-reviews
BUG=443724
NOTRY=true

Review URL: https://codereview.chromium.org/1127023002

git-svn-id: svn://svn.chromium.org/blink/trunk@194964 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Invalidate ancestor resources in when relative lengths change
If a LayoutObject within a resource had relative lengths, and the viewport
changed, only the object itself would be invalidated - not any of the
clients of the resource. This would fail to invalidate the cached display
item with Slimming Paint.
Modify SVGClipPathElement::selfHasRelativeLengths() to indicate if any
of the children have relative lengths, to make sure the clients are
invalidated in that case. (SVGClipPathElement will otherwise never indicate
that it has relative lengths.)

Fixes svg/custom/viewport-resource-inval.svg with Slimming Paint enabled.

BUG=477743

Review URL: https://codereview.chromium.org/1111223002

git-svn-id: svn://svn.chromium.org/blink/trunk@194949 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Cleanup: Only need one bit (not two) to express flow thread state.
The InsideOutOfFlowThread / InsideInFlowThread distinction is a relic from the
CSS Regions days. Just telling whether we're a descendant of a flow thread or
not is enough.

R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1124993002

git-svn-id: svn://svn.chromium.org/blink/trunk@194945 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Harden changing font style over unknown elements.
When adjusting the start node position of where to apply a font style
command, check that we haven't stepped off the end.

R=leviw
BUG=484434

Review URL: https://codereview.chromium.org/1124863003

git-svn-id: svn://svn.chromium.org/blink/trunk@194944 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
Set correct class name for interfaces with disabled partials
If an runtime enabled interface was disabled, we'd initialize its
v8::FunctionTemplate's class name to the empty string. We'd also do this
if a runtime enabled *partial* interface was disabled, even though the
interface as a whole was enabled, which is clearly wrong.

As a simple fix, simply always set the interface's real name. If the
interface is disabled, it won't matter what it's set to anyway.

BUG=475830

Review URL: https://codereview.chromium.org/1126543010

git-svn-id: svn://svn.chromium.org/blink/trunk@194937 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194911.
TBR=oilpan-reviews
BUG=484004
NOTRY=true

Review URL: https://codereview.chromium.org/1129533002

git-svn-id: svn://svn.chromium.org/blink/trunk@194921 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert Range firstNode/pastLastNode() refactoring.
The calculation of these two end points cannot in general be done by way of
anchor offsetting of the start/end node -- such an anchor may not exist.

Hence, revert their implementations back to how they were prior to r191892. The
functionality that r191892 added to Position has separate uses, and is kept.

R=haraken
BUG=484103

Review URL: https://codereview.chromium.org/1121633004

git-svn-id: svn://svn.chromium.org/blink/trunk@194918 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Allow safe_browsing_mode overriding in gn build
BUG=

Review URL: https://codereview.chromium.org/1122763003

Cr-Commit-Position: refs/heads/master@{#328298}
mstensho
Enable new multicol for testing and experimental web platform features.
This is a re-land of https://codereview.chromium.org/1028383002

There's already a RuntimeEnabledFeatures flag for region based
(aka. "new") multicol. So far it's only been used to toggle support
for column-fill (only supported in the new implementation), but will
from now on be used to determine whether to use the region based
implementation or not.

Remove internals.settings.setRegionBasedColumnsEnabled().

We need to keep a method for region based multicol (that does nothing)
in WebSettings for now, since it's still being called from the
Chromium side. Will be cleaned up later, when the
--enable-region-based-columns command line flag (which from now on has
no effect) is gone. See crbug.com/350853

Remove virtual/regionbasedcolumns tests, since region based multicol
is what's tested by default from now on. At the same time, add
virtual/stable/ tests, so that we still get test coverage for the old
implementation, since that's still what's shipping. This move causes
many changes in TestExpectations. All multicol test expectations that
used to be foo/* will now be virtual/stable/foo/* , and everything
that used to be virtual/regionbased/foo/* is now foo/* .

svg/text/columns-do-not-apply.html now passes again.

A few test expectations also need to be updated:

fast/dom/Element/getBoundingClientRect.html: Regenerated expectation
file. New multicol has improved column balancing, resulting in 6px
shorter columns.

fast/borders/border-antialiasing.html: Schedule for
rebaseline. Clipping improvements in new multicol.

fast/repaint/multicol-as-paint-container.html: Schedule for
rebaseline. Different individual rectangles, but same resulting
rectangle.

fast/repaint/multicol-repaint.html: Schedule for rebaseline. Clipping
improvements in new multicol.

BUG=334335, 467468
R=dsinclair@chromium.org,jchaffraix@chromium.org,kbr@chromium.org

Review URL: https://codereview.chromium.org/1119293002

git-svn-id: svn://svn.chromium.org/blink/trunk@194883 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: use transition type for MemoryCache::resourcesForURL()'s result.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1125733002

git-svn-id: svn://svn.chromium.org/blink/trunk@194874 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Remove some svg/custom/ repaint tests from TestExpectations
After getting new baselines in https://codereview.chromium.org/1115723003/
these test now appear green and stable:

  deep-dynamic-updates.svg
  js-update-gradient.svg
  js-update-pattern.svg
  js-update-pattern-child.svg
  js-update-stop.svg
  js-update-stop-linked-gradient.svg
  use-disappears-after-style-update.svg

TBR=pdr@chromium.org
BUG=371651

Review URL: https://codereview.chromium.org/1115213006

git-svn-id: svn://svn.chromium.org/blink/trunk@194872 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
firstRectForCharacterRange(): don't fall over in an editable-less frame.
Have this test-only method gracefully handle the case where it is
attempted used in a document having no editable element.

R=haraken
BUG=483639

Review URL: https://codereview.chromium.org/1122593004

git-svn-id: svn://svn.chromium.org/blink/trunk@194870 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
Avoid nearly identical toImplArray() and toImplHeapArray()
The only difference is the vector type, which can be made the template
argument. The value type is available as VectorType::ValueType.

BUG=

Review URL: https://codereview.chromium.org/1125683002

git-svn-id: svn://svn.chromium.org/blink/trunk@194867 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop comment about svg/custom/js-late-[clipPath,gradient}-...svg tests
Appear stable after fixups in https://codereview.chromium.org/1111323002

Rebaseline for virtual/slimmingpaint/ to include the
"paintInvalidationClients" information.

TBR=pdr@chromium.org
BUG=353301,302529,477743

Review URL: https://codereview.chromium.org/1122073002

git-svn-id: svn://svn.chromium.org/blink/trunk@194865 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Simplified layout also needs to mark spanner placeholders for layout.
If the actual column-span:all object needs layout, so does the placeholder.
There was code to ensure this for normal layout, but not for simplified layout
(when we just want to drill into the tree and locate the containing block of
some absolutely positioned object.

BUG=483976
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1120313003

git-svn-id: svn://svn.chromium.org/blink/trunk@194861 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Shut down RenderViewTest's scheduler before Blink is.
As the former may finalize tasks that are Blink allocated.

R=skyostil,haraken,jochen
BUG=420515

Review URL: https://codereview.chromium.org/1118383002

Cr-Commit-Position: refs/heads/master@{#328107}
sigbjornf
Sever HTMLImportChild client connection upon disposal.
Move the notification of the HTMLImportChild going away to its dispose()
method (instead of its destructor.) It is unsafe to access the
HTMLImportChild after its loader has been cleared, which happens as
part of disposal. Hence, clear the client connection at the same time.

This is essential for Oilpan, where HTMLImportChild destruction will not
happen synchronously with disposal.

R=haraken
BUG=458222

Review URL: https://codereview.chromium.org/1119033003

git-svn-id: svn://svn.chromium.org/blink/trunk@194847 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Have HTMLScriptRunner's list of scripts use a transition type.
r194793 introduced an Oilpan heap type for the ordered list of
scripts-to-execute-when-finished-parsing. Until HTMLScriptRunner
is always on the Oilpan heap, that's one step too far.

Use the appropriate transition type instead.

TBR=haraken,oilpan-reviews
BUG=475801
NOTRY=true

Review URL: https://codereview.chromium.org/1117973004

git-svn-id: svn://svn.chromium.org/blink/trunk@194840 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: unpoison large object payload before finalizing.
R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1117273002

git-svn-id: svn://svn.chromium.org/blink/trunk@194819 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Missing m_registeredAsCandidate = false.
Added a missing reset of registeredAsCandidate when calling
removeStyleSheetCandidateNode() from clearDocumentData().

BUG=468267

Review URL: https://codereview.chromium.org/1102003002

git-svn-id: svn://svn.chromium.org/blink/trunk@194799 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Check method.visible for methods implemented in private script
When an interface has partial interfaces in modules/, methods declared
in the partial interfaces are present in interface['methods'] for the
Jinja templates to see, but with method['visible'] set to false, meaning
code shouldn't be generated.

This flag wasn't checked when the private script trampoline of a method
implemented in private script was generated, leading to the trampoline
being defined both in core/v8/V8Foo.cpp and modules/v8/V8FooPartial.cpp.

BUG=341031

Review URL: https://codereview.chromium.org/1113023002

git-svn-id: svn://svn.chromium.org/blink/trunk@194747 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
Make DOMImplementation.hasFeature() always return true.
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/dznPapFTuZo/mpGybpVpEK4J

BUG=429536

Review URL: https://codereview.chromium.org/1108293002

git-svn-id: svn://svn.chromium.org/blink/trunk@194736 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Null check collection handling dirty scopes.
When a shadow subtree containing a style element with a loading @import is
removed from the DOM, StyleEngine::removePendingSheet() will be called,
which in turn calls markTreeScopeDirty(). The collection has already been
removed from m_styleSheetCollectionMap in StyleEngine has already been for
the shadow root, which will lead to the collection being null when the
dirty tree scopes are being handled in
StyleEngine::updateActiveStyleSheetsInShadow().

Check that the node is in the Document before calling markTreeScopeDirty().

R=tasak@chromium.org
BUG=482087,468267,463031

Review URL: https://codereview.chromium.org/1106313003

git-svn-id: svn://svn.chromium.org/blink/trunk@194733 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove unnecessary clearing of AX object cache in Document destructor.
Only frame-attached Documents can have an AX object cache. All such
Documents will be explicitly detached; detach() will clear the AX
object cache. Thus clearing it again in the destructor ought to be
redundant -- leave in an assert to verify that this assumption will hold.

R=dmazzoni,haraken

Review URL: https://codereview.chromium.org/1116773003

git-svn-id: svn://svn.chromium.org/blink/trunk@194732 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Cleanup color space resolution for ReferenceFilterBuilder
There's some dodgy-looking code, used by ReferenceFilterBuilder::build
to compute a ColorSpace for each filter primitive. Convert it to
compute an EColorInterpolation instead, and then resolve the ColorSpace
from that similarly to how LayoutSVGResourceFilter::buildPrimitives
does it. Also try to make it "cascade" the value in a more proper way,
rather than just selecting the value from the filter or the primitive.
This moves the two code-paths a bit closer to each other.

Also convert ReferenceFilterBuilder::build(...) to take references as
arguments where it makes sense.

BUG=109224

Review URL: https://codereview.chromium.org/1106973004

git-svn-id: svn://svn.chromium.org/blink/trunk@194729 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Don't cache nth-indices of pseudo elements.
A pseudo element is not found in its parent's child list. That caused an
assert while trying to cache the nth-index for a ::before element while
matching style for the ::before element's scrollbar pseudo elements.
Instead, skip the caching part and traverse siblings to fall back to the
behavior we had before the NthIndexCache.

Trying to get custom scrollbar style for pseudo elements with scrolling
overflow will not work, but never did. It's not currently possible to
match ::before::-webkit-scrollbar, and a universal ::-webkit-scrollbar
will not match scrollbars in pseudo elements like ::before, either.

R=esprehn@chromium.org
BUG=481495

Review URL: https://codereview.chromium.org/1108783002

git-svn-id: svn://svn.chromium.org/blink/trunk@194728 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Move StyleInvalidator to StyleEngine.
This is part of componentizing style resolving. We want to get rid of as
much as possible of global style data like RuleFeatureSet. We decouple the
StyleInvalidator from RuleFeatureSet and keep a single StyleInvalidator
in the StyleEngine. This removes a bunch of unused StyleInvalidators from
other RuleFeatureSets than the global one.

The plan ahead is to collect invalidation sets from rulesets in tree
scopes instead of the global one.

BUG=401359

Review URL: https://codereview.chromium.org/1111643003

git-svn-id: svn://svn.chromium.org/blink/trunk@194726 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Update baselines for some svg/custom/ tests
The existing baselines are so old, that it's hard to tell if the tests
are still flaky/broken.

TBR=pdr@chromium.org
BUG=371651

Review URL: https://codereview.chromium.org/1115723003

git-svn-id: svn://svn.chromium.org/blink/trunk@194722 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Attempt to deflake svg/custom/js-late-{clipPath,gradient}-and-...svg
Set testIsAsync to true and call finishRepaintTest(). Use runAfterDisplay
instead of setTimeout(..., 0);

Mark for rebaselining because the current baselines are a bit rotten.

BUG=353301,302529

Review URL: https://codereview.chromium.org/1111323002

git-svn-id: svn://svn.chromium.org/blink/trunk@194720 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix webkit unit tests after r194688.
When a plugin element is detached, Oilpan dispose()s of the plugin
container to clear out required references. Take that into account
when checking for detached state in isRectTopmost().

TBR=oilpan-reviews
BUG=476590
NOTRY=true

Review URL: https://codereview.chromium.org/1112953003

git-svn-id: svn://svn.chromium.org/blink/trunk@194703 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Never composite flow threads.
This will prevent flow threads from becoming paint invalidation containers.

There's an assertion in LayoutFlowThread::mapRectToPaintInvalidationBacking()
on the paint invalidation container not being the flow thread. The (very
recent) fix for issue 481663 also tried to avoid this assertion, but obviously
didn't manage to catch all cases.

BUG=482420
R=chrishtr@chromium.org,dsinclair@chromium.org,wangxianzhu@chromium.org

Review URL: https://codereview.chromium.org/1109383002

git-svn-id: svn://svn.chromium.org/blink/trunk@194680 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Gracefully handle unruly children detaching our frame and client.
When committing the load of a new document to a frame, any current
document is first detached, along with the child frames. Should these
children trigger the detachment of the frame getting a new document,
by updating the frame tree above us, simply abandon the frame loading
operation.

R=japhet,dcheng
BUG=476837

Review URL: https://codereview.chromium.org/1116763002

git-svn-id: svn://svn.chromium.org/blink/trunk@194679 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194661.
TBR=oilpan-reviews
BUG=478507
NOTRY=true

Review URL: https://codereview.chromium.org/1116743002

git-svn-id: svn://svn.chromium.org/blink/trunk@194673 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Treat a stopped AudioContext as closed.
An AudioContext that ends up being detached&stopped by its
execution context is now treated on equal terms to one that
has been explicitly close()d from script. AudioContext methods
and operations over a context in such a state will now throw.

This restriction applies to OfflineAudioContext as well as
AudioContext.

R=rtoy
BUG=435867

Review URL: https://codereview.chromium.org/1111213002

git-svn-id: svn://svn.chromium.org/blink/trunk@194666 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Out-of-flow objects don't establish column sets.
If a multicol container only contains out-of-flow objects, there'll be no
column sets, so when determining the need to create one while inserting another
(in-flow) object, we need to ignore out-of-flow objects whose containing block
is not within the flow thread.

BUG=482352
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1110383002

git-svn-id: svn://svn.chromium.org/blink/trunk@194659 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Disallow multicol on replaced content and fieldsets.
It's meaningless to multicol replaced content. For fieldsets it might make
sense, though, but currently we cannot, because the
layoutSpecialExcludedChild() mechanism only allows one special child per object
(the flow thread and the legend would make for two).

layoutSpecialExcludedChild() was especially bad for a TEXTAREA with a
placeholder attribute when attempting to multicol it, because we would go ahead
and lay out the placeholder (during TEXTAREA layout), which would be a child of
the flow thread. So we would lay out the grandchild before laying out its
parent, causing assertion failures in
LayoutMultiColumnFlowThread::columnSetAtBlockOffset().

BUG=482362
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1110403002

git-svn-id: svn://svn.chromium.org/blink/trunk@194657 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Spanners are not part of the nearest ancestor flow thread.
Cannot take the fast path when calculating the enclosing pagination layer of a
spanner. Need to examine the containing block chain, just like we do when there
are out-of-flow objects.

BUG=481663,481926
R=chrishtr@chromium.org,dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1112593002

git-svn-id: svn://svn.chromium.org/blink/trunk@194607 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fix "mouse" position selection in svg/text/resources/SelectionTestCase.js
eventSender.mouseMoveTo(...) truncates the coordinates it is passed, so
fractional coordinates could end being adjust by almost an entire pixel,
which could yield incorrect results.
Round the end-points such that they should reside within the intended
selection area.

BUG=477545

Review URL: https://codereview.chromium.org/1108033002

git-svn-id: svn://svn.chromium.org/blink/trunk@194604 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194592.
TBR=oilpan-reviews
BUG=480341
NOTRY=true

Review URL: https://codereview.chromium.org/1108823004

git-svn-id: svn://svn.chromium.org/blink/trunk@194598 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Add back interface checking over XPathExpression interface.
Mistakenly removed by r194504, re-add.

R=haraken
BUG=481813

Review URL: https://codereview.chromium.org/1108903003

git-svn-id: svn://svn.chromium.org/blink/trunk@194588 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: put MessageChannel on the heap.
R=kouhei
BUG=479467

Review URL: https://codereview.chromium.org/1104293002

git-svn-id: svn://svn.chromium.org/blink/trunk@194572 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: put ClientRect(List) on the heap.
R=kouhei
BUG=479467

Review URL: https://codereview.chromium.org/1104243003

git-svn-id: svn://svn.chromium.org/blink/trunk@194550 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Replace FilterData::boundaries with Filter::filterRegion()
Stores the same value when Filter is an SVGFilter (which it always is
in SVGFilterPainter.)

BUG=109224

Review URL: https://codereview.chromium.org/1108763004

git-svn-id: svn://svn.chromium.org/blink/trunk@194545 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Only the nearest ancestral flow thread may serve as a containing flow thread.
Prevent spanners and out-of-flow objects from returning an outer flow thread
(nested multicol). If the nearest flow thread doesn't serve as a flow thread
containing block, then have no flow thread containing block at all. This seals
each multicol context a bit better from any other multicol contexts that may
exist.

Also removed a suspicious call to parent()->flowThreadContainingBlock(). This
was required during early development stages of column-span:all support, but
not any more.

BUG=480965
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1108633002

git-svn-id: svn://svn.chromium.org/blink/trunk@194529 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Remove SourceGraphic reference from SkiaImageFilterBuilder
Only set, not read. (Last user was SourceAlpha.)

BUG=109224

Review URL: https://codereview.chromium.org/1108823002

git-svn-id: svn://svn.chromium.org/blink/trunk@194527 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] flowThreadTranslationAtOffset() needs to be relative to the flow thread.
When we want to translate from flow thread coordinates to visual coordinates,
we need to return something relative to the top/left of the flow thread, not
something relative to the top/left of the content box of the multicol
container. This distinction matters in RTL mode, since the flow thread is then
positioned at the top/right inside the multicol container.

Added LayoutTests/fast/multicol/client-rects-rtl.html , which is an adaption
for RTL of client-rects.html for RTL. This didn't pass prior to this fix. Also
added an assertion failure test, which is what the original bug report was
about.

BUG=479155
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1102273004

git-svn-id: svn://svn.chromium.org/blink/trunk@194517 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Check the nullable Document::settings() before accessing.
Add some missing null checks in LinkLoader.

R=yoav@yoav.ws
BUG=481511

Review URL: https://codereview.chromium.org/1107003002

git-svn-id: svn://svn.chromium.org/blink/trunk@194515 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: keep FormData on the heap by default.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1102253002

git-svn-id: svn://svn.chromium.org/blink/trunk@194507 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Throw NoModificationAllowed in SVG*List.removeItem(...) if immutable
BUG=477790

Review URL: https://codereview.chromium.org/1061263005

git-svn-id: svn://svn.chromium.org/blink/trunk@194506 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have xml/ objects on the heap by default.
Along with moving the XPath objects (and other objects handling
XML processing) to the heap, we're able to retire the XPath
parser's manual tracking of currently constructed XPath
sub-expressions; done so as to be able to destruct those in the
face of parse errors.

With Oilpan, such unreferenced sub-expressions will be unreferenced
and swept out whenever the next GC runs.

R=haraken,tkent
BUG=479467

Review URL: https://codereview.chromium.org/1099613003

git-svn-id: svn://svn.chromium.org/blink/trunk@194504 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the ShadowRoot interface with the spec
http://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface

ShadowRoot.innerHTML has [TreatNullAs=NullString] which is not per spec,
but this seems like an oversight in the spec:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28549

There are no changes to the generated code, other than order.

BUG=460722

Review URL: https://codereview.chromium.org/1099723004

git-svn-id: svn://svn.chromium.org/blink/trunk@194499 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have URL object on the heap.
Always allocate {window, worker}.URL on the Oilpan heap.

R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1092073007

git-svn-id: svn://svn.chromium.org/blink/trunk@194490 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: keep navigation timing objects on the heap by default.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1101123004

git-svn-id: svn://svn.chromium.org/blink/trunk@194481 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have DOMException be on the heap by default.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1107793002

git-svn-id: svn://svn.chromium.org/blink/trunk@194453 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have Navigator plugin objects on the heap by default.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1107783002

git-svn-id: svn://svn.chromium.org/blink/trunk@194452 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have Storage objects reside on the heap by default.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1055133003

git-svn-id: svn://svn.chromium.org/blink/trunk@194451 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Make Resource::switchClientsToRevalidatedResource non-virtual
In https://codereview.chromium.org/1102803002/ the
ImageResource::switchClientsToRevalidatedResource override function
was removed. Resource::switchClientsToRevalidatedResource can now be
non-virtual and made private.

Review URL: https://codereview.chromium.org/1109663002

git-svn-id: svn://svn.chromium.org/blink/trunk@194447 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have Navigator and its supplements be on the heap by default.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1101263003

git-svn-id: svn://svn.chromium.org/blink/trunk@194442 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Remove the pending container size requests list
Trust ImageResource::setContainerSizeForLayoutObject to be called
through ImageResource::notifyObservers when the image has loaded.
Given that, we will already get notifications about the up-to-date
containerSize and containerZoom and there is no need for keeping
around a list of pending container sizes and zooms to send when the
image is created.

As to why we can trust ImageResource::notifyObservers to call back
into ImageResource::setContainerSizeForLayoutObject,
https://codereview.chromium.org/22482004 added a
updateInnerContentRect() call taking care of calling
ImageResource::setContainerSizeForLayoutObject when the image's paint
has been invalidated.

Review URL: https://codereview.chromium.org/1102803002

git-svn-id: svn://svn.chromium.org/blink/trunk@194439 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Do not invoke async method on a GC-unreachable object.
For AsyncMethodRunner<Target> where Target is a garbage collected type,
we cannot have the async method runner safely call a method on an object
instance if that object has been determined as being unreachable by the
GC marking phase, but it _or_ any of the objects that it refers to hasn't
been swept yet.

This aligns the treatment of AsyncMethodRunner<> over garbage collected
objects with that of Timer<>.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1108663002

git-svn-id: svn://svn.chromium.org/blink/trunk@194437 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have Console be on the heap by default.
Enable Oilpan for Console and its supplement.

R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1063513007

git-svn-id: svn://svn.chromium.org/blink/trunk@194434 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Avoid transiently creating disallowed elements when building <use> trees
When building a shadow tree for a <use>, a direct reference to a
"disallowed" element would cause the element to first be inserted before
buildShadowTree() noticed it's disallowed and returns false, so it's
removed again.
This transient mutation could take place while computing an animation
update, if a CSS property was being animated and the layout tree/style
was dirty.
Avoid the insert-remove sequence by checking if the initial target is
disallowed up-front. This matches how it's done in the general subtree
building case inside buildShadowTree().

BUG=478549

Review URL: https://codereview.chromium.org/1105873002

git-svn-id: svn://svn.chromium.org/blink/trunk@194421 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Prevent SVG foreignObject from becoming a spanner.
BUG=480387,480393
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1107673004

git-svn-id: svn://svn.chromium.org/blink/trunk@194417 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Don't enter child multicol contexts when processing object insertions / removals.
If we were to process a descendant flow thread and its descendants, we would
need to descend into it properly, by calling flowThreadDescendantWasInserted()
/ flowThreadDescendantWillBeRemoved() on the inner flow thread for all its
children (instead of erroneously pretending that the inner flow thread's
children were part of the outer flow thread). But instead of doing all that,
just skip the whole thing. When whole subtrees are inserted or removed, it's
typically done via moveChildTo() & co, and we can safely leave inner flow
threads (and their associated column sets and spanner placeholders) as they
are. The move will not affect them. They will be exactly as much multicol
before and after the move.

Also rename a local variable from |nextRenderer| to |objectAfterSubtree| to
avoid confusion with the new variable |next|.

Similarly, only update the flow thread state flag for the objects that actually
belong to a given flow thread (i.e. don't descend into descendant flow
threads).

BUG=479126
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1109513002

git-svn-id: svn://svn.chromium.org/blink/trunk@194402 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mateuszs
Removed obsolete float_util.h as VS2013 supports standards well enough.
BUG=

Review URL: https://codereview.chromium.org/1076443002

Cr-Commit-Position: refs/heads/master@{#326781}
sigbjornf
Oilpan: have History on the heap by default.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/1109493003

git-svn-id: svn://svn.chromium.org/blink/trunk@194390 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Handle the [Unscopeable, RuntimeEnabled=X] combination better
If a runtime enabled attribute or method is unscopeable, then add it to
the @@unscopables object only if the feature is enabled. This is a
marginal change, but it does ensure that features don't leave detectable
artifacts when disabled.

BUG=462916

Review URL: https://codereview.chromium.org/1081853003

git-svn-id: svn://svn.chromium.org/blink/trunk@194384 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix HeapVectorShrinkInlineCapacity test with ASan enabled.
If 'contiguous container' overflow checking is enabled, vector inline
buffers aren't supported. Adjust test accordingly.

R=
BUG=420515

Review URL: https://codereview.chromium.org/1092223002

git-svn-id: svn://svn.chromium.org/blink/trunk@194375 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have Screen be on the heap by default.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/688993002

git-svn-id: svn://svn.chromium.org/blink/trunk@194367 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
[svg] Update the <use> shadowtree if a referenced element is removed.
BUG=477601

Review URL: https://codereview.chromium.org/1087653004

git-svn-id: svn://svn.chromium.org/blink/trunk@194363 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: expand size of vector backing container when finalizing.
The finalization of vector buffers will currently finalize all slots
in the buffer, as the actually used subsequence cannot be determined by
the buffer. Hence, the buffer finalization needs to expand the size of
the container before iterating over the slots so as to avoid ASan
container overflow checks reporting false negatives.

R=haraken
BUG=475801

Review URL: https://codereview.chromium.org/1104803002

git-svn-id: svn://svn.chromium.org/blink/trunk@194360 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Enable Oilpan for core/clipboard/
Enable Oilpan by default for the DataTransfer* and DataObject* interface
objects.

R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/640303002

git-svn-id: svn://svn.chromium.org/blink/trunk@194347 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Add #include <algorithm> to code that is missing it.
Including <algorithm> is compile time expensive but not including it
when it's used causes compiler errors when other code removes their
includes of <algorithm>.

To prevent possible future compilation errors with C++11 stl, I've
also added #include <utility> to headers that use std::swap since
<algorithm> isn't certain to provide std::swap.

R=thakis@chromium.org

Review URL: https://codereview.chromium.org/1088843002

git-svn-id: svn://svn.chromium.org/blink/trunk@194281 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194270.
R=haraken
BUG=275851
NOTRY=true

Review URL: https://codereview.chromium.org/1097063003

git-svn-id: svn://svn.chromium.org/blink/trunk@194277 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Drop [PerContextEnabled] extended attribute
It is no longer used, and adds complexity to the code generator.

BUG=465624

Review URL: https://codereview.chromium.org/1107523002

git-svn-id: svn://svn.chromium.org/blink/trunk@194275 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in components/ (part 2)
BUG=466848

Review URL: https://codereview.chromium.org/1043013002

Cr-Commit-Position: refs/heads/master@{#326483}
wmaslowski
Accessing directories in extensions should not cause content verifier failure.
BUG=479598

Review URL: https://codereview.chromium.org/1105493002

Cr-Commit-Position: refs/heads/master@{#326480}
jl
Reland of IDL: Add support for [Unscopeable] on attributes and methods
Adding [Unscopeable] to an attribute or method means it won't be found
during name lookup with an object that has the attribute or method in
the scope (i.e. using the "with" statement.)

The mechanism that makes this happen is that the interface prototype
object has a property named @@unscopables that is an object with a
property for every unscopeable member named as the member.

BUG=462916

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194091

Review URL: https://codereview.chromium.org/1085453003

git-svn-id: svn://svn.chromium.org/blink/trunk@194272 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Enable Oilpan for core/timing/.
R=haraken
BUG=479467

Review URL: https://codereview.chromium.org/693483004

git-svn-id: svn://svn.chromium.org/blink/trunk@194227 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Tighten assertions around StyleImage::computeIntrinsicDimensions
By initializing to fixed we can assume not only that the intrinsic
lengths should not be percentage but also that they should be fixed.

BUG=479687

Review URL: https://codereview.chromium.org/1096993003

git-svn-id: svn://svn.chromium.org/blink/trunk@194220 bbb929c8-8fbe-4397-9dbb-9b2b20218538
haavardm
Report the connect status of the oldest connection in the socket pool.
This CL implements a combination of the suggestions 1) and 2)
and comment #1 in crbug.com/462808. This reduces the number of
calls to GetLoadState. However the status might be less accurate
as we are far from guaranteed that the oldest connection is the
one which has come the furthest. This should be acceptable though,
as the state is mainly used report activity or at which stage
connections are hung at.

BUG=462808

Review URL: https://codereview.chromium.org/1091793002

Cr-Commit-Position: refs/heads/master@{#326244}
sigbjornf
Revert "Re-factor VisibleSelectionTest for adding tests for composed tree version"
This reverts commit 52847e6579f5703d41a96349992b79f1ae258b98.

Reason for revert:
Breaks Android Builder (dbg) compilation,

http://build.chromium.org/p/chromium.webkit/builders/Android%20Builder%20(dbg)/builds/43678

(and Oilpan compilation.)

Original issue's description:
> Re-factor VisibleSelectionTest for adding tests for composed tree version
>
> This patch changes |VisibleSelectionTest| for adding tests for composed tree
> version easier with introducing shadow tree related tests.
>
> This patch also introduces |Node| and |Position| for ease of writing and
> debugging gTest.
>
> This patch is result of collaboration work with hajimehoshi@chromium.org
> for selection of web components. After this patch, we are going to implement
> another strategies for the composed tree. We've already
> prepared that at http://crrev.com/1009603011.
>
> BUG=275851
> TEST=n/a; No behavior changes.
>
> Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=194195

TBR=yosin,tkent
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=275851

Review URL: https://codereview.chromium.org/1055633004

git-svn-id: svn://svn.chromium.org/blink/trunk@194197 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194169.
TBR=oilpan-reviews
BUG=476735
NOTRY=true

Review URL: https://codereview.chromium.org/1095323004

git-svn-id: svn://svn.chromium.org/blink/trunk@194196 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/custom_handlers/
BUG=466848

Review URL: https://codereview.chromium.org/1031083004

Cr-Commit-Position: refs/heads/master@{#326120}
mstensho
[New Multicolumn] Disallow spanners inside floats and absolutely positioned boxes.
Since the logical top of a float or absolutely positioned box isn't (guaranteed
to be) known until after layout, we get problems determining the logical height
of the flow thread portion preceding the spanner, which in turn means that
we'll get column balancing wrong. The usefulness of spanners inside floats or
absolutely positioned boxes is questionable, so just disallow spanners inside
such boxes for now.

BUG=479085
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1100823002

git-svn-id: svn://svn.chromium.org/blink/trunk@194152 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194136.
TBR=oilpan-reviews
BUG=477557
NOTRY=true

Review URL: https://codereview.chromium.org/1060193006

git-svn-id: svn://svn.chromium.org/blink/trunk@194145 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Throw exception if querying SVGAnimationElement with unresolved interval
http://www.w3.org/TR/SVG11/animate.html#__svg__SVGAnimationElement__getStartTime
http://www.w3.org/TR/SVG11/animate.html#__svg__SVGAnimationElement__getSimpleDuration

Matches Gecko.

BUG=477828

Review URL: https://codereview.chromium.org/1088933005

git-svn-id: svn://svn.chromium.org/blink/trunk@194141 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
HeapTest.HeapVectorPartObjects: fix reserveCapacity() expectation.
The size argument to reserveCapacity() is a lower bound, adjust the
tests accordingly.

TBR=haraken,tkent
BUG=475801

Review URL: https://codereview.chromium.org/1098953003

git-svn-id: svn://svn.chromium.org/blink/trunk@194138 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Make CSSKeyframesRule.insertRule an alias of appendRule
As opposed to the other way around, as insertRule is deprecated.

BUG=470400

Review URL: https://codereview.chromium.org/1091283005

git-svn-id: svn://svn.chromium.org/blink/trunk@194122 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Derive the SourceAlpha filter input from SourceGraphic
Let the SourceAlpha FilterEffect wrap a FilterEffect rather than just
getting the SourceGraphic reference from the SkiaImageFilterBuilder.
This makes the DAG constructed for a url(...) reference within a
<filter-function-list> only have a single input - SourceGraphic.

Matches Gecko-behavior for 'filter'.

BUG=109224

Review URL: https://codereview.chromium.org/1056353003

git-svn-id: svn://svn.chromium.org/blink/trunk@194115 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Refactored compound selector parsing methods.
Methods for adding simple selectors to compound selectors had names like
rewriteSpecifiers. This CL tries to make more sense to it and adds
documentation for the not-so-straightforward ways of adding simple
selectors.

Renamed tagIsForNamespaceRule to tagIsImplicit as that is what it means.
The type selector is necessary as a placeholder for use during selector
matching, but not necessary to add to the serialization.

What complicates this code a lot, is the fact that we can have one or
more implicit ShadowPseudo combinators within the same compound selector,
as seen by the parser, which means it's really multiple compound
selectors. Handling these implicit combinators as true combinators in the
parser could simplify this code. See added TODO.

R=timloh@chromium.org

Review URL: https://codereview.chromium.org/1094213002

git-svn-id: svn://svn.chromium.org/blink/trunk@194107 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove the allowfullscreen exemption for the video-specific fullscreen API
Intent to Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/3NukIuOaU4c/Boab2WxzhBYJ

Prompted by a question from Ali Alabbas (Microsoft) on blink-dev:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/f-V2GWatXkA/nvdHJ3xihMkJ

TEST=LayoutTests/media/video-controls-fullscreen-iframe.html

This test ensures that the allowfullscreen attribute is still not
required for <video controls>, even though it is for the API call.

BUG=346236

Review URL: https://codereview.chromium.org/1058783006

git-svn-id: svn://svn.chromium.org/blink/trunk@194106 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: HeapVectorBacking should call destructors for its elements
Currently HeapVectorBacking does not call destructors of its elements
and is leaking the objects. We must call them.

R=tkent
BUG=475801
TEST=HeapTest.VectorDestructors
TEST=HeapTest.DequePartObjectsExpand
TEST=HeapTest.HeapVectorPartObjects

Review URL: https://codereview.chromium.org/1086413003

git-svn-id: svn://svn.chromium.org/blink/trunk@194100 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Update a Web Animations spec link
https://github.com/w3c/web-animations/issues/89

BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1099063002

git-svn-id: svn://svn.chromium.org/blink/trunk@194097 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Add support for [Unscopeable] on attributes and methods
Adding [Unscopeable] to an attribute or method means it won't be found
during name lookup with an object that has the attribute or method in
the scope (i.e. using the "with" statement.)

The mechanism that makes this happen is that the interface prototype
object has a property named @@unscopables that is an object with a
property for every unscopeable member named as the member.

BUG=462916

Review URL: https://codereview.chromium.org/1085453003

git-svn-id: svn://svn.chromium.org/blink/trunk@194091 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mpawlowski
Sync typed urls with typed_cont() == 0
When the user types "google.com" into the address bar, the server will
redirect him to "www.google.com" (or a regional equivalent). The redirected
URL will have PAGE_TRANSITION_TYPED but typed_count() == 0. We still want
to Sync such URL, otherwise the receiving client will only see "google.com"
with PAGE_TRANSITION_CHAIN_START and without the matching _CHAIN_END.
Additionally, the history view won't show that "google.com" URL because
VisitDatabase::GetVisibleVisitsInRange filters out results that don't
match PAGE_TRANSITION_CHAIN_END.

BUG=

Review URL: https://codereview.chromium.org/1087773002

Cr-Commit-Position: refs/heads/master@{#325990}
sigbjornf
Oilpan: rename GCState and GCReason values to reflect function only.
Rename ThreadState::GCScheduledForTesting to ThreadState::FullGCScheduled
and Heap::ForcedGCForTesting to Heap::ForcedGC. That is, just reflect
their purpose, and have the names no longer include the context where
they're often, but not always, used (testing code to flush out garbage.)

R=haraken
BUG=478613

Review URL: https://codereview.chromium.org/1097443004

git-svn-id: svn://svn.chromium.org/blink/trunk@194046 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Document the Web Animation interfaces with spec links and TODOs
Almost all of these interfaces are out of sync with the latest spec,
only the two dictionaries were close enough to make it worthwhile to
document the differences on a per-member level.

BUG=460722

Review URL: https://codereview.chromium.org/1092203002

git-svn-id: svn://svn.chromium.org/blink/trunk@194042 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop some dead code from FilterEffect
Remove the following and associated getters/setters:

 FilterEffect::m_alphaImage
 FilterEffect::m_resultColorSpace
 FilterEffect::clearResultsRecursive()
 FilterEffect::getSourceRect()

Also remove declarations that lack definitions and a few unused
includes.

Review URL: https://codereview.chromium.org/1097053004

git-svn-id: svn://svn.chromium.org/blink/trunk@194041 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add UseCounters for CSS-related *List interfaces with item() methods
By request from Simon Pieters (CSSOM editor) measure the usage of the
item() method on the three interfaces that are currently marked as
[ArrayClass]. This is to determine the feasibility of removing the usage
of [ArrayClass] by using "real" arrays instead. That won't be possible
in the case of MediaList, because that interface has other members, but
measure it anyway in case some option emerges where removing
MediaList.item() would in some way help.

Also add a UseCounter for StyleSheetList's anonymous named getter, which
is the only other thing blocking array conversion of that interface.

Review URL: https://codereview.chromium.org/1072403008

git-svn-id: svn://svn.chromium.org/blink/trunk@194040 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Rid ourselves of unnecessary expected files
Get rid of -expected.txt files from SVG baseline files by removing
text from the DOM. Having text elements linger classifies the tests as
'text' and requires them to have expected files. By cleaning up the
text elements before test ends, we can get rid of the expected files.

BUG=476344

Review URL: https://codereview.chromium.org/1097933002

git-svn-id: svn://svn.chromium.org/blink/trunk@194030 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
Avoid assert for isLegacyIntrinsic too.
BUG=477786

Review URL: https://codereview.chromium.org/1095053002

git-svn-id: svn://svn.chromium.org/blink/trunk@194029 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Limit recent SVG baseline tests to a stable subset
For currently unknown reasons, some baseline-shift and
alignment-baseline values does not result in stable positions across
zoom levels on the Windows bots.

See win_blink_rel failures in
https://codereview.chromium.org/1081813003/ for patch set 4 for
details. The issue does not however reproduce in a Win7 VM.

Leave these problematic values out and remove TestExpectations line.

BUG=476344, 478703

Review URL: https://codereview.chromium.org/1052373007

git-svn-id: svn://svn.chromium.org/blink/trunk@194028 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194009.
Arrange for SVGPropertyTearOff.h to be able to #include SVGElement.h,
so as to avoid any SVGElement visibility breakages downstream.

R=haraken,kouhei
BUG=477527
NOTRY=true

Review URL: https://codereview.chromium.org/1097893003

git-svn-id: svn://svn.chromium.org/blink/trunk@194023 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r194000.
TBR=oilpan-reviews
BUG=477533
NOTRY=true

Review URL: https://codereview.chromium.org/1090273005

git-svn-id: svn://svn.chromium.org/blink/trunk@194006 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the ChildNode and ParentNode interfaces with the spec
There are no changes to the generated code.

BUG=460722

Review URL: https://codereview.chromium.org/1092113004

git-svn-id: svn://svn.chromium.org/blink/trunk@193987 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
ScriptedAnimationController: factor out has-schedulable items predicate.
Common up the logic controlling the servicing/scheduling of animation
events & actions. No change in functionality.

R=
BUG=

Review URL: https://codereview.chromium.org/1093803002

git-svn-id: svn://svn.chromium.org/blink/trunk@193983 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jiangj
Reland: Fix errors found in Mac gn component builds
This is relanding https://codereview.chromium.org/1087873003 which was
reverted in https://codereview.chromium.org/1089773003/.

Mac gn component build fail because of missing frameworks and missing some other
dependencies, and occasionally file list out of sync with the gyp counterpart:
http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_dbg/builds/321/steps/compile/logs/stdio

For instance, the frameworks linked in the components that sync depends on is not
automatically linked into sync, thus revealing the issue.

BUG=477710

Review URL: https://codereview.chromium.org/1098513002

Cr-Commit-Position: refs/heads/master@{#325771}
sigbjornf
Oilpan: fix build after r193963.
TBR=oilpan-reviews
BUG=477830
NOTRY=true

Review URL: https://codereview.chromium.org/1092793008

git-svn-id: svn://svn.chromium.org/blink/trunk@193969 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r193951.
TBR=oilpan-reviews
BUG=463143
NOTRY=true

Review URL: https://codereview.chromium.org/1092973003

git-svn-id: svn://svn.chromium.org/blink/trunk@193964 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Move FilterEffectRenderer to core/paint/
Also some minor include cleanups.

Review URL: https://codereview.chromium.org/1092673002

git-svn-id: svn://svn.chromium.org/blink/trunk@193956 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Add a "logical query mode" to SVGTextQuery
This CL adds an additional query "mode" to use for some of the query
functions. This new methods searches "logically" - using the layout
objects rather than the line boxes to guide the search. The existing
method is renamed to spatialQuery, leaving us with:

  spatialQuery() - for point -> something
  logicalQuery() - for character (code unit) -> something

This new search-order is needed to handle bi-directionality correctly.
Previously the direction of the text would influence the search, since
the line boxes would be processed in their spatial-ordering and the
search position would be adjusted based on that ordering. (As an
example, this would mean that given:

  <text direction="rtl">ltrRTL</text>

and a query range [2, 4], the third character of the RTL run and the
first character of the ltr run would be included rather than the other
way around. See also new test in bidi-getsubstringlength.html)

The value returned by getCharNumAtPosition() is adjusted such that the
layout object of the intersected glyph is used to determine the
character index based on the query root (the element on which the
method is called.) This means that the value returned is in the same
query space as that handled by logicalQuery().

BUG=471205,470326

Review URL: https://codereview.chromium.org/1083073002

git-svn-id: svn://svn.chromium.org/blink/trunk@193944 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
Avoid ASSERT_NOT_REACHED in blink::floatValueForLength.
BUG=477786

Review URL: https://codereview.chromium.org/1083083005

git-svn-id: svn://svn.chromium.org/blink/trunk@193937 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
ScreenOrientationController: task-based dispatching of change events.
Move ScreenOrientationController over to posting a task for dispatching
its async change events. That is, no longer use a one-shot timer.

R=mlamouri
BUG=

Review URL: https://codereview.chromium.org/1089523002

git-svn-id: svn://svn.chromium.org/blink/trunk@193927 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
Update histograms.xml.
Review URL: https://codereview.chromium.org/1089933003

Cr-Commit-Position: refs/heads/master@{#325609}
fs
Drop clip-rule setup from LayoutSVGResourceClipper::createContentPicture
After https://codereview.chromium.org/1052873003, SVGShapePainter will
pick the right fill rule to use (based on the PaintInfo flags.)

Review URL: https://codereview.chromium.org/1093623002

git-svn-id: svn://svn.chromium.org/blink/trunk@193889 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jiangj
Fix errors found in Mac gn component builds
Mac gn component build fail because of missing frameworks and missing some other
dependencies, and occasionally file list out of sync with the gyp counterpart:
http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_dbg/builds/321/steps/compile/logs/stdio

For instance, the frameworks linked in the components that sync depends on is not
automatically linked into sync, thus revealing the issue.

Review URL: https://codereview.chromium.org/1087873003

Cr-Commit-Position: refs/heads/master@{#325479}
sigbjornf
Oilpan: assert that new Persistents belong to Oilpan threads.
R=haraken
BUG=477577

Review URL: https://codereview.chromium.org/1089763002

git-svn-id: svn://svn.chromium.org/blink/trunk@193882 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Removed unused argument in CSSSelectorParser.
Two of the methods for rewriting specifiers had an unused elementName
parameter. Removed it.

R=timloh@chromium.org

Review URL: https://codereview.chromium.org/1095533002

git-svn-id: svn://svn.chromium.org/blink/trunk@193877 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
Add UseCounter for SVGURIReference.href.baseVal/animVal.
Review URL: https://codereview.chromium.org/1086873004

git-svn-id: svn://svn.chromium.org/blink/trunk@193870 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Disallow multicol on ruby elements.
Avoids an assertion failure and general confusion.

BUG=477469
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1092453003

git-svn-id: svn://svn.chromium.org/blink/trunk@193868 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r193843.
TBR=oilpan-reviews
BUG=416735
NOTRY=true

Review URL: https://codereview.chromium.org/1082403003

git-svn-id: svn://svn.chromium.org/blink/trunk@193848 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Add a comment about counter availability in M43 branch
R=jochen@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/1088483005

git-svn-id: svn://svn.chromium.org/blink/trunk@193816 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jiangj
Keep Mac sources that shouldn't been removed for gn builds
To match blink_platform.gyp.

Review URL: https://codereview.chromium.org/1056373003

git-svn-id: svn://svn.chromium.org/blink/trunk@193806 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Revert recent changes to the Fullscreen UA style sheet
This reverts four recent CLs:

 * Match the Fullscreen spec's CSS as far as currently practical:
   https://codereview.chromium.org/974783002

 * Move translate:none to the standard Fullscreen UA style sheet:
   https://codereview.chromium.org/1014853003

 * Remove border and padding from iframes in fullscreen:
   https://codereview.chromium.org/1032113002

 * Move iframe border/padding to the standard Fullscreen UA style sheet:
   https://codereview.chromium.org/1032253002

There are multiple unresolved regressions due to the changes:

 * Weird distorted page seen after exiting from full screen mode in
   Sleepy Jack app:
   https://code.google.com/p/chromium/issues/detail?id=468278

 * 'Print Preview' fails on 'Awesome-3d-clock' app:
   https://code.google.com/p/chromium/issues/detail?id=470057

 * Unable to toggle out of fullscreen mode after clicking on
   'fullscreen' icon for "cordy" app:
   https://code.google.com/p/chromium/issues/detail?id=475829

These are release blockers and will take some time to investigate, so
revert for this release.

BUG=402378

Review URL: https://codereview.chromium.org/1058083003

git-svn-id: svn://svn.chromium.org/blink/trunk@193799 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Move createColorSpaceFilter from ImageBuffer to ColorSpaceUtilities
Loose method that lacks a strong association with ImageBuffer.

Review URL: https://codereview.chromium.org/1083213004

git-svn-id: svn://svn.chromium.org/blink/trunk@193789 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Improve "includes for type" mechanism in various ways
- Optionally pass extended attributes along with the type, so that the
  includes generated can depend on it. (This is not needed now, but will
  be in the future.)

- Add includes for the types of method arguments, getters and setters.

- Cleanup some (now) redundant calls to add_includes_for_type() in
  v8_types.py that interfered with the next item.

- Don't add includes relating to "invisible" methods. Invisible methods
  are those that come from partial interfaces, and that won't actually
  be implemented in the compilation unit being generated. Adding such
  includes meant that files under bindings/core/ would sometimes include
  headers from bindings/modules/ (without depending on the contents of
  those headers).

BUG=358074

Review URL: https://codereview.chromium.org/1086113002

git-svn-id: svn://svn.chromium.org/blink/trunk@193787 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Remove effective zoom from font metrics before SVG text layout.
Since https://codereview.chromium.org/308123010 and
https://codereview.chromium.org/323053002, the effectiveZoom is
included in the style's font. This patch adds missing code to
SVGTextLayoutEngineBaseline to remove the effective zoom before
computing baseline and advance.

BUG=476344

Review URL: https://codereview.chromium.org/1081813003

git-svn-id: svn://svn.chromium.org/blink/trunk@193786 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Allow "::content /deep/" to match.
Add loop for matchForShadowDistributed to support ::content left of
/deep/ combinator like we do for descendant and child combinators.

R=hayato@chromium.org
BUG=453437

Review URL: https://codereview.chromium.org/1082023003

git-svn-id: svn://svn.chromium.org/blink/trunk@193748 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bratell
Move an include guard to guard all code in base/move.h
gcc -H warned about base/move.h missing an include guard and it was
because the existing include guard didn't encompass all the code in the
file.

This fixes that warning and maybe makes compilations one nanosecond
faster.

The code outside the include guard was added Oct 2014 when fixing bug
418297.

BUG=418297

Review URL: https://codereview.chromium.org/1082263002

Cr-Commit-Position: refs/heads/master@{#325132}
jiangj
Remove duplicate -std=gnu++11 flag for Mac gn build
It's already added when is_clang is true, which is always the case on
Mac.

BUG=336487

Review URL: https://codereview.chromium.org/1083963002

Cr-Commit-Position: refs/heads/master@{#325090}
ljagielski
sys_info_linux: positive return value of MaxSharedMemorySize for 32-bit build on 64-bit host.
Previous implementation caused DCHECK when value exceeded 32-bit size_t.

BUG=

Review URL: https://codereview.chromium.org/1000933002

Cr-Commit-Position: refs/heads/master@{#325034}
sigbjornf
Tidy HTMLImportsController::supplementName()
R=haraken

Review URL: https://codereview.chromium.org/1088873002

git-svn-id: svn://svn.chromium.org/blink/trunk@193699 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Removed unnecessary input selectors from html.css.
The first input selector will always match the two following ones. The
only reason for having the additional ones would be for specificity. By
inspection, I couldn't find that was the case. Removing.

Review URL: https://codereview.chromium.org/1055743005

git-svn-id: svn://svn.chromium.org/blink/trunk@193687 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
collectAllGarbage(): bail on reaching fixed point.
To root out objects that become unreachable and dead once persistent
references to them are finalized, we're forced to iteratively GC when
wanting to sweep out all garbage. But no need to continue doing it
after the live object set has stabilized.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1079993002

git-svn-id: svn://svn.chromium.org/blink/trunk@193682 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Fix gn_all deps when enable_configuration_policy=false
BUG=

Review URL: https://codereview.chromium.org/1079083003

Cr-Commit-Position: refs/heads/master@{#325018}
bratell
Removing unused function WTF::appendNumber
WTF::appendNumber can append a number as decimal characters to a
Vector of things that accept characters. It is not a string method
and nobody is using it so we have no reason to keep it.

BUG=

Review URL: https://codereview.chromium.org/1059523004

git-svn-id: svn://svn.chromium.org/blink/trunk@193677 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
Spring cleaning: remove isSupportedAttribute.
Inspired by Darin Adler's WebKit patch:
https://bugs.webkit.org/show_bug.cgi?id=143194

BUG=471771

Review URL: https://codereview.chromium.org/1074813002

git-svn-id: svn://svn.chromium.org/blink/trunk@193650 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mathiash
Make service tab launcher a component
BUG=473011

Review URL: https://codereview.chromium.org/1057533005

Cr-Commit-Position: refs/heads/master@{#324850}
bratell
Better handling of broken applet codebase
A broken codebase would result in using an invalid url as base url in
the KURL constructor and that never results in anything useful (could
even crash). Since HTMLAppletElement is deprecated and badly documented
the goal of this patch is mostly to avoid the known badness and not to
make HTMLAppletElement perfect.

R=fs@opera.com

BUG=374110

Review URL: https://codereview.chromium.org/1079953002

git-svn-id: svn://svn.chromium.org/blink/trunk@193633 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Don't clear FontFaceCache if no @font-face were removed.
AnalyzedStyleUpdate will end up with a Reconstruct for the StyleResolver
and a if we remove stylesheets which do not contain @font-face rules and
don't contain any other rules that will cause dirtiesAllStyle() to be
true. Skip clearing the font cache in those cases.

As part of understanding how the AnalyzedStyleUpdate works, I wrote a few
unit tests for compareStyleSheets. This method looks fragile and doesn't
seem to work well when stylesheets are added and removed at the same time.
I haven't found a way to trigger a real bug yet, as we don't seem to be
using AnalyzedStyleUpdate for a case where the active stylesheet list
changes in a way that triggers this bug.

BUG=471079,475858

Review URL: https://codereview.chromium.org/1076163002

git-svn-id: svn://svn.chromium.org/blink/trunk@193625 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Clear LayoutSVGText's frame rect if no line boxes are produced
The frame rect is normally updated from
SVGRootInlineBox::computePerCharacterLayoutInformation(), but if the
children are empty, there'll be no such boxes and the frame rect won't
be updated.

BUG=474275

Review URL: https://codereview.chromium.org/1078193002

git-svn-id: svn://svn.chromium.org/blink/trunk@193559 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: adjust AnimationTimeline finalization.
With Oilpan, explicitly disconnecting its animation players is not needed;
the ExecutionContext's weak reference will be transparently take care of
this instead.

While here, merge the timeline finalization steps into a detach operation
for AnimationPlayer.

TBR=dstockwell,oilpan-reviews
BUG=472307

Review URL: https://codereview.chromium.org/1080523002

git-svn-id: svn://svn.chromium.org/blink/trunk@193552 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Cleanup resolving of 'em' units in SVGLengthContext
With the 'rem' unit added, there's some duplication, since the only
difference between 'em' and 'rem' is where the style comes from.
By splitting the resolution of the style out of the methods that
convert to/from 'em' (and 'rem'), the same two functions can be used
to compute the results in both the 'em' and 'rem' case - just feeding
them with different ComputedStyle objects.

BUG=368598,470449

Review URL: https://codereview.chromium.org/1065223003

git-svn-id: svn://svn.chromium.org/blink/trunk@193547 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
Move test from fast to svg/parser, and split it.
This should hopefully make the individual parts fast enough
to not timeout. The slowness is most likely due to the
amount of console output that this test generates.

BUG=446356

Review URL: https://codereview.chromium.org/1078663002

git-svn-id: svn://svn.chromium.org/blink/trunk@193533 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r193519.
TBR=oilpan-reviews
BUG=275851
NOTRY=true

Review URL: https://codereview.chromium.org/1075123002

git-svn-id: svn://svn.chromium.org/blink/trunk@193526 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
SVGLength: Avoid reading out-of-bounds when parsing incorrect 'rem' unit
The read/check of the third char ('m') could end up reading outside the
buffer if unlucky.

BUG=368598, 470449

Review URL: https://codereview.chromium.org/1069213003

git-svn-id: svn://svn.chromium.org/blink/trunk@193523 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
Support non-function object values assigned to EventHandler attributes
In HTML, the type EventHandler, used for event handler IDL attributes,
is defined

  [TreatNonObjectAsNull]
  callback EventHandlerNonNull = any (Event event);

  typedef EventHandlerNonNull? EventHandler;

Aside from treating non-object values as null, the extended attribute
means non-callable object values should be allowed by the attribute's
setter (and returned by its getter) and should be treated as if they
were no-op functions returning undefined.

BUG=475428

Review URL: https://codereview.chromium.org/1076783002

git-svn-id: svn://svn.chromium.org/blink/trunk@193516 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tsniatowski
jinja2: make templates outside of // work again
A recent CL -- http://crrev.com/1002313002 -- made the jinja wrapper script
barf on templates located outside CHROMIUM_SRC (the used Jinja2 loader
disallows template paths with '..' components). While not actively used
currently in the Chromium build, it is a somewhat useful feature of the
wrapper that used to work.

Fix by instatiating the jinja template loader with a configurable path as the
search directory, rather than a hardcoded CHROMIUM_SRC. Usages with templates
outside CHROMIUM_SRC now must pass an appropriate --loader-base-dir value
to the wrapper script.

R=cjhopman,jbudorick
BUG=

Review URL: https://codereview.chromium.org/1077553002

Cr-Commit-Position: refs/heads/master@{#324597}
rune
Don't force layout for scrollTo(0,0).
The ICB origin will always be a valid scroll position, so there is no
need to force a synchronous layout before setting the scroll position to
(0,0).

R=rbyers@chromium.org
BUG=465574

Review URL: https://codereview.chromium.org/1071983002

git-svn-id: svn://svn.chromium.org/blink/trunk@193490 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Correctly handle updates over attached Attrs involving null values.
Element attributes having a null value are not stored by the ElementData's
attribute collection. When updating an Element-attached Attr with
a new value, which previously was null, correctly handle updates over
null values (before and after.)

R=
BUG=472840

Review URL: https://codereview.chromium.org/1073823002

git-svn-id: svn://svn.chromium.org/blink/trunk@193484 bbb929c8-8fbe-4397-9dbb-9b2b20218538
wdzierzanowski
Align ChannelLayout comments with kChannelOrderings values
The documentation of several ChannelLayout enumerators was at odds with
the values in kChannelOrderings.

Review URL: https://codereview.chromium.org/1078463003

Cr-Commit-Position: refs/heads/master@{#324481}
fs
Handle layer clients in LayoutSVGResourceContainer::registerResource
When registering pending clients on a newly discovered (filter) resource,
make sure to invalidate via the DeprectatedPaintLayer if the client has
one, or the client won't be updated properly.
Make SVGResourcesCache::clientStyleChanged handle non-SVG elements.

This was exposed by scheduler changes that caused flaky behavior in
LayoutTests/css3/filters/effect-reference-rename.html, where the
script:

  document.getElementById("NotMyFilter").id = "MyFilter";

would normally execute before the call to registerResource() that added
MyFilter. With the scheduler these could happen in the opposite order
and trigger the "layoutObject->node()->isSVGElement()" assert.

BUG=453019,432129

Review URL: https://codereview.chromium.org/1068073005

git-svn-id: svn://svn.chromium.org/blink/trunk@193438 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Add metrics for intrinsic and min-intrinsic CSS values
Blink supports the unprefixed and nonstandard values |intrinsic| and
|min-intrinsic| when passed as:

 width: min-intrinsic | intrinsic

If we want to remove them or add them to a specification, use counter
data may be useful.

BUG=475104

Review URL: https://codereview.chromium.org/1051573003

git-svn-id: svn://svn.chromium.org/blink/trunk@193429 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r193369.
TBR=oilpan-reviews
NOTRY=true

Review URL: https://codereview.chromium.org/1074463004

git-svn-id: svn://svn.chromium.org/blink/trunk@193381 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Don't enable @viewport support in inspector emulation.
Author support for @viewport is not enabled on Android and should not be
enabled in mobile emulation mode in the inspector. The idea is that if
@viewport support is enabled by default, it will be enabled on all
platforms, and there will be no need for a switch in the emulation code
of the inspector.

R=dgozman@chromium.org
BUG=467204

Review URL: https://codereview.chromium.org/1062333002

git-svn-id: svn://svn.chromium.org/blink/trunk@193365 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Update the FIXME around event handler attributes on body/frameset
BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1067303004

git-svn-id: svn://svn.chromium.org/blink/trunk@193363 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Explicitly use SkPaint(s) in SVGInlineTextBoxPainter
Move paintForLayoutObject from SVGShapePainter.cpp to SVGPaintContext,
and use it when setting up paints for decorations and text in
SVGInlineTextBoxPainter.
This eliminates the last users of SVGLayoutSupport functions
updateGraphicsContext() and applyStrokeStyleToContext(), as well as
SVGPaintServer::apply().

BUG=424655

Review URL: https://codereview.chromium.org/1070703002

git-svn-id: svn://svn.chromium.org/blink/trunk@193360 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync CSS interfaces with the specs
Other than code movement, there are two changes to the generated code:
CSSImportRule.href and StyleSheet.type are made non-nullable, so
v8SetReturnValueString is used instead of v8SetReturnValueStringOrNull.
This doesn't matter, because these never return String() internally. If
they did, the return value would change from null to the empty string.

BUG=460722

Review URL: https://codereview.chromium.org/1054303004

git-svn-id: svn://svn.chromium.org/blink/trunk@193357 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Explicitly use SkPaint(s) in SVGShapePainter
This replaces use of SVGLayoutSupport::updateGraphicsContext to update
the GC-state with code that fills in and uses SkPaints explicitly, and
hence avoids saving GC-state (except for CTM updates).
As a side-effect, the code to handle stroke of zero-length is simplified
significantly.

BUG=424655

Review URL: https://codereview.chromium.org/1052873003

git-svn-id: svn://svn.chromium.org/blink/trunk@193272 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Cache element indices for :nth-child and :nth-last-child selectors.
In order to avoid n^2 for :nth-selectors, we introduce a cache where we
store the index of every kth child of a parent node P the first time the
nth-count is queried for one of its children. The number k is given by
the "spread" constant.

After the cache has been populated for the children of P, the nth-index
for an element will be found by walking the siblings from the element
queried for and leftwards until a cached element/index pair is found.
So populating the cache for P is O(n). Subsequent lookups are best case
O(1), worst case O(k).

The cache is created on the stack when we do operations where we know we
can benefit from having it. Currently, those are querySelector,
querySelectorAll, and updateStyle. We are throwing away the cache after
each operation to avoid holding on to potentially large caches in memory.

R=esprehn@chromium.org
BUG=461878

Review URL: https://codereview.chromium.org/1023393002

git-svn-id: svn://svn.chromium.org/blink/trunk@193268 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Move SVG path blend state to its own object
Create a new inner state object SVGPathBlender::BlendState and move
SVGPathBlender::blendSegments and helpers to it. The per-segment blend*
methods are folded away into blendSegments(). This allows to better
exploit commonalities between the different segment types.
The update of the current point(s) is moved into a helper function.

BUG=467592

Review URL: https://codereview.chromium.org/1056873002

git-svn-id: svn://svn.chromium.org/blink/trunk@193262 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Improve window.closed fidelity.
Have window.close() mark the window object as closing, so that we can
return a more precise result for window.closed immediately upon return.

Otherwise window.closed would only transition to |true| after the deferred
closing operation has gone ahead. This exposes internal details and timing
to scripts, which is preferably avoided.

Spec-wise, for "close a browsing context",

 https://html.spec.whatwg.org/#close-a-browsing-context

window.closed will transition to |true| at the start of step 3, with
unloading&discarding (steps 3-5) being executed asynchronously (when
the deferred close operation runs.) This implies that window.closed
will return true before |pagehide| and |unload| events have been
dispatched as part of step 3 (but _after_ |beforeunload| dispatching
and handling, step 2.) This is not correct with the spec, it should
only happen once step 5 has run, but the behavior aligns with Gecko.
It is thought to be quite unlikely that unload handlers depend on
window.closed being |false| rather than |true| when run.

R=haraken,mkwst
BUG=472379

Review URL: https://codereview.chromium.org/1053073002

git-svn-id: svn://svn.chromium.org/blink/trunk@193255 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r193243.
TBR=oilpan-reviews
BUG=330389
NOTRY=true

Review URL: https://codereview.chromium.org/1064813002

git-svn-id: svn://svn.chromium.org/blink/trunk@193254 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Attempt to deflake append-child-adopt-node-error-crash.html test.
Somewhat speculative, avoid potential timing issues with iframe loads
going ahead before the test has initialized fully.

R=
BUG=474155

Review URL: https://codereview.chromium.org/1050403004

git-svn-id: svn://svn.chromium.org/blink/trunk@193232 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r193185.
TBR=oilpan-reviews
BUG=420515
NOTRY=true

Review URL: https://codereview.chromium.org/1063703002

git-svn-id: svn://svn.chromium.org/blink/trunk@193187 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: sync Mac test expectations.
Widen the expectations to allow for crashes to be reported as timeouts
on the mac_dbg oilpan bot.

TBR=oilpan-reviews
NOTRY=true

Review URL: https://codereview.chromium.org/1059973002

git-svn-id: svn://svn.chromium.org/blink/trunk@193164 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Sync expectations following r192161, pt 2.
TBR=oilpan-reviews,pdr,wkorman@chromium.org
BUG=470313
NOTRY=true

Review URL: https://codereview.chromium.org/1063593002

git-svn-id: svn://svn.chromium.org/blink/trunk@193163 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Sync test expectations following r193161.
TBR=oilpan-reviews,pdr,wkorman@chromium.org
BUG=470313
NOTRY=true

Review URL: https://codereview.chromium.org/1065513002

git-svn-id: svn://svn.chromium.org/blink/trunk@193162 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r193159.
TBR=oilpan-reviews
BUG=
NOTRY=true

Review URL: https://codereview.chromium.org/1062683002

git-svn-id: svn://svn.chromium.org/blink/trunk@193160 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Hide the SVGTextQuery implementation in the .cpp file
Mostly renaming and "re-namespacing" in preparation for adding a
different way to perform a query.
Actual code-changes include storing the LayoutObject to query in the
SVGTextQuery instance, and passing it on to executeQuery(). The Vector
of textboxes is moved to the stack of executeQuery(), and the helper
collectTextBoxesInFlowBox() gets a new argument to pass that Vector
around.

BUG=471205,470326

Review URL: https://codereview.chromium.org/1057853002

git-svn-id: svn://svn.chromium.org/blink/trunk@193038 bbb929c8-8fbe-4397-9dbb-9b2b20218538
davve
Use viewBox for SVG as intrinsic size when all else fails
In http://crrev.com/308643002 the use of viewBox for intrinsicSize was
removed (which means this is a partial revert of that change). The
reason for the removal was that there wasn't a known cases where it
would be useful.

But then crbug.com/441862 surfaced and showed that using the viewBox
for intrinsic size can indeed be useful and necessary for SVG inside
an image through a relatively complex chain. What in the end happens
is that the intrinsic size is used not as a size but as a ratio when
doing scaling to accommodate for object-fit:cover (see
LayoutReplaced::replacedContentRect).

Ideally, we should only allow use of the ratio from the viewBox, but
we currently have no way of expressing just the ratio for an Image. So
there is potential for the viewBox being misused as size. Putting the
code back should be relatively safe though, since we've had it before.

BUG=441862

Review URL: https://codereview.chromium.org/1019813002

git-svn-id: svn://svn.chromium.org/blink/trunk@193030 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Finalize scheduler before shutting down Blink.
Have the Blink unittest runner shutdown the scheduler before doing
same to Blink, as the former may well access objects in the latter.

R=kouhei,haraken
BUG=

Review URL: https://codereview.chromium.org/1054893002

Cr-Commit-Position: refs/heads/master@{#323453}
fs
Simplify range mapping computation in SVGTextQuery/SVGInlineTextBox
Reduce SVGInlineTextBox::mapStartEndPositionsIntoFragmentCoordinates to
a simple offset/base adjustment and an intersection (which is what it
did - just in an unnecessarily verbose way.)

In SVGTextQuery::mapStartEndPositionsIntoFragmentCoordinates, drop the
intersection code, and leave that to the SVGInlineTextBox method.
Move the call to modifyStartEndPositionsRespectingLigatures() after the
intersection, because we don't want to do any adjustments on an empty
range. This is ok because modifyStartEndPositionsRespectingLigatures()
should never expand the range outside of the fragment it operating on.
Moving the call means it needs to be adjusted to work on offsets within
the fragment, so do that.

BUG=471205,470326

Review URL: https://codereview.chromium.org/1049673002

git-svn-id: svn://svn.chromium.org/blink/trunk@193017 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Eliminate use of and remove PathCoordinateMode
No longer used by SVGPathConsumer. Used by SVGPathBlender to decide
what the blending result will be.
Replace with bools in SVGPathBlender.

BUG=467592

Review URL: https://codereview.chromium.org/1048913004

git-svn-id: svn://svn.chromium.org/blink/trunk@193009 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192943.
TBR=oilpan-reviews
BUG=464617
NOTRY=true

Review URL: https://codereview.chromium.org/1051893002

git-svn-id: svn://svn.chromium.org/blink/trunk@192951 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192936.
TBR=oilpan-reviews
BUG=436952
NOTRY=true

Review URL: https://codereview.chromium.org/1058493002

git-svn-id: svn://svn.chromium.org/blink/trunk@192948 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Move PathParsingMode to SVGPathParser.h
This enum is (only) needed when using SVGPathParser.

BUG=467592

Review URL: https://codereview.chromium.org/1051783002

git-svn-id: svn://svn.chromium.org/blink/trunk@192947 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192918.
TBR=oilpan-reviews
BUG=436952
NOTRY=true

Review URL: https://codereview.chromium.org/1053703002

git-svn-id: svn://svn.chromium.org/blink/trunk@192945 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Convert svg/text/columns-do-not-apply.html to a reftest.
Also increase column count to 4, to increase the likelihood of this failing if
the code is broken.

BUG=471172
R=ed@opera.com

Review URL: https://codereview.chromium.org/1036423002

git-svn-id: svn://svn.chromium.org/blink/trunk@192932 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix WorkerThreadStartupData finalization handling.
The WorkerThreadStartupData structure is used at creation-time to
configure new worker threads and their global scopes. To simplify
its lifetime and have the owning worker thread do the finalization,
move this structure off the heap.

The motivation for it being on the heap wasn't entirely compelling
to start with (introduced by https://codereview.chromium.org/191003010.)

R=haraken
BUG=472044

Review URL: https://codereview.chromium.org/1041053005

git-svn-id: svn://svn.chromium.org/blink/trunk@192926 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Fix unresolved gn dependencies when enable_configuration_policy=false
BUG=

Review URL: https://codereview.chromium.org/1009883002

Cr-Commit-Position: refs/heads/master@{#323206}
mostynb
add video hole support to the gn build
BUG=329447

Review URL: https://codereview.chromium.org/1042543003

Cr-Commit-Position: refs/heads/master@{#323201}
fs
Split normalized reading from non-normalized in SVGPathParser
Move to parseAndNormalizePath() and parsePath() respectively and move
state to the corresponding one as appropriate.

Default inline parsePathDataFromSource. Since callsite usually pass a
constant PathParsingMode and checkForInitialMoveTo, this allows for
some specialization.

BUG=467592

Review URL: https://codereview.chromium.org/1045343002

git-svn-id: svn://svn.chromium.org/blink/trunk@192901 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Determine the right SVGTextMetrics using the correct approach
https://codereview.chromium.org/1041693002/ had a bug with how it
determined the SVGTextMetrics cell to use for a certain character/glyph.
We need to use SVGTextFragment::metricsListOffset and iterate.

BUG=470326

Review URL: https://codereview.chromium.org/1045793002

git-svn-id: svn://svn.chromium.org/blink/trunk@192817 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Allow views::Label subclasses create RenderText
BUG=

Review URL: https://codereview.chromium.org/1036233005

Cr-Commit-Position: refs/heads/master@{#322787}
fs
Rearrange some includes for core/layout/svg/SVGText*
LayoutSVGResourceMasker.h came along for the ride too.

Review URL: https://codereview.chromium.org/1041153002

git-svn-id: svn://svn.chromium.org/blink/trunk@192754 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Adjust glyph positions in RTL runs in SVGTextQuery
When calculating the glyph position of a glyph in an RTL run/line box,
make sure the position is computed from the right of the fragment
within the line box.
Also adjust calls to SVGTextMetrics::measureCharacterRange to pass the
direction of the line box rather than the direction of the layout
object.
Use the SVGTextMetrics stored in the layout attributes to get the
extents for getExtentOfChar to avoid having to redo the somewhat
involved extent computation for cursive scripts.
With this, glyph extents for cursive scripts are better but still far
from perfect/good. This is likely not the fault of the query code
though.

The test svg/text/bidi-text-query.svg is rewritten to better illustrate
the query order and the returned extents.

BUG=470326

Review URL: https://codereview.chromium.org/1041693002

git-svn-id: svn://svn.chromium.org/blink/trunk@192701 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the DataTransfer* interfaces with the spec
The only change to the generated code is due to
DataTransferItemList.length now being unsigned long, but since will not
be observable as DataTransferItemList::length() will not return any
negative values.

BUG=460722

Review URL: https://codereview.chromium.org/1036273002

git-svn-id: svn://svn.chromium.org/blink/trunk@192697 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: avoid InjectedScriptManager::CallbackData-induced leaks.
Move CallbackData to the Oilpan heap, so as to avoid it having to
keep a Persistent<> reference to its InjectedScriptHost.

If left as a persistent, it would leave the v8 wrapper object uncollected
and prevent a clean shutdown.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1040703002

git-svn-id: svn://svn.chromium.org/blink/trunk@192684 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Enable new multicol for testing and experimental web platform features.
There's already a RuntimeEnabledFeatures flag for region based
(aka. "new") multicol. So far it's only been used to toggle support
for column-fill (only supported in the new implementation), but will
from now on be used to determine whether to use the region based
implementation or not.

Remove internals.settings.setRegionBasedColumnsEnabled().

We need to keep a method for region based multicol (that does nothing)
in WebSettings for now, since it's still being called from the
Chromium side. Will be cleaned up later, when the
--enable-region-based-columns command line flag (which from now on has
no effect) is gone. See crbug.com/350853

Remove virtual/regionbasedcolumns tests, since region based multicol
is what's tested by default from now on. At the same time, add
virtual/stable/ tests, so that we still get test coverage for the old
implementation, since that's still what's shipping. This move causes
many changes in TestExpectations. All multicol test expectations that
used to be foo/* will now be virtual/stable/foo/* , and everything
that used to be virtual/regionbased/foo/* is now foo/* .

A few test expectations also need to be updated:

fast/dom/Element/getBoundingClientRect.html: Regenerated expectation
file. New multicol has improved column balancing, resulting in 6px
shorter columns.

fast/borders/border-antialiasing.html: Schedule for
rebaseline. Clipping improvements in new multicol.

fast/repaint/multicol-as-paint-container.html: Schedule for
rebaseline. Different individual rectangles, but same resulting
rectangle.

fast/repaint/multicol-repaint.html: Schedule for rebaseline. Clipping
improvements in new multicol.

BUG=334335,467468
R=dsinclair@chromium.org,jchaffraix@chromium.org,kbr@chromium.org

Review URL: https://codereview.chromium.org/1028383002

git-svn-id: svn://svn.chromium.org/blink/trunk@192683 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: dispose an HTMLImportsController on document detach/removal.
When a Document becomes detached and removes its HTMLImportsController
supplement, this will synchronously remove the controller and all
its "HTML imports" owned objects, in a non-Oilpan setting. This cancels
all ongoing loaders and more (cf. HTMLImportsController::removeFrom().)

ResourceFetcher objects are moving to accurately detaching from their
FrameFetchContexts when their frames become detached from a document
(http://crbug.com/458222). This implies that we cannot have loader objects
active, as that may cause FrameFetchContexts to be accessed, but once
lacking a frame. The code is no longer that expecting that.

For HTML imports loaders, this is avoided by synchronously cancelling &
finalizing the loaders, but that doesn't happen for Oilpan. It needs to,
so an explicit dispose() step is introduced for HTMLImportsController
and all its associated objects.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1032293002

git-svn-id: svn://svn.chromium.org/blink/trunk@192677 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Fix handling of Arabic script in SVGTextContentElement.getSubStringLength
Pass the direction of the line box instead of the layout object when
measuring the sub string.

BUG=470326

Review URL: https://codereview.chromium.org/1032363002

git-svn-id: svn://svn.chromium.org/blink/trunk@192670 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Clear baseLayoutStyle when the font selector version has increased.
FontFaceCache has a version() member which is increased when we add fonts
to the cache. It is used to detect if new fonts have been added to the
cache after a LayoutStyle was calculated. Different version() numbers will
make Font comparison fail and trigger relayout with new font data.

When the font added to the cache is new to the style system, it is
accompanied by a full document recalc. If we add a stylesheet with an
@font-face rule, the @font-face will cause an addition to the font cache,
and a document style recalc. So, if we have a "font-family:webfont,serif"
where "webfont" does not match anything, we lay out with the serif "font".
If we then add a stylesheet with an @font-face for "webfont", we need to
re-layout with that new font even if the computed style for font-family
doesn't change. That is triggered by the version number incremented by the
addition of "webfont".

This is all well until we add or remove a stylesheet which causes an
analyzed stylesheet update where we get a Reconstruct. The StyleResolver
will be recreated and font faces will be re-added, hence increasing the
version number of the font cache. The analyzed stylesheet update is smart
enough to avoid a full document recalc if it figures out that we did not
really add or remove any @font-face rules, just re-adding the ones we had.

We will then end up with a computed Font that was created for a different
font cache version, but we figured out we didn't need to recompute the
style or relayout since the font cache didn't really change with the
increased version.

If we are animating an element while such a reconstruct happen, we end up
having a baseLayoutStyle for the animation which is based on an old font
cache version. The LayoutStyle comparison ASSERT for baseLayoutStyle in
ElementAnimations will trigger because the Font comparison will fail,
since the version number for a newly created LayoutStyle Font will be
different.

To avoid that, we throw away the baseLayoutStyle after such a reconstruct
happens, in which case the stored version in the FontFallbackList will not
be in sync with the one stored in the FontFaceCache.

The real bug here is that the version tagging/increment here is imprecise
and not correlated with needsStyleRecalc. Removing an empty stylesheet
like in the added test-case will cause any element to be re-layout the
next time some other computed style change happen on that element as we
detect that the version number is out of sync. I have reported
crbug.com/471079 for that.

There is a generation() in FontCache which is similar to version(), but
increasing that will always trigger a full document recalc in
StyleEngine::fontsNeedUpdate.

R=esprehn@chromium.org,dstockwell@chromium.org,eae@chromium.org
BUG=470458

Review URL: https://codereview.chromium.org/1038193002

git-svn-id: svn://svn.chromium.org/blink/trunk@192669 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
IDBRequestTest.AbortErrorAfterAbort: stop request on exit.
To avoid test instability should a GC happen before a later test calls
stopActiveDOMObjects(), have this test stop its request upon exit.
Otherwise we risk finalizing the request object while it is in a
pending state; something that the IDBRequest destructor checks for.

R=

Review URL: https://codereview.chromium.org/1035963002

git-svn-id: svn://svn.chromium.org/blink/trunk@192640 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in chromecast/
BUG=466848

Review URL: https://codereview.chromium.org/1038143002

Cr-Commit-Position: refs/heads/master@{#322500}
mstensho
Turn css3/unicode-bidi-isolate-basic into a reftest.
BUG=386567
R=rune@opera.com

Review URL: https://codereview.chromium.org/1029343003

git-svn-id: svn://svn.chromium.org/blink/trunk@192637 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Give up on stretching columns if they have already reached max height.
This doesn't change any behavior (column heights were already clamped against
max height), but it avoids an assertion failure that would occur if no space
shortage is recorded during a layout pass. Unbreakable content (lines) that's
taller than the column (max) height don't record space shortage, as columns
cannot be stretched beyond the (max) height anyway.

Note that layout might end up looking somewhat weird in situations like this,
since content that's supposed to be unbreakable is split across multiple
columns (instead of letting content overflow columns in the block direction).
For paged overflow (or printing) this is the desired behavior, though, since
overflow will be clipped. See also crbug.com/367651

This also avoids the same assertion failure when
fast/block/line-layout/line-break-removal-near-textarea-crash.html is run with
the new multicol implementation on Mac, because -webkit-appearance:button
imposes a min-height there. min-height is treated as height if height is auto.
That's crbug.com/65731

BUG=470527
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1017263004

git-svn-id: svn://svn.chromium.org/blink/trunk@192636 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Force Mac editing behavior for fast/multicol/hit-test-above-or-below.html
This way we won't need platform specific expectations, since it should now just
pass on all platforms. What to hit when you start selecting below the end of
the last column (or simply below the block in non-multicol), is
platform-specific. On Windows you hit the character that's directly above the
cursor, while on Linux and Mac you hit the end of the text.

This is another preparatory patch for enabling region based columns.

R=jchaffraix@chromium.org
BUG=334335

Review URL: https://codereview.chromium.org/1016603006

git-svn-id: svn://svn.chromium.org/blink/trunk@192632 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/chromeos/
BUG=466848

Review URL: https://codereview.chromium.org/1036723003

Cr-Commit-Position: refs/heads/master@{#322463}
fs
Factor out glyph position computations in SVGTextQuery
In preparation for fixing RTL handling, move some common code for
computing the position of a glyph into two helper functions.

No functional changes.

BUG=470326

Review URL: https://codereview.chromium.org/1032603005

git-svn-id: svn://svn.chromium.org/blink/trunk@192624 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
Add serializers to RTCIceCandidate and RTCSessionDescription
Support for the serializer syntax was added by these CLs:
  https://codereview.chromium.org/1031593003/
  https://codereview.chromium.org/1004503004/

The V8ObjectBuilder helper class was added by this CL:
  https://codereview.chromium.org/1031783003/

BUG=469650, 468180

Review URL: https://codereview.chromium.org/1033983002

git-svn-id: svn://svn.chromium.org/blink/trunk@192621 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] mapAbsoluteToLocalPoint() needs to convert to flow thread coordinates.
mapAbsoluteToLocalPoint() works on visual coordinates, so pretending that it's
a flow thread coordinate (and then mapping it to a visual coordinate again, why
not) on the way up the tree is just going to cause trouble.

Instead we need to convert from visual to flow thread coordinates on our way
back down the tree, when entering the flow thread on our way to the target
element. Sadly, we also need to cancel out a flowthread-to-visual conversion
done in LayoutBox::offsetFromContainer().

This makes fast/events/document-elementFromPoint.html pass in the new multicol
implementation.

Added a couple of new tests as well (one which actually fails in the old /
current implementation), since the aforementioned test isn't yet run with the
new implementation.

R=dsinclair@chromium.org,jchaffraix@chromium.org
BUG=334335

Review URL: https://codereview.chromium.org/1024023002

git-svn-id: svn://svn.chromium.org/blink/trunk@192616 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Move iframe border/padding to the standard Fullscreen UA style sheet
This spec bug was resolved very quickly: (Thanks, Anne!)
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28332

The ua-style-iframe-border.html test is no longer needed, as it was
written specifically to handle the fact that the border rule was not
!important, which it now is.

BUG=402378

Review URL: https://codereview.chromium.org/1032253002

git-svn-id: svn://svn.chromium.org/blink/trunk@192610 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Get rid of SVGTextMetrics functions without an explicit TextDirection
It's better to not use these at all. Open-code them at their current
callsites with an intent of fixing the direction they specify.

No functional changes.

BUG=470326

Review URL: https://codereview.chromium.org/1038843002

git-svn-id: svn://svn.chromium.org/blink/trunk@192605 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
Add V8ObjectBuilder helper and use in modules/crypto/
V8ObjectBuilder is used to create simple V8 objects, and replaces the
corresponding functionality in Dictionary (Dictionary::createEmpty() and
the various Dictionary::set() functions), making Dictionary a read-only
accessor of an object's properties.

BUG=469650

Review URL: https://codereview.chromium.org/1031783003

git-svn-id: svn://svn.chromium.org/blink/trunk@192599 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Add support for serializer definitions
The code generation for it is very simple. The

  serializer ReturnType name();

form adds the method "ReturnType name()" as a normal method, and in
addition a toJSON() method with identical behavior.

All other forms of serializer definitions, are equivalent to defining
a method

  [CallWith=ScriptState] any toJSON();

unless the serializer definition has additional extended attributes, in
which case those are also applied to the toJSON() method.

BUG=469650

Review URL: https://codereview.chromium.org/1004503004

git-svn-id: svn://svn.chromium.org/blink/trunk@192594 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192583.
TBR=oilpan-reviews
BUG=275851
NOTRY=true

Review URL: https://codereview.chromium.org/1037593004

git-svn-id: svn://svn.chromium.org/blink/trunk@192593 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Deprecate CSSKeyframesRule.insertRule()
Intent to Deprecate:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/jaxgGDSFVY0/l5pqsjLkt_UJ

BUG=470400

Review URL: https://codereview.chromium.org/1004733012

git-svn-id: svn://svn.chromium.org/blink/trunk@192590 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/devtools
BUG=466848

Review URL: https://codereview.chromium.org/1030263002

Cr-Commit-Position: refs/heads/master@{#322339}
fs
Rework the SVGPathConsumer interface
The per-command interface is replaced with a segment interface. The new
interface in practice only consists of the

  emitSegment(const PathSegment&)

method, but incrementPathSegmentCount() and continueConsuming() need to
be kept around for the sake of SVGPathTraversalStateBuilder.

The two users of the interface - SVGPathParser and SVGPathBlender - are
converted to use the new interface.
For SVGPathParser this is fairly
straightforward (no additional code-changes).
In SVGPathBlender, the "blend switch" is moved into a separate function
and each blend* method is converted to return the blended segment
instead of calling the consumer themselves. Some local variables are
removed in various blend* methods, but otherwise the conversion consist
of assigning blended values to a PathSegmentData, rather than feeding
them to a consumer.

BUG=467592

Review URL: https://codereview.chromium.org/1037463002

git-svn-id: svn://svn.chromium.org/blink/trunk@192589 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Turn ViewportAnchors into stack allocated objects.
The viewport anchors have stack lifetimes, so rephrase their
implementation and use slightly so as to be able to allocate
them on the stack.

The main benefit of doing so is that the references they
contain to Oilpan heap objects will then be correctly traced
should an Oilpan conservative GC be needed while resizing
the view.

R=bokan,haraken
BUG=340522

Review URL: https://codereview.chromium.org/1003323004

git-svn-id: svn://svn.chromium.org/blink/trunk@192586 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove border and padding from iframes in fullscreen
This restores two rules dropped in the spec sync:
https://codereview.chromium.org/974783002

Without the border:none rule,
http://html5-demos.appspot.com/static/fullscreen.html gets a 1px white
border in fullscreen, which looks particularly odd due to the rounded
borders in this demo.

Without the padding:0 rule, https://play.google.com/store/movies?hl=en
gets a 60px white padding at the top of the fullscreen iframe, which is
clearly not the intended design.

BUG=402378, 468292, 469133

Review URL: https://codereview.chromium.org/1032113002

git-svn-id: svn://svn.chromium.org/blink/trunk@192567 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in content/browser
BUG=466848

Review URL: https://codereview.chromium.org/1031133003

Cr-Commit-Position: refs/heads/master@{#322280}
mostynb
favor DCHECK_CURRENTLY_ON for better logs in chrome/browser/android/
BUG=466848

Review URL: https://codereview.chromium.org/1016473003

Cr-Commit-Position: refs/heads/master@{#322250}
mostynb
favor DCHECK_CURRENTLY_ON for better logs in components/
BUG=466848

Review URL: https://codereview.chromium.org/1004933003

Cr-Commit-Position: refs/heads/master@{#322240}
mostynb
favor DCHECK_CURRENTLY_ON for better logs in extensions/
BUG=466848

Review URL: https://codereview.chromium.org/1032553009

Cr-Commit-Position: refs/heads/master@{#322238}
ed
[S.P.] Use LayoutObject references in SVGFilterPainter.
Review URL: https://codereview.chromium.org/1034683002

git-svn-id: svn://svn.chromium.org/blink/trunk@192547 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: finalization of Permissions and SyncManager not needed.
With ScriptWrappable being without a destructor with Oilpan, have these
two classes derive from the non-finalizing GarbageCollected<>.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1033963002

git-svn-id: svn://svn.chromium.org/blink/trunk@192536 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Deprecate Attr child nodes
Intent to Deprecate:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/tW6Lr5nA1pY/BOedStgP2pEJ

Unfortunately this leads to duplicated deprecation warnings if one e.g.
sets attr.firstChild.data = 'foo', but both are needed to cover the
cases of mere access, like attr.firstChild, and mere modification, like
attr.appendChild().

BUG=305105

Review URL: https://codereview.chromium.org/1031073003

git-svn-id: svn://svn.chromium.org/blink/trunk@192530 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192519.
TBR=oilpan-reviews
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/1030163002

git-svn-id: svn://svn.chromium.org/blink/trunk@192525 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
[S.P.] Use 'const LayoutObject&' in SVGMaskPainter.
Review URL: https://codereview.chromium.org/1022843004

git-svn-id: svn://svn.chromium.org/blink/trunk@192515 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192502.
R=haraken
BUG=275851
NOTRY=true

Review URL: https://codereview.chromium.org/1030053004

git-svn-id: svn://svn.chromium.org/blink/trunk@192507 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build++ after r192490.
TBR=oilpan-reviews
BUG=463435
NOTRY=true

Review URL: https://codereview.chromium.org/1035533003

git-svn-id: svn://svn.chromium.org/blink/trunk@192503 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Have postMessage()s throw TypeError on failed arity checks.
R=haraken,mkwst@chromium.org
BUG=339441

Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192337

Review URL: https://codereview.chromium.org/1025203002

git-svn-id: svn://svn.chromium.org/blink/trunk@192483 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Mark wrappers of canvas rendering context objects as dependent.
When initially called, canvas.getContext() will return a fresh rendering
context object, but at the same time switch its "context mode" to a direct
one (2d or webgl), such that subsequent getContext() with the same
contextID argument will return that initially created context object.

To correctly provide that same-object identity, the wrapper object must be
marked as depending on the canvas element object, such that it will be
retained across GCs.

R=junov,haraken
BUG=450410

Review URL: https://codereview.chromium.org/1033613002

git-svn-id: svn://svn.chromium.org/blink/trunk@192465 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
[S.P.] Use 'const LayoutObject&' in SVGClipPainter.
Review URL: https://codereview.chromium.org/1035463002

git-svn-id: svn://svn.chromium.org/blink/trunk@192461 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix TaskManagerBrowserTest.WebWorkerJSHeapMemory and enable.
Update and enable the test, including adjusting postMessage() usage to no
longer call the method without any arguments.

R=ncarter, alph
BUG=339441,259368

Review URL: https://codereview.chromium.org/1027333003

Cr-Commit-Position: refs/heads/master@{#322018}
fs
Rework SVG path normalization code
This CL moves normalization code from the SVGPathParser::emit* methods,
into a emitSegment method on a new helper object NormalizingConsumer.
Normalization is a fairly uniform process, and with a more uniform
datastructure to work on (PathSegmentData), it can be simplified.
The new NormalizingConsumer::emitSegment accepts a non-normalized
segment, which it maps to a normalized segment in a few steps:
  1) Convert relative points to absolute.
  2) Convert smooth/quadratic/arc parametrizations to cubics.
  3) Convert non-normalized verbs to normalized.
  4) Update normalization state.

Normalization state (currentPoint, subPathPoint, etc.) is also moved to
the new helper class. The coordinate mode (SVGPathParser::m_mode) is no
longer needed and removed.
The checks for quadratic/cubic curve classes are turned into functions.

BUG=467592

Review URL: https://codereview.chromium.org/1033643003

git-svn-id: svn://svn.chromium.org/blink/trunk@192445 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192426.
TBR=oilpan-reviews
BUG=451004
NOTRY=true

Review URL: https://codereview.chromium.org/1029363002

git-svn-id: svn://svn.chromium.org/blink/trunk@192427 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Mark overflow-scroll-animates.html as leaking.
TBR=skobes,dglazkov
BUG=469271
NOTRY=true

Review URL: https://codereview.chromium.org/1030843002

git-svn-id: svn://svn.chromium.org/blink/trunk@192424 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Don't return the wrong flow thread from locateFlowThreadContainingBlock().
LayoutListItem::updateMarkerLocationAndInvalidateWidth() does nasty
things (inserts layout objects at "random" places in the tree during
layout), so we need to temporarily reset the current flow thread in
LayoutState, or we might end up locating the wrong one in
LayoutObject::locateFlowThreadContainingBlock(). Need this until
crbug.com/370461 gets fixed.

This makes fast/lists/list-inside-columns-crash.html pass with the new multicol
implementation, but since that test is still running with the old multicol
implementation, I added a simplified tailored test that's actually run.

BUG=334335,460251
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1021143004

git-svn-id: svn://svn.chromium.org/blink/trunk@192423 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Rename FrameDestructionObserver to LocalFrameLifecycleObserver.
Renamed so as to be consistent with the naming of other lifecycle
observers.

R=haraken
BUG=462949

Review URL: https://codereview.chromium.org/1026253002

git-svn-id: svn://svn.chromium.org/blink/trunk@192418 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ollel
Use same parameters for jpeg decoding quality on all platforms.
This patch will change android to use same decoding parameters as
other platforms, thus changing back to dct=int and dither=fs since
the faster settings caused visible artifacts that did not justify
the small performance gain.

BUG=385515

Review URL: https://codereview.chromium.org/1023193002

git-svn-id: svn://svn.chromium.org/blink/trunk@192409 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
KEYGEN elements should always create LayoutBlockFlow, regardless of display type.
Since it's a replaced element, the display value on a KEYGEN element should
only affect whether it's inline-level or block-level. The actual type of layout
object should be the same, regardless of display type.

BUG=455867
R=jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1027173002

git-svn-id: svn://svn.chromium.org/blink/trunk@192399 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Pass segment to decomposeArcToCubic and let it handle exceptional cases
Moves complexity from SVGPathParser::emitArcToSegment, and leaves it
doing just normalization and emittal.

BUG=467592

Review URL: https://codereview.chromium.org/1028183003

git-svn-id: svn://svn.chromium.org/blink/trunk@192398 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
PostMessageTest: retire use of zero-argument port.postMessage().
In testPostUnsupportedWebMessageToApp, avoid invoking postMessage()
without any arguments. At least one is required for
MessagePort.postMessage().

R=sgurun@chromium.org
BUG=339441

Review URL: https://codereview.chromium.org/1003603004

Cr-Commit-Position: refs/heads/master@{#321855}
sigbjornf
Turn the InspectorHighlight builder into a stack allocated object.
R=haraken
BUG=

Review URL: https://codereview.chromium.org/1024423002

git-svn-id: svn://svn.chromium.org/blink/trunk@192387 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Remove SiblingTraversalStrategies include from StyleResolver.
SiblingTraversalStrategies were unused in StyleResolver.h, but some files
relied on ElementTraversal being included via StyleResolver.h.

R=jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1026483003

git-svn-id: svn://svn.chromium.org/blink/trunk@192384 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Temporarily disable baseLayoutStyle optimization.
In order to figure out more about how the baseRenderStyle validity assert
triggers in the wild, we'll try to temporarily make a RELEASE_ASSERT out
of it.

This means we'll effectively disable the optimization, yet clone a
baseLayoutStyle to be able to check that the optimization would have been
sound.

Performance tests may intentionally degrade as a consequence.

R=esprehn@chromium.org
BUG=463413

Review URL: https://codereview.chromium.org/1001323003

git-svn-id: svn://svn.chromium.org/blink/trunk@192378 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Disallow adding ContextLifecycleObservers during iteration.
The implementation of ContextLifecycleNotifier disallows the addition
of ActiveDOMObjects while delivering its notifications, by way of
a RELEASE_ASSERT(). This prevents ending up in inconsistent states where
(e.g.) instructing the ActiveDOMObjects to stop would lead to the
creation of new, but running, ActiveDOMObjects.

Extend this restriction to encompass all ContextLifecycleObservers; none
may be added while iterating over the registered ActiveDOMObjects. This
allows us to simplify the underlying implementation somewhat.

R=haraken
BUG=462949

Review URL: https://codereview.chromium.org/1024543004

git-svn-id: svn://svn.chromium.org/blink/trunk@192377 bbb929c8-8fbe-4397-9dbb-9b2b20218538
christiank
Add texture compression interface and ETC1 encoder.
This CL introduces a CC texture compression API and adds an ETC1
encoder that will be used for compressing tile textures.

BUG=434699

Review URL: https://codereview.chromium.org/1015373003

Cr-Commit-Position: refs/heads/master@{#321788}
fs
Move PathTraversalState::m_segmentIndex to SVGPathTraversalStateBuilder
The latter is the only one to manipulate the value.

BUG=467592

Review URL: https://codereview.chromium.org/1015833004

git-svn-id: svn://svn.chromium.org/blink/trunk@192370 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Add support for serializer definitions
A serializer definition is output as a 'Serializer' production, with
either no children, an 'Operation' child, or a 'Map'/'List' child. The
production has an attribute named 'ATTRIBUTE' in the

  serializer = identifier;

form (and no children), and the 'Map'/'List' productions have attributes
named 'GETTER', 'INHERIT' and 'ATTRIBUTES', where the latter is a list of
the attributes named in the definition.

BUG=469650

Review URL: https://codereview.chromium.org/1031593003

Cr-Commit-Position: refs/heads/master@{#321780}
fs
SVGPathParser: Move unaltered emits to a separate code-path
Hoist the check for normalized parsing/normalization out of the emit*
methods, and with it the non-normalized emittal out of emit*. This type
of emittal is trivial, so the use of SVGPathParser::m_mode can be
avoided altogther in this code-path.
This leaves the emit* methods with only doing normalized emittals, and
SVGPathParser::m_pathParsingMode only needs to be checked in the main
parsing method, so it becomes possible to just use the parameter
directly.

BUG=467592

Review URL: https://codereview.chromium.org/1028173002

git-svn-id: svn://svn.chromium.org/blink/trunk@192369 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Synchronize SVGLengthMode values for SVGTextPathElement.startOffset
The SVGLengthMode was specified as 'Other' on the attribute, and 'Width'
in SVGLength::lengthModeForAnimatedLengthAttribute.
Since they are both "wrong" (percentage for this attribute should be
resolved against the length of the path it's used for), randomly pick
'Width'.

BUG=469620

Review URL: https://codereview.chromium.org/1003273005

git-svn-id: svn://svn.chromium.org/blink/trunk@192367 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in content/{public,shell,test}/
BUG=466848

Review URL: https://codereview.chromium.org/1010963002

Cr-Commit-Position: refs/heads/master@{#321771}
philipj
Link to https://html.spec.whatwg.org/#the-foo-element where sensible
This makes it more apparent what e.g. HTMLModElement and
HTMLParagraphElement are.

These interfaces don't have good sections and are left alone:
HTMLDirectoryElement
HTMLFontElement
HTMLFrameElement
HTMLFrameSetElement
HTMLMarqueeElement (https://www.w3.org/Bugs/Public/show_bug.cgi?id=28296)

BUG=460722
NOTRY=true

Review URL: https://codereview.chromium.org/1022413002

git-svn-id: svn://svn.chromium.org/blink/trunk@192355 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Rework the SVGPathSource interface
This CL replaces the current per-command interface of SVGPathSource
with a per-segment interface.

A new struct PathSegmentData is added, and existing SVGPathSources are
modified to implement parse into this struct. For the most part this is
a trivial copy and paste operation. In SVGPathStringSource, some of the
helpers are refactored, and leading whitespace is consumed in the
constructor to avoid having something similar to moveToNextToken() in
the new interface. Number parsing is also made "latched", by setting a
flag on error, and only check that flag when all the input has been
considered. This makes the code a bit more streamlined while optimizing
for the common case (of no error.) This also renders the
parseFloatPoint* helpers unused, so they are removed.

peekSegmentType() is added to support checking if the first segment is
a move command without directly affecting the common 'transformation'
loop.

Users of the SVGPathSource interface (SVGPathParser and SVGPathBlender)
are refactored to make use of the new interface.
For SVGPathParser this means renaming the parse* methods to emit*,
while hoisting the input-handling out into the main "parsing" loop, and
passing the parsed PathSegmentData to the right emitter.
Similarly for SVGPathBlender, the input-handling is hoisted out of the
blend* methods, and the two inputs are passed as parameters. The
command equality check is changed to only be based on the command type.

BUG=467592

Review URL: https://codereview.chromium.org/1023993002

git-svn-id: svn://svn.chromium.org/blink/trunk@192348 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Leave remaining disabled test disabled, and explain why.
I've gone through all interesting multicol tests that needed to be converted to
reftests, js-tests (or at least something that isn't dump-render-tree or PNG
tests).

The remaining tests either provide no additional test coverage, or are invalid (albeit
passing in the old implementation), so just keep them disabled. Will be removed once
the old multicol implementation is gone (that's crbug.com/408123).

BUG=386567
R=rune@opera.com

Review URL: https://codereview.chromium.org/1023203002

git-svn-id: svn://svn.chromium.org/blink/trunk@192340 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Have postMessage()s throw TypeError on failed arity checks.
R=haraken,mkwst@chromium.org
BUG=339441

Review URL: https://codereview.chromium.org/1025203002

git-svn-id: svn://svn.chromium.org/blink/trunk@192337 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: remove now-addressed PostMessageTimer fixme.
R=haraken
BUG=340522
NOTRY=true

Review URL: https://codereview.chromium.org/1025133003

git-svn-id: svn://svn.chromium.org/blink/trunk@192336 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: revert SVG GC mixin constructor workaround.
Following r191501 (http://crrev.com/980653002), the construction of
a GC mixin object is safe, preventing conservative GCs from going ahead
until the GC mixin object is in a valid state.

With that in place, revert the workaround for SVG mixins (r188695),
which restructured the mixin constructors such that they performed no
heap allocations while the constructed object was in an invalid state.

R=haraken
BUG=420515

Review URL: https://codereview.chromium.org/1025883002

git-svn-id: svn://svn.chromium.org/blink/trunk@192330 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync HTML element interfaces S-V with the spec
Switch to linking to #the-foo-element instead of #htmlfooelement, as
it gives good extra clues in cases like HTMLTableCaptionElement and
HTMLTableCellElement. It also doesn't skip past constructors, etc.

At the same time also move Event.path out of the non-standard section,
as it's in the Shadow DOM spec (below HTMLShadowElement).

Also give HTMLInputElement.autocapitalize its own section.

There are no changes to the generated code other than order.

BUG=460722

Review URL: https://codereview.chromium.org/1031473002

git-svn-id: svn://svn.chromium.org/blink/trunk@192327 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync HTML element interfaces O-Q with the spec
Also fix the confused comment in HTMLImageElement, its hspace/vspace
attributes should also be unsigned long, noticed now because of the same
attributes on HTMLObjectElement.

There are no changes to the generated code other than order.

BUG=460722

Review URL: https://codereview.chromium.org/1028633005

git-svn-id: svn://svn.chromium.org/blink/trunk@192321 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Throw TypeError if value conversion to transferable fails.
For postMessage(), when converting to a sequence<Transferable> value,
throw a TypeError for any element that isn't an instance of a Transferable
type.

(Addresses http://w3c-test.org/webmessaging/with-ports/026.html failure.)

R=haraken
BUG=339441

Review URL: https://codereview.chromium.org/1022283002

git-svn-id: svn://svn.chromium.org/blink/trunk@192320 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert "remove -Wno-header-guard workaround for old versions of NSS"
This reverts commit 86ebf48be903b226d068b08efa16fe3725babb8c.

Build failures:
  http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Builder/builds/20027
  http://build.chromium.org/p/chromium.webkit/builders/GPU%20Linux%20Builder%20%28dbg%29/builds/31334

Original issue's description:
> remove -Wno-header-guard workaround for old versions of NSS
>
> I think it's safe to re-enable this warning now.  The bug was
> fixed upstream in 3.15.1 and there have been several NSS upgrades since then.
>
> BUG=255201
> Committed: https://crrev.com/86ebf48be903b226d068b08efa16fe3725babb8c
> Cr-Commit-Position: refs/heads/master@{#321711}

TBR=mostynb@opera.com,thakis@chromium.org
BUG=255201
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1024343002

Cr-Commit-Position: refs/heads/master@{#321712}
mostynb
remove -Wno-header-guard workaround for old versions of NSS
I think it's safe to re-enable this warning now.  The bug was
fixed upstream in 3.15.1 and there have been several NSS upgrades since then.

BUG=255201

Review URL: https://codereview.chromium.org/1028863002

Cr-Commit-Position: refs/heads/master@{#321711}
sigbjornf
Completely clear the heap ages array.
R=haraken
BUG=468166

Review URL: https://codereview.chromium.org/1021393004

git-svn-id: svn://svn.chromium.org/blink/trunk@192306 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Perform CORS access checks on Beacon redirects.
Beacon "fetches" follow CORS, which means that a CORS check must be
performed on the redirect response.

R=mkwst
BUG=468527

Review URL: https://codereview.chromium.org/1016373002

git-svn-id: svn://svn.chromium.org/blink/trunk@192294 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192278.
TBR=oilpan-reviews
BUG=451004
NOTRY=true

Review URL: https://codereview.chromium.org/1020383003

git-svn-id: svn://svn.chromium.org/blink/trunk@192288 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Implement <video controls> dodging for text track layout
This is a follow-up to "Separate the text track container from the media
controls": https://codereview.chromium.org/949203002/

Previously, we got this behavior for free because the text track
container was part of the media controls.

BUG=448795

Review URL: https://codereview.chromium.org/1018593004

git-svn-id: svn://svn.chromium.org/blink/trunk@192281 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix webkit unit tests following r192243 (reland).
R=haraken
BUG=467890

Review URL: https://codereview.chromium.org/1028653002

git-svn-id: svn://svn.chromium.org/blink/trunk@192276 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Separate the text track container from the media controls
Having the text track container as a part of the media controls makes it
harder to show and hide the controls as a group, which would be useful.

One benefit of the old approach was that the controls automatically
wouldn't overlap the cues. This is now broken, and two tests are
affected. This will be addressed in a follow-up:
https://codereview.chromium.org/1018593004/

TextTrackContainer is never hidden, as that used MediaControlElement's
show() and hide(). If it does not have any cues nothing will be
rendered, it will just sit there. If an optimization of this kind is
worthwhile, it should be to remove the TextTrackContainer entirely from
the DOM.

Some bits of mediaControls.css that should have no effect are removed.

BUG=448795

Review URL: https://codereview.chromium.org/949203002

git-svn-id: svn://svn.chromium.org/blink/trunk@192263 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert of Oilpan: fix webkit unit tests following r192243. (patchset #2 id:20001 of https://codereview.chromium.org/1026753002/)
Reason for revert:
Breaks windows builder,

 http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20Builder/builds/74953

Original issue's description:
> Oilpan: fix webkit unit tests following r192243.
> 
> TBR=oilpan-reviews
> BUG=467890
> NOTRY=true

TBR=oilpan-reviews@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=467890

Review URL: https://codereview.chromium.org/1024013002

git-svn-id: svn://svn.chromium.org/blink/trunk@192252 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix webkit unit tests following r192243.
TBR=oilpan-reviews
BUG=467890
NOTRY=true

Review URL: https://codereview.chromium.org/1026753002

git-svn-id: svn://svn.chromium.org/blink/trunk@192251 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Disable inline vector buffers for WTF::Deque for ASAN builds.
Speculatively extend r191159 to Deque<> vector buffers.

R=tkent
BUG=469111

Review URL: https://codereview.chromium.org/1025623002

git-svn-id: svn://svn.chromium.org/blink/trunk@192247 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Clear need for animation style for forced styleForElement.
When style recalc for an element is triggered by a StyleRecalcChange from
the ancestors, we need to clear the m_animationStyleChange flag on
ElementAnimations if set since the baseLayoutStyle cannot be used. This
is normally done from Element::recalcStyle just before recalcOwnStyle is
called.

Document::inheritHtmlAndBodyElementStyles does styleForElement outside of
the recalcStyle machinery and didn't clear this flag which caused an
assert for baseLayoutStyle comparison.

In particular, the case was that while an animation was running on body,
attempting to load an @font-face would trigger a version increase in the
font cache and a SubtreeStyleChange for the document, while we still tried
to use the baseLayoutStyle for the animating body because we ignored the
Force passed to inheritHtmlAndBodyElementStyles.

Comparing the baseLayoutStyle with the LayoutStyle created from scratch
would cause comparison to fail, due to a Font comparison fail because of
the increased font cache version number, which in turn caused the assert
to trigger.

R=esprehn@chromium.org,dstockwell@chromium.org
BUG=459661

Review URL: https://codereview.chromium.org/1000413003

git-svn-id: svn://svn.chromium.org/blink/trunk@192241 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Turn fast/block/float/float-not-removed-from-next-sibling4.html into a reftest.
BUG=386567
R=rune@opera.com

Review URL: https://codereview.chromium.org/1016403002

git-svn-id: svn://svn.chromium.org/blink/trunk@192237 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Remove dubious part from fast/block/margin-collapse/self-collapsing-cols-creates-block-formatting-context.html
The test had invalid column-span:all elements, i.e. there was no multicol
containing block. The new multicol implementation ignores all effects of
column-span:all unless it's a valid one, while the old / current implementation
doesn't.

BUG=386567
R=rune@opera.com

Review URL: https://codereview.chromium.org/1020923002

git-svn-id: svn://svn.chromium.org/blink/trunk@192236 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Simplify handling of LocalFrame lifecycle notifications.
LocalFrame provides a registration interface for observers to observe
its detachment and destruction, by way of FrameDestructionObserver.

Just like the derived objects of LifecycleNotifier<> do, hence it makes
sense for LocalFrame to also use that interface and implementation. Done
so here by introducing LocalFrameLifecycleNotifier<>.

On the observer side, the FrameDestructionObserver interface now derives
from LifecycleObserver<>, reusing its implementation. Instead of
canonicalizing its name as LocalFrameLifecycleObserver also, keep the
established FrameDestructionObserver.

R=haraken
BUG=462949

Review URL: https://codereview.chromium.org/1017313002

git-svn-id: svn://svn.chromium.org/blink/trunk@192231 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Simplify conversion of quadratic bezier segments
Perform the normalization first, and then compute the control points for
the equivalent cubic segment.

BUG=467592

Review URL: https://codereview.chromium.org/1024583002

git-svn-id: svn://svn.chromium.org/blink/trunk@192208 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix gcc compilation.
To catch out erroneous uses of unregisterPreFinalizer() over
class types T that do not provide an implementation of invokePreFinalizer()
(by way of USING_PRE_FINALIZER(), most likely), unregisterPreFinalizer()
currently asserts for T::invokePreFinalizer being bound and non-null.

This unfortunately runs into gcc's -Waddress warning ("the address of
<function> will never be null"), as the static method is statically
known and bound (where correctly used.)

Rephrase the assert by wrapping up the check in a sizeof() so as to
steer clear of gcc's fussiness.

R=
BUG=420515

Review URL: https://codereview.chromium.org/1000493003

git-svn-id: svn://svn.chromium.org/blink/trunk@192201 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Turn fast/css/first-letter-range-insert.html into a dumpAsText test.
Better option than rebaselining for new multicol (which uses different layout
objects, so DRT is just cumbersome).

BUG=386567
R=dsinclair@chromium.org

Review URL: https://codereview.chromium.org/1025493002

git-svn-id: svn://svn.chromium.org/blink/trunk@192192 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Add helper for computing the reflected control point for smooth segments
BUG=467592

Review URL: https://codereview.chromium.org/1019853003

git-svn-id: svn://svn.chromium.org/blink/trunk@192177 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
[svg] Make svgView override existing data selectively.
The change is to not blow off all the existing viewBox,
pAR, etc when an #svgView(...) is used. Instead only
replace the parts that are actually specified in the
svgView syntax.

BUG=444553

Review URL: https://codereview.chromium.org/1015743003

git-svn-id: svn://svn.chromium.org/blink/trunk@192174 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Correct localPoint when hitting an anonymous child block.
If Layer::hitTestContents() detects a hit, but we have failed to pinpoint it to
a DOM node (because we only found anonymous layout objects), there's code to
locate the nearest ancestor DOM node above the layer, and store it. But there's
no code to actually set the corresponding localPoint (and that sounds like a
tricky task, anyway), which means that text selecting and caretRangeFromPoint()
will suffer.

Add a work-around for flow thread layers. We can just report that didn't hit
anything so that we continue and hit a sibling column set instead, and thus set
the right localPoint (because the column set is in the same layer as the
multicol container, and the multicol container does have a DOM node).

Note that we should no longer get here for positioned generated content, like
the old comment suggested, because generated content now inserts pseudo nodes,
instead of creating anonymous layout objects. So it's actually a bit unclear if
we can end up here at all in other cases than multicol (which is now handled
properly-ish).

Re-enable an old test that now passes, and add some new ones.

BUG=461352
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: https://codereview.chromium.org/1003303005

git-svn-id: svn://svn.chromium.org/blink/trunk@192173 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Eliminate TextTrackCue::updateDisplayTree()
updateDisplayTree() cloned and inserted a new tree every time, and was
called continuously from CueTimeline::updateActiveCues(). The net effect
of this was to re-layout the cue continuously, causing cues to move into
areas where a cue was previously. The letter and spirit of the WebVTT
spec is to have a stable layout, where cues do not move once laid out.

TEST=LayoutTests/media/track/track-webvtt-two-cue-layout-after-first-end.html

As the display tree is now kept intact, it becomes necessary to
invalidate the style in setIsPastNode.

Test coverage of past and future cues:
LayoutTests/media/track/cue-style-invalidation.html
LayoutTests/media/track/track-css-matching-timestamps.html
LayoutTests/media/track/track-css-matching.html

Note that per spec a part of the cue could match neither :past nor
:future, but our implementation is mutually exclusive. It's not clear
what the best behavior is, so a spec bug was filed instead:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28237

BUG=322434

Review URL: https://codereview.chromium.org/1013393004

git-svn-id: svn://svn.chromium.org/blink/trunk@192171 bbb929c8-8fbe-4397-9dbb-9b2b20218538
peterp
Let adb_gdb support privileged processes with a switch.
Add "--privileged" and "--privileged=<num>" that works similar to
"--sandboxed" to make it easier to debug the GPU process on Android.

BUG=468697

Review URL: https://codereview.chromium.org/1023703002

Cr-Commit-Position: refs/heads/master@{#321351}
davve
Fix typo in layout test in rarely taken code branch
Review URL: https://codereview.chromium.org/1011393006

git-svn-id: svn://svn.chromium.org/blink/trunk@192167 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Move 'closePath' handling to the consumers
Only one consumer which needs it: SVGPathBuilder; Move it there.

BUG=467592

Review URL: https://codereview.chromium.org/1016023002

git-svn-id: svn://svn.chromium.org/blink/trunk@192163 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Cleanup: Call logicalTopInFlowThreadAt() at more places.
R=rune@opera.com

Review URL: https://codereview.chromium.org/1011413002

git-svn-id: svn://svn.chromium.org/blink/trunk@192158 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Removed unused styleSheetCandidateNodes().
Review URL: https://codereview.chromium.org/1023693002

git-svn-id: svn://svn.chromium.org/blink/trunk@192157 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Rewrite fast/multicol/*nested-columns.html as reftests.
The vertical-rl version fails (both before and after the rewrite) with the
region based multicol implementation. Reported bug 467477 for that.

BUG=386567
R=andersr@opera.com

Review URL: https://codereview.chromium.org/1009313002

git-svn-id: svn://svn.chromium.org/blink/trunk@192155 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Revert "Tweaks layoutTests to use eventSender.setTouchPointRadius correctly"
This reverts commit e0717a58a20cc4d14501cd6e9b9164789b7581eb

Reason for revert:
Touch event test failures,

 https://storage.googleapis.com/chromium-layout-test-archives/WebKit_Linux_32/34636/layout-test-results/results.html

Original issue's description:
> Tweaks layoutTests to use eventSender.setTouchPointRadius correctly
>
> A link to the Chrome patch (event_sender.cc) https://codereview.chromium.org/990183003/
>
> BUG=
>
> Review URL: https://codereview.chromium.org/990193002
>
> git-svn-id: svn://svn.chromium.org/blink/trunk@192088 bbb929c8-8fbe-4397-9dbb-9b2b20218538

TBR=rbyers@chromium.org,d.pikalov@partner.samsung.com,fdegans@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=468704

Review URL: https://codereview.chromium.org/1019273002

git-svn-id: svn://svn.chromium.org/blink/trunk@192154 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: tidy up finalization of InspectorEmulationAgent following r192106.
Move InspectorEmulationAgent's self-reference clearing to discardAgent()
instead of doing in its destructor, as that will access an already dead
WebViewImpl object.

R=tkent
BUG=467059

Review URL: https://codereview.chromium.org/1022773002

git-svn-id: svn://svn.chromium.org/blink/trunk@192150 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove all event listeners during window's frame destruction step.
Perform the removal of LocalDOMWindow event listeners as part of it being
informed of LocalFrame's destruction (via frameDestroyed()). This is preferable
to waiting until LocalDOMWindow's destructor is run, as it makes the timing of it
independent of when that destructor actually gets to run.

With Oilpan, it is possible that a frame and its window will be swept out without
an explicit frame destruction notification. In that event, a prefinalizing
action is run to take care of the removal.

Additionally, this CL removes an explicit call to reset() from the LocalDOMWindow
destructor. We have since r182337 been asserting that the reset() has already
occurred, without it ever triggering. Time to remove the redundant reset() call.

R=haraken
BUG=340522

Review URL: https://codereview.chromium.org/1017043002

git-svn-id: svn://svn.chromium.org/blink/trunk@192149 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Document calls to the "rules for updating the text track rendering"
Per spec there are only two calls to these rules:
 * The last step of the "time marches on" algorithm.
 * "When the user agent starts exposing a user interface for a video
   element."

We have the first call, and two others that are needed when the text
track mode changes between hidden and visible. A spec bug was filed
for this case: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28236

BUG=322434
NOTRY=true

Review URL: https://codereview.chromium.org/1022743002

git-svn-id: svn://svn.chromium.org/blink/trunk@192148 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Add [Custom=CallEpilogue] to eliminate CG special cases
The effect is similar to having [Custom] on a method, but instead of
completely replacing the generated method implementation, the custom
callback is just called after the regular method implementation call.

Use this to reimplement EventTarget.{add,remove}EventListener and
MediaQueryList.{add,remove}Listener's code generation special cases.

Also use this to reduce the custom code for History.{push,replace}State
to such a call epilogue. While doing so, update History.idl so that the
now generated code is behaves the same as the old custom code.

BUG=345519

Review URL: https://codereview.chromium.org/1019453002

git-svn-id: svn://svn.chromium.org/blink/trunk@192146 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Let CueTimeline::currentlyActiveCues() return by reference-to-const
CueList is a Vector<CueInterval>, so passing it by value creates a copy.
This was verified in a debugger.

BUG=321654

Review URL: https://codereview.chromium.org/1014873004

git-svn-id: svn://svn.chromium.org/blink/trunk@192144 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192119.
TBR=oilpan-reviews
BUG=458222
NOTRY=true

Review URL: https://codereview.chromium.org/1016113003

git-svn-id: svn://svn.chromium.org/blink/trunk@192123 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in content/browser/[f-p]*
BUG=466848

Review URL: https://codereview.chromium.org/1000373002

Cr-Commit-Position: refs/heads/master@{#321215}
fs
Only update SVGPathParser::m_controlPoint when doing NormalizedParsing
It's part of "normalization state".

BUG=467592

Review URL: https://codereview.chromium.org/1015083003

git-svn-id: svn://svn.chromium.org/blink/trunk@192115 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Clean up around text track display state updates
Several minor oddities are changed to be hopefully less odd:

 * CueTimeline need not check activeSetChanged due to an earlier
   |if (!activeSetChanged) return|.
 * Move one-time setup of m_displayTree and m_cueBackgroundBox to where
   they are created.
 * ASSERT the preconditions guaranteed in VTTCue::updateDisplay() and
   getDisplayTree(), guaranteed by TextTrackContainer::updateDisplay.
 * Never remove and m_cueBackgroundBox from m_displayTree, just leave it
   there and assert that it is so.
 * Document where m_cueBackgroundBox is actually populated.
 * Remove a bunch of spec comments where the code doesn't resemble the
   shape of the spec and FIXMEs that aren't anywhere close to where they
   would actually be fixed. A link to http://wkb.ug/79916 remains in
   VTTCueBox::applyCSSProperties().

BUG=322434

Review URL: https://codereview.chromium.org/1022523002

git-svn-id: svn://svn.chromium.org/blink/trunk@192113 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192098.
TBR=oilpan-reviews
BUG=467883
NOTRY=true

Review URL: https://codereview.chromium.org/1018043002

git-svn-id: svn://svn.chromium.org/blink/trunk@192100 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in android_webview/
BUG=466848

Review URL: https://codereview.chromium.org/1013843002

Cr-Commit-Position: refs/heads/master@{#321125}
sigbjornf
Oilpan: adjust encrypted-media expectations following r192054.
R=haraken
BUG=441585

Review URL: https://codereview.chromium.org/1021473002

git-svn-id: svn://svn.chromium.org/blink/trunk@192090 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192077.
TBR=oilpan-reviews
NOTRY=true

Review URL: https://codereview.chromium.org/1020453003

git-svn-id: svn://svn.chromium.org/blink/trunk@192089 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Remove Document.getOverrideStyle()
Intent to Deprecate and Remove:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/s3ezjTuC8ig/_IBbI5svjDoJ

BUG=468173

Review URL: https://codereview.chromium.org/1015943002

git-svn-id: svn://svn.chromium.org/blink/trunk@192076 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Simplify SVGPathBlender::blendArcToSegment
By factoring the "simple" (same coordinate type) case out of
SVGPathBlender::blendAnimatedFloatPoint, we can simplify the blending
of rx/ry/angle of two arc segments.
Additionally, since the m_fromMode == m_toMode if m_addTypesCount != 0,
the same expression can be used to determine the mode of the blended
segment.

BUG=467592

Review URL: https://codereview.chromium.org/1014023003

git-svn-id: svn://svn.chromium.org/blink/trunk@192073 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Allow cross-origin cssRules access to CORS-fetched stylesheet.
When accessing the cssRules property on CSSStyleSheet an origin check is
performed for non-inline stylesheets. Should that stylesheet have been
loaded from another origin following CORS, the access ought to be
permitted, but wasn't.

Address by having the link element (LinkStyle) record if the stylesheet
it creates was successfully fetched using CORS. If it was, the stylesheet
access check will succeed.

R=mkwst
BUG=467672

Review URL: https://codereview.chromium.org/1011103002

git-svn-id: svn://svn.chromium.org/blink/trunk@192066 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Move translate:none to the standard Fullscreen UA style sheet
As expected, it has now been added to the spec:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27931
https://fullscreen.spec.whatwg.org/#user-agent-level-style-sheet-defaults

BUG=402378

Review URL: https://codereview.chromium.org/1014853003

git-svn-id: svn://svn.chromium.org/blink/trunk@192056 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192041.
TBR=oilpan-reviews
BUG=458222
NOTRY=true

Review URL: https://codereview.chromium.org/1014983002

git-svn-id: svn://svn.chromium.org/blink/trunk@192044 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r192035.
TBR=oilpan-reviews
BUG=458191
NOTRY=true

Review URL: https://codereview.chromium.org/1012073004

git-svn-id: svn://svn.chromium.org/blink/trunk@192043 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Normalize targetPoint first in parseArcToSegment
This simplifies the code a bit.

BUG=467592

Review URL: https://codereview.chromium.org/1017703002

git-svn-id: svn://svn.chromium.org/blink/trunk@192028 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Stop mutating inputs to decomposeArcToCubic
There's not a lot of gain from doing so, and not doing it will provide
more freedom to the caller (w/ handling of current point.)

BUG=467592

Review URL: https://codereview.chromium.org/1013183002

git-svn-id: svn://svn.chromium.org/blink/trunk@192027 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
Remove custom implementation of History.state attribute getter
Using [CachedAttribute=stateChanged] gives equivalent generated code, so
there is no reason to have a custom implementation.

BUG=345519

Review URL: https://codereview.chromium.org/1013823005

git-svn-id: svn://svn.chromium.org/blink/trunk@192026 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Reorder the emittal parts of SVGPathParser::parse*
In preparation for separating normalization from "unaltered".

BUG=467592

Review URL: https://codereview.chromium.org/1016553007

git-svn-id: svn://svn.chromium.org/blink/trunk@192020 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
List IDL compiler sources as inputs to GN's idl_impl action
This simply copies the inputs of the similar idl_compiler action, and
fixes a dependency issue where e.g. UnionTypes{Core,Modules}.* would not
be regenerated properly when the compiler sources were modified.

BUG=240176, 321462

Review URL: https://codereview.chromium.org/1014793002

git-svn-id: svn://svn.chromium.org/blink/trunk@192014 bbb929c8-8fbe-4397-9dbb-9b2b20218538
ed
[svg2] Make 'width' and 'height' presentation attributes
The following elements' width and height attributes have been made
into presentation attributes:

* mask
* rect
* image
* foreignObject

BUG=400725

Review URL: https://codereview.chromium.org/963733002

git-svn-id: svn://svn.chromium.org/blink/trunk@192013 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: have LifetimeNotifier<T> track its observers weakly.
Simplify the unregistration of lifetime observers upon finalization by
having LifetimeNotifier<> keep a WeakMember<> reference to them. As a
result the observers will no longer have to explicitly unregister
themselves when going away. Observers can still explicitly unregister,
should that be needed for other reasons.

R=haraken
BUG=462949, 467502

Review URL: https://codereview.chromium.org/1006253002

git-svn-id: svn://svn.chromium.org/blink/trunk@192011 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop SVGPathSegWithContext
SVGPathSegWithContext no longer adds any functionality to the SVGPathSeg
class hierarchy (SVGPathSeg now has a context.)

BUG=467592

Review URL: https://codereview.chromium.org/1011983003

git-svn-id: svn://svn.chromium.org/blink/trunk@192010 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't handle out-of-range parameters for arcs in UnalteredParsing mode
This means that pathSegList actually keeps/presents the out-of-range
parameters. (This behavior matches Gecko.)

BUG=467592

Review URL: https://codereview.chromium.org/1015433003

git-svn-id: svn://svn.chromium.org/blink/trunk@191990 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop SVGPathBuilder::m_current
This path consumer can only handle normalized paths, which means only
absolute commands.

BUG=467592

Review URL: https://codereview.chromium.org/1013753003

git-svn-id: svn://svn.chromium.org/blink/trunk@191989 bbb929c8-8fbe-4397-9dbb-9b2b20218538
jl
IDL: Improve CG for attributes with [CachedAttribute]
Avoid converting the C++ value to a V8 value twice (once for the call to
V8HiddenValue::setHiddenValue() and once for the function return value)
by storing the converted value in a local and using that in both places.

The similar case attribute.is_keep_alive_for_gc already worked this way,
but with a different variable name ('wrapper' instead of 'v8Value').

The only significant CG change is that the Vector<String> returned by
Navigator::languages() is now converted only once, and that the same
resulting JavaScript array object is returned on the first access as on
subsequent accesses.

Review URL: https://codereview.chromium.org/1012713003

git-svn-id: svn://svn.chromium.org/blink/trunk@191980 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mostynb
favor DCHECK_CURRENTLY_ON for better logs in content/browser/[q-z]*
BUG=466848

Review URL: https://codereview.chromium.org/1005683003

Cr-Commit-Position: refs/heads/master@{#320804}
sigbjornf
Oilpan: fix build after r191945
TBR=oilpan-reviews
BUG=458222
NOTRY=true

Review URL: https://codereview.chromium.org/1014483005

git-svn-id: svn://svn.chromium.org/blink/trunk@191952 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: fix build after r191942.
TBR=oilpan-reviews
BUG=467059
NOTRY=true

Review URL: https://codereview.chromium.org/1014533006

git-svn-id: svn://svn.chromium.org/blink/trunk@191951 bbb929c8-8fbe-4397-9dbb-9b2b20218538
rune
Missing collectMatchingShadowHostRules call from hasAnyMatchingRules.
This caused style to be incorrectly shared between two different hosts
with different matching for :host([attr]).

Regression from https://codereview.chromium.org/789403005

R=kochi@chromium.org
BUG=466815

Review URL: https://codereview.chromium.org/1009893004

git-svn-id: svn://svn.chromium.org/blink/trunk@191947 bbb929c8-8fbe-4397-9dbb-9b2b20218538
tmoniuszko
Fix includes in exclusive_access_controller_base.cc
BUG=

Review URL: https://codereview.chromium.org/1008403002

Cr-Commit-Position: refs/heads/master@{#320765}
fs
Drop declarations without matching definitions from SVGPathUtilities.h
appendSVGPathByteStreamFromSVGPathSeg and buildStringFromSVGPathSegList
lack corresponding definitions.
Also drop related forward declarations and includes.

Review URL: https://codereview.chromium.org/1014473003

git-svn-id: svn://svn.chromium.org/blink/trunk@191941 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
Correct LayoutPagedFlowThread::name().
Review URL: https://codereview.chromium.org/1001803002

git-svn-id: svn://svn.chromium.org/blink/trunk@191938 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Drop unused includes for SVG path machinery
Drops some includes of PassOwnPtr.h from path-source implementations
and the path parser as well as an include of WTFString.h from the
latter.

Review URL: https://codereview.chromium.org/1004803006

git-svn-id: svn://svn.chromium.org/blink/trunk@191937 bbb929c8-8fbe-4397-9dbb-9b2b20218538
fs
Don't allow <stop> as layout tree child of <svg> or <g>
LayoutSVGGradientStop would be allowed as children of <svg>, <g> and
other containers which could trigger asserts and wreck havoc.

BUG=466937

Review URL: https://codereview.chromium.org/1009923002

git-svn-id: svn://svn.chromium.org/blink/trunk@191932 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: promptly release FilterData on LayoutSVGResourceFilter destruction
For Oilpan, mirror the prompt release of the resources attached to
FilterData, instead of leaving it until the next GC strikes.

R=haraken,fs@opera.com
BUG=467542

Review URL: https://codereview.chromium.org/1010673005

git-svn-id: svn://svn.chromium.org/blink/trunk@191921 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the Event, EventTarget and CustomEvent interfaces with the spec
https://dom.spec.whatwg.org/#interface-event
https://dom.spec.whatwg.org/#interface-eventtarget
https://dom.spec.whatwg.org/#interface-customevent

Note that the EventListener argument for add/removeEventListener() is
named callback in the spec but left as listener here, as custom code in
Source/bindings/templates/methods.cpp to deal with missing arguments
depends on it. Sorting this out is left to http://crbug.com/353484

There are no observable changes to the generated code.

BUG=460722, 353484

Review URL: https://codereview.chromium.org/1005193002

git-svn-id: svn://svn.chromium.org/blink/trunk@191913 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Merge Element::offsetParentForBindings() into offsetParent()
This split was introduced with a fix for "offsetParent should never
return nodes in user agent Shadow DOM to script" in 2013:
https://trac.webkit.org/changeset/146037

SpatialNavigations's rectToAbsoluteCoordinates was the only internal use
of Element::offsetParent(). Rewrite that in a way that preserves the
existing behavior.

Review URL: https://codereview.chromium.org/994903003

git-svn-id: svn://svn.chromium.org/blink/trunk@191902 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Oilpan: consistently use IsGarbageCollectedMixin<> trait.
Use blink::IsGarbageCollectedMixin<T> to test if the object
T implements GarbageCollectedMixin. It handles objects that
have multiple GarbageCollectedMixin bases.

With that in place for WebPrivatePtr<>'s LifetimeOf trait,
SpeechRecognition's specialization for it can be retired.

R=haraken
BUG=420515
TBR=tkent

Review URL: https://codereview.chromium.org/1007803004

git-svn-id: svn://svn.chromium.org/blink/trunk@191900 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Fix windowclient-focus test expectation.
TBR=mkwst@chromium.org,mlamouri@chromium.org
BUG=466943
NOTRY=true

Review URL: https://codereview.chromium.org/1008243004

git-svn-id: svn://svn.chromium.org/blink/trunk@191895 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Mark http/tests/misc/client-hints-{no,invalid}-accept tests as failing.
TBR=yoaw@yoaw.ws
BUG=467450
NOTRY=true

Review URL: https://codereview.chromium.org/1009253002

git-svn-id: svn://svn.chromium.org/blink/trunk@191894 bbb929c8-8fbe-4397-9dbb-9b2b20218538
philipj
Sync the HTMLM*Element interfaces with the spec
No FIXME was added for HTMLMapElement.images, as it seems unlikely that
we will actually implement it. A spec bug was filed instead:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=28219

There are no changes to the generated code other than order.

BUG=460722

Review URL: https://codereview.chromium.org/1011593002

git-svn-id: svn://svn.chromium.org/blink/trunk@191890 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove LifecycleNotifier<>::m_context.
It serves no purpose any longer to keep this self reference around,
hence retire m_context.

Also, move isContextThread() up to ExecutionContext; a more natural place
to position the predicate.

R=haraken
BUG=462949

Review URL: https://codereview.chromium.org/1008113002

git-svn-id: svn://svn.chromium.org/blink/trunk@191883 bbb929c8-8fbe-4397-9dbb-9b2b20218538
sigbjornf
Remove ExecutionContext::lifecycleNotifier.
No longer used nor created by ExecutionContext, remove entirely.

Notice that this will make ExecutionContext::isIteratingOverObservers()
now return an accurate status (it was always 'false' before.)

R=haraken
BUG=462949

Review URL: https://codereview.chromium.org/1009623002

git-svn-id: svn://svn.chromium.org/blink/trunk@191880 bbb929c8-8fbe-4397-9dbb-9b2b20218538
mstensho
[New Multicolumn] Make positionForPoint() work.
When we decide to look "inside" a column set for text content, convert
the visual point to a flow thread point, and then redirect to the flow
thread. The flow thread is where the actual content is; column sets
are always childless. Also make sure that we don't enter flow threads
directly, since they are not visual.

This improves text selecting when hitting something outside the
columns (in the area around the multicol container, or in gaps between
columns).

Re-enable some old tests that now pass because of this change.

The old (current) multicol implementation deals with this in
LayoutBlock::adjustPointToColumnContents().

BUG=461352
R=dsinclair@chromium.org,jchaffraix@chromium.org

Review URL: