  Context: Radius and mass measurements of short-period giant planets reveal
that many of these planets contain a large amount of heavy elements, in sharp
contrast with the expectations of the conventional core-accretion model for the
origin of giant planets.
  Aims: The proposed explanations for the heavy-element enrichment of giant
planets fall short of explaining the most enriched planets. We look for
additional processes that can explain the full envelope of inferred
enrichments.
  Methods: We revisit the dynamics of pebbles and dust in the vicinity of giant
planets using analytic estimates. Although our results are derived in the
framework of a viscous alpha-disk we also discuss the case of disks driven by
angular momentum removal in magnetized winds.
  Results: When giant planets are far from the star, dust and pebbles are
confined in a pressure bump at the outer edge of the planet-induced gap.
Instead, when the planets reach the inner part of the disk (r << 2 au), dust
penetrates the gap together with the gas. The dust/gas ratio can be enhanced by
more than an order of magnitude if radial drift of dust is not impeded farther
out by other barriers. Thus, hot planets undergoing runaway gas accretion can
swallow a large amount of dust.
  Conclusions: Whereas the gas accreted by giant planets in the outer disk is
very dust-poor, that accreted by hot planets can be extremely dust-rich. Thus,
provided that a large fraction of the atmosphere of hot-Jupiters is accreted in
situ, a large amount of dust can be accreted as well. We draw a distinction
between this process and pebble accretion, which is ineffective at small
stellocentric radii, even for super-Earths. Giant planets farther out in the
disk are extremely effective barriers against the flow of pebbles and dust
across their gap.
