LCOV - code coverage report
Current view: top level - dom/base - Text.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 12 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 2 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2             : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
       3             : /* This Source Code Form is subject to the terms of the Mozilla Public
       4             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       5             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
       6             : 
       7             : #include "mozilla/dom/Text.h"
       8             : #include "nsTextNode.h"
       9             : 
      10             : namespace mozilla {
      11             : namespace dom {
      12             : 
      13             : already_AddRefed<Text>
      14           0 : Text::SplitText(uint32_t aOffset, ErrorResult& rv)
      15             : {
      16           0 :   nsCOMPtr<nsIContent> newChild;
      17           0 :   rv = SplitData(aOffset, getter_AddRefs(newChild));
      18           0 :   if (rv.Failed()) {
      19           0 :     return nullptr;
      20             :   }
      21           0 :   return newChild.forget().downcast<Text>();
      22             : }
      23             : 
      24             : /* static */ already_AddRefed<Text>
      25           0 : Text::Constructor(const GlobalObject& aGlobal,
      26             :                   const nsAString& aData, ErrorResult& aRv)
      27             : {
      28           0 :   nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal.GetAsSupports());
      29           0 :   if (!window || !window->GetDoc()) {
      30           0 :     aRv.Throw(NS_ERROR_FAILURE);
      31           0 :     return nullptr;
      32             :   }
      33             : 
      34           0 :   return window->GetDoc()->CreateTextNode(aData);
      35             : }
      36             : 
      37             : } // namespace dom
      38             : } // namespace mozilla

Generated by: LCOV version 1.13