Changeset 91573 in webkit
- Timestamp:
- Jul 22, 2011 10:46:12 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r91569 r91573 1 2011-07-22 Kent Tamura <tkent@chromium.org> 2 3 Validation message bubble is incorrectly positioned in a relative body. 4 https://bugs.webkit.org/show_bug.cgi?id=65018 5 6 Reviewed by Dimitri Glazkov. 7 8 * fast/forms/validation-message-in-relative-body-expected.txt: Added. 9 * fast/forms/validation-message-in-relative-body.html: Added. 10 * platform/gtk/Skipped: 11 * platform/qt/Skipped: 12 * platform/win/Skipped: 13 1 14 2011-07-22 Andrey Kosyakov <caseq@chromium.org> 2 15 -
trunk/LayoutTests/platform/gtk/Skipped
r91408 r91573 1244 1244 fast/forms/validation-message-appearance.html 1245 1245 fast/forms/validation-message-clone.html 1246 fast/forms/validation-message-in-relative-body.html 1246 1247 fast/forms/validation-message-on-checkbox.html 1247 1248 fast/forms/validation-message-on-listbox.html -
trunk/LayoutTests/platform/qt/Skipped
r91459 r91573 2034 2034 fast/forms/validation-message-appearance.html 2035 2035 fast/forms/validation-message-clone.html 2036 fast/forms/validation-message-in-relative-body.html 2036 2037 fast/forms/validation-message-on-checkbox.html 2037 2038 fast/forms/validation-message-on-listbox.html -
trunk/LayoutTests/platform/win/Skipped
r91525 r91573 1125 1125 fast/forms/validation-message-appearance.html 1126 1126 fast/forms/validation-message-clone.html 1127 fast/forms/validation-message-in-relative-body.html 1127 1128 fast/forms/validation-message-on-checkbox.html 1128 1129 fast/forms/validation-message-on-listbox.html -
trunk/Source/WebCore/ChangeLog
r91571 r91573 1 2011-07-22 Kent Tamura <tkent@chromium.org> 2 3 Validation message bubble is incorrectly positioned in a relative body. 4 https://bugs.webkit.org/show_bug.cgi?id=65018 5 6 Reviewed by Dimitri Glazkov. 7 8 We use position:aboslute for validation message bubbles, and the 9 origin of the absolute position can be not only the page, but also 10 an ancestor block with non-static position. 11 12 Test: fast/forms/validation-message-in-relative-body.html 13 14 * html/ValidationMessage.cpp: 15 (WebCore::adjustBubblePosition): 16 Subtract the containing block position from the host position. 17 (WebCore::ValidationMessage::buildBubbleTree): 18 Change the order of appendChild() and adjustBubblePosition() in 19 order to use RenderObject::containingBlock() in 20 adjustbubbleposition(). 21 1 22 2011-07-22 David Grogan <dgrogan@chromium.org> 2 23 -
trunk/Source/WebCore/html/ValidationMessage.cpp
r90071 r91573 40 40 #include "HTMLNames.h" 41 41 #include "Page.h" 42 #include "RenderBlock.h" 42 43 #include "RenderObject.h" 43 44 #include "Settings.h" … … 111 112 if (hostRect.isEmpty()) 112 113 return; 113 bubble->getInlineStyleDecl()->setProperty(CSSPropertyTop, static_cast<double>(hostRect.y() + hostRect.height()), CSSPrimitiveValue::CSS_PX); 114 double hostX = hostRect.x(); 115 double hostY = hostRect.y(); 116 if (RenderBox* container = bubble->renderer()->containingBlock()) { 117 FloatPoint containerLocation = container->localToAbsolute(); 118 hostX -= containerLocation.x() + container->borderLeft() + container->paddingLeft(); 119 hostY -= containerLocation.y() + container->borderTop() + container->paddingTop(); 120 } 121 bubble->getInlineStyleDecl()->setProperty(CSSPropertyTop, hostY + hostRect.height(), CSSPrimitiveValue::CSS_PX); 114 122 // The 'left' value of ::-webkit-validation-bubble-arrow. 115 123 const int bubbleArrowTopOffset = 32; 116 double bubbleX = host Rect.x();124 double bubbleX = hostX; 117 125 if (hostRect.width() / 2 < bubbleArrowTopOffset) 118 bubbleX = max(host Rect.x() + hostRect.width() / 2 - bubbleArrowTopOffset,0);126 bubbleX = max(hostX + hostRect.width() / 2 - bubbleArrowTopOffset, 0.0); 119 127 bubble->getInlineStyleDecl()->setProperty(CSSPropertyLeft, bubbleX, CSSPrimitiveValue::CSS_PX); 120 128 } … … 131 139 // contains non-absolute or non-fixed renderers as children. 132 140 m_bubble->getInlineStyleDecl()->setProperty(CSSPropertyPosition, CSSValueAbsolute); 133 adjustBubblePosition(host->getRect(), m_bubble.get());134 141 host->ensureShadowRoot()->appendChild(m_bubble.get(), ec); 135 142 ASSERT(!ec); 143 adjustBubblePosition(host->getRect(), m_bubble.get()); 136 144 137 145 RefPtr<HTMLDivElement> clipper = HTMLDivElement::create(doc);
Note: See TracChangeset
for help on using the changeset viewer.