Changeset 245823 in webkit
- Timestamp:
- May 28, 2019, 2:02:38 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/accessibility/AXObjectCache.cpp (modified) (2 diffs)
-
WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (2 diffs)
-
WebCore/css/CSSComputedStyleDeclaration.cpp (modified) (2 diffs)
-
WebCore/css/CSSComputedStyleDeclaration.h (modified) (1 diff)
-
WebCore/css/SVGCSSComputedStyleDeclaration.cpp (modified) (2 diffs)
-
WebCore/dom/Document.cpp (modified) (1 diff)
-
WebCore/editing/TypingCommand.cpp (modified) (5 diffs)
-
WebCore/editing/ios/EditorIOS.mm (modified) (2 diffs)
-
WebCore/html/HTMLLabelElement.cpp (modified) (2 diffs)
-
WebCore/html/HTMLTextAreaElement.cpp (modified) (2 diffs)
-
WebCore/html/ImageDocument.cpp (modified) (2 diffs)
-
WebCore/html/ValidationMessage.cpp (modified) (2 diffs)
-
WebCore/page/FrameView.cpp (modified) (3 diffs)
-
WebCore/page/PrintContext.cpp (modified) (4 diffs)
-
WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
WebKitLegacy/mac/DOM/DOM.mm (modified) (2 diffs)
-
WebKitLegacy/mac/WebView/WebHTMLView.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r245818 r245823 1 2019-05-28 Brent Fulgham <bfulgham@apple.com> 2 3 Protect frames during style and layout changes 4 https://bugs.webkit.org/show_bug.cgi?id=198047 5 <rdar://problem/50954082> 6 7 Reviewed by Zalan Bujtas. 8 9 Be more careful about the scope and lifetime of objects that participate in layout or 10 style updates. If a method decides a layout or style update is needed, it needs to 11 confirm that the elements it was operating on are still valid and needed in the 12 current operation. 13 14 * accessibility/AXObjectCache.cpp: 15 (WebCore::AXObjectCache::getOrCreate): 16 * accessibility/AccessibilityRenderObject.cpp: 17 (WebCore::AccessibilityRenderObject::accessibilityHitTest const): 18 * css/CSSComputedStyleDeclaration.cpp: 19 (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): 20 * css/CSSComputedStyleDeclaration.h: 21 * css/SVGCSSComputedStyleDeclaration.cpp: 22 (WebCore::ComputedStyleExtractor::svgPropertyValue): 23 * dom/Document.cpp: 24 (WebCore::Document::setFocusedElement): 25 * editing/TypingCommand.cpp: 26 (WebCore::TypingCommand::insertTextRunWithoutNewlines): 27 (WebCore::TypingCommand::insertLineBreak): 28 (WebCore::TypingCommand::insertParagraphSeparator): 29 (WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent): 30 * editing/ios/EditorIOS.mm: 31 (WebCore::Editor::setDictationPhrasesAsChildOfElement): 32 * html/HTMLLabelElement.cpp: 33 (WebCore::HTMLLabelElement::focus): 34 * html/HTMLTextAreaElement.cpp: 35 (WebCore::HTMLTextAreaElement::appendFormData): 36 * html/ImageDocument.cpp: 37 (WebCore::ImageDocument::imageClicked): 38 * html/ValidationMessage.cpp: 39 (WebCore::ValidationMessage::buildBubbleTree): 40 * page/FrameView.cpp: 41 (WebCore::FrameView::autoSizeIfEnabled): 42 (WebCore::FrameView::trackedRepaintRectsAsText const): 43 * page/PrintContext.cpp: 44 (WebCore::PrintContext::pageProperty): 45 (WebCore::PrintContext::numberOfPages): 46 (WebCore::PrintContext::spoolAllPagesWithBoundaries): 47 1 48 2019-05-28 Antti Koivisto <antti@apple.com> 2 49 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r244200 r245823 1 1 /* 2 * Copyright (C) 2008-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2008-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 594 594 if (!inCanvasSubtree && !isHidden && !insideMeterElement) 595 595 return nullptr; 596 597 auto protectedNode = makeRef(*node); 596 598 597 599 // Fallback content is only focusable as long as the canvas is displayed and visible. -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r245716 r245823 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 2418 2418 m_renderer->document().updateLayout(); 2419 2419 2420 if (!m_renderer || !m_renderer->hasLayer()) 2421 return nullptr; 2422 2420 2423 RenderLayer* layer = downcast<RenderBox>(*m_renderer).layer(); 2421 2424 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r245768 r245823 1 1 /* 2 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 3 * Copyright (C) 2004-201 7Apple Inc. All rights reserved.3 * Copyright (C) 2004-2019 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 5 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> … … 4224 4224 case CSSPropertyTextAnchor: 4225 4225 case CSSPropertyVectorEffect: 4226 return svgPropertyValue(propertyID , DoNotUpdateLayout);4226 return svgPropertyValue(propertyID); 4227 4227 case CSSPropertyCustom: 4228 4228 ASSERT_NOT_REACHED(); -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h
r243931 r245823 89 89 RenderElement* styledRenderer() const; 90 90 91 RefPtr<CSSValue> svgPropertyValue(CSSPropertyID , EUpdateLayout);91 RefPtr<CSSValue> svgPropertyValue(CSSPropertyID); 92 92 Ref<CSSValue> adjustSVGPaintForCurrentColor(SVGPaintType, const String& url, const Color&, const Color& currentColor) const; 93 93 static Ref<CSSValue> valueForShadow(const ShadowData*, CSSPropertyID, const RenderStyle&, AdjustPixelValuesForComputedStyle = AdjustPixelValues); -
trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp
r243163 r245823 2 2 Copyright (C) 2007 Eric Seidel <eric@webkit.org> 3 3 Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 Copyright (C) 2019 Apple Inc. All rights reserved. 4 5 5 6 This library is free software; you can redistribute it and/or … … 82 83 } 83 84 84 RefPtr<CSSValue> ComputedStyleExtractor::svgPropertyValue(CSSPropertyID propertyID , EUpdateLayout updateLayout)85 RefPtr<CSSValue> ComputedStyleExtractor::svgPropertyValue(CSSPropertyID propertyID) 85 86 { 86 87 if (!m_element) 87 88 return nullptr; 88 89 // Make sure our layout is up to date before we allow a query on these attributes.90 if (updateLayout)91 m_element->document().updateLayout();92 89 93 90 auto* style = m_element->computedStyle(); -
trunk/Source/WebCore/dom/Document.cpp
r245796 r245823 4259 4259 if (focusWidget) 4260 4260 focusWidget->setFocus(true); 4261 else 4262 view()->setFocus(true);4261 else if (auto* frameView = view()) 4262 frameView->setFocus(true); 4263 4263 } 4264 4264 } -
trunk/Source/WebCore/editing/TypingCommand.cpp
r239535 r245823 1 1 /* 2 * Copyright (C) 2005-20 08, 2016Apple Inc. All rights reserved.2 * Copyright (C) 2005-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 552 552 applyCommandToComposite(WTFMove(command), endingSelection()); 553 553 554 Frame& frame = this->frame(); 555 Ref<Frame> protector(frame); 554 556 typingAddedToOpenCommand(InsertText); 555 557 } … … 564 566 565 567 applyCommandToComposite(InsertLineBreakCommand::create(document())); 568 569 Frame& frame = this->frame(); 570 Ref<Frame> protector(frame); 566 571 typingAddedToOpenCommand(InsertLineBreak); 567 572 } … … 584 589 585 590 applyCommandToComposite(InsertParagraphSeparatorCommand::create(document(), false, false, EditAction::TypingInsertParagraph)); 591 592 Frame& frame = this->frame(); 593 Ref<Frame> protector(frame); 586 594 typingAddedToOpenCommand(InsertParagraphSeparator); 587 595 } … … 608 616 609 617 applyCommandToComposite(BreakBlockquoteCommand::create(document())); 618 619 Frame& frame = this->frame(); 620 Ref<Frame> protector(frame); 610 621 typingAddedToOpenCommand(InsertParagraphSeparatorInQuotedContent); 611 622 } -
trunk/Source/WebCore/editing/ios/EditorIOS.mm
r240237 r245823 1 1 /* 2 * Copyright (C) 2006 , 2007, 2013Apple Inc. All rights reserved.2 * Copyright (C) 2006-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 280 280 element.appendChild(createFragmentFromText(*context, dictationPhrasesBuilder.toString())); 281 281 282 auto weakElement = makeWeakPtr(element); 283 282 284 // We need a layout in order to add markers below. 283 285 document().updateLayout(); 286 287 if (!weakElement) 288 return; 284 289 285 290 if (!element.firstChild()->isTextNode()) { -
trunk/Source/WebCore/html/HTMLLabelElement.cpp
r229694 r245823 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * Copyright (C) 2004-201 7Apple Inc. All rights reserved.5 * Copyright (C) 2004-2019 Apple Inc. All rights reserved. 6 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 7 7 * … … 150 150 void HTMLLabelElement::focus(bool restorePreviousSelection, FocusDirection direction) 151 151 { 152 Ref<HTMLLabelElement> protectedThis(*this); 152 153 if (document().haveStylesheetsLoaded()) { 153 154 document().updateLayout(); -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r242379 r245823 3 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 4 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * Copyright (C) 2004-201 7Apple Inc. All rights reserved.5 * Copyright (C) 2004-2019 Apple Inc. All rights reserved. 6 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 7 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) … … 224 224 return false; 225 225 226 Ref<HTMLTextAreaElement> protectedThis(*this); 226 227 document().updateLayout(); 227 228 -
trunk/Source/WebCore/html/ImageDocument.cpp
r245508 r245823 1 1 /* 2 * Copyright (C) 2006 , 2007, 2008, 2010, 2014Apple Inc. All rights reserved.2 * Copyright (C) 2006-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 400 400 updateLayout(); 401 401 402 if (!view()) 403 return; 404 402 405 float scale = this->scale(); 403 406 -
trunk/Source/WebCore/html/ValidationMessage.cpp
r234278 r245823 1 1 /* 2 2 * Copyright (C) 2010, 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 188 189 m_bubble->setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute); 189 190 shadowRoot.appendChild(*m_bubble); 191 192 auto weakElement = makeWeakPtr(*m_element); 193 190 194 document.updateLayout(); 195 196 if (!weakElement || !m_element->renderer()) 197 return; 198 191 199 adjustBubblePosition(m_element->renderer()->absoluteBoundingBoxRect(), m_bubble.get()); 192 200 -
trunk/Source/WebCore/page/FrameView.cpp
r245787 r245823 4 4 * 1999 Antti Koivisto <koivisto@kde.org> 5 5 * 2000 Dirk Mueller <mueller@kde.org> 6 * Copyright (C) 2004-201 7Apple Inc. All rights reserved.6 * Copyright (C) 2004-2019 Apple Inc. All rights reserved. 7 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 8 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) … … 3469 3469 documentRenderer.mutableStyle().setMaxWidth(Length(m_autoSizeConstraint.width(), Fixed)); 3470 3470 resize(m_autoSizeConstraint.width(), m_autoSizeConstraint.height()); 3471 3472 Ref<FrameView> protectedThis(*this); 3471 3473 document->updateStyleIfNeeded(); 3472 3474 document->updateLayoutIgnorePendingStylesheets(); … … 4867 4869 String FrameView::trackedRepaintRectsAsText() const 4868 4870 { 4869 if (frame().document()) 4870 frame().document()->updateLayout(); 4871 Frame& frame = this->frame(); 4872 Ref<Frame> protector(frame); 4873 4874 if (auto* document = frame.document()) 4875 document->updateLayout(); 4871 4876 4872 4877 TextStream ts; -
trunk/Source/WebCore/page/PrintContext.cpp
r244208 r245823 1 1 /* 2 2 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 , 2016Apple Inc.3 * Copyright (C) 2007-2019 Apple Inc. 4 4 * 5 5 * This library is free software; you can redistribute it and/or … … 346 346 ASSERT(frame->document()); 347 347 348 Ref<Frame> protectedFrame(*frame); 349 348 350 auto& document = *frame->document(); 349 351 PrintContext printContext(frame); … … 401 403 int PrintContext::numberOfPages(Frame& frame, const FloatSize& pageSizeInPixels) 402 404 { 405 Ref<Frame> protectedFrame(frame); 406 403 407 PrintContext printContext(&frame); 404 408 if (!printContext.beginAndComputePageRectsWithPageSize(frame, pageSizeInPixels)) … … 410 414 void PrintContext::spoolAllPagesWithBoundaries(Frame& frame, GraphicsContext& graphicsContext, const FloatSize& pageSizeInPixels) 411 415 { 416 Ref<Frame> protectedFrame(frame); 417 412 418 PrintContext printContext(&frame); 413 419 if (!printContext.beginAndComputePageRectsWithPageSize(frame, pageSizeInPixels)) -
trunk/Source/WebKitLegacy/mac/ChangeLog
r245796 r245823 1 2019-05-28 Brent Fulgham <bfulgham@apple.com> 2 Protect frames during style and layout changes 3 https://bugs.webkit.org/show_bug.cgi?id=198047 4 <rdar://problem/50954082> 5 6 Reviewed by Zalan Bujtas. 7 8 Be more careful about the scope and lifetime of objects that participate in layout or 9 style updates. If a method decides a layout or style update is needed, it needs to 10 confirm that the elements it was operating on are still valid and needed in the 11 current operation. 12 13 * DOM/DOM.mm: 14 (-[DOMRange renderedImageForcingBlackText:renderedImageForcingBlackText:]): 15 * WebView/WebHTMLView.mm: 16 (-[WebHTMLView _selectionDraggingImage]): 17 (-[WebHTMLView selectionImageForcingBlackText:selectionImageForcingBlackText:]): 18 1 19 2019-05-27 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebKitLegacy/mac/DOM/DOM.mm
r239535 r245823 1 1 /* 2 * Copyright (C) 2004 , 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.2 * Copyright (C) 2004-2019 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 James G. Speth (speth@end.com) 4 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) … … 619 619 return nil; 620 620 621 Ref<Frame> protectedFrame(*frame); 622 621 623 // iOS uses CGImageRef for drag images, which doesn't support separate logical/physical sizes. 622 624 #if PLATFORM(MAC) -
trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
r245076 r245823 1 1 /* 2 * Copyright (C) 2005-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2005-2019 Apple Inc. All rights reserved. 3 3 * (C) 2006, 2007 Graham Dennis (graham.dennis@gmail.com) 4 4 * … … 2201 2201 return nil; 2202 2202 2203 Ref<Frame> protectedCoreFrame(*coreFrame); 2204 2203 2205 TextIndicatorData textIndicator; 2204 2206 auto dragImage = createDragImageForSelection(*coreFrame, textIndicator); … … 6961 6963 return nil; 6962 6964 6965 Ref<Frame> protectedCoreFrame(*coreFrame); 6966 6963 6967 #if PLATFORM(IOS_FAMILY) 6964 6968 return selectionImage(coreFrame, forceBlackText);
Note:
See TracChangeset
for help on using the changeset viewer.