| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 default_settings.GetGenericFontFamilySettings(); | 727 default_settings.GetGenericFontFamilySettings(); |
| 728 page->GetSettings().SetMinimumFontSize( | 728 page->GetSettings().SetMinimumFontSize( |
| 729 default_settings.GetMinimumFontSize()); | 729 default_settings.GetMinimumFontSize()); |
| 730 page->GetSettings().SetMinimumLogicalFontSize( | 730 page->GetSettings().SetMinimumLogicalFontSize( |
| 731 default_settings.GetMinimumLogicalFontSize()); | 731 default_settings.GetMinimumLogicalFontSize()); |
| 732 page->GetSettings().SetDefaultFontSize( | 732 page->GetSettings().SetDefaultFontSize( |
| 733 default_settings.GetDefaultFontSize()); | 733 default_settings.GetDefaultFontSize()); |
| 734 page->GetSettings().SetDefaultFixedFontSize( | 734 page->GetSettings().SetDefaultFixedFontSize( |
| 735 default_settings.GetDefaultFixedFontSize()); | 735 default_settings.GetDefaultFixedFontSize()); |
| 736 } | 736 } |
| 737 } | 737 } |
| 738 | 738 |
| 739 LocalFrame* frame = nullptr; | 739 LocalFrame* frame = nullptr; |
| 740 { | 740 { |
| 741 TRACE_EVENT0("blink", "SVGImage::dataChanged::createFrame"); | 741 TRACE_EVENT0("blink", "SVGImage::dataChanged::createFrame"); |
| 742 DCHECK(!frame_client_); | 742 DCHECK(!frame_client_); |
| 743 frame_client_ = new SVGImageLocalFrameClient(this); | 743 frame_client_ = new SVGImageLocalFrameClient(this); |
| 744 frame = LocalFrame::Create(frame_client_, *page, 0); | 744 frame = LocalFrame::Create(frame_client_, *page, 0); |
| 745 frame->SetView(LocalFrameView::Create(*frame)); | 745 frame->SetView(LocalFrameView::Create(*frame)); |
| 746 frame->Init(); | 746 frame->Init(); |
| 747 } | 747 } |
| 748 | 748 |
| 749 FrameLoader& loader = frame->Loader(); | 749 FrameLoader& loader = frame->Loader(); |
| 750 loader.ForceSandboxFlags(kSandboxAll); | 750 loader.ForceSandboxFlags(kSandboxAll); |
| 751 | 751 |
| 752 frame->View()->SetScrollbarsSuppressed(true); | 752 frame->View()->SetScrollbarsSuppressed(true); |
| 753 // SVG Images will always synthesize a viewBox, if it's not available, and | 753 // SVG Images will always synthesize a viewBox, if it's not available, and |
| 754 // thus never see scrollbars. | 754 // thus never see scrollbars. |
| 755 frame->View()->SetCanHaveScrollbars(false); | 755 frame->View()->SetCanHaveScrollbars(false); |
| 756 // SVG Images are transparent. | 756 // SVG Images are transparent. |
| 757 frame->View()->SetBaseBackgroundColor(Color::kTransparent); | 757 frame->View()->SetBaseBackgroundColor(Color::kTransparent); |
| 758 | 758 |
| 759 page_ = page; | 759 page_ = page; |
| 760 | 760 |
| 761 TRACE_EVENT0("blink", "SVGImage::dataChanged::load"); | 761 TRACE_EVENT0("blink", "SVGImage::dataChanged::load"); |
| 762 loader.Load(FrameLoadRequest( | 762 loader.Load(FrameLoadRequest( |
| 763 0, ResourceRequest(BlankURL()), | 763 0, ResourceRequest(BlankURL()), |
| 764 SubstituteData(Data(), AtomicString("image/svg+xml"), | 764 SubstituteData(Data(), AtomicString("image/svg+xml"), |
| 765 AtomicString("UTF-8"), KURL(), kForceSynchronousLoad))); | 765 AtomicString("UTF-8"), KURL(), kForceSynchronousLoad))); |
| 766 | 766 |
| 767 // Set the concrete object size before a container size is available. | 767 // Set the concrete object size before a container size is available. |
| 768 intrinsic_size_ = RoundedIntSize(ConcreteObjectSize(FloatSize( | 768 intrinsic_size_ = RoundedIntSize(ConcreteObjectSize(FloatSize( |
| 769 LayoutReplaced::kDefaultWidth, LayoutReplaced::kDefaultHeight))); | 769 LayoutReplaced::kDefaultWidth, LayoutReplaced::kDefaultHeight))); |
| 770 | 770 |
| 771 DCHECK(page_); | 771 DCHECK(page_); |
| 772 switch (load_state_) { | 772 switch (load_state_) { |
| 773 case kInDataChanged: | 773 case kInDataChanged: |
| 774 load_state_ = kWaitingForAsyncLoadCompletion; | 774 load_state_ = kWaitingForAsyncLoadCompletion; |
| 775 return kSizeAvailableAndLoadingAsynchronously; | 775 return kSizeAvailableAndLoadingAsynchronously; |
| 776 | 776 |
| 777 case kLoadCompleted: | 777 case kLoadCompleted: |
| 778 return kSizeAvailable; | 778 return kSizeAvailable; |
| 779 | 779 |
| 780 case kDataChangedNotStarted: | 780 case kDataChangedNotStarted: |
| 781 case kWaitingForAsyncLoadCompletion: | 781 case kWaitingForAsyncLoadCompletion: |
| 782 CHECK(false); | 782 CHECK(false); |
| 783 break; | 783 break; |
| 784 } | 784 } |
| 785 | 785 |
| 786 NOTREACHED(); | 786 NOTREACHED(); |
| 787 return kSizeAvailable; | 787 return kSizeAvailable; |
| 788 } | 788 } |
| 789 | 789 |
| 790 String SVGImage::FilenameExtension() const { | 790 String SVGImage::FilenameExtension() const { |
| 791 return "svg"; | 791 return "svg"; |
| 792 } | 792 } |
| 793 | 793 |
| 794 } // namespace blink | 794 } // namespace blink |
| OLD | NEW |