Support getComputedStyle for non-rendered pseudo elements.

Computed style for pseudo elements exist and is defined by [1] regardless
of whether the pseudo element, or its ancestor, is rendered or not [2].
We make sure that the computed pseudo element style hangs off of the
RenderStyle of the ancestor, or the computed style in the ancestor's
rare-data if the ancestor is not rendered.

getCachedPseudoStyle, getUncachedPseudoStyle, and pseudoStyleForElement are
all written to not return anything if the pseudo element is not rendered.
That is the reason for calling pseudoStyleForElement in a special mode at
the end of Element::computedStyle to force creating and adding the pseudo
style to the cache.

This CL does not try to support computed style for pseudo elements which
are not in the document.

[1] http://dev.w3.org/csswg/cssom/#dom-window-getcomputedstyle
[2] http://dev.w3.org/csswg/cssom/#::after-pseudo-element

R=esprehn@chromium.org
BUG=414088

Review URL: https://codereview.chromium.org/572043002

git-svn-id: svn://svn.chromium.org/blink/trunk@182203 bbb929c8-8fbe-4397-9dbb-9b2b20218538
7 files changed
tree: 71ceeb110c26933c51e7c51d3c7420d39572b029
  1. third_party/