Title: [111660] trunk/Source/WebCore
Revision
111660
Author
[email protected]
Date
2012-03-22 01:06:37 -0700 (Thu, 22 Mar 2012)

Log Message

Expand RenderTextControlSingleLine::controlClipRect() to contain contentRect().
https://bugs.webkit.org/show_bug.cgi?id=81866

Reviewed by Hajime Morita.

We need to expand the controlClipRect because the existing shadow
tree of a text field can be wrapped by another shadow tree. e.g.

A current situation:

<input>
  ┗ ShadowRoot
     ┗ container element
┌────────────┐<input>'s border box
│┌──────────┐│
││container box       ││
│└──────────┘│
└────────────┘

Wrapped by another ShadowRoot:

<input>
  ┗ New ShadowRoot
     ┣ <shadow> represents the existing shadow tree
     ┃  ┗ container element
     ┗ D: an additional decoration element
┌────────────┐<input>'s border box
│┌───────┬──┐│
││container box │ D  ││
│└───────┴──┘│
└────────────┘
In this case, if we clip child renderers by container box, D is not
drawn. We should clip by the content box of the <input>.

A search field has an exceptional behavior. It can have the container
box of which height is taller than the content box height. The
controlClipRect should contain both of the container box and the content
box in this case. In other cases, the container box is equivalent to the
content box. So the code always unites them.

No new tests. This won't make any behavior change for now.

* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::controlClipRect):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (111659 => 111660)


--- trunk/Source/WebCore/ChangeLog	2012-03-22 08:04:11 UTC (rev 111659)
+++ trunk/Source/WebCore/ChangeLog	2012-03-22 08:06:37 UTC (rev 111660)
@@ -1,3 +1,50 @@
+2012-03-22  Kent Tamura  <[email protected]>
+
+        Expand RenderTextControlSingleLine::controlClipRect() to contain contentRect().
+        https://bugs.webkit.org/show_bug.cgi?id=81866
+
+        Reviewed by Hajime Morita.
+
+        We need to expand the controlClipRect because the existing shadow
+        tree of a text field can be wrapped by another shadow tree. e.g.
+
+        A current situation:
+
+        <input>
+          ┗ ShadowRoot
+             ┗ container element
+        ┌────────────┐<input>'s border box
+        │┌──────────┐│
+        ││container box       ││
+        │└──────────┘│
+        └────────────┘
+
+        Wrapped by another ShadowRoot:
+
+        <input>
+          ┗ New ShadowRoot
+             ┣ <shadow> represents the existing shadow tree
+             ┃  ┗ container element
+             ┗ D: an additional decoration element
+        ┌────────────┐<input>'s border box
+        │┌───────┬──┐│
+        ││container box │ D  ││
+        │└───────┴──┘│
+        └────────────┘
+        In this case, if we clip child renderers by container box, D is not
+        drawn. We should clip by the content box of the <input>.
+
+        A search field has an exceptional behavior. It can have the container
+        box of which height is taller than the content box height. The
+        controlClipRect should contain both of the container box and the content
+        box in this case. In other cases, the container box is equivalent to the
+        content box. So the code always unites them.
+
+        No new tests. This won't make any behavior change for now.
+
+        * rendering/RenderTextControlSingleLine.cpp:
+        (WebCore::RenderTextControlSingleLine::controlClipRect):
+
 2012-03-22  Yoshifumi Inoue  <[email protected]>
 
         [Forms] The option element should not be form associated element.

Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp (111659 => 111660)


--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp	2012-03-22 08:04:11 UTC (rev 111659)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp	2012-03-22 08:06:37 UTC (rev 111660)
@@ -370,7 +370,7 @@
 LayoutRect RenderTextControlSingleLine::controlClipRect(const LayoutPoint& additionalOffset) const
 {
     ASSERT(hasControlClip());
-    LayoutRect clipRect = LayoutRect(containerElement()->renderBox()->frameRect());
+    LayoutRect clipRect = unionRect(contentBoxRect(), containerElement()->renderBox()->frameRect());
     clipRect.moveBy(additionalOffset);
     return clipRect;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to