OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 do { | 306 do { |
307 first = first->firstChild(); | 307 first = first->firstChild(); |
308 // Skip list markers and generated run-ins. | 308 // Skip list markers and generated run-ins. |
309 while (first && (first->isListMarker() || (first->isRenderInline() && fi
rst->isRunIn()))) | 309 while (first && (first->isListMarker() || (first->isRenderInline() && fi
rst->isRunIn()))) |
310 first = first->nextInPreOrderAfterChildren(owner); | 310 first = first->nextInPreOrderAfterChildren(owner); |
311 } while (first && first->isAnonymous() && first->style()->styleType() == NOP
SEUDO); | 311 } while (first && first->isAnonymous() && first->style()->styleType() == NOP
SEUDO); |
312 | 312 |
313 if (!first) | 313 if (!first) |
314 return 0; | 314 return 0; |
315 | 315 |
316 if (first->style()->styleType() == BEFORE) | 316 if (first->isBeforeContent()) |
317 return first; | 317 return first; |
318 | 318 |
319 // Check for a possible generated run-in, using run-in positioning rules. | 319 // Check for a possible generated run-in, using run-in positioning rules. |
320 first = owner->firstChild(); | 320 first = owner->firstChild(); |
321 if (!first->isRenderBlock()) | 321 if (!first->isRenderBlock()) |
322 return 0; | 322 return 0; |
323 | 323 |
324 first = first->firstChild(); | 324 first = first->firstChild(); |
325 // We still need to skip any list markers that could exist before the run-in
. | 325 // We still need to skip any list markers that could exist before the run-in
. |
326 while (first && first->isListMarker()) | 326 while (first && first->isListMarker()) |
327 first = first->nextSibling(); | 327 first = first->nextSibling(); |
328 if (first && first->style()->styleType() == BEFORE && first->isRenderInline(
) && first->isRunIn()) | 328 if (first && first->isBeforeContent() && first->isRenderInline() && first->i
sRunIn()) |
329 return first; | 329 return first; |
330 | 330 |
331 return 0; | 331 return 0; |
332 } | 332 } |
333 | 333 |
334 RenderObject* RenderObjectChildList::afterPseudoElementRenderer(const RenderObje
ct* owner) const | 334 RenderObject* RenderObjectChildList::afterPseudoElementRenderer(const RenderObje
ct* owner) const |
335 { | 335 { |
336 RenderObject* last = const_cast<RenderObject*>(owner); | 336 RenderObject* last = const_cast<RenderObject*>(owner); |
337 do { | 337 do { |
338 last = last->lastChild(); | 338 last = last->lastChild(); |
339 } while (last && last->isAnonymous() && last->style()->styleType() == NOPSEU
DO && !last->isListMarker()); | 339 } while (last && last->isAnonymous() && last->style()->styleType() == NOPSEU
DO && !last->isListMarker()); |
340 if (last && last->style()->styleType() != AFTER) | 340 if (last && !last->isAfterContent()) |
341 return 0; | 341 return 0; |
342 return last; | 342 return last; |
343 } | 343 } |
344 | 344 |
345 void RenderObjectChildList::updateBeforeAfterContent(RenderObject* owner, Pseudo
Id type, const RenderObject* styledObject) | 345 void RenderObjectChildList::updateBeforeAfterContent(RenderObject* owner, Pseudo
Id type, const RenderObject* styledObject) |
346 { | 346 { |
347 // Double check that the document did in fact use generated content rules.
Otherwise we should not have been called. | 347 // Double check that the document did in fact use generated content rules.
Otherwise we should not have been called. |
348 ASSERT(owner->document()->usesBeforeAfterRules()); | 348 ASSERT(owner->document()->usesBeforeAfterRules()); |
349 | 349 |
350 // In CSS2, before/after pseudo-content cannot nest. Check this first. | 350 // In CSS2, before/after pseudo-content cannot nest. Check this first. |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 } | 521 } |
522 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) | 522 if (generatedContentContainer->isChildAllowed(renderer, pseudoElemen
tStyle)) |
523 generatedContentContainer->addChild(renderer); | 523 generatedContentContainer->addChild(renderer); |
524 else | 524 else |
525 renderer->destroy(); | 525 renderer->destroy(); |
526 } | 526 } |
527 } | 527 } |
528 } | 528 } |
529 | 529 |
530 } // namespace WebCore | 530 } // namespace WebCore |
OLD | NEW |