Changeset 149754 in webkit
- Timestamp:
- May 8, 2013 11:54:24 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r149749 r149754 1 2013-05-08 Darin Adler <darin@apple.com> 2 3 REGRESSION(r149700): fast/css-generated-content/close-quote-negative-depth.html 4 https://bugs.webkit.org/show_bug.cgi?id=115776 5 6 Reviewed by Anders Carlsson. 7 8 * TestExpectations: Expect success again on this test. 9 1 10 2013-05-08 Eric Carlson <eric.carlson@apple.com> 2 11 -
trunk/LayoutTests/TestExpectations
r149715 r149754 11 11 # pending CSS grammar refactoring 12 12 webkit.org/b/113401 inspector/console/console-css-warnings.html [ Skip ] 13 14 webkit.org/b/115776 fast/css-generated-content/close-quote-negative-depth.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r149749 r149754 1 2013-05-08 Darin Adler <darin@apple.com> 2 3 REGRESSION(r149700): fast/css-generated-content/close-quote-negative-depth.html 4 https://bugs.webkit.org/show_bug.cgi?id=115776 5 6 Reviewed by Anders Carlsson. 7 8 I changed depth to more closely match what is in the CSS3 specification. 9 There may be a more optimal way to make it work, but this seems the most straightforward. 10 11 * rendering/RenderQuote.cpp: 12 (WebCore::RenderQuote::RenderQuote): Initialize m_depth to -1 because that depth 13 is consistent with the empty string that is the initial value of the text. The 14 real depth will be calculated when the node is attached. 15 (WebCore::RenderQuote::originalText): Removed the "depth - 1" logic that 16 used to be done for close quotes. Instead, the updateDepth function now correctly 17 subtracts one for the close quote itself, not just afterward. Also added an early 18 exit when the depth is negative; these changes together fix the bug. 19 (WebCore::RenderQuote::attachQuote): Added a call to updateDepth even for the render 20 quote head, we now need that to set the depth either to 0 or to -1. 21 (WebCore::RenderQuote::detachQuote): Removed code to set m_depth to 0; if we are not 22 resetting the text then m_depth should be left matching the text, otherwise updateDepth 23 might not do its job correctly if the quote is later re-attached. What matters is that 24 m_depth and the text are in sync. 25 (WebCore::RenderQuote::updateDepth): Changed updating logic in two ways. First, 26 compute the depth in a local variable rather than computing it in a data member 27 after first saving off the old value of the data member. That's clearer style. 28 Second, add the code to change negative depths to zero when propagating to the 29 next quote in the chain, which matches how the standard is written, and decrement 30 the depth of the close quote itself, not the quote after the close quote. 31 1 32 2013-05-08 Eric Carlson <eric.carlson@apple.com> 2 33 -
trunk/Source/WebCore/rendering/RenderQuote.cpp
r149700 r149754 1 /* *1 /* 2 2 * Copyright (C) 2011 Nokia Inc. All rights reserved. 3 3 * Copyright (C) 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2013 Apple Inc. All rights reserved. 4 5 * 5 6 * This library is free software; you can redistribute it and/or … … 33 34 : RenderText(node, StringImpl::empty()) 34 35 , m_type(quote) 35 , m_depth( 0)36 , m_depth(-1) 36 37 , m_next(0) 37 38 , m_previous(0) … … 236 237 PassRefPtr<StringImpl> RenderQuote::originalText() const 237 238 { 239 if (m_depth < 0) 240 return StringImpl::empty(); 238 241 switch (m_type) { 239 242 case NO_OPEN_QUOTE: … … 241 244 return StringImpl::empty(); 242 245 case CLOSE_QUOTE: 243 return quotesData()->closeQuote(m_depth - 1).impl();246 return quotesData()->closeQuote(m_depth).impl(); 244 247 case OPEN_QUOTE: 245 248 return quotesData()->openQuote(m_depth).impl(); … … 273 276 view()->setRenderQuoteHead(this); 274 277 m_attached = true; 278 updateDepth(); 275 279 return; 276 280 } … … 325 329 m_next = 0; 326 330 m_previous = 0; 327 m_depth = 0;328 331 } 329 332 … … 331 334 { 332 335 ASSERT(m_attached); 333 int oldDepth = m_depth; 334 m_depth = 0; 336 int depth = 0; 335 337 if (m_previous) { 336 m_depth = m_previous->m_depth; 338 depth = m_previous->m_depth; 339 if (depth < 0) 340 depth = 0; 337 341 switch (m_previous->m_type) { 338 342 case OPEN_QUOTE: 339 343 case NO_OPEN_QUOTE: 340 m_depth++;344 depth++; 341 345 break; 342 346 case CLOSE_QUOTE: 343 347 case NO_CLOSE_QUOTE: 344 if (m_depth)345 m_depth--;346 348 break; 347 349 } 348 350 } 349 if (oldDepth != m_depth) 350 setText(originalText()); 351 switch (m_type) { 352 case OPEN_QUOTE: 353 case NO_OPEN_QUOTE: 354 break; 355 case CLOSE_QUOTE: 356 case NO_CLOSE_QUOTE: 357 depth--; 358 break; 359 } 360 if (m_depth == depth) 361 return; 362 m_depth = depth; 363 setText(originalText()); 351 364 } 352 365
Note: See TracChangeset
for help on using the changeset viewer.