Commit ec144630 authored by Peter Van der Beken's avatar Peter Van der Beken
Browse files

Bug 1749935 - Remove nsIParser::ParseFragment/Reset. r=hsivonen

parent 15b814cc
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -476,20 +476,12 @@ nsHtml5Parser::Terminate() {
  return executor->DidBuildModel(true);
}

NS_IMETHODIMP
nsHtml5Parser::ParseFragment(const nsAString& aSourceBuffer,
                             nsTArray<nsString>& aTagStack) {
  return NS_ERROR_NOT_IMPLEMENTED;
}

NS_IMETHODIMP
nsHtml5Parser::CancelParsingEvents() {
  MOZ_ASSERT_UNREACHABLE("Don't call this!");
  return NS_ERROR_NOT_IMPLEMENTED;
}

void nsHtml5Parser::Reset() { MOZ_ASSERT_UNREACHABLE("Don't call this!"); }

bool nsHtml5Parser::IsInsertionPointDefined() {
  return !mExecutor->IsFlushing() && !mInsertionPointPermanentlyUndefined &&
         (!GetStreamParser() || mScriptNestingLevel != 0);
+0 −11
Original line number Diff line number Diff line
@@ -136,22 +136,11 @@ class nsHtml5Parser final : public nsIParser, public nsSupportsWeakReference {
   */
  NS_IMETHOD Terminate() override;

  /**
   * Don't call. For interface backwards compat only.
   */
  NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
                           nsTArray<nsString>& aTagStack) override;

  /**
   * Don't call. For interface compat only.
   */
  NS_IMETHOD CancelParsingEvents() override;

  /**
   * Don't call. For interface compat only.
   */
  virtual void Reset() override;

  /**
   * True if the insertion point (per HTML5) is defined.
   */
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ class DocumentFragment;

/**
 * The fragment sink allows a client to parse a fragment of sink, possibly
 * surrounded in context. Also see nsIParser::ParseFragment().
 * surrounded in context. Also see nsParser::ParseFragment().
 * Note: once you've parsed a fragment, the fragment sink must be re-set on
 * the parser in order to parse another fragment.
 */
+0 −14
Original line number Diff line number Diff line
@@ -157,18 +157,6 @@ class nsIParser : public nsParserBase {

  NS_IMETHOD Terminate(void) = 0;

  /**
   * This method gets called when you want to parse a fragment of HTML or XML
   * surrounded by the context |aTagStack|. It requires that the parser have
   * been given a fragment content sink.
   *
   * @param aSourceBuffer The XML or HTML that hasn't been parsed yet.
   * @param aTagStack The context of the source buffer.
   * @return Success or failure.
   */
  NS_IMETHOD ParseFragment(const nsAString& aSourceBuffer,
                           nsTArray<nsString>& aTagStack) = 0;

  /**
   *  Call this method to cancel any pending parsing events.
   *  Parsing events may be pending if all of the document's content
@@ -181,8 +169,6 @@ class nsIParser : public nsParserBase {

  NS_IMETHOD CancelParsingEvents() = 0;

  virtual void Reset() = 0;

  /**
   * True if the insertion point (per HTML5) is defined.
   */
+2 −3
Original line number Diff line number Diff line
@@ -580,8 +580,7 @@ nsresult nsParser::Parse(const nsAString& aSourceBuffer, bool aLastCall) {
  return ResumeParse(false, false, false);
}

NS_IMETHODIMP
nsParser::ParseFragment(const nsAString& aSourceBuffer,
nsresult nsParser::ParseFragment(const nsAString& aSourceBuffer,
                                 nsTArray<nsString>& aTagStack) {
  if (mInternalState == NS_ERROR_OUT_OF_MEMORY) {
    // Checking NS_ERROR_OUT_OF_MEMORY instead of NS_FAILED
Loading